A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::Mac64Address Class Reference

an EUI-64 address More...

#include "mac64-address.h"

Collaboration diagram for ns3::Mac64Address:

Public Member Functions

 Mac64Address ()=default
 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
constexpr std::strong_ordering operator<=> (const Mac64Address &other) const =default
 Spaceship comparison operator.

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

std::array< uint8_t, 8 > m_address {}
 Address value.

Static Private Attributes

static uint64_t m_allocationIndex = 0
 Address allocation index.

Friends

std::ostream & operator<< (std::ostream &os, const Mac64Address &address)
 Stream insertion operator.
std::istream & operator>> (std::istream &is, Mac64Address &address)
 Stream extraction operator.

Detailed Description

an EUI-64 address

This class can contain 64 bit IEEE addresses.

See also
Mac64Address Attribute

Definition at line 36 of file mac64-address.h.

Constructor & Destructor Documentation

◆ Mac64Address() [1/3]

ns3::Mac64Address::Mac64Address ( )
default

References Mac64Address().

Referenced by Mac64Address(), Allocate(), ConvertFrom(), operator<<, operator<=>(), and operator>>.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Mac64Address() [2/3]

ns3::Mac64Address::Mac64Address ( const char * str)
Parameters
stra string representing the new Mac64Address

The format of the string is "xx:xx:xx:xx:xx:xx:xx:xx"

Definition at line 28 of file mac64-address.cc.

References m_address, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ Mac64Address() [3/3]

ns3::Mac64Address::Mac64Address ( uint64_t addr)
Parameters
addrThe 64 bit unsigned integer used to create a Mac64Address object.

Create a Mac64Address from an 64 bit unsigned integer.

Definition at line 52 of file mac64-address.cc.

References m_address, and NS_LOG_FUNCTION.

Member Function Documentation

◆ Allocate()

Mac64Address ns3::Mac64Address::Allocate ( )
static

Allocate a new Mac64Address.

Returns
newly allocated mac64Address

Definition at line 127 of file mac64-address.cc.

References Mac64Address(), m_allocationIndex, NS_LOG_FUNCTION_NOARGS, ResetAllocationIndex(), and ns3::Simulator::ScheduleDestroy().

Referenced by ns3::lrwpan::LrWpanMac::LrWpanMac(), and ns3::LteHelper::InstallSingleUeDevice().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConvertFrom()

Mac64Address ns3::Mac64Address::ConvertFrom ( const Address & address)
static
Parameters
addressa polymorphic address
Returns
a new Mac64Address from the 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 93 of file mac64-address.cc.

References Mac64Address(), GetType(), m_address, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by ns3::Ipv6Address::MakeAutoconfiguredAddress(), ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(), ns3::Ipv6AddressHelper::NewAddress(), ns3::SixLowPanMesh::Print(), ns3::lrwpan::LrWpanNetDevice::SetAddress(), and ns3::LteNetDevice::SetAddress().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConvertTo()

Address ns3::Mac64Address::ConvertTo ( ) const
Returns
a new Address instance

Convert an instance of this class to a polymorphic Address instance.

Definition at line 103 of file mac64-address.cc.

References GetType(), m_address, and NS_LOG_FUNCTION.

Referenced by operator Address().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConvertToInt()

uint64_t ns3::Mac64Address::ConvertToInt ( ) const
Returns
the mac address in a 64 bit unsigned integer.

Convert an instance of this class to a 64 bit unsigned integer.

Definition at line 110 of file mac64-address.cc.

References m_address.

◆ CopyFrom()

void ns3::Mac64Address::CopyFrom ( const uint8_t buffer[8])
Parameters
bufferaddress in network order

Copy the input address to our internal buffer.

Definition at line 66 of file mac64-address.cc.

References m_address, and NS_LOG_FUNCTION.

Referenced by ns3::LrWpanHelper::CreateAssociatedPan(), ns3::ReadFrom(), and ns3::LrWpanHelper::SetExtendedAddresses().

Here is the caller graph for this function:

◆ CopyTo()

void ns3::Mac64Address::CopyTo ( uint8_t buffer[8]) const
Parameters
bufferaddress in network order

Copy the internal address to the input buffer.

Definition at line 73 of file mac64-address.cc.

References m_address, and NS_LOG_FUNCTION.

Referenced by ns3::Ipv6Address::MakeAutoconfiguredAddress(), ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(), and ns3::WriteTo().

Here is the caller graph for this function:

◆ GetType()

uint8_t ns3::Mac64Address::GetType ( )
staticprivate

Return the Type of address.

Returns
type of address

Definition at line 157 of file mac64-address.cc.

References NS_LOG_FUNCTION_NOARGS, and ns3::Address::Register().

Referenced by ConvertFrom(), ConvertTo(), and IsMatchingType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsMatchingType()

bool ns3::Mac64Address::IsMatchingType ( const Address & address)
static
Parameters
addressaddress to test
Returns
true if the address matches, false otherwise.

Definition at line 80 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::lrwpan::LrWpanNetDevice::SetAddress(), ns3::SixLowPanMesh::SetFinalDst(), and ns3::SixLowPanMesh::SetOriginator().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator Address()

ns3::Mac64Address::operator Address ( ) const
Returns
a new Address instance

Convert an instance of this class to a polymorphic Address instance.

Definition at line 86 of file mac64-address.cc.

References ConvertTo().

Here is the call graph for this function:

◆ operator<=>()

std::strong_ordering ns3::Mac64Address::operator<=> ( const Mac64Address & other) const
constexprdefault

Spaceship comparison operator.

All the other comparison operators are automatically generated from this one.

Parameters
otheraddress to compare to this one
Returns
The result of the comparison.

References Mac64Address().

Here is the call graph for this function:

◆ ResetAllocationIndex()

void ns3::Mac64Address::ResetAllocationIndex ( )
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

SimulatorDestroy ();

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 150 of file mac64-address.cc.

References m_allocationIndex, and NS_LOG_FUNCTION_NOARGS.

Referenced by Allocate().

Here is the caller graph for this function:

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const Mac64Address & address )
friend

Stream insertion operator.

Parameters
osthe stream
addressthe address
Returns
a reference to the stream

Definition at line 164 of file mac64-address.cc.

References Mac64Address().

◆ operator>>

std::istream & operator>> ( std::istream & is,
Mac64Address & address )
friend

Stream extraction operator.

Parameters
isthe stream
addressthe address
Returns
a reference to the stream

Definition at line 187 of file mac64-address.cc.

References Mac64Address(), and v.

Member Data Documentation

◆ m_address

std::array<uint8_t, 8> ns3::Mac64Address::m_address {}
private

◆ m_allocationIndex

uint64_t ns3::Mac64Address::m_allocationIndex = 0
staticprivate

Address allocation index.

Definition at line 155 of file mac64-address.h.

Referenced by Allocate(), ns3::Mac64AddressValue::Copy(), and ResetAllocationIndex().


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