21 #include "ns3/assert.h"
23 #include "ns3/header.h"
24 #include "ipv6-extension-header.h"
31 NS_OBJECT_ENSURE_REGISTERED (Ipv6ExtensionHeader);
105 uint8_t* data =
new uint8_t[dataLength];
106 i.
Read (data, dataLength);
118 i.
Write (data, dataLength);
126 m_optionsOffset (optionsOffset)
143 NS_LOG_LOGIC (
"fill with " << fill <<
" bytes padding");
156 uint8_t* buf =
new uint8_t[length];
157 start.
Read (buf, length);
206 static TypeId tid =
TypeId (
"ns3::Ipv6ExtensionHopByHopHeader")
208 .SetParent<Ipv6ExtensionHeader> ()
261 static TypeId tid =
TypeId (
"ns3::Ipv6ExtensionDestinationHeader")
263 .SetParent<Ipv6ExtensionHeader> ()
317 static TypeId tid =
TypeId (
"ns3::Ipv6ExtensionFragmentHeader")
319 .SetParent<Ipv6ExtensionHeader> ()
408 static TypeId tid =
TypeId (
"ns3::Ipv6ExtensionRoutingHeader")
410 .SetParent<Ipv6ExtensionHeader> ()
487 static TypeId tid =
TypeId (
"ns3::Ipv6ExtensionLooseRoutingHeader")
489 .SetParent<Ipv6ExtensionRoutingHeader> ()
500 : m_routersAddress (0)
565 it->Serialize (buff);
594 static TypeId tid =
TypeId (
"ns3::Ipv6ExtensionESPHeader")
596 .SetParent<Ipv6ExtensionHeader> ()
640 static TypeId tid =
TypeId (
"ns3::Ipv6ExtensionAHHeader")
642 .SetParent<Ipv6ExtensionHeader> ()
TypeId AddConstructor(void)
void RemoveAtEnd(uint32_t end)
uint32_t CalculatePad(Ipv6OptionHeader::Alignment alignment) const
Calculate padding.
automatically resized byte buffer
#define NS_LOG_COMPONENT_DEFINE(name)
#define NS_LOG_FUNCTION_NOARGS()
Buffer m_optionData
Data payload.
OptionField(uint32_t optionsOffset)
Constructor.
uint32_t ReadNtohU32(void)
iterator in a Buffer instance
uint32_t GetSerializedSize() const
Get the serialized size of the packet.
Option field for an IPv6ExtensionHeader Enables adding options to an IPv6ExtensionHeader.
void WriteHtonU16(uint16_t data)
Buffer::Iterator End(void) const
uint8_t const * PeekData(void) const
#define NS_LOG_LOGIC(msg)
Buffer::Iterator Begin(void) const
uint32_t m_optionsOffset
Offset.
uint32_t GetOptionsOffset()
Get the offset where the options begin, measured from the start of the extension header.
void Read(uint8_t *buffer, uint32_t size)
void WriteHtonU32(uint32_t data)
uint32_t GetSize(void) const
bool AddAtEnd(uint32_t end)
Describes an IPv6 address.
void WriteU8(uint8_t data)
void AddOption(Ipv6OptionHeader const &option)
Serialize the option, prepending pad1 or padn option as necessary.
~OptionField()
Destructor.
uint32_t Deserialize(Buffer::Iterator start, uint32_t length)
Deserialize the packet.
Buffer GetOptionBuffer()
Get the buffer.
void Write(uint8_t const *buffer, uint32_t size)
void Serialize(Buffer::Iterator start) const
Serialize all added options.
uint16_t ReadNtohU16(void)
void WriteU32(uint32_t data)
a unique identifier for an interface.