awds::AwdsRouting Class Reference
[Awdsrouting_mod]

This class implement the routing functionality. More...

#include <AwdsRouting.h>

Inheritance diagram for awds::AwdsRouting:

awds::FlowRouting awds::Routing

List of all members.

Public Types

typedef std::map< NodeId,
Hop2RefCount > 
Hop2List
typedef std::pair
< recv_callback, void * > 
RegisterEntry
typedef std::map< int,
RegisterEntry > 
ProtocolRegister
typedef std::map
< FlowRouting::FlowId, struct
FlowReceiverData > 
FlowReceiverMap
typedef std::map
< FlowRouting::FlowId, NodeId
ForwardingTable

Public Member Functions

 AwdsRouting (basic *base)
virtual size_t getMTU ()
virtual std::string getNameOfNode (const awds::NodeId &id) const
virtual bool getNodeByName (awds::NodeId &id, const char *name) const
virtual int foreachNode (awds::Routing::NodeFunctor, void *data) const
virtual int foreachEdge (awds::Routing::EdgeFunctor, void *data) const
virtual void addNodeObserver (struct awds::Routing::NodesObserver *observer)
virtual void addLinkObserver (struct LinksObserver *observer)
void recv_beacon (BasePacket *p)
void recv_flood (BasePacket *p)
void recv_unicast (BasePacket *p)
virtual bool isReachable (const NodeId &id) const
virtual BasePacketnewFloodPacket (int floodType)
virtual BasePacketnewUnicastPacket (int type)
virtual void sendBroadcast (BasePacket *p)
virtual void sendUnicast (BasePacket *p)
virtual void sendUnicastVia (BasePacket *p, NodeId nextHop)
virtual void registerUnicastProtocol (int num, recv_callback cb, void *data)
virtual void registerBroadcastProtocol (int num, recv_callback cb, void *data)
int findNeigh (const NodeId &id) const
bool hasNeigh (const NodeId &id) const
void removeOldNeigh ()
bool refreshNeigh (BasePacket *p)
void stat2dyn ()
void assert_stat ()
void calcMpr ()
virtual int addForwardingRule (FlowRouting::FlowId flowid, NodeId nextHop)
virtual int delForwardingRule (FlowRouting::FlowId flowid)
virtual int addFlowReceiver (FlowRouting::FlowId flowid, FlowRouting::FlowReceiver, void *data)
virtual int delFlowReceiver (FlowRouting::FlowId)
virtual BasePacketnewFlowPacket (FlowRouting::FlowId flowid)
virtual int sendFlowPacket (BasePacket *p)

Static Public Member Functions

static void send_beacon (gea::Handle *h, gea::AbsTime t, void *data)
static void recv_packet (gea::Handle *h, gea::AbsTime t, void *data)
static void trigger_topo (gea::Handle *h, gea::AbsTime t, void *data)
static void repeat_flood (gea::Handle *h, gea::AbsTime t, void *data)
static void send_unicast (gea::Handle *h, gea::AbsTime t, void *data)

Public Attributes

bool verbose
basicbase
int topoPeriod
gea::Handle * udpSend
gea::Handle * udpRecv
gea::Blocker blocker
class RTopologytopology
class FloodHistory * floodHistory
Hop2List hop2list
ProtocolRegister unicastRegister
ProtocolRegister broadcastRegister
NodeDescr * neighbors
int numNeigh
u_int16_t beaconSeq
gea::Duration beaconPeriod
gea::AbsTime nextBeacon
u_int16_t floodSeq
u_int16_t unicastSeq
FlowReceiverMap flowReceiverMap
ForwardingTable forwardingTable

Static Public Attributes

static const int UdpPort = 4921
static const int period = BEACON_INTERVAL
static const int MaxNeighbors = 40

Classes

struct  FlowReceiverData
struct  Hop2RefCount


Detailed Description

This class implement the routing functionality.

See also:
awds::RTopology

Member Function Documentation

std::string awds::AwdsRouting::getNameOfNode ( const awds::NodeId id  )  const [virtual]

convert a node id to a unique name This method implements the abstact version in awds::Routing

Parameters:
id which node is looked up
Returns:
a unique string for identifying the node.

Implements awds::Routing.

bool awds::AwdsRouting::getNodeByName ( awds::NodeId id,
const char *  name 
) const [virtual]

convert a node name to an internal node id This method implements the abstact version in awds::Routing

Parameters:
id a reference to a node id, where the return value is stored.
name the name to look for.
Returns:
0 on success, -1 otherwise.

Implements awds::Routing.

virtual int awds::AwdsRouting::foreachNode ( awds::Routing::NodeFunctor  ,
void *  data 
) const [virtual]

function to iterate over the list of nodes

Implements awds::Routing.

virtual int awds::AwdsRouting::foreachEdge ( awds::Routing::EdgeFunctor  ,
void *  data 
) const [virtual]

function to iterate over the list of nodes

Implements awds::Routing.

BasePacket * awds::AwdsRouting::newFloodPacket ( int  floodType  )  [virtual]

allocate a new flood packet. This function allocates a new flood packet that can be transmitted. via sendBroadcast(BasePacket *). The packets content should be accessed by created a awds::Flood wrapper around it.

The packet should never be freed directly via delete. Instead the refence counting mechanism of BasePacket should be used.

See also:
awds::BasePacket::unref().

Implements awds::Routing.


Member Data Documentation

bool awds::AwdsRouting::verbose

enable verbose debug output

const int awds::AwdsRouting::period = BEACON_INTERVAL [static]

beacon period in milliseconds

int awds::AwdsRouting::topoPeriod

topology propagtion period in milliseconds

class FloodHistory* awds::AwdsRouting::floodHistory

history of recent flood packets


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