27 #define USE_FREE_LIST 1
28 #define FREE_LIST_SIZE 1000
29 #define OFFSET_MAX (2147483647)
51 for (ByteTagListDataFreeList::iterator i = begin ();
54 uint8_t *buffer = (uint8_t *)(*i);
121 return m_offsetStart;
170 uint32_t spaceNeeded =
m_used + bufferSize + 4 + 4 + 4 + 4;
233 return Iterator (0, 0, offsetStart, offsetEnd);
249 if (item.
end > appendOffset)
265 if (item.
start < prependOffset)
286 item.
start += adjustment;
287 item.
end += adjustment;
289 if (item.
start >= appendOffset)
293 else if (item.
start < appendOffset && item.
end > appendOffset)
295 item.
end = appendOffset;
320 item.
start += adjustment;
321 item.
end += adjustment;
323 if (item.
end <= prependOffset)
327 else if (item.
end > prependOffset && item.
start < prependOffset)
329 item.
start = prependOffset;
352 if (data->
size >= size)
358 uint8_t *buffer = (uint8_t *)data;
379 if (data->
count == 0)
384 uint8_t *buffer = (uint8_t *)data;
400 uint8_t *buffer =
new uint8_t [size +
sizeof (
struct ByteTagListData) - 4];
417 if (data->count == 0)
419 uint8_t *buffer = (uint8_t *)data;
#define NS_LOG_FUNCTION(parameters)
ByteTagList & operator=(const ByteTagList &o)
Assignment operator, deallocates current data and assigns value of passed in ByteTagList.
Iterator(uint8_t *start, uint8_t *end, int32_t offsetStart, int32_t offsetEnd)
struct ByteTagListData * m_data
NS_LOG_COMPONENT_DEFINE("ByteTagList")
keep track of the byte tags stored in a packet.
#define NS_ASSERT(condition)
TagBuffer Add(TypeId tid, uint32_t bufferSize, int32_t start, int32_t end)
void TrimAtEnd(uint32_t trim)
TAG_BUFFER_INLINE uint32_t ReadU32(void)
void Deallocate(struct ByteTagListData *data)
void PrepareForNext(void)
void RemoveAll(void)
Removes all of the tags from the ByteTagList.
TAG_BUFFER_INLINE void WriteU32(uint32_t v)
int32_t start
size of tag data
void AddAtEnd(int32_t adjustment, int32_t appendOffset)
Adjust the offsets stored internally by the adjustment delta and make sure that all offsets are small...
struct ByteTagList::Iterator::Item Next(void)
struct ByteTagListData * Allocate(uint32_t size)
void SetUid(uint16_t tid)
uint32_t GetOffsetStart(void) const
int32_t end
offset to the start of the tag from the virtual byte buffer
uint16_t GetUid(void) const
ByteTagList::Iterator BeginAll(void) const
uint32_t size
type of the tag
bool IsDirtyAtStart(int32_t prependOffset)
~ByteTagListDataFreeList()
ByteTagList::Iterator Begin(int32_t offsetStart, int32_t offsetEnd) const
TagBuffer buf
offset to the end of the tag from the virtual byte buffer
ns3::ByteTagListDataFreeList g_freeList
Item(TagBuffer buf)
the data for the tag as generated by Tag::Serialize
bool IsDirtyAtEnd(int32_t appendOffset)
static uint32_t g_maxSize
a unique identifier for an interface.
void CopyFrom(TagBuffer o)
void AddAtStart(int32_t adjustment, int32_t prependOffset)
Adjust the offsets stored internally by the adjustment delta and make sure that all offsets are bigge...