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