22 #include "ns3/net-device.h"
92 PacketSocketAddress::operator
Address()
const
105 buffer[2] = (
m_device >> 24) & 0xff;
106 buffer[3] = (
m_device >> 16) & 0xff;
121 uint16_t protocol = buffer[0] | (buffer[1] << 8);
130 bool isSingleDevice = (buffer[6] == 1);
a polymophic address class
static constexpr uint32_t MAX_SIZE
The maximum size of a byte buffer which can be stored in an Address instance.
uint32_t CopyAllFrom(const uint8_t *buffer, uint8_t len)
static uint8_t Register()
Allocate a new type id for a new type of address.
uint32_t CopyAllTo(uint8_t *buffer, uint8_t len) const
an address for a packet socket
Address ConvertTo() const
Convert an instance of this class to a polymorphic Address instance.
uint32_t GetSingleDevice() const
Get the device this address is bound to.
bool IsSingleDevice() const
Checks if the address is bound to a specified NetDevice.
Address GetPhysicalAddress() const
Get the destination address.
Address m_address
Destination address.
uint32_t m_device
Outgoing NetDevice index.
void SetProtocol(uint16_t protocol)
Set the protocol.
static bool IsMatchingType(const Address &address)
void SetPhysicalAddress(const Address address)
Set the destination address.
bool m_isSingleDevice
True if directed to a specific outgoing NetDevice.
static PacketSocketAddress ConvertFrom(const Address &address)
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
static uint8_t GetType()
Return the Type of address.
uint16_t m_protocol
Protocol.
void SetAllDevices()
Set the address to match all the outgoing NetDevice.
uint16_t GetProtocol() const
Get the 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.