#include <uan-address.h>
Public Member Functions | |
UanAddress () | |
UanAddress (uint8_t addr) | |
Create UanAddress object with address addr. | |
virtual | ~UanAddress () |
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 |
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. |
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.
ns3::UanAddress::UanAddress | ( | ) |
Definition at line 26 of file uan-address.cc.
References m_address.
Referenced by Allocate(), and GetBroadcast().
ns3::UanAddress::UanAddress | ( | uint8_t | addr | ) |
Create UanAddress object with address addr.
addr | byte address to assign to this address |
Definition at line 31 of file uan-address.cc.
|
virtual |
Definition at line 36 of file uan-address.cc.
|
static |
Allocates UanAddress from 0-254 (will wrap back to 0 if more than 255 are allocated)
Definition at line 97 of file uan-address.cc.
References first::address, and UanAddress().
Referenced by ns3::UanHelper::Install().
|
static |
address | Address to convert to UAN address |
Definition at line 54 of file uan-address.cc.
References ns3::Address::CopyTo(), IsMatchingType(), m_address, and NS_ASSERT.
Referenced by ns3::UanMacAloha::Enqueue(), ns3::UanMacCw::Enqueue(), ns3::UanMacRc::Enqueue(), ns3::UanMacAloha::RxPacketError(), and ns3::UanNetDevice::SetAddress().
|
private |
Definition at line 48 of file uan-address.cc.
References GetType(), and m_address.
void ns3::UanAddress::CopyFrom | ( | const uint8_t * | pBuffer | ) |
Sets address to address stored in parameter.
pBuffer | Buffer to extract address from |
Definition at line 79 of file uan-address.cc.
References m_address.
void ns3::UanAddress::CopyTo | ( | uint8_t * | pBuffer | ) |
Writes address to buffer parameter.
pBuffer |
Definition at line 85 of file uan-address.cc.
References m_address.
uint8_t ns3::UanAddress::GetAsInt | ( | void | ) | const |
Definition at line 63 of file uan-address.cc.
References m_address.
Referenced by ns3::operator<(), ns3::UanHeaderCommon::Serialize(), and ns3::UanHeaderRcCts::Serialize().
|
static |
Definition at line 92 of file uan-address.cc.
References UanAddress().
Referenced by ns3::UanMacRc::Associate(), ns3::UanMacRc::AssociateTimeout(), ns3::UanMacRc::ReceiveOkFromPhy(), ns3::UanMacRc::RtsTimeout(), ns3::UanMacRc::SendRts(), and ns3::UanMacRcGw::StartCycle().
|
staticprivate |
Definition at line 41 of file uan-address.cc.
References ns3::Address::Register().
Referenced by ConvertTo(), and IsMatchingType().
|
static |
address | Address to test |
Definition at line 68 of file uan-address.cc.
References ns3::Address::CheckCompatible(), and GetType().
Referenced by ConvertFrom().
ns3::UanAddress::operator Address | ( | ) | const |
Create UanAddress object with broadcast address.
Definition at line 73 of file uan-address.cc.
|
friend |
Returns true if byte address a is unequal to byte address b.
Definition at line 117 of file uan-address.cc.
|
friend |
Writes param address to stream os as 8 bit integer.
Definition at line 123 of file uan-address.cc.
|
friend |
Returns true if byte address a is equal to byte address b.
Definition at line 111 of file uan-address.cc.
|
friend |
Inputs param address from stream is as 8 bit integer.
Definition at line 129 of file uan-address.cc.
|
private |
Definition at line 94 of file uan-address.h.
Referenced by ConvertFrom(), ConvertTo(), CopyFrom(), CopyTo(), GetAsInt(), ns3::operator<<(), ns3::operator==(), ns3::operator>>(), and UanAddress().