32 #include "ns3/assert.h"
34 #include "ns3/header.h"
36 #include "ns3/ipv4-address.h"
37 #include "ns3/address-utils.h"
38 #include "ns3/packet.h"
93 os <<
"( type = " << (uint32_t)
m_type <<
" length = " << (uint32_t)
m_length <<
" )";
137 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionPad1Header")
139 .SetParent<DsrOptionHeader> ()
160 os <<
"( type = " << (uint32_t)
GetType () <<
" )";
188 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionPadnHeader")
190 .SetParent<DsrOptionHeader> ()
203 NS_ASSERT_MSG (pad >= 2,
"PadN must be at least 2 bytes long");
213 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength () <<
" )";
228 for (
int padding = 0; padding <
GetLength (); padding++)
248 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionRreqHeader")
250 .SetParent<DsrOptionHeader> ()
331 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength () <<
"";
358 it->Serialize (buff);
395 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionRrepHeader")
397 .SetParent<DsrOptionHeader> ()
452 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength () <<
"";
479 it->Serialize (buff);
516 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionSRHeader")
518 .SetParent<DsrOptionHeader> ()
529 : m_segmentsLeft (0),
594 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength () <<
"";
621 it->Serialize (buff);
658 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionRerrHeader")
660 .SetParent<DsrOptionHeader> ()
725 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength ()
780 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionRerrUnreachHeader")
782 .SetParent<DsrOptionRerrHeader> ()
857 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength ()
908 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionRerrUnsupportHeader")
910 .SetParent<DsrOptionRerrHeader> ()
975 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength ()
978 <<
" unsupported option = " <<
m_unsupport <<
" )";
1026 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionAckReqHeader")
1028 .SetParent<DsrOptionHeader> ()
1039 : m_identification (0)
1062 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength ()
1101 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionAckHeader")
1103 .SetParent<DsrOptionHeader> ()
1114 : m_identification (0)
1156 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength ()
static Ipv4Address Deserialize(const uint8_t buf[4])
TypeId AddConstructor(void)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory.
void ReadFrom(Buffer::Iterator &i, Ipv4Address &ad)
Read an Ipv4Address from a Buffer.
automatically resized byte buffer
void WriteTo(Buffer::Iterator &i, Ipv4Address ad)
Write an Ipv4Address to a Buffer.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
iterator in a Buffer instance
void WriteU16(uint16_t data)
void WriteHtonU16(uint16_t data)
Buffer::Iterator End(void) const
void Next(void)
go forward by one byte
Buffer::Iterator Begin(void) const
void Read(uint8_t *buffer, uint32_t size)
bool AddAtEnd(uint32_t end)
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Ipv4 addresses are stored in host order in this class.
void WriteU8(uint8_t data)
void Write(uint8_t const *buffer, uint32_t size)
uint16_t ReadNtohU16(void)
a unique identifier for an interface.