IPRoutingModule Class Reference

Basic IP routing functionality. More...

#include <ip-routing.h>

Inheritance diagram for IPRoutingModule:

Inheritance graph
[legend]
Collaboration diagram for IPRoutingModule:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 IPRoutingModule ()
virtual ~IPRoutingModule ()
virtual void recv (Packet *p)
virtual int command (int argc, const char *const *argv)
virtual nsaddr_t GetNextHop (Packet *p)
virtual nsaddr_t GetNextHop (nsaddr_t dst)
virtual void clearRoutes ()
virtual void addRoute (nsaddr_t dst, nsaddr_t mask, nsaddr_t next)

Protected Attributes

nsaddr_t destination [IP_ROUTING_MAX_ROUTES]
nsaddr_t subnetmask [IP_ROUTING_MAX_ROUTES]
nsaddr_t nexthop [IP_ROUTING_MAX_ROUTES]
int nroutes

Detailed Description

Basic IP routing functionality.

This class implements tcl class Module/IP/Routing and is expected to be installed above one or more Module/IP/Interface classes.

Note:
Inheritance from IPModule is actually needed only for the str2add() method et similia. Other functionality from the IPModule is not needed in IPRoutingModule, and all methods are overloaded. In particular, it should be remembered that an IPRoutingModule does *NOT* have its own IP address.

Definition at line 54 of file ip-routing.h.


Member Function Documentation

void IPRoutingModule::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

Reimplemented from IPModule.

Definition at line 152 of file ip-routing.cc.

References DOWN, Module::drop(), GetNextHop(), Module::sendDown(), Module::sendUp(), and UP.

Here is the call graph for this function:

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

TCL command interpreter. It implements the following OTcl methods:

Moreover it inherits all the OTcl method of PlugIn

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:
PlugIn

Reimplemented from IPModule.

Definition at line 87 of file ip-routing.cc.

References addRoute(), clearRoutes(), Module::command(), destination, nexthop, nroutes, IPModule::str2addr(), and subnetmask.

Here is the call graph for this function:


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