Public Types | Public Member Functions | Static Public Member Functions

ns3::PbbPacket Class Reference

Main PacketBB Packet object. More...

#include <packetbb.h>

Inheritance diagram for ns3::PbbPacket:
Inheritance graph
[legend]
Collaboration diagram for ns3::PbbPacket:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::list< Ptr< PbbTlv >
>::iterator 
TlvIterator
typedef std::list< Ptr< PbbTlv >
>::const_iterator 
ConstTlvIterator
typedef std::list< Ptr
< PbbMessage > >::iterator 
MessageIterator
typedef std::list< Ptr
< PbbMessage >
>::const_iterator 
ConstMessageIterator

Public Member Functions

uint8_t GetVersion (void) const
void SetSequenceNumber (uint16_t number)
 Sets the sequence number of this packet.
uint16_t GetSequenceNumber (void) const
bool HasSequenceNumber (void) const
 Tests whether or not this packet has a sequence number.
TlvIterator TlvBegin (void)
ConstTlvIterator TlvBegin (void) const
TlvIterator TlvEnd (void)
ConstTlvIterator TlvEnd (void) const
int TlvSize (void) const
bool TlvEmpty (void) const
Ptr< PbbTlvTlvFront (void)
const Ptr< PbbTlvTlvFront (void) const
Ptr< PbbTlvTlvBack (void)
const Ptr< PbbTlvTlvBack (void) const
void TlvPushFront (Ptr< PbbTlv > tlv)
 Prepends a packet TLV to the front of this packet.
void TlvPopFront (void)
 Removes a packet TLV from the front of this packet.
void TlvPushBack (Ptr< PbbTlv > tlv)
 Appends a packet TLV to the back of this packet.
void TlvPopBack (void)
 Removes a packet TLV from the back of this block.
TlvIterator Erase (TlvIterator position)
 Removes the packet TLV at the specified position.
TlvIterator Erase (TlvIterator first, TlvIterator last)
 Removes all packet TLVs from [first, last) (includes first, not includes last).
void TlvClear (void)
 Removes all packet TLVs from this packet.
MessageIterator MessageBegin (void)
ConstMessageIterator MessageBegin (void) const
MessageIterator MessageEnd (void)
ConstMessageIterator MessageEnd (void) const
int MessageSize (void) const
bool MessageEmpty (void) const
Ptr< PbbMessageMessageFront (void)
const Ptr< PbbMessageMessageFront (void) const
Ptr< PbbMessageMessageBack (void)
const Ptr< PbbMessageMessageBack (void) const
void MessagePushFront (Ptr< PbbMessage > message)
 Prepends a message to the front of this packet.
void MessagePopFront (void)
 Removes a message from the front of this packet.
void MessagePushBack (Ptr< PbbMessage > message)
 Appends a message to the back of this packet.
void MessagePopBack (void)
 Removes a message from the back of this packet.
MessageIterator Erase (MessageIterator position)
 Removes the message at the specified position.
MessageIterator Erase (MessageIterator first, MessageIterator last)
 Removes all messages from [first, last) (includes first, not includes last).
void MessageClear (void)
 Removes all messages from this packet.
virtual TypeId GetInstanceTypeId (void) const
virtual uint32_t GetSerializedSize (void) const
virtual void Serialize (Buffer::Iterator start) const
 Serializes this packet into the specified buffer.
virtual uint32_t Deserialize (Buffer::Iterator start)
 Deserializes a packet from the specified buffer.
virtual void Print (std::ostream &os) const
 Pretty-prints the contents of this block.
bool operator== (const PbbPacket &other) const
bool operator!= (const PbbPacket &other) const

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::PbbPacket.

Detailed Description

Main PacketBB Packet object.

A PacketBB packet is made up of zero or more packet TLVs (PbbTlv), and zero or more messages (PbbMessage).

See: http://tools.ietf.org/html/rfc5444 for details.


Member Function Documentation

virtual uint32_t ns3::PbbPacket::Deserialize ( Buffer::Iterator  start  )  [virtual]

Deserializes a packet from the specified buffer.

Parameters:
start start offset
Returns:
the number of bytes deserialized

If this returns a number smaller than the total number of bytes in the buffer, there was an error.

Implements ns3::Header.

TlvIterator ns3::PbbPacket::Erase ( TlvIterator  position  ) 

Removes the packet TLV at the specified position.

Parameters:
position an Iterator pointing to the packet TLV to erase.
Returns:
an iterator pointing to the next packet TLV in the block.
MessageIterator ns3::PbbPacket::Erase ( MessageIterator  position  ) 

Removes the message at the specified position.

Parameters:
position an Iterator pointing to the message to erase.
Returns:
an iterator pointing to the next message in the packet.
MessageIterator ns3::PbbPacket::Erase ( MessageIterator  first,
MessageIterator  last 
)

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

Parameters:
first an Iterator pointing to the first message to erase (inclusive).
last an Iterator pointing to the element past the last message to erase.
Returns:
an iterator pointing to the next message in the block.
TlvIterator ns3::PbbPacket::Erase ( TlvIterator  first,
TlvIterator  last 
)

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

Parameters:
first an Iterator pointing to the first packet TLV to erase (inclusive).
last an Iterator pointing to the element past the last packet TLV to erase.
Returns:
an iterator pointing to the next packet TLV in the block.
virtual TypeId ns3::PbbPacket::GetInstanceTypeId ( void   )  const [virtual]
Returns:
the TypeId associated to the most-derived type of this instance.

This method is typically implemented by ns3::Object::GetInstanceTypeId but some classes which derive from ns3::ObjectBase directly have to implement it themselves.

Implements ns3::ObjectBase.

uint16_t ns3::PbbPacket::GetSequenceNumber ( void   )  const
Returns:
the sequence number of this packet.

Calling this while HasSequenceNumber is False is undefined. Make sure you check it first. This will be checked by an assert in debug builds.

virtual uint32_t ns3::PbbPacket::GetSerializedSize ( void   )  const [virtual]
Returns:
The size (in bytes) needed to serialize this packet.

Implements ns3::Header.

static TypeId ns3::PbbPacket::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::PbbPacket.

No Attributes defined for this type.
No TraceSources defined for this type.

Reimplemented from ns3::Header.

uint8_t ns3::PbbPacket::GetVersion ( void   )  const
Returns:
the version of PacketBB that constructed this packet.

This will always return 0 for packets constructed using this API.

bool ns3::PbbPacket::HasSequenceNumber ( void   )  const

Tests whether or not this packet has a sequence number.

Returns:
true if this packet has a sequence number, false otherwise.

This should be called before calling GetSequenceNumber to make sure there actually is one.

Ptr<PbbMessage> ns3::PbbPacket::MessageBack ( void   ) 
Returns:
a smart pointer to the last message in this packet.
const Ptr<PbbMessage> ns3::PbbPacket::MessageBack ( void   )  const
Returns:
a const smart pointer to the last message in this packet.
MessageIterator ns3::PbbPacket::MessageBegin ( void   ) 
Returns:
an iterator to the first message in this packet.
ConstMessageIterator ns3::PbbPacket::MessageBegin ( void   )  const
Returns:
a const iterator to the first message in this packet.
bool ns3::PbbPacket::MessageEmpty ( void   )  const
Returns:
true if there are no messages in this packet, false otherwise.
ConstMessageIterator ns3::PbbPacket::MessageEnd ( void   )  const
Returns:
a const iterator to the past-the-end element in this message block.
MessageIterator ns3::PbbPacket::MessageEnd ( void   ) 
Returns:
an iterator to the past-the-end element in this message block.
const Ptr<PbbMessage> ns3::PbbPacket::MessageFront ( void   )  const
Returns:
a const smart pointer to the first message in this packet.
Ptr<PbbMessage> ns3::PbbPacket::MessageFront ( void   ) 
Returns:
a smart pointer to the first message in this packet.
void ns3::PbbPacket::MessagePushBack ( Ptr< PbbMessage message  ) 

Appends a message to the back of this packet.

Parameters:
message a smart pointer to the message to append.
void ns3::PbbPacket::MessagePushFront ( Ptr< PbbMessage message  ) 

Prepends a message to the front of this packet.

Parameters:
message a smart pointer to the message to prepend.
int ns3::PbbPacket::MessageSize ( void   )  const
Returns:
the number of messages in this packet.
virtual void ns3::PbbPacket::Print ( std::ostream &  os  )  const [virtual]

Pretty-prints the contents of this block.

Parameters:
os a stream object to print to.

Implements ns3::Header.

virtual void ns3::PbbPacket::Serialize ( Buffer::Iterator  start  )  const [virtual]

Serializes this packet into the specified buffer.

Parameters:
start a reference to the point in a buffer to begin serializing.

Implements ns3::Header.

void ns3::PbbPacket::SetSequenceNumber ( uint16_t  number  ) 

Sets the sequence number of this packet.

Parameters:
number the sequence number.
Ptr<PbbTlv> ns3::PbbPacket::TlvBack ( void   ) 
Returns:
a smart pointer to the last packet TLV in this packet.
const Ptr<PbbTlv> ns3::PbbPacket::TlvBack ( void   )  const
Returns:
a const smart pointer to the last packet TLV in this packet.
TlvIterator ns3::PbbPacket::TlvBegin ( void   ) 
Returns:
an iterator to the first Packet TLV in this packet.
ConstTlvIterator ns3::PbbPacket::TlvBegin ( void   )  const
Returns:
a const iterator to the first Packet TLV in this packet.
bool ns3::PbbPacket::TlvEmpty ( void   )  const
Returns:
true if there are no packet TLVs in this packet, false otherwise.
ConstTlvIterator ns3::PbbPacket::TlvEnd ( void   )  const
Returns:
a const iterator to the past-the-end element in this packet TLV block.
TlvIterator ns3::PbbPacket::TlvEnd ( void   ) 
Returns:
an iterator to the past-the-end element in this packet TLV block.
Ptr<PbbTlv> ns3::PbbPacket::TlvFront ( void   ) 
Returns:
a smart pointer to the first packet TLV in this packet.
const Ptr<PbbTlv> ns3::PbbPacket::TlvFront ( void   )  const
Returns:
a const smart pointer to the first packet TLV in this packet.
void ns3::PbbPacket::TlvPushBack ( Ptr< PbbTlv tlv  ) 

Appends a packet TLV to the back of this packet.

Parameters:
tlv a smart pointer to the packet TLV to append.
void ns3::PbbPacket::TlvPushFront ( Ptr< PbbTlv tlv  ) 

Prepends a packet TLV to the front of this packet.

Parameters:
tlv a smart pointer to the packet TLV to prepend.
int ns3::PbbPacket::TlvSize ( void   )  const
Returns:
the number of packet TLVs in this packet.

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