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

#include <uwip-module.h>

Inheritance diagram for UWIPModule:
Collaboration diagram for UWIPModule:

Public Member Functions

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

Static Public Member Functions

static const string printIP (const nsaddr_t &)
 
static const string printIP (const uint8_t &)
 

Static Protected Member Functions

static int getIpHeaderSize ()
 

Protected Attributes

uint8_t ipAddr_
 
int debug_
 
bool addr_type_inet
 

Static Protected Attributes

static uint8_t lastIP = 0
 

Detailed Description

UWIPModule class is used to define the Internet Protocol (IP) layer of a node.

Definition at line 115 of file uwip-module.h.

Constructor & Destructor Documentation

◆ UWIPModule()

UWIPModule::UWIPModule ( )

Constructor of UWIPModule class.

Definition at line 80 of file uwip-module.cpp.

◆ ~UWIPModule()

UWIPModule::~UWIPModule ( )
virtual

Destructor of UWIPModule class.

Definition at line 89 of file uwip-module.cpp.

Member Function Documentation

◆ command()

int UWIPModule::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 in UwStaticRoutingModule.

Definition at line 94 of file uwip-module.cpp.

◆ getIpHeaderSize()

static int UWIPModule::getIpHeaderSize ( )
inlinestaticprotected

Returns the size in byte of a hdr_sun_data packet header.

Returns
The size of a hdr_sun_data packet header.

Definition at line 200 of file uwip-module.h.

◆ printIdsPkts()

void UWIPModule::printIdsPkts ( ) const
inline

Prints the IDs of the packet's headers defined by UWIP.

Definition at line 179 of file uwip-module.h.

◆ printIP() [1/2]

const string UWIPModule::printIP ( const nsaddr_t &  ip_)
static

Returns a string with an IP in the classic form "x.x.x.x" converting an ns2 nsaddr_t address.

Parameters
nsaddr_t&ns2 address
Returns
String that contains a printable IP in the classic form "x.x.x.x"

Definition at line 215 of file uwip-module.cpp.

◆ printIP() [2/2]

const string UWIPModule::printIP ( const uint8_t &  ip_)
static

Returns a string with an IP in the classic form "x.x.x.x" converting an uint8_t address.

Parameters
uint8_t&address
Returns
String that contains a printable IP in the classic form "x.x.x.x"

Definition at line 229 of file uwip-module.cpp.

◆ recv()

void UWIPModule::recv ( Packet *  p)
virtual

Performs the reception of packets from upper and lower layers.

Parameters
Packet*Pointer to the packet received.

Reimplemented in UwStaticRoutingModule.

Definition at line 135 of file uwip-module.cpp.

◆ recvSyncClMsg()

int UWIPModule::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 in UwStaticRoutingModule.

Definition at line 201 of file uwip-module.cpp.

Member Data Documentation

◆ addr_type_inet

bool UWIPModule::addr_type_inet
protected

true if the addressing type is INET, false if it is ILINK.

Definition at line 190 of file uwip-module.h.

◆ debug_

int UWIPModule::debug_
protected

Flag to enable or disable dirrefent levels of debug.

Definition at line 188 of file uwip-module.h.

◆ ipAddr_

uint8_t UWIPModule::ipAddr_
protected

IP address of the node.

Definition at line 187 of file uwip-module.h.

◆ lastIP

uint8_t UWIPModule::lastIP = 0
staticprotected

Used to set a default IP address.

Definition at line 186 of file uwip-module.h.


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