33 #include "ns3/address-utils.h"
34 #include "ns3/assert.h"
36 #include "ns3/header.h"
37 #include "ns3/ipv4-address.h"
39 #include "ns3/packet.h"
104 os <<
"( type = " << (uint32_t)
m_type <<
" length = " << (uint32_t)
m_length <<
" )";
153 static TypeId tid =
TypeId(
"ns3::dsr::DsrOptionPad1Header")
155 .SetParent<DsrOptionHeader>()
156 .SetGroupName(
"Dsr");
178 os <<
"( type = " << (uint32_t)
GetType() <<
" )";
210 static TypeId tid =
TypeId(
"ns3::dsr::DsrOptionPadnHeader")
212 .SetParent<DsrOptionHeader>()
213 .SetGroupName(
"Dsr");
226 NS_ASSERT_MSG(pad >= 2,
"PadN must be at least 2 bytes long");
237 os <<
"( type = " << (uint32_t)
GetType() <<
" length = " << (uint32_t)
GetLength() <<
" )";
254 for (
int padding = 0; padding <
GetLength(); padding++)
276 static TypeId tid =
TypeId(
"ns3::dsr::DsrOptionRreqHeader")
278 .SetParent<DsrOptionHeader>()
279 .SetGroupName(
"Dsr");
333 std::vector<Ipv4Address>
372 os <<
"( type = " << (uint32_t)
GetType() <<
" length = " << (uint32_t)
GetLength() <<
"";
417 for (std::size_t index = 0; index <
m_ipv4Address.size(); index++)
439 static TypeId tid =
TypeId(
"ns3::dsr::DsrOptionRrepHeader")
441 .SetParent<DsrOptionHeader>()
442 .SetGroupName(
"Dsr");
477 std::vector<Ipv4Address>
504 os <<
"( type = " << (uint32_t)
GetType() <<
" length = " << (uint32_t)
GetLength() <<
"";
549 for (std::size_t index = 0; index <
m_ipv4Address.size(); index++)
571 static TypeId tid =
TypeId(
"ns3::dsr::DsrOptionSRHeader")
573 .SetParent<DsrOptionHeader>()
574 .SetGroupName(
"Dsr");
634 std::vector<Ipv4Address>
661 os <<
"( type = " << (uint32_t)
GetType() <<
" length = " << (uint32_t)
GetLength() <<
"";
706 for (std::size_t index = 0; index <
m_ipv4Address.size(); index++)
728 static TypeId tid =
TypeId(
"ns3::dsr::DsrOptionRerrHeader")
730 .SetParent<DsrOptionHeader>()
731 .SetGroupName(
"Dsr");
805 os <<
"( type = " << (uint32_t)
GetType() <<
" length = " << (uint32_t)
GetLength()
864 static TypeId tid =
TypeId(
"ns3::dsr::DsrOptionRerrUnreachHeader")
866 .SetParent<DsrOptionRerrHeader>()
867 .SetGroupName(
"Dsr");
952 os <<
"( type = " << (uint32_t)
GetType() <<
" length = " << (uint32_t)
GetLength()
1008 static TypeId tid =
TypeId(
"ns3::dsr::DsrOptionRerrUnsupportedHeader")
1010 .SetParent<DsrOptionRerrHeader>()
1011 .SetGroupName(
"Dsr");
1084 os <<
"( type = " << (uint32_t)
GetType() <<
" length = " << (uint32_t)
GetLength()
1138 static TypeId tid =
TypeId(
"ns3::dsr::DsrOptionAckReqHeader")
1140 .SetParent<DsrOptionHeader>()
1141 .SetGroupName(
"Dsr");
1152 : m_identification(0)
1178 os <<
"( type = " << (uint32_t)
GetType() <<
" length = " << (uint32_t)
GetLength()
1222 static TypeId tid =
TypeId(
"ns3::dsr::DsrOptionAckHeader")
1224 .SetParent<DsrOptionHeader>()
1225 .SetGroupName(
"Dsr");
1236 : m_identification(0)
1285 os <<
"( type = " << (uint32_t)
GetType() <<
" length = " << (uint32_t)
GetLength()
iterator in a Buffer instance
void WriteU8(uint8_t data)
void Write(const uint8_t *buffer, uint32_t size)
void WriteU16(uint16_t data)
void Read(uint8_t *buffer, uint32_t size)
void WriteHtonU16(uint16_t data)
void Next()
go forward by one byte
automatically resized byte buffer
Buffer::Iterator Begin() const
void AddAtEnd(uint32_t end)
Buffer::Iterator End() const
Ipv4 addresses are stored in host order in this class.
static Ipv4Address Deserialize(const uint8_t buf[4])
a unique identifier for an interface.
TypeId AddConstructor()
Record in this TypeId the fact that the default constructor is accessible.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void WriteTo(Buffer::Iterator &i, Ipv4Address ad)
Write an Ipv4Address to a Buffer.
void ReadFrom(Buffer::Iterator &i, Ipv4Address &ad)
Read an Ipv4Address from a Buffer.