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"
95 os <<
"( type = " << (uint32_t)
m_type <<
" length = " << (uint32_t)
m_length <<
" )";
139 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionPad1Header")
141 .SetParent<DsrOptionHeader> ()
162 os <<
"( type = " << (uint32_t)
GetType () <<
" )";
190 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionPadnHeader")
192 .SetParent<DsrOptionHeader> ()
205 NS_ASSERT_MSG (pad >= 2,
"PadN must be at least 2 bytes long");
215 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength () <<
" )";
230 for (
int padding = 0; padding <
GetLength (); padding++)
250 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionRreqHeader")
252 .SetParent<DsrOptionHeader> ()
333 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength () <<
"";
360 it->Serialize (buff);
397 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionRrepHeader")
399 .SetParent<DsrOptionHeader> ()
454 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength () <<
"";
481 it->Serialize (buff);
518 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionSRHeader")
520 .SetParent<DsrOptionHeader> ()
531 : m_segmentsLeft (0),
596 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength () <<
"";
623 it->Serialize (buff);
660 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionRerrHeader")
662 .SetParent<DsrOptionHeader> ()
727 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength ()
782 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionRerrUnreachHeader")
784 .SetParent<DsrOptionRerrHeader> ()
859 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength ()
910 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionRerrUnsupportHeader")
912 .SetParent<DsrOptionRerrHeader> ()
977 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength ()
980 <<
" unsupported option = " <<
m_unsupport <<
" )";
1028 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionAckReqHeader")
1030 .SetParent<DsrOptionHeader> ()
1041 : m_identification (0)
1064 os <<
"( type = " << (uint32_t)
GetType () <<
" length = " << (uint32_t)
GetLength ()
1103 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionAckHeader")
1105 .SetParent<DsrOptionHeader> ()
1116 : m_identification (0)
1158 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 an Object subclass with the TypeId system.
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
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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.