#include <BasePacket.h>
Public Types | |
typedef void(* | SendCallback )(BasePacket &p, void *data, ssize_t size) |
Public Member Functions | |
int | receive (gea::Handle *h) |
void | setSendCallback (SendCallback cb, void *data) |
int | ref () |
increase the reference counter. | |
int | unref () |
decrease the reference counter. | |
PacketType | getType () const |
void | setType (PacketType pt) |
void | setDest (const NodeId &dest) |
Public Attributes | |
char | buffer [MaxSize] |
size_t | size |
int | refcount |
SendCallback | cb |
void * | cb_data |
NodeId | dest |
Static Public Attributes | |
static const int | MaxSize = 0x1000 |
The BasePacket class is used for holding the data of a packet.
int awds::BasePacket::unref | ( | ) | [inline] |
decrease the reference counter.
This method decreases the reference counter. When its value becomes zero, the packet is automatically deallocated.
References refcount.
Referenced by Pinger::next_ping(), Pinger::ping_recv(), and awds::AwdsRouting::send_topo().
the buffer with the actual data
Referenced by awds::Flood::decrTTL(), awds::RTopology::feed(), awds::SrcPacket::getControlBit(), awds::Flood::getLastHop(), awds::TopoPacket::getNumLinks(), awds::SrcPacket::getSeq(), awds::SrcPacket::getSrc(), awds::Flood::getTTL(), awds::TopoPacket::getValidity(), awds::Flood::incTTL(), Pinger::next_ping(), Pinger::ping_recv(), awds::TopoPacket::print(), awds::AwdsRouting::send_topo(), awds::SrcPacket::setControlBit(), awds::Flood::setLastHop(), awds::TopoPacket::setNeigh(), awds::SrcPacket::setSeq(), awds::SrcPacket::setSrc(), awds::Flood::setTTL(), and awds::TopoPacket::setValidity().
const int awds::BasePacket::MaxSize = 0x1000 [static] |
The maximum number of bytes per packet
the refcount is used for memory management.
size_t awds::BasePacket::size |
the number of bytes in the packet, including all headers
Referenced by awds::RTopology::feed(), Pinger::next_ping(), awds::TopoPacket::print(), awds::AwdsRouting::send_topo(), and awds::TopoPacket::setNeigh().