DESERT 3.5.1
Loading...
Searching...
No Matches
UwStaticRoutingModule Class Reference

#include <uwstaticrouting.h>

Inheritance diagram for UwStaticRoutingModule:
Collaboration diagram for UwStaticRoutingModule:

Public Member Functions

 UwStaticRoutingModule ()
 
virtual ~UwStaticRoutingModule ()
 
virtual void recv (Packet *)
 
virtual int recvSyncClMsg (ClMessage *)
 
virtual int command (int, const char *const *)
 
virtual uint8_t getNextHop (const Packet *) const
 
virtual uint8_t getNextHop (const uint8_t &) const
 
virtual void clearRoutes ()
 
virtual void addRoute (const uint8_t &, const uint8_t &)
 
- Public Member Functions inherited from UWIPModule
 UWIPModule ()
 
virtual ~UWIPModule ()
 
void printIdsPkts () const
 

Private Attributes

std::map< uint8_t, uint8_t > routing_table
 
uint8_t default_gateway
 

Additional Inherited Members

- Static Public Member Functions inherited from UWIPModule
static const string printIP (const nsaddr_t &)
 
static const string printIP (const uint8_t &)
 
- Static Protected Member Functions inherited from UWIPModule
static int getIpHeaderSize ()
 
- Protected Attributes inherited from UWIPModule
uint8_t ipAddr_
 
int debug_
 
bool addr_type_inet
 
- Static Protected Attributes inherited from UWIPModule
static uint8_t lastIP = 0
 

Detailed Description

UwStaticRoutingModule class implements basic routing functionalities.

Definition at line 58 of file uwstaticrouting.h.

Constructor & Destructor Documentation

◆ UwStaticRoutingModule()

UwStaticRoutingModule::UwStaticRoutingModule ( )

Constructor of UwStaticRoutingModule class.

Definition at line 62 of file uwstaticrouting.cpp.

◆ ~UwStaticRoutingModule()

UwStaticRoutingModule::~UwStaticRoutingModule ( )
virtual

Destructor of UwStaticRoutingModule class.

Definition at line 68 of file uwstaticrouting.cpp.

Member Function Documentation

◆ addRoute()

void UwStaticRoutingModule::addRoute ( const uint8_t &  dst,
const uint8_t &  next 
)
virtual

Adds a new entry in the routing table.

Parameters
nsaddr_tAddress of the destination.
nsaddr_tAddress of the next hop.

Definition at line 85 of file uwstaticrouting.cpp.

◆ clearRoutes()

void UwStaticRoutingModule::clearRoutes ( )
virtual

Removes all the routing information.

Definition at line 79 of file uwstaticrouting.cpp.

◆ command()

int UwStaticRoutingModule::command ( int  argc,
const char *const *  argv 
)
virtual

TCL command interpreter.

It implements the following OTcl methods:

Parameters
argcNumber of arguments in argv.
argvArray of strings which are the command parameters (Note that argv[0] is the name of the object).
Returns
TCL_OK or TCL_ERROR whether the command has been dispatched successfully or not.

Reimplemented from UWIPModule.

Definition at line 111 of file uwstaticrouting.cpp.

◆ getNextHop() [1/2]

uint8_t UwStaticRoutingModule::getNextHop ( const Packet *  p) const
virtual

Returns the next hop address of a packet passed as input.

Parameters
Packet*Packet to process.
Returns
IP of the next hop.

Definition at line 187 of file uwstaticrouting.cpp.

◆ getNextHop() [2/2]

uint8_t UwStaticRoutingModule::getNextHop ( const uint8_t &  dst) const
virtual

Returns the next hop address of an address passed as input.

Parameters
nsaddr_tAddress to process.
Returns
IP of the next hop.

Definition at line 194 of file uwstaticrouting.cpp.

◆ recv()

void UwStaticRoutingModule::recv ( Packet *  p)
virtual

Performs the reception of packets from upper and lower layers.

Parameters
Packet*Pointer to the packet will be received.

Reimplemented from UWIPModule.

Definition at line 147 of file uwstaticrouting.cpp.

◆ recvSyncClMsg()

int UwStaticRoutingModule::recvSyncClMsg ( ClMessage *  m)
virtual

Cross-Layer messages synchronous interpreter.

Parameters
ClMessage*an instance of ClMessage that represent the message received
Returns
0 if successful.

Reimplemented from UWIPModule.

Definition at line 73 of file uwstaticrouting.cpp.

Member Data Documentation

◆ default_gateway

uint8_t UwStaticRoutingModule::default_gateway
private

Default gateway.

Definition at line 131 of file uwstaticrouting.h.

◆ routing_table

std::map<uint8_t, uint8_t> UwStaticRoutingModule::routing_table
private

Routing table: destination - next hop.

Definition at line 130 of file uwstaticrouting.h.


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