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;
uint16_t GetProtocol(void) const
Get the protocol.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
bool IsMatchingType(uint8_t type) const
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...
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.
uint32_t GetSingleDevice(void) const
Get the device this address is bound to.
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
a polymophic address class
uint32_t CopyAllTo(uint8_t *buffer, uint8_t len) const
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.
void SetPhysicalAddress(const Address address)
Set the destination address.
Address GetPhysicalAddress(void) const
Get the destination address.
uint16_t m_protocol
Protocol.
Address m_address
Destination address.
uint32_t CopyTo(uint8_t buffer[MAX_SIZE]) const
Copy the address bytes into a buffer.
bool IsSingleDevice(void) const
Checks if the address is bound to a specified NetDevice.
void SetProtocol(uint16_t protocol)
Set the protocol.
static PacketSocketAddress ConvertFrom(const Address &address)
Address ConvertTo(void) const
Convert an instance of this class to a polymorphic Address instance.
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.