20 #ifndef PACKET_TAG_LIST_H
21 #define PACKET_TAG_LIST_H
30 #include "ns3/type-id.h"
185 void Add (
Tag const&tag)
const;
234 uint32_t
Serialize (uint32_t* buffer, uint32_t maxSize)
const;
243 uint32_t
Deserialize (
const uint32_t* buffer, uint32_t size);
268 (
Tag & tag,
bool preMerge,
List of the packet tags stored in a packet.
bool Remove(Tag &tag)
Remove (the first instance of) tag from the list.
uint32_t Deserialize(const uint32_t *buffer, uint32_t size)
Deserialize tag list from the provided buffer.
uint32_t Serialize(uint32_t *buffer, uint32_t maxSize) const
Serialize the tag list into a byte buffer.
bool ReplaceWriter(Tag &tag, bool preMerge, struct TagData *cur, struct TagData **prevNext)
Copy-on-write implementing Replace.
struct TagData * m_next
Pointer to first TagData on the list.
bool Replace(Tag &tag)
Replace the value of a tag.
bool Peek(Tag &tag) const
Find a tag and return its value.
bool(PacketTagList::* COWWriter)(Tag &tag, bool preMerge, struct TagData *cur, struct TagData **prevNext)
Typedef of method function pointer for copy-on-write operations.
void RemoveAll(void)
Remove all tags from this list (up to the first merge).
bool COWTraverse(Tag &tag, PacketTagList::COWWriter Writer)
Traverse the list implementing copy-on-write, using Writer.
PacketTagList & operator=(PacketTagList const &o)
Assignment.
PacketTagList()
Create a new PacketTagList.
static TagData * CreateTagData(size_t dataSize)
Allocate and construct a TagData struct, sizing the data area large enough to serialize dataSize byte...
bool RemoveWriter(Tag &tag, bool preMerge, struct TagData *cur, struct TagData **prevNext)
Copy-on-write implementing Remove.
~PacketTagList()
Destructor.
uint32_t GetSerializedSize(void) const
Returns number of bytes required for packet serialization.
void Add(Tag const &tag) const
Add a tag to the head of this branch.
const struct PacketTagList::TagData * Head(void) const
tag a set of bytes in a packet
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Tree node for sharing serialized tags.
TypeId tid
Type of the tag serialized into data.
uint32_t size
Size of the data buffer.
uint32_t count
Number of incoming links.
struct TagData * next
Pointer to next in list.
uint8_t data[1]
Serialization buffer.