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

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

Get the node the station came from.

See also:
setLastHop(const NodeId&)

References awds::BasePacket::buffer, and AbstractID< 6 >::fromArray().

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.

References awds::BasePacket::buffer.

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

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

See also:
getLastHop(const NodeId&)

References awds::BasePacket::buffer.

Referenced by awds::AwdsRouting::newFloodPacket().

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.

References awds::BasePacket::buffer.

Referenced by awds::AwdsRouting::newFloodPacket().


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

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