32 #include "ns3/callback.h"
33 #include "ns3/assert.h"
35 #include "ns3/deprecated.h"
75 uint32_t
GetEnd (
void)
const;
235 Packet (uint8_t
const*buffer, uint32_t size,
bool magic);
244 Packet (uint8_t
const*buffer, uint32_t size);
258 inline uint32_t
GetSize (
void)
const;
363 uint32_t
CopyData (uint8_t *buffer, uint32_t size)
const;
373 void CopyData (std::ostream *os, uint32_t size)
const;
401 uint64_t
GetUid (
void)
const;
411 void Print (std::ostream &os)
const;
459 uint32_t
Serialize (uint8_t* buffer, uint32_t maxSize)
const;
585 uint32_t
Deserialize (uint8_t
const*buffer, uint32_t size);
PacketMetadata m_metadata
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
bool FindFirstMatchingByteTag(Tag &tag) const
void PrintPacketTags(std::ostream &os) const
Print the list of packet tags.
uint32_t Deserialize(uint8_t const *buffer, uint32_t size)
const struct PacketTagList::TagData * m_data
automatically resized byte buffer
void AddPacketTag(const Tag &tag) const
Add a packet tag.
List of the packet tags stored in a packet.
uint64_t GetUid(void) const
A packet is allocated a new uid when it is created empty or with zero-filled payload.
uint32_t Serialize(uint8_t *buffer, uint32_t maxSize) const
Serialize a packet, tags, and metadata into a byte buffer.
keep track of the byte tags stored in a packet.
static uint32_t m_globalUid
uint32_t GetSize(void) const
Ptr< NixVector > GetNixVector(void) const
Get the packet nix-vector.
Item(TypeId tid, uint32_t start, uint32_t end, TagBuffer buffer)
void Print(std::ostream &os) const
Packet & operator=(const Packet &o)
PacketTagIterator GetPacketTagIterator(void) const
ByteTagList::Iterator m_current
Packet()
Create an empty packet with a new uid (as returned by getUid).
void GetTag(Tag &tag) const
Read the requested tag and store it in the user-provided tag instance.
Ptr< Packet > CreateFragment(uint32_t start, uint32_t length) const
Create a new packet which contains a fragment of the original packet.
uint32_t PeekTrailer(Trailer &trailer)
Deserialize but does not remove a trailer from the internal buffer.
void AddAtEnd(Ptr< const Packet > packet)
Concatenate the input packet at the end of the current packet.
Tree node for sharing serialized tags.
uint8_t const * PeekData(void) const NS_DEPRECATED
bool PeekPacketTag(Tag &tag) const
Search a matching tag and call Tag::Deserialize if it is found.
void RemoveAllPacketTags(void)
Remove all packet tags.
Identifies a byte tag and a set of bytes within a packet to which the tag applies.
void RemoveAtStart(uint32_t size)
Remove size bytes from the start of the current packet.
static void EnablePrinting(void)
By default, packets do not keep around enough metadata to perform the operations requested by the Pri...
void SetNixVector(Ptr< NixVector >)
Set the packet nix-vector.
ByteTagList m_byteTagList
Defines a linked list of Packet tags, including copy-on-write semantics.
bool ReplacePacketTag(Tag &tag)
Replace the value of a packet tag.
static void EnableChecking(void)
The packet metadata is also used to perform extensive sanity checks at runtime when performing operat...
void AddPaddingAtEnd(uint32_t size)
ByteTagIterator GetByteTagIterator(void) const
uint32_t GetEnd(void) const
Iterator over the set of packet tags in a packet.
void PrintByteTags(std::ostream &os) const
const struct PacketTagList::TagData * m_current
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Ptr< Packet > Copy(void) const
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
Protocol trailer serialization and deserialization.
tag a set of bytes in a packet
PacketMetadata::ItemIterator BeginItem(void) const
PacketTagIterator(const struct PacketTagList::TagData *head)
void AddTrailer(const Trailer &trailer)
Add trailer to this packet.
void RemoveAtEnd(uint32_t size)
Remove size bytes from the end of the current packet It is safe to remove more bytes than are present...
Iterator over the set of byte tags in a packet.
uint32_t RemoveTrailer(Trailer &trailer)
Remove a deserialized trailer from the internal buffer.
PacketTagList m_packetTagList
TypeId GetTypeId(void) const
Identifies a packet tag within a packet.
uint32_t GetSize(void) const
TypeId GetTypeId(void) const
Item(const struct PacketTagList::TagData *data)
void GetTag(Tag &tag) const
Read the requested tag and store it in the user-provided tag instance.
uint32_t GetStart(void) const
uint32_t GetSerializedSize(void) const
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
void RemoveAllByteTags(void)
Remove all byte tags stored in this packet.
Ptr< NixVector > m_nixVector
uint32_t CopyData(uint8_t *buffer, uint32_t size) const
Copy the packet contents to a byte buffer.
ByteTagIterator(ByteTagList::Iterator i)
A template-based reference counting class.
a unique identifier for an interface.
void AddHeader(const Header &header)
Add header to this packet.
void AddByteTag(const Tag &tag) const
Tag each byte included in this packet with a new byte tag.