A Discrete-Event Network Simulator
API
ns3::dsr::DsrOptionField Class Reference

Option field for an DsrFsHeader Enables adding options to an DsrFsHeader. More...

#include "dsr-fs-header.h"

+ Inheritance diagram for ns3::dsr::DsrOptionField:
+ Collaboration diagram for ns3::dsr::DsrOptionField:

Public Member Functions

 DsrOptionField (uint32_t optionsOffset)
 Constructor. More...
 
 ~DsrOptionField ()
 Destructor. More...
 
void AddDsrOption (const DsrOptionHeader &option)
 Serialize the option, prepending pad1 or padn option as necessary. More...
 
uint32_t Deserialize (Buffer::Iterator start, uint32_t length)
 Deserialize the packet. More...
 
Buffer GetDsrOptionBuffer ()
 Get the buffer. More...
 
uint32_t GetDsrOptionsOffset () const
 Get the offset where the options begin, measured from the start of the extension header. More...
 
uint32_t GetSerializedSize () const
 Get the serialized size of the packet. More...
 
void Serialize (Buffer::Iterator start) const
 Serialize all added options. More...
 

Private Member Functions

uint32_t CalculatePad (DsrOptionHeader::Alignment alignment) const
 Calculate padding. More...
 

Private Attributes

Buffer m_optionData
 Data payload. More...
 
uint32_t m_optionsOffset
 Offset. More...
 

Detailed Description

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 211 of file dsr-fs-header.h.

Constructor & Destructor Documentation

◆ DsrOptionField()

ns3::dsr::DsrOptionField::DsrOptionField ( uint32_t  optionsOffset)

Constructor.

Parameters
optionsOffsetoption offset

Definition at line 196 of file dsr-fs-header.cc.

◆ ~DsrOptionField()

ns3::dsr::DsrOptionField::~DsrOptionField ( )

Destructor.

Definition at line 202 of file dsr-fs-header.cc.

Member Function Documentation

◆ AddDsrOption()

◆ CalculatePad()

uint32_t ns3::dsr::DsrOptionField::CalculatePad ( DsrOptionHeader::Alignment  alignment) const
private

Calculate padding.

Parameters
alignmentalignment
Returns
the number of bytes required to pad

Definition at line 270 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Deserialize()

uint32_t ns3::dsr::DsrOptionField::Deserialize ( Buffer::Iterator  start,
uint32_t  length 
)

Deserialize the packet.

Parameters
startBuffer iterator
lengthlength
Returns
size of the packet

Definition at line 234 of file dsr-fs-header.cc.

References ns3::Buffer::AddAtEnd(), ns3::Buffer::Begin(), m_optionData, two-ray-to-three-gpp-ch-calibration::start, and ns3::Buffer::Iterator::Write().

Referenced by ns3::dsr::DsrRoutingHeader::Deserialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDsrOptionBuffer()

Buffer ns3::dsr::DsrOptionField::GetDsrOptionBuffer ( )

Get the buffer.

Returns
buffer

Definition at line 282 of file dsr-fs-header.cc.

References m_optionData.

◆ GetDsrOptionsOffset()

uint32_t ns3::dsr::DsrOptionField::GetDsrOptionsOffset ( ) const

Get the offset where the options begin, measured from the start of the extension header.

Returns
the offset from the start of the extension header

Definition at line 276 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().

+ Here is the caller graph for this function:

◆ GetSerializedSize()

uint32_t ns3::dsr::DsrOptionField::GetSerializedSize ( ) const

Get the serialized size of the packet.

Returns
size

Definition at line 207 of file dsr-fs-header.cc.

References CalculatePad(), ns3::Buffer::GetSize(), and m_optionData.

Referenced by ns3::dsr::DsrRoutingHeader::GetSerializedSize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Serialize()

void ns3::dsr::DsrOptionField::Serialize ( Buffer::Iterator  start) const

Serialize all added options.

Parameters
startBuffer iterator

Definition at line 214 of file dsr-fs-header.cc.

References ns3::Buffer::Begin(), CalculatePad(), ns3::Buffer::End(), m_optionData, NS_LOG_LOGIC, ns3::dsr::DsrOptionPad1Header::Serialize(), ns3::dsr::DsrOptionPadnHeader::Serialize(), and two-ray-to-three-gpp-ch-calibration::start.

Referenced by ns3::dsr::DsrRoutingHeader::Serialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_optionData

Buffer ns3::dsr::DsrOptionField::m_optionData
private

Data payload.

Definition at line 267 of file dsr-fs-header.h.

Referenced by AddDsrOption(), CalculatePad(), Deserialize(), GetDsrOptionBuffer(), GetSerializedSize(), and Serialize().

◆ m_optionsOffset

uint32_t ns3::dsr::DsrOptionField::m_optionsOffset
private

Offset.

Definition at line 271 of file dsr-fs-header.h.

Referenced by CalculatePad(), and GetDsrOptionsOffset().


The documentation for this class was generated from the following files: