11#include "ns3/assert.h"
12#include "ns3/header.h"
28 .SetGroupName(
"Internet");
65 "Invalid Ipv6ExtensionHeader Length, must be a multiple of 8 bytes.");
66 NS_ASSERT_MSG(length > 0,
"Invalid Ipv6ExtensionHeader Length, must be greater than 0.");
67 NS_ASSERT_MSG(length < 2048,
"Invalid Ipv6ExtensionHeader Length, must be a lower than 2048.");
110 auto data =
new uint8_t[dataLength];
131 m_optionsOffset(optionsOffset)
167 auto buf =
new uint8_t[length];
168 start.Read(buf, length);
224 static TypeId tid =
TypeId(
"ns3::Ipv6ExtensionHopByHopHeader")
226 .SetParent<Ipv6ExtensionHeader>()
227 .SetGroupName(
"Internet");
286 static TypeId tid =
TypeId(
"ns3::Ipv6ExtensionDestinationHeader")
288 .SetParent<Ipv6ExtensionHeader>()
289 .SetGroupName(
"Internet");
348 static TypeId tid =
TypeId(
"ns3::Ipv6ExtensionFragmentHeader")
350 .SetParent<Ipv6ExtensionHeader>()
351 .SetGroupName(
"Internet");
455 static TypeId tid =
TypeId(
"ns3::Ipv6ExtensionRoutingHeader")
457 .SetParent<Ipv6ExtensionHeader>()
458 .SetGroupName(
"Internet");
545 static TypeId tid =
TypeId(
"ns3::Ipv6ExtensionLooseRoutingHeader")
547 .SetParent<Ipv6ExtensionRoutingHeader>()
548 .SetGroupName(
"Internet");
559 : m_routersAddress(0)
580std::vector<Ipv6Address>
654 for (uint8_t index = 0; index < addressNum; index++)
668 static TypeId tid =
TypeId(
"ns3::Ipv6ExtensionESPHeader")
670 .SetParent<Ipv6ExtensionHeader>()
671 .SetGroupName(
"Internet");
720 static TypeId tid =
TypeId(
"ns3::Ipv6ExtensionAHHeader")
722 .SetParent<Ipv6ExtensionHeader>()
723 .SetGroupName(
"Internet");
iterator in a Buffer instance
void WriteU32(uint32_t data)
void WriteU8(uint8_t data)
void Write(const uint8_t *buffer, uint32_t size)
void Read(uint8_t *buffer, uint32_t size)
void WriteHtonU16(uint16_t data)
void WriteHtonU32(uint32_t data)
void Prev()
go backward by one byte
automatically resized byte buffer
void RemoveAtEnd(uint32_t end)
Buffer::Iterator Begin() const
void AddAtEnd(uint32_t end)
Buffer::Iterator End() const
const uint8_t * PeekData() const
Describes an IPv6 address.
Option field for an IPv6ExtensionHeader.
uint32_t GetSerializedSize() const
Get the serialized size of the packet.
uint32_t CalculatePad(Ipv6OptionHeader::Alignment alignment) const
Calculate padding.
void Serialize(Buffer::Iterator start) const
Serialize all added options.
uint32_t GetOptionsOffset() const
Get the offset where the options begin, measured from the start of the extension header.
uint32_t Deserialize(Buffer::Iterator start, uint32_t length)
Deserialize the packet.
Buffer GetOptionBuffer()
Get the buffer.
Buffer m_optionData
Data payload.
OptionField(uint32_t optionsOffset)
Constructor.
~OptionField()
Destructor.
uint32_t m_optionsOffset
Offset.
void AddOption(const Ipv6OptionHeader &option)
Serialize the option, prepending pad1 or padn option as necessary.
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_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#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.