|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #include "ns3/assert.h"
23 #include "ns3/header.h"
38 .SetGroupName (
"Internet")
71 NS_ASSERT_MSG (!(length & 0x7),
"Invalid Ipv6ExtensionHeader Length, must be a multiple of 8 bytes.");
72 NS_ASSERT_MSG (length > 0,
"Invalid Ipv6ExtensionHeader Length, must be greater than 0.");
73 NS_ASSERT_MSG (length < 2048,
"Invalid Ipv6ExtensionHeader Length, must be a lower than 2048.");
110 uint8_t*
data =
new uint8_t[dataLength];
131 m_optionsOffset (optionsOffset)
148 NS_LOG_LOGIC (
"fill with " << fill <<
" bytes padding");
161 uint8_t* buf =
new uint8_t[length];
162 start.Read (buf, length);
211 static TypeId tid =
TypeId (
"ns3::Ipv6ExtensionHopByHopHeader")
213 .SetParent<Ipv6ExtensionHeader> ()
214 .SetGroupName (
"Internet")
267 static TypeId tid =
TypeId (
"ns3::Ipv6ExtensionDestinationHeader")
269 .SetParent<Ipv6ExtensionHeader> ()
270 .SetGroupName (
"Internet")
323 static TypeId tid =
TypeId (
"ns3::Ipv6ExtensionFragmentHeader")
325 .SetParent<Ipv6ExtensionHeader> ()
326 .SetGroupName (
"Internet")
418 static TypeId tid =
TypeId (
"ns3::Ipv6ExtensionRoutingHeader")
420 .SetParent<Ipv6ExtensionHeader> ()
421 .SetGroupName (
"Internet")
498 static TypeId tid =
TypeId (
"ns3::Ipv6ExtensionLooseRoutingHeader")
500 .SetParent<Ipv6ExtensionRoutingHeader> ()
501 .SetGroupName (
"Internet")
512 : m_routersAddress (0)
579 it->Serialize (buff);
597 for (uint8_t index = 0; index < addressNum; index++)
610 static TypeId tid =
TypeId (
"ns3::Ipv6ExtensionESPHeader")
612 .SetParent<Ipv6ExtensionHeader> ()
613 .SetGroupName (
"Internet")
657 static TypeId tid =
TypeId (
"ns3::Ipv6ExtensionAHHeader")
659 .SetParent<Ipv6ExtensionHeader> ()
660 .SetGroupName (
"Internet")
a unique identifier for an interface.
void Write(uint8_t const *buffer, uint32_t size)
#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.
void AddAtEnd(uint32_t end)
Buffer m_optionData
Data payload.
uint32_t CalculatePad(Ipv6OptionHeader::Alignment alignment) const
Calculate padding.
void AddOption(Ipv6OptionHeader const &option)
Serialize the option, prepending pad1 or padn option as necessary.
void Read(uint8_t *buffer, uint32_t size)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t GetSize(void) const
uint16_t ReadNtohU16(void)
Buffer GetOptionBuffer()
Get the buffer.
void WriteU8(uint8_t data)
Describes an IPv6 address.
void Serialize(Buffer::Iterator start) const
Serialize all added options.
Buffer::Iterator End(void) const
void WriteHtonU16(uint16_t data)
uint32_t GetSerializedSize() const
Get the serialized size of the packet.
uint32_t m_optionsOffset
Offset.
automatically resized byte buffer
uint8_t const * PeekData(void) const
Buffer::Iterator Begin(void) const
uint32_t Deserialize(Buffer::Iterator start, uint32_t length)
Deserialize the packet.
#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_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
iterator in a Buffer instance
void RemoveAtEnd(uint32_t end)
Option field for an IPv6ExtensionHeader.
~OptionField()
Destructor.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
TypeId AddConstructor(void)
Record in this TypeId the fact that the default constructor is accessible.
void Prev(void)
go backward by one byte
void WriteU32(uint32_t data)
uint32_t GetOptionsOffset()
Get the offset where the options begin, measured from the start of the extension header.
uint32_t ReadNtohU32(void)
void WriteHtonU32(uint32_t data)
OptionField(uint32_t optionsOffset)
Constructor.