an EUI-48 address More...
#include <mac48-address.h>
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) |
an EUI-48 address
This class can contain 48 bit IEEE addresses.
Definition at line 41 of file mac48-address.h.
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 | ) |
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.
Mac48Address ns3::Mac48Address::Allocate | ( | void | ) | [static] |
Allocate a new Mac48Address.
Definition at line 119 of file mac48-address.cc.
References m_address.
Referenced by ns3::TcpSocketImplTest::AddSimpleNetDevice(), ns3::WifiTest::CreateOne(), ns3::WifiHelper::Install(), ns3::EmuHelper::InstallPriv(), ns3::UdpSocketImplTest::RunTests(), and ns3::PointToPointTest::RunTests().
Mac48Address ns3::Mac48Address::ConvertFrom | ( | const Address & | address | ) | [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 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] |
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] | ) |
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 |
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] |
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.
Definition at line 215 of file mac48-address.cc.
References CopyFrom(), CopyTo(), GetMulticast6Prefix(), and ns3::Ipv6Address::Serialize().
Mac48Address ns3::Mac48Address::GetMulticast | ( | Ipv4Address | address | ) | [static] |
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).
Definition at line 174 of file mac48-address.cc.
References Mac48Address().
Referenced by GetMulticast().
Mac48Address ns3::Mac48Address::GetMulticastPrefix | ( | void | ) | [static] |
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 |
Definition at line 140 of file mac48-address.cc.
References GetBroadcast().
Referenced by ns3::WifiNetDevice::ForwardUp(), ns3::EmuNetDevice::ForwardUp(), ns3::MacTxMiddle::GetNextSequenceNumberfor(), ns3::WifiRemoteStationManager::Lookup(), ns3::MacRxMiddle::Lookup(), ns3::DcaTxop::NotifyAccessGranted(), ns3::SimpleNetDevice::Receive(), ns3::NqstaWifiMac::Receive(), ns3::NqapWifiMac::Receive(), ns3::MacRxMiddle::Receive(), ns3::CsmaNetDevice::Receive(), and ns3::MacLow::ReceiveOk().
bool ns3::Mac48Address::IsGroup | ( | void | ) | const |
Definition at line 157 of file mac48-address.cc.
References m_address.
bool ns3::Mac48Address::IsMatchingType | ( | const Address & | address | ) | [static] |
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 |
Definition at line 145 of file mac48-address.cc.
References CopyFrom(), CopyTo(), and GetMulticastPrefix().
Referenced by ns3::WifiNetDevice::ForwardUp(), ns3::EmuNetDevice::ForwardUp(), ns3::WifiRemoteStationManager::Lookup(), ns3::SimpleNetDevice::Receive(), ns3::NqapWifiMac::Receive(), and ns3::CsmaNetDevice::Receive().
ns3::Mac48Address::operator Address | ( | void | ) | const |
Convert an instance of this class to a polymorphic Address instance.
Definition at line 101 of file mac48-address.cc.
References ConvertTo().
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] |
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().