22 #include "ns3/assert.h"
23 #include "ns3/header.h"
39 .SetGroupName(
"Internet");
76 "Invalid Ipv6ExtensionHeader Length, must be a multiple of 8 bytes.");
77 NS_ASSERT_MSG(length > 0,
"Invalid Ipv6ExtensionHeader Length, must be greater than 0.");
78 NS_ASSERT_MSG(length < 2048,
"Invalid Ipv6ExtensionHeader Length, must be a lower than 2048.");
121 auto data =
new uint8_t[dataLength];
142 m_optionsOffset(optionsOffset)
178 auto buf =
new uint8_t[length];
179 start.Read(buf, length);
235 static TypeId tid =
TypeId(
"ns3::Ipv6ExtensionHopByHopHeader")
237 .SetParent<Ipv6ExtensionHeader>()
238 .SetGroupName(
"Internet");
297 static TypeId tid =
TypeId(
"ns3::Ipv6ExtensionDestinationHeader")
299 .SetParent<Ipv6ExtensionHeader>()
300 .SetGroupName(
"Internet");
359 static TypeId tid =
TypeId(
"ns3::Ipv6ExtensionFragmentHeader")
361 .SetParent<Ipv6ExtensionHeader>()
362 .SetGroupName(
"Internet");
466 static TypeId tid =
TypeId(
"ns3::Ipv6ExtensionRoutingHeader")
468 .SetParent<Ipv6ExtensionHeader>()
469 .SetGroupName(
"Internet");
556 static TypeId tid =
TypeId(
"ns3::Ipv6ExtensionLooseRoutingHeader")
558 .SetParent<Ipv6ExtensionRoutingHeader>()
559 .SetGroupName(
"Internet");
570 : m_routersAddress(0)
591 std::vector<Ipv6Address>
665 for (uint8_t index = 0; index < addressNum; index++)
679 static TypeId tid =
TypeId(
"ns3::Ipv6ExtensionESPHeader")
681 .SetParent<Ipv6ExtensionHeader>()
682 .SetGroupName(
"Internet");
731 static TypeId tid =
TypeId(
"ns3::Ipv6ExtensionAHHeader")
733 .SetParent<Ipv6ExtensionHeader>()
734 .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.