keep track of the tags stored in a packet. More...
#include <byte-tag-list.h>
Classes | |
class | Iterator |
Public Member Functions | |
ByteTagList () | |
ByteTagList (const ByteTagList &o) | |
~ByteTagList () | |
TagBuffer | Add (TypeId tid, uint32_t bufferSize, int32_t start, int32_t end) |
void | Add (const ByteTagList &o) |
void | AddAtEnd (int32_t adjustment, int32_t appendOffset) |
void | AddAtStart (int32_t adjustment, int32_t prependOffset) |
ByteTagList::Iterator | Begin (int32_t offsetStart, int32_t offsetEnd) const |
ByteTagList & | operator= (const ByteTagList &o) |
void | RemoveAll (void) |
Private Member Functions | |
struct ByteTagListData * | Allocate (uint32_t size) |
ByteTagList::Iterator | BeginAll (void) const |
void | Deallocate (struct ByteTagListData *data) |
bool | IsDirtyAtEnd (int32_t appendOffset) |
bool | IsDirtyAtStart (int32_t prependOffset) |
Private Attributes | |
struct ByteTagListData * | m_data |
uint16_t | m_used |
keep track of the tags stored in a packet.
This class is mostly private to the Packet implementation and users should never have to access it directly.
The implementation of this class is a bit tricky so, there are a couple of things to keep in mind here:
Definition at line 68 of file byte-tag-list.h.
ns3::ByteTagList::ByteTagList | ( | ) |
Definition at line 119 of file byte-tag-list.cc.
References NS_LOG_FUNCTION.
ns3::ByteTagList::ByteTagList | ( | const ByteTagList & | o | ) |
Definition at line 125 of file byte-tag-list.cc.
References ns3::ByteTagListData::count, m_data, and NS_LOG_FUNCTION.
ns3::ByteTagList::~ByteTagList | ( | ) |
Definition at line 153 of file byte-tag-list.cc.
References Deallocate(), m_data, m_used, and NS_LOG_FUNCTION.
tid | the typeid of the tag added |
bufferSize | the size of the tag when its serialization will be completed. Typically, the return value of Tag::GetSerializedSize |
start | offset which uniquely identifies the first byte tagged by this tag. |
end | offset which uniquely identifies the last byte tagged by this tag. |
Definition at line 162 of file byte-tag-list.cc.
References Allocate(), ns3::ByteTagListData::count, ns3::ByteTagListData::data, Deallocate(), ns3::ByteTagListData::dirty, ns3::TypeId::GetUid(), m_data, m_used, NS_ASSERT, NS_LOG_FUNCTION, ns3::ByteTagListData::size, and ns3::TagBuffer::WriteU32().
Referenced by Add(), AddAtEnd(), ns3::Packet::AddAtEnd(), and AddAtStart().
void ns3::ByteTagList::Add | ( | const ByteTagList & | o | ) |
o | the other list of tags to aggregate. |
Aggregate the two lists of tags.
Definition at line 192 of file byte-tag-list.cc.
References Add(), BeginAll(), ns3::ByteTagList::Iterator::Item::buf, ns3::TagBuffer::CopyFrom(), ns3::ByteTagList::Iterator::Item::end, ns3::ByteTagList::Iterator::HasNext(), ns3::ByteTagList::Iterator::Next(), NS_LOG_FUNCTION, ns3::ByteTagList::Iterator::Item::size, ns3::ByteTagList::Iterator::Item::start, and ns3::ByteTagList::Iterator::Item::tid.
void ns3::ByteTagList::AddAtEnd | ( | int32_t | adjustment, |
int32_t | appendOffset | ||
) |
Adjust the offsets stored internally by the adjustment delta and make sure that all offsets are smaller than appendOffset which represents the location where new bytes have been added to the byte buffer.
Definition at line 269 of file byte-tag-list.cc.
References Add(), BeginAll(), ns3::ByteTagList::Iterator::Item::buf, ns3::TagBuffer::CopyFrom(), ns3::ByteTagList::Iterator::Item::end, ns3::ByteTagList::Iterator::HasNext(), IsDirtyAtEnd(), list, ns3::ByteTagList::Iterator::Next(), NS_LOG_FUNCTION, ns3::ByteTagList::Iterator::Item::size, ns3::ByteTagList::Iterator::Item::start, and ns3::ByteTagList::Iterator::Item::tid.
Referenced by ns3::Packet::AddAtEnd(), ns3::Packet::AddPaddingAtEnd(), and ns3::Packet::AddTrailer().
void ns3::ByteTagList::AddAtStart | ( | int32_t | adjustment, |
int32_t | prependOffset | ||
) |
Adjust the offsets stored internally by the adjustment delta and make sure that all offsets are bigger than prependOffset which represents the location where new bytes have been added to the byte buffer.
Definition at line 303 of file byte-tag-list.cc.
References Add(), BeginAll(), ns3::ByteTagList::Iterator::Item::buf, ns3::TagBuffer::CopyFrom(), ns3::ByteTagList::Iterator::Item::end, ns3::ByteTagList::Iterator::HasNext(), IsDirtyAtStart(), list, ns3::ByteTagList::Iterator::Next(), NS_LOG_FUNCTION, ns3::ByteTagList::Iterator::Item::size, ns3::ByteTagList::Iterator::Item::start, and ns3::ByteTagList::Iterator::Item::tid.
Referenced by ns3::Packet::AddAtEnd(), and ns3::Packet::AddHeader().
|
readprivate |
Definition at line 339 of file byte-tag-list.cc.
References ns3::ByteTagListData::count, data, ns3::ByteTagListData::dirty, ns3::g_freeList, ns3::g_maxSize, NS_ASSERT, NS_LOG_FUNCTION, and ns3::ByteTagListData::size.
Referenced by Add().
ByteTagList::Iterator ns3::ByteTagList::Begin | ( | int32_t | offsetStart, |
int32_t | offsetEnd | ||
) | const |
offsetStart | the offset which uniquely identifies the first data byte present in the byte buffer associated to this ByteTagList. |
offsetEnd | the offset which uniquely identifies the last data byte present in the byte buffer associated to this ByteTagList. |
The returned iterator will allow you to loop through the set of tags present in this list: the boundaries of each tag as reported by their start and end offsets will be included within the input offsetStart and offsetEnd.
Definition at line 223 of file byte-tag-list.cc.
References ns3::ByteTagListData::data, m_data, m_used, and NS_LOG_FUNCTION.
Referenced by BeginAll(), and ns3::Packet::GetByteTagIterator().
|
private |
Definition at line 214 of file byte-tag-list.cc.
References Begin(), NS_LOG_FUNCTION, and OFFSET_MAX.
Referenced by Add(), AddAtEnd(), AddAtStart(), IsDirtyAtEnd(), and IsDirtyAtStart().
|
private |
Definition at line 365 of file byte-tag-list.cc.
References ns3::ByteTagListData::count, FREE_LIST_SIZE, ns3::g_freeList, ns3::g_maxSize, NS_LOG_FUNCTION, and ns3::ByteTagListData::size.
Referenced by Add(), operator=(), RemoveAll(), and ~ByteTagList().
|
private |
Definition at line 237 of file byte-tag-list.cc.
References BeginAll(), ns3::ByteTagList::Iterator::Item::end, ns3::ByteTagList::Iterator::HasNext(), ns3::ByteTagList::Iterator::Next(), and NS_LOG_FUNCTION.
Referenced by AddAtEnd().
|
private |
Definition at line 253 of file byte-tag-list.cc.
References BeginAll(), ns3::ByteTagList::Iterator::HasNext(), ns3::ByteTagList::Iterator::Next(), NS_LOG_FUNCTION, and ns3::ByteTagList::Iterator::Item::start.
Referenced by AddAtStart().
ByteTagList & ns3::ByteTagList::operator= | ( | const ByteTagList & | o | ) |
Definition at line 136 of file byte-tag-list.cc.
References ns3::ByteTagListData::count, Deallocate(), m_data, m_used, and NS_LOG_FUNCTION.
void ns3::ByteTagList::RemoveAll | ( | void | ) |
Definition at line 205 of file byte-tag-list.cc.
References Deallocate(), m_data, m_used, and NS_LOG_FUNCTION.
Referenced by ns3::Packet::RemoveAllByteTags().
|
private |
Definition at line 165 of file byte-tag-list.h.
Referenced by Add(), Begin(), ByteTagList(), operator=(), RemoveAll(), and ~ByteTagList().
|
private |
Definition at line 164 of file byte-tag-list.h.
Referenced by Add(), Begin(), operator=(), RemoveAll(), and ~ByteTagList().