EMANE
1.2.1
|
Specialized packet the allows downstream processing to add layer specific headers as the packet travels down the stack. Optionally, events can be attached to the packet to guarantee delivery before the packet. More...
#include <downstreampacket.h>
Public Types | |
using | EventSerializations = std::list< std::tuple< EMANE::NEMId, EMANE::EventId, Serialization > > |
Public Member Functions | |
DownstreamPacket (const PacketInfo &info, const void *buf, size_t size) | |
DownstreamPacket (const DownstreamPacket &) | |
DownstreamPacket & | operator= (const DownstreamPacket &pkt) |
DownstreamPacket (DownstreamPacket &&pkt) | |
DownstreamPacket & | operator= (DownstreamPacket &&pkt) |
~DownstreamPacket () | |
void | prepend (const void *buf, size_t size) |
void | prependLengthPrefixFraming (std::uint16_t u16Length) |
void | prependLengthPrefixFramingLong (std::uint32_t u32Length) |
Utils::VectorIO | getVectorIO () const |
size_t | length () const |
const PacketInfo & | getPacketInfo () const |
void | attachEvent (NEMId nemId, const Event &event) |
const EventSerializations & | getEventSerializations () const |
Specialized packet the allows downstream processing to add layer specific headers as the packet travels down the stack. Optionally, events can be attached to the packet to guarantee delivery before the packet.
Definition at line 55 of file downstreampacket.h.
using EMANE::DownstreamPacket::EventSerializations = std::list<std::tuple<EMANE::NEMId,EMANE::EventId, Serialization> > |
Definition at line 154 of file downstreampacket.h.
EMANE::DownstreamPacket::DownstreamPacket | ( | const PacketInfo & | info, |
const void * | buf, | ||
size_t | size | ||
) |
Creates a DownstreamPacket instance from a buffer
info | The PacketInfo to use |
buf | Pointer to the buffer |
size | Length of the buffer |
Definition at line 148 of file downstreampacket.cc.
EMANE::DownstreamPacket::DownstreamPacket | ( | const DownstreamPacket & | pkt | ) |
Creates a DownstreamPacket instance by copying another instance
Definition at line 154 of file downstreampacket.cc.
EMANE::DownstreamPacket::DownstreamPacket | ( | DownstreamPacket && | pkt | ) |
Creates a DownstreamPacket instance by moving another instance
Definition at line 157 of file downstreampacket.cc.
EMANE::DownstreamPacket::~DownstreamPacket | ( | ) |
Destroys an instance
Definition at line 160 of file downstreampacket.cc.
Attach an event to the packet.
nemId | NEM id of the event target. Use 0 for all NEMs |
event | Event to be attached |
Definition at line 204 of file downstreampacket.cc.
const EMANE::DownstreamPacket::EventSerializations & EMANE::DownstreamPacket::getEventSerializations | ( | ) | const |
Gets any attached events in serialized form
Definition at line 210 of file downstreampacket.cc.
const EMANE::PacketInfo & EMANE::DownstreamPacket::getPacketInfo | ( | ) | const |
Get a reference to the packet information
Definition at line 199 of file downstreampacket.cc.
EMANE::Utils::VectorIO EMANE::DownstreamPacket::getVectorIO | ( | ) | const |
Gets a vectored IO representation of the packet.
Definition at line 189 of file downstreampacket.cc.
size_t EMANE::DownstreamPacket::length | ( | ) | const |
Gets the overall packet length which is a summation of all the vectored IO segments.
Definition at line 194 of file downstreampacket.cc.
EMANE::DownstreamPacket & EMANE::DownstreamPacket::operator= | ( | const DownstreamPacket & | pkt | ) |
Creates a DownstreamPacket instance by copying another instance
Definition at line 162 of file downstreampacket.cc.
EMANE::DownstreamPacket & EMANE::DownstreamPacket::operator= | ( | DownstreamPacket && | pkt | ) |
Creates a DownstreamPacket instance by moving another instance
Definition at line 168 of file downstreampacket.cc.
void EMANE::DownstreamPacket::prepend | ( | const void * | buf, |
size_t | size | ||
) |
Prepends bytes of buf to the beginning of packet. This method is used to add layer specific headers to a packet
buf | Pointer to the start of the layer specific data |
size | Number of bytes to prepend |
Definition at line 174 of file downstreampacket.cc.
void EMANE::DownstreamPacket::prependLengthPrefixFraming | ( | std::uint16_t | u16Length | ) |
Prepends an unsigned 16 bit length value to the beginning of the packet. This method is used in conjunction with prefix length framing.
u16Length | value to be prepended |
Definition at line 179 of file downstreampacket.cc.
void EMANE::DownstreamPacket::prependLengthPrefixFramingLong | ( | std::uint32_t | u32Length | ) |
Prepends an unsigned 32 bit length value to the beginning of the packet. This method is used in conjunction with prefix length framing.
u32Length | value to be prepended |
Definition at line 184 of file downstreampacket.cc.