NS-3
|
#include <uan-address.h>
Public Member Functions | |
UanAddress (uint8_t addr) | |
Create UanAddress object with address addr. | |
operator Address () const | |
Create UanAddress object with broadcast address. | |
void | CopyFrom (const uint8_t *pBuffer) |
Sets address to address stored in parameter. | |
void | CopyTo (uint8_t *pBuffer) |
Writes address to buffer parameter. | |
uint8_t | GetAsInt (void) const |
Static Public Member Functions | |
static UanAddress | ConvertFrom (const Address &address) |
static bool | IsMatchingType (const Address &address) |
static UanAddress | GetBroadcast (void) |
static UanAddress | Allocate () |
Allocates UanAddress from 0-254 (will wrap back to 0 if more than 255 are allocated) | |
Friends | |
bool | operator== (const UanAddress &a, const UanAddress &b) |
Returns true if byte address a is equal to byte address b. | |
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. | |
std::istream & | operator>> (std::istream &is, UanAddress &address) |
Inputs param address from stream is as 8 bit integer. |
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.
ns3::UanAddress::UanAddress | ( | uint8_t | addr | ) |
Create UanAddress object with address addr.
addr | byte address to assign to this address |
static UanAddress ns3::UanAddress::ConvertFrom | ( | const Address & | address | ) | [static] |
address | Address to convert to UAN address |
void ns3::UanAddress::CopyFrom | ( | const uint8_t * | pBuffer | ) |
Sets address to address stored in parameter.
pBuffer | Buffer to extract address from |
void ns3::UanAddress::CopyTo | ( | uint8_t * | pBuffer | ) |
Writes address to buffer parameter.
pBuffer |
uint8_t ns3::UanAddress::GetAsInt | ( | void | ) | const |
static UanAddress ns3::UanAddress::GetBroadcast | ( | void | ) | [static] |
static bool ns3::UanAddress::IsMatchingType | ( | const Address & | address | ) | [static] |
address | Address to test |