Option field for an DsrFsHeader Enables adding options to an DsrFsHeader. More...
#include "dsr-fs-header.h"
Public Member Functions | |
DsrOptionField (uint32_t optionsOffset) | |
Constructor. | |
~DsrOptionField () | |
Destructor. | |
void | AddDsrOption (const DsrOptionHeader &option) |
Serialize the option, prepending pad1 or padn option as necessary. | |
uint32_t | Deserialize (Buffer::Iterator start, uint32_t length) |
Deserialize the packet. | |
Buffer | GetDsrOptionBuffer () |
Get the buffer. | |
uint32_t | GetDsrOptionsOffset () const |
Get the offset where the options begin, measured from the start of the extension header. | |
uint32_t | GetSerializedSize () const |
Get the serialized size of the packet. | |
void | Serialize (Buffer::Iterator start) const |
Serialize all added options. | |
Private Member Functions | |
uint32_t | CalculatePad (DsrOptionHeader::Alignment alignment) const |
Calculate padding. | |
Private Attributes | |
Buffer | m_optionData |
Data payload. | |
uint32_t | m_optionsOffset |
Offset. | |
Option field for an DsrFsHeader Enables adding options to an DsrFsHeader.
Implementor's note: Make sure to add the result of OptionField::GetSerializedSize () to your DsrFsHeader::GetSerializedSize () return value. Call OptionField::Serialize and OptionField::Deserialize at the end of your corresponding DsrFsHeader methods.
Definition at line 200 of file dsr-fs-header.h.
ns3::dsr::DsrOptionField::DsrOptionField | ( | uint32_t | optionsOffset | ) |
ns3::dsr::DsrOptionField::~DsrOptionField | ( | ) |
Destructor.
Definition at line 193 of file dsr-fs-header.cc.
void ns3::dsr::DsrOptionField::AddDsrOption | ( | const DsrOptionHeader & | option | ) |
Serialize the option, prepending pad1 or padn option as necessary.
option | the option header to serialize |
Definition at line 236 of file dsr-fs-header.cc.
References ns3::Buffer::AddAtEnd(), AddDsrOption(), CalculatePad(), ns3::Buffer::End(), ns3::dsr::DsrOptionHeader::GetAlignment(), ns3::dsr::DsrOptionHeader::GetSerializedSize(), m_optionData, NS_LOG_FUNCTION_NOARGS, NS_LOG_LOGIC, ns3::Buffer::Iterator::Prev(), and ns3::dsr::DsrOptionHeader::Serialize().
Referenced by ns3::dsr::DsrRouting::AddAckReqHeader(), AddDsrOption(), ns3::dsr::DsrRouting::CheckSendBuffer(), DsrAckHeaderTest::DoRun(), DsrAckReqHeaderTest::DoRun(), DsrFsHeaderTest::DoRun(), DsrRerrHeaderTest::DoRun(), DsrRrepHeaderTest::DoRun(), DsrRreqHeaderTest::DoRun(), DsrSRHeaderTest::DoRun(), ns3::dsr::DsrRouting::ForwardErrPacket(), ns3::dsr::DsrRouting::ForwardPacket(), ns3::dsr::DsrRouting::PacketNewRoute(), ns3::dsr::DsrOptionRrep::Process(), ns3::dsr::DsrOptionRreq::Process(), ns3::dsr::DsrRouting::SalvagePacket(), ns3::dsr::DsrRouting::Send(), ns3::dsr::DsrRouting::SendAck(), ns3::dsr::DsrRouting::SendErrorRequest(), ns3::dsr::DsrRouting::SendGratuitousReply(), ns3::dsr::DsrRouting::SendInitialRequest(), ns3::dsr::DsrRouting::SendPacketFromBuffer(), and ns3::dsr::DsrRouting::SendUnreachError().
|
private |
Calculate padding.
alignment | alignment |
Definition at line 261 of file dsr-fs-header.cc.
References ns3::dsr::DsrOptionHeader::Alignment::factor, ns3::Buffer::GetSize(), m_optionData, m_optionsOffset, and ns3::dsr::DsrOptionHeader::Alignment::offset.
Referenced by AddDsrOption(), GetSerializedSize(), and Serialize().
uint32_t ns3::dsr::DsrOptionField::Deserialize | ( | Buffer::Iterator | start, |
uint32_t | length ) |
Deserialize the packet.
start | Buffer iterator |
length | length |
Definition at line 225 of file dsr-fs-header.cc.
References ns3::Buffer::AddAtEnd(), ns3::Buffer::Begin(), m_optionData, and ns3::Buffer::Iterator::Write().
Referenced by ns3::dsr::DsrRoutingHeader::Deserialize().
Buffer ns3::dsr::DsrOptionField::GetDsrOptionBuffer | ( | ) |
Get the buffer.
Definition at line 273 of file dsr-fs-header.cc.
References m_optionData.
uint32_t ns3::dsr::DsrOptionField::GetDsrOptionsOffset | ( | ) | const |
Get the offset where the options begin, measured from the start of the extension header.
Definition at line 267 of file dsr-fs-header.cc.
References m_optionsOffset.
Referenced by ns3::dsr::DsrRouting::AddAckReqHeader(), ns3::dsr::DsrRouting::CancelPacketTimerNextHop(), ns3::dsr::DsrRouting::CheckSendBuffer(), ns3::dsr::DsrRouting::PromiscReceive(), ns3::dsr::DsrRouting::Receive(), ns3::dsr::DsrRouting::SalvagePacket(), and ns3::dsr::DsrRouting::SendPacketFromBuffer().
uint32_t ns3::dsr::DsrOptionField::GetSerializedSize | ( | ) | const |
Get the serialized size of the packet.
Definition at line 198 of file dsr-fs-header.cc.
References CalculatePad(), ns3::Buffer::GetSize(), and m_optionData.
Referenced by ns3::dsr::DsrRoutingHeader::GetSerializedSize().
void ns3::dsr::DsrOptionField::Serialize | ( | Buffer::Iterator | start | ) | const |
Serialize all added options.
start | Buffer iterator |
Definition at line 205 of file dsr-fs-header.cc.
References ns3::Buffer::Begin(), CalculatePad(), ns3::Buffer::End(), m_optionData, NS_LOG_LOGIC, ns3::dsr::DsrOptionPad1Header::Serialize(), and ns3::dsr::DsrOptionPadnHeader::Serialize().
Referenced by ns3::dsr::DsrRoutingHeader::Serialize().
|
private |
Data payload.
Definition at line 256 of file dsr-fs-header.h.
Referenced by AddDsrOption(), CalculatePad(), Deserialize(), GetDsrOptionBuffer(), GetSerializedSize(), and Serialize().
|
private |
Offset.
Definition at line 260 of file dsr-fs-header.h.
Referenced by CalculatePad(), and GetDsrOptionsOffset().