ns-3
|
Main PacketBB Packet object. More...
#include <packetbb.h>
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< PbbTlv > | TlvFront (void) |
const Ptr< PbbTlv > | TlvFront (void) const |
Ptr< PbbTlv > | TlvBack (void) |
const Ptr< PbbTlv > | TlvBack (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< PbbMessage > | MessageFront (void) |
const Ptr< PbbMessage > | MessageFront (void) const |
Ptr< PbbMessage > | MessageBack (void) |
const Ptr< PbbMessage > | MessageBack (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 |
![]() | |
SimpleRefCount (const SimpleRefCount &o) | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
uint32_t | GetReferenceCount (void) const |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::PbbPacket. | |
![]() | |
static void | Cleanup (void) |
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.
|
virtual |
Deserializes a packet from the specified buffer.
start | start offset |
If this returns a number smaller than the total number of bytes in the buffer, there was an error.
Implements ns3::Header.
References ns3::PbbTlvBlock::Deserialize(), ns3::PbbMessage::DeserializeMessage(), ns3::Buffer::Iterator::GetDistanceFrom(), ns3::Buffer::Iterator::IsEnd(), MessagePushBack(), ns3::Buffer::Iterator::ReadNtohU16(), ns3::Buffer::Iterator::ReadU8(), and SetSequenceNumber().
PbbPacket::TlvIterator ns3::PbbPacket::Erase | ( | PbbPacket::TlvIterator | position | ) |
Removes the packet TLV at the specified position.
position | an Iterator pointing to the packet TLV to erase. |
References ns3::PbbTlvBlock::Erase().
PbbPacket::TlvIterator ns3::PbbPacket::Erase | ( | PbbPacket::TlvIterator | first, |
PbbPacket::TlvIterator | last | ||
) |
Removes all packet TLVs from [first, last) (includes first, not includes last).
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. |
References ns3::PbbTlvBlock::Erase().
PbbPacket::MessageIterator ns3::PbbPacket::Erase | ( | PbbPacket::MessageIterator | position | ) |
Removes the message at the specified position.
position | an Iterator pointing to the message to erase. |
PbbPacket::MessageIterator ns3::PbbPacket::Erase | ( | PbbPacket::MessageIterator | first, |
PbbPacket::MessageIterator | last | ||
) |
Removes all messages from [first, last) (includes first, not includes last).
first | an Iterator pointing to the first message to erase (inclusive). |
last | an Iterator pointing to the element past the last message to erase. |
|
virtual |
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.
References GetTypeId().
uint16_t ns3::PbbPacket::GetSequenceNumber | ( | void | ) | const |
Calling this while HasSequenceNumber is False is undefined. Make sure you check it first. This will be checked by an assert in debug builds.
References HasSequenceNumber(), and NS_ASSERT.
Referenced by Print(), and Serialize().
|
virtual |
Implements ns3::Header.
References ns3::PbbTlvBlock::GetSerializedSize(), HasSequenceNumber(), MessageBegin(), MessageEnd(), and TlvEmpty().
|
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.
References ns3::TypeId::SetParent().
Referenced by GetInstanceTypeId().
uint8_t ns3::PbbPacket::GetVersion | ( | void | ) | const |
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.
This should be called before calling GetSequenceNumber to make sure there actually is one.
Referenced by GetSequenceNumber(), GetSerializedSize(), Print(), and Serialize().
Ptr< PbbMessage > ns3::PbbPacket::MessageBack | ( | void | ) |
const Ptr< PbbMessage > ns3::PbbPacket::MessageBack | ( | void | ) | const |
PbbPacket::MessageIterator ns3::PbbPacket::MessageBegin | ( | void | ) |
Referenced by GetSerializedSize(), MessageClear(), Print(), and Serialize().
PbbPacket::ConstMessageIterator ns3::PbbPacket::MessageBegin | ( | void | ) | const |
bool ns3::PbbPacket::MessageEmpty | ( | void | ) | const |
PbbPacket::MessageIterator ns3::PbbPacket::MessageEnd | ( | void | ) |
Referenced by GetSerializedSize(), MessageClear(), Print(), and Serialize().
PbbPacket::ConstMessageIterator ns3::PbbPacket::MessageEnd | ( | void | ) | const |
Ptr< PbbMessage > ns3::PbbPacket::MessageFront | ( | void | ) |
const Ptr< PbbMessage > ns3::PbbPacket::MessageFront | ( | void | ) | const |
void ns3::PbbPacket::MessagePushBack | ( | Ptr< PbbMessage > | message | ) |
Appends a message to the back of this packet.
message | a smart pointer to the message to append. |
Referenced by Deserialize().
void ns3::PbbPacket::MessagePushFront | ( | Ptr< PbbMessage > | message | ) |
Prepends a message to the front of this packet.
message | a smart pointer to the message to prepend. |
int ns3::PbbPacket::MessageSize | ( | void | ) | const |
|
virtual |
Pretty-prints the contents of this block.
os | a stream object to print to. |
Implements ns3::Header.
References GetSequenceNumber(), HasSequenceNumber(), MessageBegin(), MessageEnd(), and ns3::PbbTlvBlock::Print().
|
virtual |
Serializes this packet into the specified buffer.
start | a reference to the point in a buffer to begin serializing. |
Implements ns3::Header.
References GetSequenceNumber(), HasSequenceNumber(), MessageBegin(), MessageEnd(), ns3::Buffer::Iterator::Next(), ns3::PbbTlvBlock::Serialize(), TlvEmpty(), ns3::Buffer::Iterator::WriteHtonU16(), and ns3::Buffer::Iterator::WriteU8().
void ns3::PbbPacket::SetSequenceNumber | ( | uint16_t | number | ) |
Sets the sequence number of this packet.
number | the sequence number. |
Referenced by Deserialize().
References ns3::PbbTlvBlock::Back().
References ns3::PbbTlvBlock::Back().
PbbPacket::TlvIterator ns3::PbbPacket::TlvBegin | ( | void | ) |
References ns3::PbbTlvBlock::Begin().
PbbPacket::ConstTlvIterator ns3::PbbPacket::TlvBegin | ( | void | ) | const |
References ns3::PbbTlvBlock::Begin().
bool ns3::PbbPacket::TlvEmpty | ( | void | ) | const |
References ns3::PbbTlvBlock::Empty().
Referenced by GetSerializedSize(), and Serialize().
PbbPacket::TlvIterator ns3::PbbPacket::TlvEnd | ( | void | ) |
References ns3::PbbTlvBlock::End().
PbbPacket::ConstTlvIterator ns3::PbbPacket::TlvEnd | ( | void | ) | const |
References ns3::PbbTlvBlock::End().
References ns3::PbbTlvBlock::Front().
References ns3::PbbTlvBlock::Front().
Appends a packet TLV to the back of this packet.
tlv | a smart pointer to the packet TLV to append. |
References ns3::PbbTlvBlock::PushBack().
Prepends a packet TLV to the front of this packet.
tlv | a smart pointer to the packet TLV to prepend. |
References ns3::PbbTlvBlock::PushFront().
int ns3::PbbPacket::TlvSize | ( | void | ) | const |
References ns3::PbbTlvBlock::Size().