ns3::Mac48Address Class Reference
[Address]

an EUI-48 address More...

#include <mac48-address.h>

List of all members.

Public Member Functions

 Mac48Address ()
 Mac48Address (const char *str)
void CopyFrom (const uint8_t buffer[6])
void CopyTo (uint8_t buffer[6]) const
 operator Address () const
bool IsBroadcast (void) const
bool IsMulticast (void) const
bool IsGroup (void) const

Static Public Member Functions

static Mac48Address ConvertFrom (const Address &address)
static bool IsMatchingType (const Address &address)
static Mac48Address Allocate (void)
static Mac48Address GetBroadcast (void)
static Mac48Address GetMulticast (Ipv4Address address)
static Mac48Address GetMulticast (Ipv6Address address)
 Get multicast address from IPv6 address.
static Mac48Address GetMulticastPrefix (void)
static Mac48Address GetMulticast6Prefix (void)
 Get the multicast prefix for IPv6 (33:33:00:00:00:00).

Private Member Functions

Address ConvertTo (void) const

Static Private Member Functions

static uint8_t GetType (void)

Private Attributes

uint8_t m_address [6]

Friends

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

Detailed Description

an EUI-48 address

This class can contain 48 bit IEEE addresses.

Definition at line 41 of file mac48-address.h.


Constructor & Destructor Documentation

ns3::Mac48Address::Mac48Address (  ) 

Definition at line 51 of file mac48-address.cc.

References m_address.

Referenced by GetBroadcast(), GetMulticast6Prefix(), and GetMulticastPrefix().

ns3::Mac48Address::Mac48Address ( const char *  str  ) 
Parameters:
str a string representing the new Mac48Address

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

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

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


Member Function Documentation

Mac48Address ns3::Mac48Address::Allocate ( void   )  [static]
Mac48Address ns3::Mac48Address::ConvertFrom ( const Address address  )  [static]
Parameters:
address a polymorphic address
Returns:
a new Mac48Address from the polymorphic address

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

Definition at line 111 of file mac48-address.cc.

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

Referenced by ns3::BridgeNetDevice::AddBridgePort(), ns3::BridgeNetDevice::ReceiveFromDevice(), ns3::SimpleNetDevice::Send(), ns3::WifiNetDevice::Send(), ns3::SimpleNetDevice::SendFrom(), ns3::WifiNetDevice::SendFrom(), ns3::EmuNetDevice::SendFrom(), and ns3::CsmaNetDevice::SendFrom().

Address ns3::Mac48Address::ConvertTo ( void   )  const [private]
Returns:
a new Address instance

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

Definition at line 106 of file mac48-address.cc.

References GetType(), and m_address.

Referenced by operator Address().

void ns3::Mac48Address::CopyFrom ( const uint8_t  buffer[6]  ) 
Parameters:
buffer address in network order

Copy the input address to our internal buffer.

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

References m_address.

Referenced by GetMulticast(), IsMulticast(), and ns3::CsmaNetDevice::Receive().

void ns3::Mac48Address::CopyTo ( uint8_t  buffer[6]  )  const
Parameters:
buffer address in network order

Copy the internal address to the input buffer.

Definition at line 91 of file mac48-address.cc.

References m_address.

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

Mac48Address ns3::Mac48Address::GetBroadcast ( void   )  [static]
Returns:
the broadcast address

Definition at line 162 of file mac48-address.cc.

References Mac48Address().

Referenced by ns3::NqstaWifiMac::GetBroadcastBssid(), IsBroadcast(), and ns3::NqapWifiMac::SendOneBeacon().

Mac48Address ns3::Mac48Address::GetMulticast ( Ipv6Address  address  )  [static]

Get multicast address from IPv6 address.

Returns:
a multicast address

Definition at line 215 of file mac48-address.cc.

References CopyFrom(), CopyTo(), GetMulticast6Prefix(), and ns3::Ipv6Address::Serialize().

Mac48Address ns3::Mac48Address::GetMulticast ( Ipv4Address  address  )  [static]
Returns:
a multicast address

Definition at line 180 of file mac48-address.cc.

References CopyFrom(), CopyTo(), GetMulticastPrefix(), and ns3::Ipv4Address::Serialize().

Mac48Address ns3::Mac48Address::GetMulticast6Prefix ( void   )  [static]

Get the multicast prefix for IPv6 (33:33:00:00:00:00).

Returns:
a multicast address.

Definition at line 174 of file mac48-address.cc.

References Mac48Address().

Referenced by GetMulticast().

Mac48Address ns3::Mac48Address::GetMulticastPrefix ( void   )  [static]
Returns:
the multicast prefix (01:00:5e:00:00:00).

Definition at line 168 of file mac48-address.cc.

References Mac48Address().

Referenced by GetMulticast(), and IsMulticast().

uint8_t ns3::Mac48Address::GetType ( void   )  [static, private]

Definition at line 133 of file mac48-address.cc.

References ns3::Address::Register().

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

bool ns3::Mac48Address::IsBroadcast ( void   )  const
bool ns3::Mac48Address::IsGroup ( void   )  const
Returns:
true if the group bit is set, false otherwise.

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

References m_address.

bool ns3::Mac48Address::IsMatchingType ( const Address address  )  [static]
Returns:
true if the address matches, false otherwise.

Definition at line 97 of file mac48-address.cc.

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

Referenced by ns3::BridgeNetDevice::AddBridgePort(), ns3::WifiNetDevice::Send(), and ns3::WifiNetDevice::SendFrom().

bool ns3::Mac48Address::IsMulticast ( void   )  const
ns3::Mac48Address::operator Address ( void   )  const
Returns:
a new Address instance

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

Definition at line 101 of file mac48-address.cc.

References ConvertTo().


Friends And Related Function Documentation

bool operator< ( const Mac48Address a,
const Mac48Address b 
) [friend]
bool operator== ( const Mac48Address a,
const Mac48Address b 
) [friend]
std::istream& operator>> ( std::istream &  is,
Mac48Address address 
) [friend]

Member Data Documentation

uint8_t ns3::Mac48Address::m_address[6] [private]

Definition at line 140 of file mac48-address.h.

Referenced by Allocate(), ConvertTo(), CopyFrom(), CopyTo(), IsGroup(), and Mac48Address().


The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:12:03 2009 for NS-3 by  doxygen 1.6.3