20 #ifndef BYTE_TAG_LIST_H
21 #define BYTE_TAG_LIST_H
23 #define __STDC_LIMIT_MACROS
25 #include "ns3/type-id.h"
30 struct ByteTagListData;
131 Iterator (uint8_t *
start, uint8_t *end, int32_t offsetStart, int32_t offsetEnd, int32_t adjustment);
214 inline void Adjust (int32_t adjustment);
223 void AddAtEnd (int32_t appendOffset);
246 uint32_t
Serialize (uint32_t* buffer, uint32_t maxSize)
const;
255 uint32_t
Deserialize (
const uint32_t* buffer, uint32_t size);
An iterator for iterating through a byte tag list.
uint8_t * m_current
Current tag.
int32_t m_adjustment
Adjustment to byte tag offsets.
int32_t m_offsetEnd
Offset to the end of the tag from the virtual byte buffer.
uint32_t GetOffsetStart(void) const
Returns the offset from the start of the virtual byte buffer to the ByteTagList.
bool HasNext(void) const
Used to determine if the iterator is at the end of the byteTagList.
int32_t m_nextEnd
End of the next tag.
int32_t m_nextStart
Start of the next tag.
int32_t m_offsetStart
Offset to the start of the tag from the virtual byte buffer.
uint32_t m_nextSize
Size of the next tag.
Iterator(uint8_t *start, uint8_t *end, int32_t offsetStart, int32_t offsetEnd, int32_t adjustment)
Constructor.
uint32_t m_nextTid
TypeId of the next tag.
struct ByteTagList::Iterator::Item Next(void)
Returns the next Item from the ByteTagList.
void PrepareForNext(void)
Prepare the iterator for the next tag.
keep track of the byte tags stored in a packet.
uint32_t Deserialize(const uint32_t *buffer, uint32_t size)
Deserialize tag list from the provided buffer.
void AddAtEnd(int32_t appendOffset)
Make sure that all offsets are smaller than appendOffset which represents the location where new byte...
ByteTagList & operator=(const ByteTagList &o)
Assignment operator, deallocates current data and assigns value of passed in ByteTagList.
void Adjust(int32_t adjustment)
Adjust the offsets stored internally by the adjustment delta.
ByteTagList::Iterator Begin(int32_t offsetStart, int32_t offsetEnd) const
int32_t m_minStart
minimal start offset
uint32_t m_used
the number of used bytes in the buffer
struct ByteTagListData * Allocate(uint32_t size)
Allocate the memory for the ByteTagListData.
struct ByteTagListData * m_data
the ByteTagListData structure
void RemoveAll(void)
Removes all of the tags from the ByteTagList.
ByteTagList::Iterator BeginAll(void) const
Returns an iterator pointing to the very first tag in this list.
uint32_t GetSerializedSize(void) const
Returns number of bytes required for packet serialization.
int32_t m_adjustment
adjustment to byte tag offsets
TagBuffer Add(TypeId tid, uint32_t bufferSize, int32_t start, int32_t end)
uint32_t Serialize(uint32_t *buffer, uint32_t maxSize) const
Serialize the tag list into a byte buffer.
void AddAtStart(int32_t prependOffset)
Make sure that all offsets are bigger than prependOffset which represents the location where new byte...
int32_t m_maxEnd
maximal end offset
void Deallocate(struct ByteTagListData *data)
Deallocates a ByteTagListData.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
An item specifies an individual tag within a byte buffer.
TypeId tid
type of the tag
TagBuffer buf
the data for the tag as generated by Tag::Serialize
uint32_t size
size of tag data
int32_t end
offset to the end of the tag from the virtual byte buffer
Item(TagBuffer buf)
Constructs an item with the given TagBuffer.
int32_t start
offset to the start of the tag from the virtual byte buffer
Internal representation of the byte tags stored in a packet.