A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ns3::UanAddress Class Reference

#include <uan-address.h>

Public Member Functions

 UanAddress (uint8_t addr)
 Create UanAddress object with address addr. More...
 
void CopyFrom (const uint8_t *pBuffer)
 Sets address to address stored in parameter. More...
 
void CopyTo (uint8_t *pBuffer)
 Writes address to buffer parameter. More...
 
uint8_t GetAsInt (void) const
 
 operator Address () const
 Create UanAddress object with broadcast address.
 

Static Public Member Functions

static UanAddress Allocate ()
 Allocates UanAddress from 0-254 (will wrap back to 0 if more than 255 are allocated)
 
static UanAddress ConvertFrom (const Address &address)
 
static UanAddress GetBroadcast (void)
 
static bool IsMatchingType (const Address &address)
 

Private Member Functions

Address ConvertTo (void) const
 

Static Private Member Functions

static uint8_t GetType (void)
 

Private Attributes

uint8_t m_address
 

Friends

bool operator!= (const UanAddress &a, const UanAddress &b)
 Returns true if byte address a is unequal to byte address b.
 
std::ostream & operator<< (std::ostream &os, const UanAddress &address)
 Writes param address to stream os as 8 bit integer.
 
bool operator== (const UanAddress &a, const UanAddress &b)
 Returns true if byte address a is equal to byte address b.
 
std::istream & operator>> (std::istream &is, UanAddress &address)
 Inputs param address from stream is as 8 bit integer.
 

Detailed Description

A class used for addressing UAN MAC's. This implementation uses a simple 8 bit flat addressing scheme. It is unlikely that perceived underwater networks will soon exceed 200 nodes (or the overlapping of two underwater networks - the ocean is big), so this should provide adequate addressing for most applications.

Definition at line 37 of file uan-address.h.

Constructor & Destructor Documentation

ns3::UanAddress::UanAddress ( uint8_t  addr)

Create UanAddress object with address addr.

Parameters
addrbyte address to assign to this address

Definition at line 31 of file uan-address.cc.

Member Function Documentation

UanAddress ns3::UanAddress::ConvertFrom ( const Address address)
static
void ns3::UanAddress::CopyFrom ( const uint8_t *  pBuffer)

Sets address to address stored in parameter.

Parameters
pBufferBuffer to extract address from

Definition at line 79 of file uan-address.cc.

void ns3::UanAddress::CopyTo ( uint8_t *  pBuffer)

Writes address to buffer parameter.

Parameters
pBuffer

Definition at line 85 of file uan-address.cc.

uint8_t ns3::UanAddress::GetAsInt ( void  ) const
Returns
8 bit integer version of address

Definition at line 63 of file uan-address.cc.

Referenced by ns3::operator<(), ns3::UanHeaderCommon::Serialize(), and ns3::UanHeaderRcCts::Serialize().

UanAddress ns3::UanAddress::GetBroadcast ( void  )
static
Returns
Broadcast address: 255

Definition at line 92 of file uan-address.cc.

Referenced by ns3::UanMacCw::GetBroadcast(), ns3::UanMacRc::GetBroadcast(), and ns3::UanMacAloha::RxPacketGood().

bool ns3::UanAddress::IsMatchingType ( const Address address)
static
Parameters
addressAddress to test
Returns
True if address given is consistant with UanAddress

Definition at line 68 of file uan-address.cc.

References ns3::Address::CheckCompatible().

Referenced by ConvertFrom().


The documentation for this class was generated from the following files: