A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::PbbTlvBlock Class Reference

A block of packet or message TLVs (PbbTlv). More...

#include "packetbb.h"

+ Collaboration diagram for ns3::PbbTlvBlock:

Public Types

typedef std::list< Ptr< PbbTlv > >::const_iterator ConstIterator
 PbbTlv container const iterator.
 
typedef std::list< Ptr< PbbTlv > >::iterator Iterator
 PbbTlv container iterator.
 

Public Member Functions

 PbbTlvBlock ()
 
 ~PbbTlvBlock ()
 
Ptr< PbbTlvBack () const
 
Iterator Begin ()
 
ConstIterator Begin () const
 
void Clear ()
 Removes all TLVs from this block.
 
void Deserialize (Buffer::Iterator &start)
 Deserializes a block from the specified buffer.
 
bool Empty () const
 
Iterator End ()
 
ConstIterator End () const
 
Iterator Erase (Iterator first, Iterator last)
 Removes all TLVs from [first, last) (includes first, not includes last).
 
Iterator Erase (Iterator position)
 Removes the TLV at the specified position.
 
Ptr< PbbTlvFront () const
 
uint32_t GetSerializedSize () const
 
Iterator Insert (Iterator position, const Ptr< PbbTlv > tlv)
 Inserts a TLV at the specified position in this block.
 
bool operator!= (const PbbTlvBlock &other) const
 Inequality operator for PbbTlvBlock.
 
bool operator== (const PbbTlvBlock &other) const
 Equality operator for PbbTlvBlock.
 
void PopBack ()
 Removes a TLV from the back of this block.
 
void PopFront ()
 Removes a TLV from the front of this block.
 
void Print (std::ostream &os) const
 Pretty-prints the contents of this block.
 
void Print (std::ostream &os, int level) const
 Pretty-prints the contents of this block, with specified indentation.
 
void PushBack (Ptr< PbbTlv > tlv)
 Appends a TLV to the back of this block.
 
void PushFront (Ptr< PbbTlv > tlv)
 Prepends a TLV to the front of this block.
 
void Serialize (Buffer::Iterator &start) const
 Serializes this block into the specified buffer.
 
int Size () const
 

Private Attributes

std::list< Ptr< PbbTlv > > m_tlvList
 PbbTlv container.
 

Detailed Description

A block of packet or message TLVs (PbbTlv).

Acts similar to a C++ STL container. Should not be used for Address TLVs.

Definition at line 44 of file packetbb.h.

Member Typedef Documentation

◆ ConstIterator

typedef std::list<Ptr<PbbTlv>>::const_iterator ns3::PbbTlvBlock::ConstIterator

PbbTlv container const iterator.

Definition at line 50 of file packetbb.h.

◆ Iterator

typedef std::list<Ptr<PbbTlv>>::iterator ns3::PbbTlvBlock::Iterator

PbbTlv container iterator.

Definition at line 48 of file packetbb.h.

Constructor & Destructor Documentation

◆ PbbTlvBlock()

ns3::PbbTlvBlock::PbbTlvBlock ( )

Definition at line 53 of file packetbb.cc.

References NS_LOG_FUNCTION.

◆ ~PbbTlvBlock()

ns3::PbbTlvBlock::~PbbTlvBlock ( )

Definition at line 58 of file packetbb.cc.

References Clear(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Member Function Documentation

◆ Back()

Ptr< PbbTlv > ns3::PbbTlvBlock::Back ( ) const
Returns
a smart pointer to the last TLV in this block.

Definition at line 114 of file packetbb.cc.

References m_tlvList, and NS_LOG_FUNCTION.

Referenced by ns3::PbbMessage::TlvBack(), ns3::PbbMessage::TlvBack(), ns3::PbbPacket::TlvBack(), and ns3::PbbPacket::TlvBack().

+ Here is the caller graph for this function:

◆ Begin() [1/2]

PbbTlvBlock::Iterator ns3::PbbTlvBlock::Begin ( )
Returns
an iterator to the first TLV in this block.

Definition at line 65 of file packetbb.cc.

References m_tlvList, and NS_LOG_FUNCTION.

Referenced by Clear(), GetSerializedSize(), operator==(), Print(), Serialize(), ns3::PbbMessage::TlvBegin(), ns3::PbbMessage::TlvBegin(), ns3::PbbPacket::TlvBegin(), and ns3::PbbPacket::TlvBegin().

+ Here is the caller graph for this function:

◆ Begin() [2/2]

PbbTlvBlock::ConstIterator ns3::PbbTlvBlock::Begin ( ) const
Returns
a const iterator to the first TLV in this block.

Definition at line 72 of file packetbb.cc.

References m_tlvList, and NS_LOG_FUNCTION.

◆ Clear()

void ns3::PbbTlvBlock::Clear ( )

Removes all TLVs from this block.

Definition at line 170 of file packetbb.cc.

References Begin(), End(), m_tlvList, and NS_LOG_FUNCTION.

Referenced by ~PbbTlvBlock(), ns3::PbbMessage::TlvClear(), and ns3::PbbPacket::TlvClear().

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

◆ Deserialize()

void ns3::PbbTlvBlock::Deserialize ( Buffer::Iterator & start)

Deserializes a block from the specified buffer.

Parameters
starta reference to the point in a buffer to begin deserializing.

Users should not need to call this. Blocks will be deserialized by their containing packet.

Definition at line 217 of file packetbb.cc.

References ns3::Create(), NS_LOG_FUNCTION, and PushBack().

Referenced by ns3::PbbMessage::Deserialize(), and ns3::PbbPacket::Deserialize().

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

◆ Empty()

bool ns3::PbbTlvBlock::Empty ( ) const
Returns
true if there are no TLVs in this block, false otherwise.

Definition at line 100 of file packetbb.cc.

References m_tlvList, and NS_LOG_FUNCTION.

Referenced by Serialize(), ns3::PbbMessage::TlvEmpty(), and ns3::PbbPacket::TlvEmpty().

+ Here is the caller graph for this function:

◆ End() [1/2]

PbbTlvBlock::Iterator ns3::PbbTlvBlock::End ( )
Returns
an iterator to the past-the-end element in this block.

Definition at line 79 of file packetbb.cc.

References m_tlvList, and NS_LOG_FUNCTION.

Referenced by Clear(), GetSerializedSize(), operator==(), Print(), Serialize(), ns3::PbbMessage::TlvEnd(), ns3::PbbMessage::TlvEnd(), ns3::PbbPacket::TlvEnd(), and ns3::PbbPacket::TlvEnd().

+ Here is the caller graph for this function:

◆ End() [2/2]

PbbTlvBlock::ConstIterator ns3::PbbTlvBlock::End ( ) const
Returns
a const iterator to the past-the-end element in this block.

Definition at line 86 of file packetbb.cc.

References m_tlvList, and NS_LOG_FUNCTION.

◆ Erase() [1/2]

PbbTlvBlock::Iterator ns3::PbbTlvBlock::Erase ( PbbTlvBlock::Iterator first,
PbbTlvBlock::Iterator last )

Removes all TLVs from [first, last) (includes first, not includes last).

Parameters
firstan Iterator pointing to the first TLV to erase (inclusive).
lastan Iterator pointing to the element past the last TLV to erase.
Returns
an iterator pointing to the next TLV in the block.

Definition at line 163 of file packetbb.cc.

References m_tlvList, and NS_LOG_FUNCTION.

◆ Erase() [2/2]

PbbTlvBlock::Iterator ns3::PbbTlvBlock::Erase ( PbbTlvBlock::Iterator position)

Removes the TLV at the specified position.

Parameters
positionan Iterator pointing to the TLV to erase.
Returns
an iterator pointing to the next TLV in the block.

Definition at line 156 of file packetbb.cc.

References m_tlvList, and NS_LOG_FUNCTION.

Referenced by ns3::PbbPacket::Erase(), ns3::PbbPacket::Erase(), ns3::PbbMessage::TlvErase(), and ns3::PbbMessage::TlvErase().

+ Here is the caller graph for this function:

◆ Front()

Ptr< PbbTlv > ns3::PbbTlvBlock::Front ( ) const
Returns
a smart pointer to the first TLV in this block.

Definition at line 107 of file packetbb.cc.

References m_tlvList, and NS_LOG_FUNCTION.

Referenced by ns3::PbbMessage::TlvFront(), ns3::PbbMessage::TlvFront(), ns3::PbbPacket::TlvFront(), and ns3::PbbPacket::TlvFront().

+ Here is the caller graph for this function:

◆ GetSerializedSize()

uint32_t ns3::PbbTlvBlock::GetSerializedSize ( ) const
Returns
The size (in bytes) needed to serialize this block.

Definition at line 181 of file packetbb.cc.

References Begin(), End(), and NS_LOG_FUNCTION.

Referenced by ns3::PbbMessage::GetSerializedSize(), and ns3::PbbPacket::GetSerializedSize().

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

◆ Insert()

PbbTlvBlock::Iterator ns3::PbbTlvBlock::Insert ( PbbTlvBlock::Iterator position,
const Ptr< PbbTlv > tlv )

Inserts a TLV at the specified position in this block.

Parameters
positionan Iterator pointing to the position in this block to insert the TLV.
tlva smart pointer to the TLV to insert.
Returns
An iterator pointing to the newly inserted TLV.

Definition at line 149 of file packetbb.cc.

References m_tlvList, and NS_LOG_FUNCTION.

◆ operator!=()

bool ns3::PbbTlvBlock::operator!= ( const PbbTlvBlock & other) const

Inequality operator for PbbTlvBlock.

Parameters
otherPbbTlvBlock to compare this one to
Returns
true if the blocks are not equal

Definition at line 285 of file packetbb.cc.

◆ operator==()

bool ns3::PbbTlvBlock::operator== ( const PbbTlvBlock & other) const

Equality operator for PbbTlvBlock.

Parameters
otherPbbTlvBlock to compare this one to
Returns
true if the blocks are equal

Definition at line 265 of file packetbb.cc.

References Begin(), End(), and Size().

+ Here is the call graph for this function:

◆ PopBack()

void ns3::PbbTlvBlock::PopBack ( )

Removes a TLV from the back of this block.

Definition at line 142 of file packetbb.cc.

References m_tlvList, and NS_LOG_FUNCTION.

Referenced by ns3::PbbMessage::TlvPopBack(), and ns3::PbbPacket::TlvPopBack().

+ Here is the caller graph for this function:

◆ PopFront()

void ns3::PbbTlvBlock::PopFront ( )

Removes a TLV from the front of this block.

Definition at line 128 of file packetbb.cc.

References m_tlvList, and NS_LOG_FUNCTION.

Referenced by ns3::PbbMessage::TlvPopFront(), and ns3::PbbPacket::TlvPopFront().

+ Here is the caller graph for this function:

◆ Print() [1/2]

void ns3::PbbTlvBlock::Print ( std::ostream & os) const

Pretty-prints the contents of this block.

Parameters
osa stream object to print to.

Definition at line 235 of file packetbb.cc.

References NS_LOG_FUNCTION, and Print().

Referenced by ns3::PbbMessage::Print(), ns3::PbbPacket::Print(), and Print().

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

◆ Print() [2/2]

void ns3::PbbTlvBlock::Print ( std::ostream & os,
int level ) const

Pretty-prints the contents of this block, with specified indentation.

Parameters
osa stream object to print to.
levellevel of indentation.

This probably never needs to be called by users. This is used when recursively printing sub-objects.

Definition at line 242 of file packetbb.cc.

References Begin(), End(), NS_LOG_FUNCTION, and Size().

+ Here is the call graph for this function:

◆ PushBack()

void ns3::PbbTlvBlock::PushBack ( Ptr< PbbTlv > tlv)

Appends a TLV to the back of this block.

Parameters
tlva smart pointer to the TLV to append.

Definition at line 135 of file packetbb.cc.

References m_tlvList, and NS_LOG_FUNCTION.

Referenced by Deserialize(), ns3::PbbMessage::TlvPushBack(), and ns3::PbbPacket::TlvPushBack().

+ Here is the caller graph for this function:

◆ PushFront()

void ns3::PbbTlvBlock::PushFront ( Ptr< PbbTlv > tlv)

Prepends a TLV to the front of this block.

Parameters
tlva smart pointer to the TLV to prepend.

Definition at line 121 of file packetbb.cc.

References m_tlvList, and NS_LOG_FUNCTION.

Referenced by ns3::PbbMessage::TlvPushFront(), and ns3::PbbPacket::TlvPushFront().

+ Here is the caller graph for this function:

◆ Serialize()

void ns3::PbbTlvBlock::Serialize ( Buffer::Iterator & start) const

Serializes this block into the specified buffer.

Parameters
starta reference to the point in a buffer to begin serializing.

Users should not need to call this. Blocks will be serialized by their containing packet.

Definition at line 194 of file packetbb.cc.

References Begin(), Empty(), End(), ns3::Buffer::Iterator::Next(), NS_LOG_FUNCTION, and ns3::Buffer::Iterator::WriteHtonU16().

Referenced by ns3::PbbMessage::Serialize(), and ns3::PbbPacket::Serialize().

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

◆ Size()

int ns3::PbbTlvBlock::Size ( ) const
Returns
the number of TLVs in this block.

Definition at line 93 of file packetbb.cc.

References m_tlvList, and NS_LOG_FUNCTION.

Referenced by operator==(), Print(), ns3::PbbMessage::TlvSize(), and ns3::PbbPacket::TlvSize().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_tlvList

std::list<Ptr<PbbTlv> > ns3::PbbTlvBlock::m_tlvList
private

PbbTlv container.

Definition at line 200 of file packetbb.h.

Referenced by Back(), Begin(), Begin(), Clear(), Empty(), End(), End(), Erase(), Erase(), Front(), Insert(), PopBack(), PopFront(), PushBack(), PushFront(), and Size().


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