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

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
bool IsBroadcast (void) const
bool IsGroup (void) const
 operator Address () const

Static Public Member Functions

static Mac48Address Allocate (void)
static Mac48Address ConvertFrom (const Address &address)
static Mac48Address GetBroadcast (void)
static Mac48Address GetMulticast (Ipv4Address address)
static Mac48Address GetMulticast (Ipv6Address address)
 Get multicast address from IPv6 address.
static Mac48Address GetMulticast6Prefix (void)
 Get the multicast prefix for IPv6 (33:33:00:00:00:00).
static Mac48Address GetMulticastPrefix (void)
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 [6]

Friends

bool operator!= (const Mac48Address &a, const Mac48Address &b)
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().

+ Here is the caller graph for this function:

ns3::Mac48Address::Mac48Address ( const char *  str)
Parameters
stra 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.

+ Here is the call graph for this function:

Member Function Documentation

Mac48Address ns3::Mac48Address::ConvertFrom ( const Address address)
static
Parameters
addressa 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::Ipv6L3Protocol::AddAutoconfiguredAddress(), ns3::BridgeNetDevice::AddBridgePort(), ns3::MeshPointDevice::AddInterface(), ns3::TcpTestCase::AddSimpleNetDevice(), ns3::AddSimpleNetDevice(), ns3::TcpTestCase::AddSimpleNetDevice6(), ns3::TapBridge::CreateTap(), ns3::Ipv4HeaderTest::DoRun(), ns3::Ipv4RawSocketImplTest::DoRun(), ns3::Ipv4FragmentationTest::DoRun(), ns3::Ipv6FragmentationTest::DoRun(), ns3::UdpSocketImplTest::DoRun(), ns3::Udp6SocketImplTest::DoRun(), ns3::Ipv6Interface::DoSetup(), ns3::TapBridge::ForwardToBridgedDevice(), ns3::dot11s::PeerManagementProtocol::Install(), ns3::dot11s::HwmpProtocol::Install(), ns3::flame::FlameProtocol::Install(), ns3::aodv::Neighbors::LookupMacAddress(), ns3::dsr::RouteCache::LookupMacAddress(), ns3::Ipv6AddressHelper::NewAddress(), ns3::dsr::DsrRouting::PromiscReceive(), ns3::TapBridge::ReceiveFromBridgedDevice(), ns3::BridgeNetDevice::ReceiveFromDevice(), ns3::MeshPointDevice::ReceiveFromDevice(), ns3::Ipv6L3Protocol::RemoveAutoconfiguredAddress(), ns3::MeshHelper::Report(), ns3::LoopbackNetDevice::Send(), ns3::SimpleNetDevice::Send(), ns3::ErrorNetDevice::Send(), ns3::WifiNetDevice::Send(), ns3::MeshPointDevice::Send(), ns3::WimaxNetDevice::Send(), ns3::LoopbackNetDevice::SendFrom(), ns3::ErrorNetDevice::SendFrom(), ns3::SimpleNetDevice::SendFrom(), ns3::BridgeNetDevice::SendFrom(), ns3::MeshPointDevice::SendFrom(), ns3::WifiNetDevice::SendFrom(), ns3::AlohaNoackNetDevice::SendFrom(), ns3::EmuNetDevice::SendFrom(), ns3::WimaxNetDevice::SendFrom(), ns3::CsmaNetDevice::SendFrom(), ns3::LoopbackNetDevice::SetAddress(), ns3::LteNetDevice::SetAddress(), ns3::SimpleNetDevice::SetAddress(), ns3::ErrorNetDevice::SetAddress(), ns3::WifiNetDevice::SetAddress(), ns3::BridgeNetDevice::SetAddress(), ns3::MeshPointDevice::SetAddress(), ns3::EmuNetDevice::SetAddress(), ns3::PointToPointNetDevice::SetAddress(), ns3::AlohaNoackNetDevice::SetAddress(), ns3::TapBridge::SetAddress(), ns3::WimaxNetDevice::SetAddress(), and ns3::CsmaNetDevice::SetAddress().

+ Here is the call graph for this function:

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.

+ Here is the call graph for this function:

void ns3::Mac48Address::CopyFrom ( const uint8_t  buffer[6])
Parameters
bufferaddress 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 ns3::dot11s::HwmpTag::Deserialize(), ns3::flame::FlameTag::Deserialize(), GetMulticast(), and ns3::ReadFrom().

+ Here is the caller graph for this function:

void ns3::Mac48Address::CopyTo ( uint8_t  buffer[6]) const
Parameters
bufferaddress 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 SwitchFlowTableTestCase::DoRun(), GetMulticast(), ns3::Ipv6Address::MakeAutoconfiguredAddress(), ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(), ns3::operator<<(), ns3::dot11s::HwmpTag::Serialize(), ns3::flame::FlameTag::Serialize(), and ns3::WriteTo().

+ Here is the caller graph for this function:

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

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

References Mac48Address().

Referenced by ns3::EpcHelper::AddEnb(), ns3::dot11s::PeerLink::ConfirmAccept(), ns3::dot11s::PeerLink::ConfirmReject(), ns3::MeshWifiBeacon::CreateHeader(), ns3::dot11s::HwmpRtable::DeleteProactivePath(), ns3::EpcS1uUlTestCase::DoRun(), ns3::dot11s::HwmpProtocolMac::ForwardPerr(), ns3::dot11s::HwmpProtocol::ForwardUnicast(), ns3::dot11s::HwmpProtocol::GetBroadcastReceivers(), ns3::dot11s::HwmpProtocol::GetPreqReceivers(), ns3::flame::FlameProtocol::HandleDataFrame(), IsBroadcast(), ns3::dot11s::HwmpRtable::LookupResult::IsValid(), ns3::flame::FlameRtable::LookupResult::IsValid(), ns3::dot11s::IePreq::MayAddAddress(), ns3::dot11s::PeerLink::OpenAccept(), ns3::dot11s::PeerLink::OpenReject(), ns3::dot11s::HwmpProtocol::ProactivePathResolved(), ns3::dot11s::HwmpProtocol::ReactivePathResolved(), ns3::flame::FlameProtocolMac::Receive(), ns3::MeshWifiInterfaceMac::Receive(), ns3::dot11s::PeerManagementProtocol::ReceiveBeacon(), ns3::dot11s::HwmpProtocolMac::ReceiveData(), ns3::dot11s::HwmpProtocol::ReceivePrep(), ns3::dot11s::HwmpProtocol::ReceivePreq(), ns3::flame::FlameProtocol::RemoveRoutingStuff(), ns3::dot11s::HwmpProtocol::RequestRoute(), ns3::flame::FlameProtocol::RequestRoute(), ns3::dot11s::HwmpProtocol::RetryPathDiscovery(), ns3::MeshWifiInterfaceMac::SendManagementFrame(), ns3::ApWifiMac::SendOneBeacon(), ns3::dot11s::HwmpProtocol::SendProactivePreq(), ns3::StaWifiMac::SendProbeRequest(), ns3::dot11s::PeerLink::StateMachine(), and ns3::flame::FlameProtocolMac::UpdateOutcomingFrame().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Mac48Address ns3::Mac48Address::GetMulticast ( Ipv4Address  address)
static
Parameters
addressbase IPv4 address
Returns
a multicast address

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

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

+ Here is the call graph for this function:

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

Get multicast address from IPv6 address.

Parameters
addressbase IPv6 address
Returns
a multicast address

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

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

+ Here is the call graph for this function:

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 162 of file mac48-address.cc.

References Mac48Address().

Referenced by GetMulticast().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

References Mac48Address().

Referenced by GetMulticast().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

References 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::Mac48Address::IsGroup ( void  ) const
Returns
true if the group bit is set, false otherwise.

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

References m_address.

Referenced by ns3::WifiRemoteStationManager::AddSupportedMode(), ns3::dot11s::AirtimeLinkMetricCalculator::CalculateMetric(), ns3::WifiNetDevice::ForwardUp(), ns3::EmuNetDevice::ForwardUp(), ns3::WifiRemoteStationManager::GetAckMode(), ns3::WifiRemoteStationManager::GetCtsMode(), ns3::WifiRemoteStationManager::GetDataMode(), ns3::WifiRemoteStationManager::GetFragmentOffset(), ns3::WifiRemoteStationManager::GetFragmentSize(), ns3::MacTxMiddle::GetNextSequenceNumberfor(), ns3::WifiRemoteStationManager::GetRtsMode(), ns3::WifiRemoteStationManager::IsAssociated(), ns3::WifiRemoteStationManager::IsBrandNew(), ns3::WifiRemoteStationManager::IsLastFragment(), ns3::WifiRemoteStationManager::IsWaitAssocTxOk(), ns3::MacRxMiddle::Lookup(), ns3::WifiRemoteStationManager::NeedDataRetransmission(), ns3::WifiRemoteStationManager::NeedFragmentation(), ns3::WifiRemoteStationManager::NeedRts(), ns3::WifiRemoteStationManager::NeedRtsRetransmission(), ns3::EdcaTxopN::NotifyAccessGranted(), ns3::DcaTxop::NotifyAccessGranted(), ns3::AlohaNoackNetDevice::NotifyReceptionEndOk(), ns3::WifiRemoteStationManager::PrepareForQueue(), ns3::MacRxMiddle::Receive(), ns3::SimpleNetDevice::Receive(), ns3::ErrorNetDevice::Receive(), ns3::LoopbackNetDevice::Receive(), ns3::StaWifiMac::Receive(), ns3::ApWifiMac::Receive(), ns3::CsmaNetDevice::Receive(), ns3::MeshPointDevice::ReceiveFromDevice(), ns3::MacLow::ReceiveOk(), ns3::WifiRemoteStationManager::RecordDisassociated(), ns3::WifiRemoteStationManager::RecordGotAssocTxFailed(), ns3::WifiRemoteStationManager::RecordGotAssocTxOk(), ns3::WifiRemoteStationManager::RecordWaitAssocTxOk(), ns3::WifiRemoteStationManager::ReportDataFailed(), ns3::WifiRemoteStationManager::ReportDataOk(), ns3::WifiRemoteStationManager::ReportFinalDataFailed(), ns3::WifiRemoteStationManager::ReportFinalRtsFailed(), ns3::WifiRemoteStationManager::ReportRtsFailed(), ns3::WifiRemoteStationManager::ReportRtsOk(), ns3::WifiRemoteStationManager::ReportRxOk(), ns3::WifiRemoteStationManager::Reset(), ns3::BridgeNetDevice::SendFrom(), and ns3::dot11s::PeerManagementProtocolMac::UpdateOutcomingFrame().

+ Here is the caller graph for this function:

bool ns3::Mac48Address::IsMatchingType ( const Address address)
static
Parameters
addressaddress to test
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::Ipv6L3Protocol::AddAutoconfiguredAddress(), ns3::BridgeNetDevice::AddBridgePort(), ns3::MeshPointDevice::AddInterface(), ns3::Ipv6Interface::DoSetup(), ns3::Ipv6AddressHelper::NewAddress(), ns3::WifiNetDevice::Send(), ns3::WifiNetDevice::SendFrom(), and ns3::TapBridge::SetBridgedNetDevice().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ns3::Mac48Address::operator Address ( ) 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.

Friends And Related Function Documentation

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

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

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

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

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

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

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

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

Member Data Documentation

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

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