#include <SrcPacket.h>
Public Member Functions | |
SrcPacket (BasePacket &packet) | |
The constructor. | |
void | setSrc (const NodeId &id) |
Set the source address of the packet. | |
void | getSrc (NodeId &id) const |
Get the source address of the packet. | |
NodeId | getSrc () const |
Get the source address of the packet. | |
void | setSeq (u_int16_t num) |
Set sequence number of the packet. | |
u_int16_t | getSeq () const |
Get the sequence number of the packet. | |
void | setControlBit (int bit, bool v=true) |
Manipulate a control bit. | |
bool | getControlBit (int bit) const |
Get the value of a control bit. | |
void | setTraceFlag (bool v=true) |
Set the trace control bit. | |
bool | getTraceFlag () const |
Get the trace control bit. | |
Public Attributes | |
BasePacket & | packet |
Static Public Attributes | |
static const size_t | OffsetSrc = 1 |
static const size_t | OffsetSeq = OffsetSrc + NodeId::size |
static const size_t | SrcPacketEnd = OffsetSeq + 2 |
awds::BasePacket *p = getPacketFromSomewhere(); awds::SrcPacket srcP(*p); awds::NodeId src = srcP.getSrc();
awds::SrcPacket::SrcPacket | ( | BasePacket & | packet | ) | [inline] |
The constructor.
Creates a SrcPacket that accesses the values in packet
void awds::SrcPacket::getSrc | ( | NodeId & | id | ) | const [inline] |
Get the source address of the packet.
This function is used to get the source address of the packet. It is an optimized version of the getSrc() member funtion, because it avoids the creation of a temporary NodeId object.
References awds::BasePacket::buffer.
Referenced by awds::RTopology::feed().