#include <Flood.h>
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 |
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);
NodeId awds::Flood::getLastHop | ( | ) | const [inline] |
Get the node the station came from.
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.
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().