23 #include "ns3/ipv4-address.h"
103 .AddConstructor<Ipv4PacketInfoTag> ()
150 os <<
"Ipv4 PKTINFO [DestAddr: " <<
m_addr;
152 os <<
", RecvIf:" << (uint32_t)
m_ifindex;
153 os <<
", TTL:" << (uint32_t)
m_ttl;
static Ipv4Address Deserialize(const uint8_t buf[4])
void Write(const uint8_t *buffer, uint32_t size)
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
virtual uint32_t GetSerializedSize(void) const
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
TAG_BUFFER_INLINE uint32_t ReadU32(void)
Ipv4Address m_addr
Header destination address.
TAG_BUFFER_INLINE uint8_t ReadU8(void)
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
uint32_t m_ifindex
interface index
void SetTtl(uint8_t ttl)
Set the tag's Time to Live Implemented, but not used in the stack yet.
Ipv4Address m_spec_dst
Local address.
uint32_t GetRecvIf(void) const
Get the tag's receiving interface.
TAG_BUFFER_INLINE void WriteU32(uint32_t v)
void Serialize(uint8_t buf[4]) const
Serialize this address to a 4-byte buffer.
virtual void Serialize(TagBuffer i) const
uint8_t GetTtl(void) const
Get the tag's Time to Live Implemented, but not used in the stack yet.
tag a set of bytes in a packet
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ipv4Address GetLocalAddress(void) const
Get the tag's local address.
static TypeId GetTypeId(void)
Get the type ID.
uint8_t m_ttl
Time to Live.
TAG_BUFFER_INLINE void WriteU8(uint8_t v)
Ipv4 addresses are stored in host order in this class.
virtual void Deserialize(TagBuffer i)
Ipv4Address GetAddress(void) const
Get the tag's address.
void SetLocalAddress(Ipv4Address addr)
Set the tag's local address.
void Read(uint8_t *buffer, uint32_t size)
virtual void Print(std::ostream &os) const
void SetAddress(Ipv4Address addr)
Set the tag's address.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
void SetRecvIf(uint32_t ifindex)
Set the tag's receiving interface.