awds::Flood Class Reference

access class for flood packets More...

#include <Flood.h>

Inheritance diagram for awds::Flood:

awds::SrcPacket awds::TopoPacket

List of all members.

Public Member Functions

 Flood (BasePacket &p)
int getTTL ()
 Get the Time to Live (TTL) of a flood packet.
void setTTL (int ttl)
 Set the Time to Live (TTL) of a flood packet.
void decrTTL ()
 Decrease the TTL value of the packet by one.
void incTTL ()
 Increase the TTL value of the packet by one.
NodeId getLastHop () const
 Get the node the station came from.
void setLastHop (const NodeId &id)
 Set the node id of the LastHop field in the packet.
int getFloodType ()
void setFloodType (int ft)

Static Public Attributes

static const size_t OffsetLastHop = SrcPacketEnd
static const size_t OffsetTTL = OffsetLastHop + NodeId::size
static const size_t OffsetFloodType = OffsetTTL + 1
static const size_t FloodHeaderEnd = OffsetFloodType + 1


Detailed Description

access class for flood packets

Use this class to access the content of a flood packet. It should be used the following way

  BasePacket *p = getPacketFromSomewhere();
  Flood flood(*p);
  flood.setTTL(1);

Member Function Documentation

int awds::Flood::getTTL (  )  [inline]

Get the Time to Live (TTL) of a flood packet.

The TTL is in fact the maximum hop count of a packet.

void awds::Flood::setTTL ( int  ttl  )  [inline]

Set the Time to Live (TTL) of a flood packet.

The TTL is in fact the maximum hop count of a packet.

NodeId awds::Flood::getLastHop (  )  const [inline]

Get the node the station came from.

See also:
setLastHop(const NodeId&)

void awds::Flood::setLastHop ( const NodeId id  )  [inline]

Set the node id of the LastHop field in the packet.

See also:
getLastHop(const NodeId&)


The documentation for this class was generated from the following file:
Generated on Tue Dec 11 17:58:48 2007 for AWDS by  doxygen 1.5.3-20071008