an EUI-64 address More...
#include "mac64-address.h"
Public Member Functions | |
Mac64Address () | |
Mac64Address (const char *str) | |
Mac64Address (uint64_t addr) | |
Address | ConvertTo () const |
uint64_t | ConvertToInt () const |
void | CopyFrom (const uint8_t buffer[8]) |
void | CopyTo (uint8_t buffer[8]) const |
operator Address () const | |
Static Public Member Functions | |
static Mac64Address | Allocate () |
Allocate a new Mac64Address. | |
static Mac64Address | ConvertFrom (const Address &address) |
static bool | IsMatchingType (const Address &address) |
static void | ResetAllocationIndex () |
Reset the Mac64Address allocation index. | |
Static Private Member Functions | |
static uint8_t | GetType () |
Return the Type of address. | |
Private Attributes | |
uint8_t | m_address [8] |
address value | |
Static Private Attributes | |
static uint64_t | m_allocationIndex = 0 |
Address allocation index. | |
Friends | |
bool | operator!= (const Mac64Address &a, const Mac64Address &b) |
Not equal to operator. | |
bool | operator< (const Mac64Address &a, const Mac64Address &b) |
Less than operator. | |
std::ostream & | operator<< (std::ostream &os, const Mac64Address &address) |
Stream insertion operator. | |
bool | operator== (const Mac64Address &a, const Mac64Address &b) |
Equal to operator. | |
std::istream & | operator>> (std::istream &is, Mac64Address &address) |
Stream extraction operator. | |
an EUI-64 address
This class can contain 64 bit IEEE addresses.
Definition at line 45 of file mac64-address.h.
ns3::Mac64Address::Mac64Address | ( | ) |
Definition at line 69 of file mac64-address.cc.
References m_address, and NS_LOG_FUNCTION.
ns3::Mac64Address::Mac64Address | ( | const char * | str | ) |
str | a string representing the new Mac64Address |
The format of the string is "xx:xx:xx:xx:xx:xx:xx:xx"
Definition at line 75 of file mac64-address.cc.
References ASCII_a, ASCII_COLON, ASCII_ZERO, ns3::AsciiToLowCase(), m_address, NS_ASSERT, and NS_LOG_FUNCTION.
ns3::Mac64Address::Mac64Address | ( | uint64_t | addr | ) |
addr | The 64 bit unsigned integer used to create a Mac64Address object. |
Create a Mac64Address from an 64 bit unsigned integer.
Definition at line 107 of file mac64-address.cc.
References m_address, and NS_LOG_FUNCTION.
|
static |
Allocate a new Mac64Address.
Definition at line 181 of file mac64-address.cc.
References m_allocationIndex, NS_LOG_FUNCTION_NOARGS, ResetAllocationIndex(), and ns3::Simulator::ScheduleDestroy().
Referenced by ns3::LrWpanMac::LrWpanMac(), and ns3::LteHelper::InstallSingleUeDevice().
|
static |
address | a polymorphic address |
This function performs a type check and asserts if the type of the input address is not compatible with an Mac64Address.
Definition at line 147 of file mac64-address.cc.
References GetType(), m_address, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ns3::Ipv6Address::MakeAutoconfiguredAddress(), ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(), ns3::Ipv6AddressHelper::NewAddress(), ns3::SixLowPanMesh::Print(), ns3::LrWpanNetDevice::SetAddress(), and ns3::LteNetDevice::SetAddress().
Address ns3::Mac64Address::ConvertTo | ( | ) | const |
Convert an instance of this class to a polymorphic Address instance.
Definition at line 157 of file mac64-address.cc.
References GetType(), m_address, and NS_LOG_FUNCTION.
uint64_t ns3::Mac64Address::ConvertToInt | ( | ) | const |
Convert an instance of this class to a 64 bit unsigned integer.
Definition at line 164 of file mac64-address.cc.
References m_address.
void ns3::Mac64Address::CopyFrom | ( | const uint8_t | buffer[8] | ) |
buffer | address in network order |
Copy the input address to our internal buffer.
Definition at line 121 of file mac64-address.cc.
References m_address, and NS_LOG_FUNCTION.
Referenced by ns3::LrWpanHelper::CreateAssociatedPan(), ns3::ReadFrom(), and ns3::LrWpanHelper::SetExtendedAddresses().
void ns3::Mac64Address::CopyTo | ( | uint8_t | buffer[8] | ) | const |
buffer | address in network order |
Copy the internal address to the input buffer.
Definition at line 128 of file mac64-address.cc.
References m_address, and NS_LOG_FUNCTION.
Referenced by ns3::Ipv6Address::MakeAutoconfiguredAddress(), ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(), and ns3::WriteTo().
|
staticprivate |
Return the Type of address.
Definition at line 211 of file mac64-address.cc.
References NS_LOG_FUNCTION_NOARGS, and ns3::Address::Register().
Referenced by ConvertFrom(), ConvertTo(), and IsMatchingType().
|
static |
address | address to test |
Definition at line 135 of file mac64-address.cc.
References GetType(), and NS_LOG_FUNCTION.
Referenced by ns3::MockNetDevice::IsBroadcast(), ns3::MockNetDevice::IsMulticast(), ns3::Ipv6Address::MakeAutoconfiguredAddress(), ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(), ns3::Ipv6AddressHelper::NewAddress(), ns3::SixLowPanMesh::Print(), ns3::LrWpanNetDevice::SetAddress(), ns3::SixLowPanMesh::SetFinalDst(), and ns3::SixLowPanMesh::SetOriginator().
ns3::Mac64Address::operator Address | ( | ) | const |
Convert an instance of this class to a polymorphic Address instance.
Definition at line 141 of file mac64-address.cc.
|
static |
Reset the Mac64Address allocation index.
This function resets (to zero) the global integer that is used for unique address allocation. It is automatically called whenever
is called. It may also be optionally called by user code if there is a need to force a reset of this allocation index.
Definition at line 204 of file mac64-address.cc.
References m_allocationIndex, and NS_LOG_FUNCTION_NOARGS.
Referenced by Allocate().
|
friend |
Not equal to operator.
a | the first operand |
b | the first operand |
Definition at line 200 of file mac64-address.h.
|
friend |
Less than operator.
a | the first operand |
b | the first operand |
Definition at line 205 of file mac64-address.h.
|
friend |
Stream insertion operator.
os | the stream |
address | the address |
Definition at line 218 of file mac64-address.cc.
|
friend |
Equal to operator.
a | the first operand |
b | the first operand |
Definition at line 194 of file mac64-address.h.
|
friend |
Stream extraction operator.
is | the stream |
address | the address |
Definition at line 238 of file mac64-address.cc.
|
private |
address value
Definition at line 183 of file mac64-address.h.
Referenced by Mac64Address(), ConvertFrom(), ConvertTo(), ConvertToInt(), CopyFrom(), and CopyTo().
|
staticprivate |
Address allocation index.
Definition at line 182 of file mac64-address.h.
Referenced by Allocate(), and ResetAllocationIndex().