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.

Classes

struct  FlowReceiverData
struct  Hop2RefCount

Public Types

enum  PeriodType { Constant, Adaptive }
typedef std::map< NodeId,
Hop2RefCount > 
Hop2List
typedef std::pair
< recv_callback, void * > 
RegisterEntry
typedef std::vector
< RegisterEntry > 
RegisterList
typedef std::map< int,
RegisterList > 
ProtocolRegister
typedef std::map
< FlowRouting::FlowId, struct
FlowReceiverData > 
FlowReceiverMap
typedef std::map
< FlowRouting::FlowId, NodeId
ForwardingTable

Public Member Functions

 AwdsRouting (basic *base)
virtual ~AwdsRouting ()
 destructor
virtual size_t getMTU ()
virtual void send_topo ()
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 (BasePacket *p, void *data)
static void send_periodic_topo (gea::Handle *h, gea::AbsTime t, void *data)
static void checkLinkFailure (gea::Handle *h, gea::AbsTime t, void *data)

Public Attributes

bool verbose
basicbase
int topoPeriod_ms
PeriodType topoPeriodType
gea::Blocker beaconBlocker
gea::Blocker blocker
class RTopologytopology
class FloodHistoryfloodHistory
class awds::Firewallfirewall
Hop2List hop2list
ProtocolRegister unicastRegister
ProtocolRegister broadcastRegister
NodeDescr * neighbors
int numNeigh
gea::Blocker linkFailBlocker
 Blocker for checkLinkFailure callback.
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 period = BEACON_INTERVAL
static const int MaxNeighbors = 40


Detailed Description

This class implement the routing functionality.

See also:
awds::RTopology

Member Enumeration Documentation

Enumerator:
Constant  type for constant or adaptive periods


Member Function Documentation

void awds::AwdsRouting::checkLinkFailure ( gea::Handle *  h,
gea::AbsTime  t,
void *  data 
) [static]

GEA callback that checks whether links have bacome inactive.

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

function to iterate over the list of nodes

Implements awds::Routing.

References awds::RTopology::adjList, and topology.

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

function to iterate over the list of nodes

Implements awds::Routing.

References awds::RTopology::adjList, and topology.

size_t awds::AwdsRouting::getMTU (  )  [virtual]

get the maximum transfer unit

Implements awds::Routing.

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.

References awds::RTopology::getNameOfNode(), and topology.

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.

References awds::RTopology::getNodeByName(), and topology.

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.

References awds::basic::BroadcastId, floodSeq, awds::Routing::myNodeId, awds::BasePacket::setDest(), awds::Flood::setFloodType(), awds::Flood::setLastHop(), awds::SrcPacket::setSeq(), awds::SrcPacket::setSrc(), and awds::Flood::setTTL().

Referenced by send_topo().

void awds::AwdsRouting::send_topo (  )  [virtual]


Member Data Documentation

for periodic sending of beacon packets

period of sending beacon packets

becon sequence number

for periodic sending of topo packets

used for packet filtering

history of recent flood packets

Referenced by ~AwdsRouting().

sequence number of flooding packets

Referenced by newFloodPacket().

when the next beacon packet will be generated

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

beacon period in milliseconds

topology propagtion period in milliseconds

Referenced by send_topo().

period type for topo packets

Referenced by send_topo().

sequence number of unicast packets

enable verbose debug output


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

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