21 #include "ns3/net-device.h" 84 PacketSocketAddress::operator
Address ()
const 112 uint16_t protocol = buffer[0] | (buffer[1] << 8);
121 bool isSingleDevice = (buffer[6] == 1) ?
true :
false;
Address ConvertTo(void) const
Convert an instance of this class to a polymorphic Address instance.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
an address for a packet socket
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
uint32_t CopyAllTo(uint8_t *buffer, uint8_t len) const
static bool IsMatchingType(const Address &address)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetAllDevices(void)
Set the address to match all the outgoing NetDevice.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
a polymophic address class
bool IsSingleDevice(void) const
Checks if the address is bound to a specified NetDevice.
uint16_t GetProtocol(void) const
Get the protocol.
uint32_t m_device
Outgoing NetDevice index.
uint32_t CopyAllFrom(const uint8_t *buffer, uint8_t len)
static uint8_t GetType(void)
Return the Type of address.
uint32_t GetSingleDevice(void) const
Get the device this address is bound to.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetPhysicalAddress(const Address address)
Set the destination address.
uint16_t m_protocol
Protocol.
Address m_address
Destination address.
void SetProtocol(uint16_t protocol)
Set the protocol.
static PacketSocketAddress ConvertFrom(const Address &address)
Address GetPhysicalAddress(void) const
Get the destination address.
bool m_isSingleDevice
True if directed to a specific outgoing NetDevice.
static uint8_t Register(void)
Allocate a new type id for a new type of address.