32 #include "ns3/mac48-address.h" 33 #include "ns3/callback.h" 34 #include "ns3/assert.h" 36 #include "ns3/deprecated.h" 79 uint32_t
GetEnd (
void)
const;
275 Packet (uint8_t
const*buffer, uint32_t size,
bool magic);
286 Packet (uint8_t
const*buffer, uint32_t size);
304 inline uint32_t
GetSize (
void)
const;
433 uint32_t
CopyData (uint8_t *buffer, uint32_t size)
const;
443 void CopyData (std::ostream *os, uint32_t size)
const;
475 uint64_t
GetUid (
void)
const;
487 void Print (std::ostream &os)
const;
555 uint32_t
Serialize (uint8_t* buffer, uint32_t maxSize)
const;
730 (uint32_t oldSize, uint32_t newSize);
759 uint32_t
Deserialize (uint8_t
const*buffer, uint32_t size);
bool FindFirstMatchingByteTag(Tag &tag) const
Finds the first tag matching the parameter Tag type.
PacketMetadata m_metadata
the packet's metadata
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
TypeId GetTypeId(void) const
void(* Mac48AddressTracedCallback)(Ptr< const Packet > packet, Mac48Address mac)
TracedCallback signature for packet and Mac48Address.
uint64_t GetUid(void) const
Returns the packet's Uid.
void Print(std::ostream &os) const
Print the packet contents.
uint32_t Deserialize(uint8_t const *buffer, uint32_t size)
Deserializes a packet.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
void(* TwoAddressTracedCallback)(const Ptr< const Packet > packet, const Address &srcAddress, const Address &destAddress)
TracedCallback signature for packet and source/destination addresses.
uint32_t GetSerializedSize(void) const
Returns number of bytes required for packet serialization.
TypeId GetTypeId(void) const
const struct PacketTagList::TagData * m_data
the tag data
automatically resized byte buffer
Forward calls to a chain of Callback.
List of the packet tags stored in a packet.
keep track of the byte tags stored in a packet.
Ptr< Packet > CreateFragment(uint32_t start, uint32_t length) const
Create a new packet which contains a fragment of the original packet.
static uint32_t m_globalUid
Global counter of packets Uid.
void(* SizeTracedCallback)(uint32_t oldSize, uint32_t newSize)
TracedCallback signature for changes in packet size.
uint32_t GetStart(void) const
The index is an offset from the start of the packet.
Buffer m_buffer
the packet buffer (it's actual contents)
Item(TypeId tid, uint32_t start, uint32_t end, TagBuffer buffer)
Constructor.
Packet & operator=(const Packet &o)
Basic assignment.
void PrintPacketTags(std::ostream &os) const
Print the list of packet tags.
a polymophic address class
ByteTagList::Iterator m_current
actual position over the set of byte tags in a packet
Packet()
Create an empty packet with a new uid (as returned by getUid).
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.
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.
TagBuffer m_buffer
the buffer associated with this tag.
static void EnablePrinting(void)
Enable printing packets metadata.
void(* AddressTracedCallback)(Ptr< const Packet > packet, const Address &address)
TracedCallback signature for packet and Address.
TypeId m_tid
the ns3::TypeId associated to this tag.
void SetNixVector(Ptr< NixVector > nixVector)
Set the packet nix-vector.
ByteTagList m_byteTagList
the ByteTag list
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)
Enable packets metadata checking.
std::string ToString(void) const
Return a string representation of the packet.
void AddPaddingAtEnd(uint32_t size)
Add a zero-filled padding to the packet.
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
void(* SinrTracedCallback)(Ptr< const Packet > packet, double sinr)
TracedCallback signature for packet and SINR.
Iterator over the set of packet tags in a packet.
const struct PacketTagList::TagData * m_current
actual position over the set of tags in a packet
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
uint32_t m_end
the index of the last byte tagged by this tag.
Protocol trailer serialization and deserialization.
tag a set of bytes in a packet
PacketTagIterator GetPacketTagIterator(void) const
Returns an object which can be used to iterate over the list of packet tags.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
PacketTagIterator(const struct PacketTagList::TagData *head)
Constructor.
void AddTrailer(const Trailer &trailer)
Add trailer to this packet.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
void RemoveAtEnd(uint32_t size)
Remove size bytes from the end of the current packet.
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
the packet's Tag list
void PrintByteTags(std::ostream &os) const
Iterate over the byte tags present in this packet, and invoke the Print method of each tag stored in ...
Identifies a packet tag within a packet.
PacketMetadata::ItemIterator BeginItem(void) const
Returns an iterator which points to the first 'item' stored in this buffer.
Item(const struct PacketTagList::TagData *data)
Constructor.
uint32_t GetEnd(void) const
The index is an offset from the start of the packet.
An iterator for iterating through a byte tag list.
void GetTag(Tag &tag) const
Read the requested tag and store it in the user-provided tag instance.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
uint32_t CopyData(uint8_t *buffer, uint32_t size) const
Copy the packet contents to a byte buffer.
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
void RemoveAllByteTags(void)
Remove all byte tags stored in this packet.
Ptr< NixVector > GetNixVector(void) const
Get the packet nix-vector.
Ptr< NixVector > m_nixVector
the packet's Nix vector
uint32_t GetSize(void) const
uint32_t m_start
the index of the first byte tagged by this tag.
ByteTagIterator(ByteTagList::Iterator i)
Copy Constructor.
bool PeekPacketTag(Tag &tag) const
Search a matching tag and call Tag::Deserialize if it is found.
void GetTag(Tag &tag) const
Read the requested tag and store it in the user-provided tag instance.
A template-based reference counting class.
a unique identifier for an interface.
void AddByteTag(const Tag &tag) const
Tag each byte included in this packet with a new byte tag.
void AddHeader(const Header &header)
Add header to this packet.
ByteTagIterator GetByteTagIterator(void) const
Returns an iterator over the set of byte tags included in this packet.
uint32_t Serialize(uint8_t *buffer, uint32_t maxSize) const
Serialize a packet, tags, and metadata into a byte buffer.