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

#include <mac16-address.h>

Public Member Functions

 Mac16Address ()
 
 Mac16Address (const char *str)
 
void CopyFrom (const uint8_t buffer[2])
 
void CopyTo (uint8_t buffer[2]) const
 
 operator Address () const
 

Static Public Member Functions

static Mac16Address Allocate (void)
 
static Mac16Address ConvertFrom (const Address &address)
 
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 [2]
 

Friends

bool operator!= (const Mac16Address &a, const Mac16Address &b)
 
bool operator< (const Mac16Address &a, const Mac16Address &b)
 
bool operator== (const Mac16Address &a, const Mac16Address &b)
 
std::istream & operator>> (std::istream &is, Mac16Address &address)
 

Detailed Description

This class can contain 16 bit addresses.

Definition at line 39 of file mac16-address.h.

Constructor & Destructor Documentation

ns3::Mac16Address::Mac16Address ( )

Definition at line 55 of file mac16-address.cc.

References m_address, and NS_LOG_FUNCTION.

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

Definition at line 61 of file mac16-address.cc.

References ASCII_a, ASCII_COLON, ASCII_ZERO, ns3::AsciiToLowCase(), m_address, NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Member Function Documentation

Mac16Address ns3::Mac16Address::Allocate ( void  )
static

Allocate a new Mac16Address.

Definition at line 135 of file mac16-address.cc.

References first::address, m_address, and NS_LOG_FUNCTION_NOARGS.

Mac16Address ns3::Mac16Address::ConvertFrom ( const Address address)
static
Parameters
addressa polymorphic address
Returns
a new Mac16Address from the polymorphic address

This function performs a type check and asserts if the type of the input address is not compatible with an Mac16Address.

Definition at line 119 of file mac16-address.cc.

References ns3::Address::CheckCompatible(), ns3::Address::CopyTo(), GetType(), NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by ns3::Ipv6L3Protocol::AddAutoconfiguredAddress(), ns3::Ipv6Interface::DoSetup(), ns3::Ipv6AddressHelper::NewAddress(), and ns3::Ipv6L3Protocol::RemoveAutoconfiguredAddress().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Address ns3::Mac16Address::ConvertTo ( void  ) const
private
Returns
a new Address instance

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

Definition at line 128 of file mac16-address.cc.

References GetType(), m_address, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

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

Copy the input address to our internal buffer.

Definition at line 94 of file mac16-address.cc.

References m_address, and NS_LOG_FUNCTION.

Referenced by ns3::ReadFrom().

+ Here is the caller graph for this function:

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

Copy the internal address to the input buffer.

Definition at line 100 of file mac16-address.cc.

References m_address, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

uint8_t ns3::Mac16Address::GetType ( void  )
staticprivate

Definition at line 147 of file mac16-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:

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

Definition at line 107 of file mac16-address.cc.

References ns3::Address::CheckCompatible(), GetType(), and NS_LOG_FUNCTION.

Referenced by ns3::Ipv6L3Protocol::AddAutoconfiguredAddress(), ns3::Ipv6Interface::DoSetup(), ns3::Ipv6AddressHelper::NewAddress(), and ns3::Ipv6L3Protocol::RemoveAutoconfiguredAddress().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

Definition at line 113 of file mac16-address.cc.

Friends And Related Function Documentation

bool operator!= ( const Mac16Address a,
const Mac16Address b 
)
friend

Definition at line 113 of file mac16-address.h.

bool operator< ( const Mac16Address a,
const Mac16Address b 
)
friend

Definition at line 117 of file mac16-address.h.

bool operator== ( const Mac16Address a,
const Mac16Address b 
)
friend

Definition at line 109 of file mac16-address.h.

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

Definition at line 183 of file mac16-address.cc.

Member Data Documentation

uint8_t ns3::Mac16Address::m_address[2]
private

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