an address for a packet socket More...
#include "packet-socket-address.h"
Public Member Functions | |
PacketSocketAddress () | |
Address | ConvertTo () const |
Convert an instance of this class to a polymorphic Address instance. More... | |
Address | GetPhysicalAddress () const |
Get the destination address. More... | |
uint16_t | GetProtocol () const |
Get the protocol. More... | |
uint32_t | GetSingleDevice () const |
Get the device this address is bound to. More... | |
bool | IsSingleDevice () const |
Checks if the address is bound to a specified NetDevice. More... | |
operator Address () const | |
void | SetAllDevices () |
Set the address to match all the outgoing NetDevice. More... | |
void | SetPhysicalAddress (const Address address) |
Set the destination address. More... | |
void | SetProtocol (uint16_t protocol) |
Set the protocol. More... | |
void | SetSingleDevice (uint32_t device) |
Set the address to match only a specified NetDevice. More... | |
Static Public Member Functions | |
static PacketSocketAddress | ConvertFrom (const Address &address) |
static bool | IsMatchingType (const Address &address) |
Static Private Member Functions | |
static uint8_t | GetType () |
Return the Type of address. More... | |
Private Attributes | |
Address | m_address |
Destination address. More... | |
uint32_t | m_device |
Outgoing NetDevice index. More... | |
bool | m_isSingleDevice |
True if directed to a specific outgoing NetDevice. More... | |
uint16_t | m_protocol |
Protocol. More... | |
an address for a packet socket
Definition at line 39 of file packet-socket-address.h.
ns3::PacketSocketAddress::PacketSocketAddress | ( | ) |
Definition at line 29 of file packet-socket-address.cc.
References NS_LOG_FUNCTION.
|
static |
address | a polymorphic address |
Definition at line 115 of file packet-socket-address.cc.
References first::address, ns3::Address::CopyAllFrom(), IsMatchingType(), ns3::Address::MAX_SIZE, NS_ASSERT, NS_LOG_FUNCTION, SetAllDevices(), SetPhysicalAddress(), SetProtocol(), and SetSingleDevice().
Referenced by ns3::PacketSocket::Bind(), ns3::PacketSocket::GetTxAvailable(), ns3::PacketSocketServer::HandleRead(), ns3::PacketSocketClient::Send(), and ns3::PacketSocket::SendTo().
Address ns3::PacketSocketAddress::ConvertTo | ( | ) | const |
Convert an instance of this class to a polymorphic Address instance.
Definition at line 98 of file packet-socket-address.cc.
References first::address, ns3::Address::CopyAllTo(), GetType(), m_address, m_device, m_isSingleDevice, m_protocol, ns3::Address::MAX_SIZE, and NS_LOG_FUNCTION.
Address ns3::PacketSocketAddress::GetPhysicalAddress | ( | ) | const |
Get the destination address.
Definition at line 86 of file packet-socket-address.cc.
References m_address, and NS_LOG_FUNCTION.
Referenced by ns3::PacketSocket::SendTo().
uint16_t ns3::PacketSocketAddress::GetProtocol | ( | ) | const |
Get the protocol.
Definition at line 65 of file packet-socket-address.cc.
References m_protocol, and NS_LOG_FUNCTION.
Referenced by ns3::PacketSocket::SendTo().
uint32_t ns3::PacketSocketAddress::GetSingleDevice | ( | ) | const |
Get the device this address is bound to.
Definition at line 79 of file packet-socket-address.cc.
References m_device, and NS_LOG_FUNCTION.
Referenced by ns3::PacketSocket::GetMinMtu(), and ns3::PacketSocket::SendTo().
|
staticprivate |
Return the Type of address.
Definition at line 155 of file packet-socket-address.cc.
References NS_LOG_FUNCTION_NOARGS, ns3::Address::Register(), and check-style-clang-format::type.
Referenced by ConvertTo(), and IsMatchingType().
|
static |
address | address to test |
Definition at line 148 of file packet-socket-address.cc.
References first::address, GetType(), and NS_LOG_FUNCTION.
Referenced by ns3::PacketSocket::Bind(), ns3::PacketSocket::Connect(), ConvertFrom(), ns3::PacketSocketServer::HandleRead(), ns3::PacketSocket::SendTo(), and ns3::OnOffApplication::StartApplication().
bool ns3::PacketSocketAddress::IsSingleDevice | ( | ) | const |
Checks if the address is bound to a specified NetDevice.
Definition at line 72 of file packet-socket-address.cc.
References m_isSingleDevice, and NS_LOG_FUNCTION.
Referenced by ns3::PacketSocket::GetMinMtu(), and ns3::PacketSocket::SendTo().
ns3::PacketSocketAddress::operator Address | ( | ) | const |
Convert an instance of this class to a polymorphic Address instance.
Definition at line 92 of file packet-socket-address.cc.
void ns3::PacketSocketAddress::SetAllDevices | ( | ) |
Set the address to match all the outgoing NetDevice.
Definition at line 42 of file packet-socket-address.cc.
References m_device, m_isSingleDevice, and NS_LOG_FUNCTION.
Referenced by ConvertFrom(), and ns3::PacketSocket::GetSockName().
void ns3::PacketSocketAddress::SetPhysicalAddress | ( | const Address | address | ) |
Set the destination address.
address | the destination address |
Definition at line 58 of file packet-socket-address.cc.
References first::address, m_address, and NS_LOG_FUNCTION.
Referenced by ns3::NoBackhaulEpcHelper::AddEnb(), ConvertFrom(), PacketSocketAppsTest::DoRun(), SpectrumIdealPhyTestCase::DoRun(), CsmaPacketSocketTestCase::DoRun(), BlockAckAggregationDisabledTest::DoRun(), PreservePacketsInAmpdus::DoRun(), OfdmaAckSequenceTest::DoRun(), TestUnsupportedModulationReception::DoRun(), Bug730TestCase::DoRun(), Bug2222TestCase::DoRun(), WifiTxopTest::DoRun(), ns3::PacketSocket::GetSockName(), Experiment::Run(), NetAnimExperiment::Run(), WifiChannelSwitchingTest::SendPacket(), UanExperiment::SendSinglePacket(), MultiLinkSetupTest::StartTraffic(), MultiLinkTxTest::StartTraffic(), MultiLinkMuTxTest::StartTraffic(), and ReleaseSeqNoAfterCtsTimeoutTest::StartTraffic().
void ns3::PacketSocketAddress::SetProtocol | ( | uint16_t | protocol | ) |
Set the protocol.
protocol | the protocol |
Definition at line 35 of file packet-socket-address.cc.
References m_protocol, and NS_LOG_FUNCTION.
Referenced by ns3::NoBackhaulEpcHelper::AddEnb(), ConvertFrom(), PacketSocketAppsTest::DoRun(), SpectrumIdealPhyTestCase::DoRun(), CsmaPacketSocketTestCase::DoRun(), BlockAckAggregationDisabledTest::DoRun(), PreservePacketsInAmpdus::DoRun(), OfdmaAckSequenceTest::DoRun(), TestUnsupportedModulationReception::DoRun(), Bug730TestCase::DoRun(), Bug2222TestCase::DoRun(), WifiTxopTest::DoRun(), EmlsrOperationsTestBase::DoSetup(), MultiLinkOperationsTestBase::DoSetup(), ns3::PacketSocket::GetSockName(), Experiment::Run(), NetAnimExperiment::Run(), WifiChannelSwitchingTest::SendPacket(), UanExperiment::SendSinglePacket(), MultiLinkSetupTest::StartTraffic(), MultiLinkTxTest::StartTraffic(), MultiLinkMuTxTest::StartTraffic(), and ReleaseSeqNoAfterCtsTimeoutTest::StartTraffic().
void ns3::PacketSocketAddress::SetSingleDevice | ( | uint32_t | device | ) |
Set the address to match only a specified NetDevice.
device | the NetDevice index |
Definition at line 50 of file packet-socket-address.cc.
References m_device, m_isSingleDevice, and NS_LOG_FUNCTION.
Referenced by ns3::NoBackhaulEpcHelper::AddEnb(), ConvertFrom(), PacketSocketAppsTest::DoRun(), SpectrumIdealPhyTestCase::DoRun(), CsmaPacketSocketTestCase::DoRun(), BlockAckAggregationDisabledTest::DoRun(), PreservePacketsInAmpdus::DoRun(), OfdmaAckSequenceTest::DoRun(), TestUnsupportedModulationReception::DoRun(), Bug730TestCase::DoRun(), QosFragmentationTestCase::DoRun(), Bug2222TestCase::DoRun(), WifiTxopTest::DoRun(), EmlsrOperationsTestBase::DoSetup(), MultiLinkOperationsTestBase::DoSetup(), ns3::PacketSocket::GetSockName(), Experiment::Run(), NetAnimExperiment::Run(), WifiChannelSwitchingTest::SendPacket(), UanExperiment::SendSinglePacket(), MultiLinkSetupTest::StartTraffic(), MultiLinkTxTest::StartTraffic(), MultiLinkMuTxTest::StartTraffic(), and ReleaseSeqNoAfterCtsTimeoutTest::StartTraffic().
|
private |
Destination address.
Definition at line 128 of file packet-socket-address.h.
Referenced by ConvertTo(), GetPhysicalAddress(), and SetPhysicalAddress().
|
private |
Outgoing NetDevice index.
Definition at line 127 of file packet-socket-address.h.
Referenced by ConvertTo(), GetSingleDevice(), SetAllDevices(), and SetSingleDevice().
|
private |
True if directed to a specific outgoing NetDevice.
Definition at line 126 of file packet-socket-address.h.
Referenced by ConvertTo(), IsSingleDevice(), SetAllDevices(), and SetSingleDevice().
|
private |
Protocol.
Definition at line 125 of file packet-socket-address.h.
Referenced by ConvertTo(), GetProtocol(), and SetProtocol().