Main PacketBB Packet object. More...
#include <packetbb.h>
Public Types | |
typedef std::list< Ptr < PbbMessage > >::const_iterator | ConstMessageIterator |
This is a PbbMessageIterator for PbbPacket. More... | |
typedef std::list< Ptr< PbbTlv > >::const_iterator | ConstTlvIterator |
This is a PbbTlv iterator for PbbPacket. More... | |
typedef std::list< Ptr < PbbMessage > >::iterator | MessageIterator |
This is a const PbbTlv iterator for PbbPacket. More... | |
typedef std::list< Ptr< PbbTlv > >::iterator | TlvIterator |
Public Member Functions | |
PbbPacket (void) | |
This is a const PbbMessageIterator for PbbPacket. More... | |
~PbbPacket (void) | |
virtual uint32_t | Deserialize (Buffer::Iterator start) |
Deserializes a packet from the specified buffer. More... | |
TlvIterator | Erase (TlvIterator position) |
Removes the packet TLV at the specified position. More... | |
TlvIterator | Erase (TlvIterator first, TlvIterator last) |
Removes all packet TLVs from [first, last) (includes first, not includes last). More... | |
MessageIterator | Erase (MessageIterator position) |
Removes the message at the specified position. More... | |
MessageIterator | Erase (MessageIterator first, MessageIterator last) |
Removes all messages from [first, last) (includes first, not includes last). More... | |
virtual TypeId | GetInstanceTypeId (void) const |
uint16_t | GetSequenceNumber (void) const |
virtual uint32_t | GetSerializedSize (void) const |
uint8_t | GetVersion (void) const |
bool | HasSequenceNumber (void) const |
Tests whether or not this packet has a sequence number. More... | |
Ptr< PbbMessage > | MessageBack (void) |
const Ptr< PbbMessage > | MessageBack (void) const |
MessageIterator | MessageBegin (void) |
ConstMessageIterator | MessageBegin (void) const |
void | MessageClear (void) |
Removes all messages from this packet. More... | |
bool | MessageEmpty (void) const |
MessageIterator | MessageEnd (void) |
ConstMessageIterator | MessageEnd (void) const |
Ptr< PbbMessage > | MessageFront (void) |
const Ptr< PbbMessage > | MessageFront (void) const |
void | MessagePopBack (void) |
Removes a message from the back of this packet. More... | |
void | MessagePopFront (void) |
Removes a message from the front of this packet. More... | |
void | MessagePushBack (Ptr< PbbMessage > message) |
Appends a message to the back of this packet. More... | |
void | MessagePushFront (Ptr< PbbMessage > message) |
Prepends a message to the front of this packet. More... | |
int | MessageSize (void) const |
bool | operator!= (const PbbPacket &other) const |
Inequality operator for PbbPacket. More... | |
bool | operator== (const PbbPacket &other) const |
Equality operator for PbbPacket. More... | |
virtual void | Print (std::ostream &os) const |
Pretty-prints the contents of this block. More... | |
virtual void | Serialize (Buffer::Iterator start) const |
Serializes this packet into the specified buffer. More... | |
void | SetSequenceNumber (uint16_t number) |
Sets the sequence number of this packet. More... | |
Ptr< PbbTlv > | TlvBack (void) |
const Ptr< PbbTlv > | TlvBack (void) const |
TlvIterator | TlvBegin (void) |
ConstTlvIterator | TlvBegin (void) const |
void | TlvClear (void) |
Removes all packet TLVs from this packet. More... | |
bool | TlvEmpty (void) const |
TlvIterator | TlvEnd (void) |
ConstTlvIterator | TlvEnd (void) const |
Ptr< PbbTlv > | TlvFront (void) |
const Ptr< PbbTlv > | TlvFront (void) const |
void | TlvPopBack (void) |
Removes a packet TLV from the back of this block. More... | |
void | TlvPopFront (void) |
Removes a packet TLV from the front of this packet. More... | |
void | TlvPushBack (Ptr< PbbTlv > tlv) |
Appends a packet TLV to the back of this packet. More... | |
void | TlvPushFront (Ptr< PbbTlv > tlv) |
Prepends a packet TLV to the front of this packet. More... | |
int | TlvSize (void) const |
Public Member Functions inherited from ns3::SimpleRefCount< PbbPacket, Header > | |
SimpleRefCount () | |
Constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::Header | |
virtual | ~Header () |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::SimpleRefCount< PbbPacket, Header > | |
static void | Cleanup (void) |
Noop. More... | |
Static Public Member Functions inherited from ns3::Header | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::Chunk | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Private Attributes | |
bool | m_hasseqnum |
std::list< Ptr< PbbMessage > > | m_messageList |
uint16_t | m_seqnum |
PbbTlvBlock | m_tlvList |
uint8_t | m_version |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
virtual void | NotifyConstructionCompleted (void) |
This method is invoked once all member attributes have been initialized. More... | |
Main PacketBB Packet object.
Doxygen introspection did not find any typical Config paths.
A PacketBB packet is made up of zero or more packet TLVs (PbbTlv), and zero or more messages (PbbMessage).
See: RFC 5444 for details.
No Attributes are defined for this type.
No TraceSources are defined for this type.
Definition at line 385 of file packetbb.h.
typedef std::list< Ptr<PbbMessage> >::const_iterator ns3::PbbPacket::ConstMessageIterator |
This is a PbbMessageIterator for PbbPacket.
Definition at line 391 of file packetbb.h.
typedef std::list< Ptr<PbbTlv> >::const_iterator ns3::PbbPacket::ConstTlvIterator |
This is a PbbTlv iterator for PbbPacket.
Definition at line 389 of file packetbb.h.
typedef std::list< Ptr<PbbMessage> >::iterator ns3::PbbPacket::MessageIterator |
This is a const PbbTlv iterator for PbbPacket.
Definition at line 390 of file packetbb.h.
typedef std::list< Ptr<PbbTlv> >::iterator ns3::PbbPacket::TlvIterator |
Definition at line 388 of file packetbb.h.
ns3::PbbPacket::PbbPacket | ( | void | ) |
This is a const PbbMessageIterator for PbbPacket.
Definition at line 547 of file packetbb.cc.
References m_hasseqnum, m_version, NS_LOG_FUNCTION, and VERSION.
ns3::PbbPacket::~PbbPacket | ( | void | ) |
Definition at line 554 of file packetbb.cc.
References MessageClear(), and NS_LOG_FUNCTION.
|
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.
Definition at line 917 of file packetbb.cc.
References ns3::PbbTlvBlock::Deserialize(), ns3::PbbMessage::DeserializeMessage(), ns3::Buffer::Iterator::GetDistanceFrom(), ns3::Buffer::Iterator::IsEnd(), m_tlvList, m_version, MessagePushBack(), NS_LOG_FUNCTION, PHAS_SEQ_NUM, PHAS_TLV, ns3::Buffer::Iterator::ReadNtohU16(), ns3::Buffer::Iterator::ReadU8(), SetSequenceNumber(), and visualizer.core::start().
Referenced by PbbTestCase::TestDeserialize().
PbbPacket::MessageIterator ns3::PbbPacket::Erase | ( | PbbPacket::TlvIterator | position | ) |
Removes the packet TLV at the specified position.
position | an Iterator pointing to the packet TLV to erase. |
Definition at line 691 of file packetbb.cc.
References ns3::PbbTlvBlock::Erase(), m_tlvList, and NS_LOG_FUNCTION.
PbbPacket::MessageIterator 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. |
Definition at line 698 of file packetbb.cc.
References ns3::PbbTlvBlock::Erase(), m_tlvList, and NS_LOG_FUNCTION.
MessageIterator ns3::PbbPacket::Erase | ( | MessageIterator | position | ) |
Removes the message at the specified position.
position | an Iterator pointing to the message to erase. |
MessageIterator ns3::PbbPacket::Erase | ( | MessageIterator | first, |
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.
Definition at line 849 of file packetbb.cc.
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.
Definition at line 576 of file packetbb.cc.
References HasSequenceNumber(), m_seqnum, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by operator==(), Print(), and Serialize().
|
virtual |
Implements ns3::Header.
Definition at line 855 of file packetbb.cc.
References ns3::PbbTlvBlock::GetSerializedSize(), HasSequenceNumber(), m_tlvList, MessageBegin(), MessageEnd(), NS_LOG_FUNCTION, and TlvEmpty().
Referenced by PbbTestCase::TestSerialize().
|
static |
Definition at line 839 of file packetbb.cc.
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.
Definition at line 561 of file packetbb.cc.
References m_version, and NS_LOG_FUNCTION.
Referenced by operator==().
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.
Definition at line 584 of file packetbb.cc.
References m_hasseqnum, and NS_LOG_FUNCTION.
Referenced by GetSequenceNumber(), GetSerializedSize(), operator==(), Print(), and Serialize().
Ptr< PbbMessage > ns3::PbbPacket::MessageBack | ( | void | ) |
Definition at line 770 of file packetbb.cc.
References m_messageList, and NS_LOG_FUNCTION.
const Ptr< PbbMessage > ns3::PbbPacket::MessageBack | ( | void | ) | const |
Definition at line 777 of file packetbb.cc.
References m_messageList, and NS_LOG_FUNCTION.
PbbPacket::MessageIterator ns3::PbbPacket::MessageBegin | ( | void | ) |
Definition at line 714 of file packetbb.cc.
References m_messageList, and NS_LOG_FUNCTION.
Referenced by GetSerializedSize(), MessageClear(), operator==(), Print(), and Serialize().
PbbPacket::ConstMessageIterator ns3::PbbPacket::MessageBegin | ( | void | ) | const |
Definition at line 721 of file packetbb.cc.
References m_messageList, and NS_LOG_FUNCTION.
void ns3::PbbPacket::MessageClear | ( | void | ) |
Removes all messages from this packet.
Definition at line 827 of file packetbb.cc.
References m_messageList, MessageBegin(), MessageEnd(), and NS_LOG_FUNCTION.
Referenced by ~PbbPacket().
bool ns3::PbbPacket::MessageEmpty | ( | void | ) | const |
Definition at line 749 of file packetbb.cc.
References m_messageList, and NS_LOG_FUNCTION.
PbbPacket::MessageIterator ns3::PbbPacket::MessageEnd | ( | void | ) |
Definition at line 728 of file packetbb.cc.
References m_messageList, and NS_LOG_FUNCTION.
Referenced by GetSerializedSize(), MessageClear(), operator==(), Print(), and Serialize().
PbbPacket::ConstMessageIterator ns3::PbbPacket::MessageEnd | ( | void | ) | const |
Definition at line 735 of file packetbb.cc.
References m_messageList, and NS_LOG_FUNCTION.
Ptr< PbbMessage > ns3::PbbPacket::MessageFront | ( | void | ) |
Definition at line 756 of file packetbb.cc.
References m_messageList, and NS_LOG_FUNCTION.
const Ptr< PbbMessage > ns3::PbbPacket::MessageFront | ( | void | ) | const |
Definition at line 763 of file packetbb.cc.
References m_messageList, and NS_LOG_FUNCTION.
void ns3::PbbPacket::MessagePopBack | ( | void | ) |
Removes a message from the back of this packet.
Definition at line 805 of file packetbb.cc.
References m_messageList, and NS_LOG_FUNCTION.
void ns3::PbbPacket::MessagePopFront | ( | void | ) |
Removes a message from the front of this packet.
Definition at line 791 of file packetbb.cc.
References m_messageList, and NS_LOG_FUNCTION.
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. |
Definition at line 798 of file packetbb.cc.
References m_messageList, and NS_LOG_FUNCTION.
Referenced by Deserialize(), and PbbTestSuite::PbbTestSuite().
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. |
Definition at line 784 of file packetbb.cc.
References m_messageList, and NS_LOG_FUNCTION.
int ns3::PbbPacket::MessageSize | ( | void | ) | const |
Definition at line 742 of file packetbb.cc.
References m_messageList, and NS_LOG_FUNCTION.
Referenced by operator==().
bool ns3::PbbPacket::operator!= | ( | const PbbPacket & | other | ) | const |
Inequality operator for PbbPacket.
other | PbbPacket to compare to this one |
Definition at line 1018 of file packetbb.cc.
bool ns3::PbbPacket::operator== | ( | const PbbPacket & | other | ) | const |
Equality operator for PbbPacket.
other | PbbPacket to compare to this one |
Definition at line 976 of file packetbb.cc.
References GetSequenceNumber(), GetVersion(), HasSequenceNumber(), m_tlvList, MessageBegin(), MessageEnd(), and MessageSize().
|
virtual |
Pretty-prints the contents of this block.
os | a stream object to print to. |
Implements ns3::Header.
Definition at line 951 of file packetbb.cc.
References GetSequenceNumber(), HasSequenceNumber(), m_tlvList, MessageBegin(), MessageEnd(), NS_LOG_FUNCTION, 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.
Definition at line 882 of file packetbb.cc.
References GetSequenceNumber(), HasSequenceNumber(), m_tlvList, MessageBegin(), MessageEnd(), ns3::Buffer::Iterator::Next(), NS_LOG_FUNCTION, PHAS_SEQ_NUM, PHAS_TLV, ns3::PbbTlvBlock::Serialize(), visualizer.core::start(), TlvEmpty(), VERSION, ns3::Buffer::Iterator::WriteHtonU16(), and ns3::Buffer::Iterator::WriteU8().
Referenced by PbbTestCase::TestSerialize().
void ns3::PbbPacket::SetSequenceNumber | ( | uint16_t | number | ) |
Sets the sequence number of this packet.
number | the sequence number. |
Definition at line 568 of file packetbb.cc.
References m_hasseqnum, m_seqnum, and NS_LOG_FUNCTION.
Referenced by Deserialize(), and PbbTestSuite::PbbTestSuite().
Definition at line 649 of file packetbb.cc.
References ns3::PbbTlvBlock::Back(), m_tlvList, and NS_LOG_FUNCTION.
Definition at line 656 of file packetbb.cc.
References ns3::PbbTlvBlock::Back(), m_tlvList, and NS_LOG_FUNCTION.
PbbPacket::TlvIterator ns3::PbbPacket::TlvBegin | ( | void | ) |
Definition at line 593 of file packetbb.cc.
References ns3::PbbTlvBlock::Begin(), m_tlvList, and NS_LOG_FUNCTION.
PbbPacket::ConstTlvIterator ns3::PbbPacket::TlvBegin | ( | void | ) | const |
Definition at line 600 of file packetbb.cc.
References ns3::PbbTlvBlock::Begin(), m_tlvList, and NS_LOG_FUNCTION.
void ns3::PbbPacket::TlvClear | ( | void | ) |
Removes all packet TLVs from this packet.
Definition at line 705 of file packetbb.cc.
References ns3::PbbTlvBlock::Clear(), m_tlvList, and NS_LOG_FUNCTION.
bool ns3::PbbPacket::TlvEmpty | ( | void | ) | const |
Definition at line 628 of file packetbb.cc.
References ns3::PbbTlvBlock::Empty(), m_tlvList, and NS_LOG_FUNCTION.
Referenced by GetSerializedSize(), and Serialize().
PbbPacket::TlvIterator ns3::PbbPacket::TlvEnd | ( | void | ) |
Definition at line 607 of file packetbb.cc.
References ns3::PbbTlvBlock::End(), m_tlvList, and NS_LOG_FUNCTION.
PbbPacket::ConstTlvIterator ns3::PbbPacket::TlvEnd | ( | void | ) | const |
Definition at line 614 of file packetbb.cc.
References ns3::PbbTlvBlock::End(), m_tlvList, and NS_LOG_FUNCTION.
Definition at line 635 of file packetbb.cc.
References ns3::PbbTlvBlock::Front(), m_tlvList, and NS_LOG_FUNCTION.
Definition at line 642 of file packetbb.cc.
References ns3::PbbTlvBlock::Front(), m_tlvList, and NS_LOG_FUNCTION.
void ns3::PbbPacket::TlvPopBack | ( | void | ) |
Removes a packet TLV from the back of this block.
Definition at line 684 of file packetbb.cc.
References m_tlvList, NS_LOG_FUNCTION, and ns3::PbbTlvBlock::PopBack().
void ns3::PbbPacket::TlvPopFront | ( | void | ) |
Removes a packet TLV from the front of this packet.
Definition at line 670 of file packetbb.cc.
References m_tlvList, NS_LOG_FUNCTION, and ns3::PbbTlvBlock::PopFront().
Appends a packet TLV to the back of this packet.
tlv | a smart pointer to the packet TLV to append. |
Definition at line 677 of file packetbb.cc.
References m_tlvList, NS_LOG_FUNCTION, and ns3::PbbTlvBlock::PushBack().
Referenced by PbbTestSuite::PbbTestSuite().
Prepends a packet TLV to the front of this packet.
tlv | a smart pointer to the packet TLV to prepend. |
Definition at line 663 of file packetbb.cc.
References m_tlvList, NS_LOG_FUNCTION, and ns3::PbbTlvBlock::PushFront().
int ns3::PbbPacket::TlvSize | ( | void | ) | const |
Definition at line 621 of file packetbb.cc.
References m_tlvList, NS_LOG_FUNCTION, and ns3::PbbTlvBlock::Size().
|
private |
Definition at line 673 of file packetbb.h.
Referenced by HasSequenceNumber(), PbbPacket(), and SetSequenceNumber().
|
private |
Definition at line 669 of file packetbb.h.
Referenced by MessageBack(), MessageBegin(), MessageClear(), MessageEmpty(), MessageEnd(), MessageFront(), MessagePopBack(), MessagePopFront(), MessagePushBack(), MessagePushFront(), and MessageSize().
|
private |
Definition at line 674 of file packetbb.h.
Referenced by GetSequenceNumber(), and SetSequenceNumber().
|
private |
Definition at line 668 of file packetbb.h.
Referenced by Deserialize(), Erase(), GetSerializedSize(), operator==(), Print(), Serialize(), TlvBack(), TlvBegin(), TlvClear(), TlvEmpty(), TlvEnd(), TlvFront(), TlvPopBack(), TlvPopFront(), TlvPushBack(), TlvPushFront(), and TlvSize().
|
private |
Definition at line 671 of file packetbb.h.
Referenced by Deserialize(), GetVersion(), and PbbPacket().