awds::SrcPacket Class Reference

The access class for all packets that contain a source address. More...

#include <SrcPacket.h>

Inheritance diagram for awds::SrcPacket:

awds::Beacon awds::Flood awds::FlowPacket awds::UnicastPacket awds::TopoPacket

List of all members.

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

BasePacketpacket

Static Public Attributes

static const size_t OffsetSrc = 1
static const size_t OffsetSeq = OffsetSrc + NodeId::size
static const size_t SrcPacketEnd = OffsetSeq + 2


Detailed Description

The access class for all packets that contain a source address.

  awds::BasePacket *p = getPacketFromSomewhere();
  awds::SrcPacket srcP(*p);
  awds::NodeId src = srcP.getSrc();

Constructor & Destructor Documentation

awds::SrcPacket::SrcPacket ( BasePacket packet  )  [inline]

The constructor.

Creates a SrcPacket that accesses the values in packet


Member Function Documentation

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().


The documentation for this class was generated from the following file:

Generated on Fri Mar 27 13:58:27 2009 for AWDS by  doxygen 1.5.8