awds::TopoPacket Class Reference

class for accessing fields of a Topology packet. More...

#include <TopoPacket.h>

Inheritance diagram for awds::TopoPacket:

awds::Flood awds::SrcPacket

List of all members.

Public Member Functions

 TopoPacket (BasePacket &p)
void setNeigh (AwdsRouting *awdsRouting)
 set the list of neighbors in a packet.
int getNumLinks () const
 get the number of links in a TopoPacket.
gea::Duration getValidity () const
 return validity as Duration.
void setValidity (long d)
 set validity in milliseconds.
void print ()
 dump the topo packet.

Static Public Attributes

static const size_t OffsetValidity = FloodHeaderEnd
static const size_t OffsetNumLinks = OffsetValidity + sizeof(u_int32_t)
static const size_t OffsetLinks = OffsetNumLinks + 1


Detailed Description

class for accessing fields of a Topology packet.

  awds::BasePacket *p = getPacketFromSomewhere();
  awds::TopoPacket topoP(*p);
  int n = topoP.getNumLinks();

Member Function Documentation

int awds::TopoPacket::getNumLinks (  )  const [inline]

get the number of links in a TopoPacket.

Returns:
number of links.

References awds::BasePacket::buffer.

Referenced by awds::RTopology::feed(), and print().

void TopoPacket::setNeigh ( AwdsRouting awdsRouting  ) 

set the list of neighbors in a packet.

Parameters:
awdsRouting pointer to the interf object that contains the neihbors.
t the current time, used for calculating timeouts.

References awds::BasePacket::buffer, awds::Metric::get_quality(), awds::RTopology::metric, awds::Routing::myNodeId, awds::AwdsRouting::neighbors, awds::RTopology::nodeName, awds::AwdsRouting::numNeigh, awds::BasePacket::size, AbstractID< 6 >::toArray(), awds::AwdsRouting::topology, and awds::Metric::update().

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


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

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