MrclRouting Class Reference

#include <routing-module.h>

Inheritance diagram for MrclRouting:

Inheritance graph
[legend]
Collaboration diagram for MrclRouting:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MrclRouting ()
virtual ~MrclRouting ()
virtual int command (int argc, const char *const *argv)
virtual int recvSyncClMsg (ClMessage *m)
void recv (Packet *p)

Protected Member Functions

virtual int controlPacket (Packet *p)=0
virtual char * getNextHop (Packet *p)=0
int getRoute (MrclAddress *a, Packet *p, int i)
int getRoute (char *addr, Packet *p, int i)
virtual int canIReach (char *a, Metric ***m)=0
virtual void forward (Packet *p)=0
virtual void resolve (Packet *p)=0
void addAddress (MrclAddress *a)
MrclAddressgetAddress (int i)
int nAddresses ()
int isMyAddress (char *addr)

Protected Attributes

int overheadLength_

Private Member Functions

int getConfiguration (char *a, int source=-1)
int findNextLeaf (int i=-1)

Private Attributes

MrclAddress ** addresses_
int nAddresses_
RouteReachablerr_
double lastGetConfiguration_
DinArray routes_
double delayUp_
double delayDown_

Friends

class RoutingQueue

Detailed Description

This is the class which can be exteded in order to develop a new routing module for miracle

Definition at line 164 of file routing-module.h.


Constructor & Destructor Documentation

MrclRouting::MrclRouting (  ) 

Class constructor

Definition at line 174 of file routing-module.cc.

References overheadLength_.

MrclRouting::~MrclRouting (  )  [virtual]

Class destructor

Definition at line 179 of file routing-module.cc.

References rr_.


Member Function Documentation

int MrclRouting::command ( int  argc,
const char *const *  argv 
) [virtual]

TCL command interpreter. It implements the following OTcl methods:

Parameters:
argc number of arguments in argv
argv array of strings which are the comand parameters (Note that argv[0] is the name of the object)
Returns:
TCL_OK or TCL_ERROR whether the command has been dispatched succesfully or no
See also:
Module

Reimplemented from Module.

Reimplemented in MrclRoutingStatic, and AodvModule.

Definition at line 185 of file routing-module.cc.

References addAddress(), Module::command(), getAddress(), nAddresses(), rr_, MrclAddress::strlen(), and MrclAddress::toString().

Referenced by MrclRoutingStatic::command(), and AodvModule::command().

Here is the call graph for this function:

int MrclRouting::recvSyncClMsg ( ClMessage m  )  [virtual]

Entry point for the synchronous cross layer message. It implements the answer to the CL_ROUTEMESSAGE.

Parameters:
m pointer to the receives cross layer message

Reimplemented from PlugIn.

Definition at line 325 of file routing-module.cc.

References RouteReachable::addRouteInfo(), RouteReachable::empty(), getAddress(), getConfiguration(), RouteReachable::getRouteInfo(), ClMessage::getSource(), PlugIn::recvSyncClMsg(), rr_, and ClMessage::type().

Here is the call graph for this function:

void MrclRouting::recv ( Packet *  p  )  [virtual]

Abstract method which has to be filled with the ad-hoc operations that the module has to do to the packet received

Parameters:
p pointer to the packet will be received
See also:
SAP, ChSAP

Implements Module.

Definition at line 507 of file routing-module.cc.

References addresses_, RoutingHdr::clearModuleRoute(), controlPacket(), delayDown_, delayUp_, DOWN, MrclAddress::getAddr(), PlugIn::getId(), RoutingHdr::getModuleRoute(), getNextHop(), HDR_ROUTING, RoutingHdr::moduleRouteCount(), nAddresses(), RoutingHdr::nexthop(), RoutingHdr::saddr(), Module::sendDown(), Module::sendUp(), RoutingHdr::sendup(), and MrclAddress::storeAddr().

Here is the call graph for this function:

virtual int MrclRouting::controlPacket ( Packet *  p  )  [protected, pure virtual]

Abstract method to be extended by the specific routing algorithm in order to get all the info it needed from its control packets

Parameters:
p pointer to the received packet
Returns:
TRUE when the packet pointed by *p is a control packet

Implemented in MrclRoutingStatic, and AodvModule.

Referenced by recv().

virtual char* MrclRouting::getNextHop ( Packet *  p  )  [protected, pure virtual]

Abstract method used to solve the routing of the packet as function of the specific routing algorithm

Parameters:
p pointer to the received packet
Returns:
The address of the next hop node

Implemented in MrclRoutingStatic, and AodvModule.

Referenced by recv().

virtual int MrclRouting::canIReach ( char *  a,
Metric ***  m 
) [protected, pure virtual]

This method is called by isReachable and it say if a particular destination can be reach by the current module.

Parameters:
a Pointer to the address of the node which can be reached
m [out] reference to a ponter of metric returned by the method
Returns:
The number of returned metrics
Remarks:
The returned metrics have not to be dellocated

Implemented in MrclRoutingStatic, and AodvModule.

Referenced by getConfiguration().

int MrclRouting::getConfiguration ( char *  a,
int  source = -1 
) [private]

This method has to be called in order to understand whether a particular destination can be reached towards the current module or another module in the node.

Parameters:
a Pointer to the address of the node which can be reached
source Id of the module at which do not propagates the accessibility request. If it assumes negative values the request will be propagated to all the adjacentes modules
Returns:
The length of the array pointed out to *info. If the address a is an address of the current module the returned value is negative and *info will be null.
Remarks:
The array pointed out to *info wil be not deallocated

Definition at line 234 of file routing-module.cc.

References RouteInfo::addChild(), RouteInfo::addFather(), RouteInfo::addMetric(), addresses_, RouteReachable::addRouteInfo(), MrclAddress::areEqual(), canIReach(), RouteReachable::empty(), Module::getDownLaySAP(), Module::getDownLaySAPnum(), PlugIn::getId(), SAP::getModuleDownId(), SAP::getModuleUpId(), RouteReachable::getRouteInfo(), Module::getUpLaySAP(), Module::getUpLaySAPnum(), RouteReachable::isMyIP(), RouteReachable::length(), MAYBE, nAddresses_, RouteReachable::processed(), REACHABLE, rr_, Module::sendSyncClMsgDown(), Module::sendSyncClMsgUp(), RouteReachable::setAddress(), ClMessage::setDest(), RouteInfo::setModuleId(), RouteInfo::setReachability(), and UNREACHABLE.

Referenced by getRoute(), and recvSyncClMsg().

Here is the call graph for this function:


Member Data Documentation

MrclAddress** MrclRouting::addresses_ [private]

Array of the addresses of the current module

Definition at line 254 of file routing-module.h.

Referenced by addAddress(), getAddress(), getConfiguration(), and recv().

int MrclRouting::nAddresses_ [private]

Length of addresses_

Definition at line 258 of file routing-module.h.

Referenced by addAddress(), getAddress(), getConfiguration(), and nAddresses().

RouteReachable* MrclRouting::rr_ [private]

Pointer to the cross layer message which will be propagated toward the adjectes modules in ordert to retrive information about the accessibility of a particular destination. It is allocated as soon as an id is assigned to the current module.

Definition at line 264 of file routing-module.h.

Referenced by command(), findNextLeaf(), getConfiguration(), getRoute(), recvSyncClMsg(), and ~MrclRouting().

double MrclRouting::lastGetConfiguration_ [private]

Last instant when the configuration has been computed

Definition at line 268 of file routing-module.h.

Referenced by getRoute().

DinArray MrclRouting::routes_ [private]

Last computed routes

Reimplemented in MrclRoutingStatic.

Definition at line 272 of file routing-module.h.

Referenced by getRoute().

double MrclRouting::delayUp_ [private]

The delay introduced by the module before transmit to the upper module

Definition at line 276 of file routing-module.h.

Referenced by recv().

double MrclRouting::delayDown_ [private]

The delay introduced by the module before transmit to the lower modules

Definition at line 280 of file routing-module.h.

Referenced by recv().


The documentation for this class was generated from the following files:
Generated on Wed Nov 26 15:51:42 2008 for NS-MIRACLE library by  doxygen 1.5.2