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

#include <uwicrp-module-sink.h>

Inheritance diagram for UwIcrpSink:
Collaboration diagram for UwIcrpSink:

Public Member Functions

 UwIcrpSink ()
 
 ~UwIcrpSink ()
 

Protected Member Functions

virtual int recvSyncClMsg (ClMessage *)
 
virtual int recvAsyncClMsg (ClMessage *)
 
virtual int command (int, const char *const *)
 
virtual void recv (Packet *)
 
virtual void initStatusPkt (Packet *, Packet *)
 
virtual void initialize ()
 
virtual void sendBackAck (const Packet *p)
 
virtual string printIP (const uint8_t)
 

Static Protected Member Functions

static const int getAckPktHeaderSize ()
 
static const int getDataPktHeaderSize ()
 
static const int getStatusPktHeaderSize ()
 

Protected Attributes

uint8_t ipAddr_
 
int printDebug_
 

Static Private Attributes

static long numberofackpkt_ = 0
 
static long numberofstatuspkt_ = 0
 

Detailed Description

UwIcrpSink class is used to represent the routing layer of a node.

Definition at line 65 of file uwicrp-module-sink.h.

Constructor & Destructor Documentation

◆ UwIcrpSink()

UwIcrpSink::UwIcrpSink ( )

Constructor of UwIcrpSink class.

Definition at line 66 of file uwicrp-module-sink.cpp.

◆ ~UwIcrpSink()

UwIcrpSink::~UwIcrpSink ( )

Destructor of UwIcrpSink class.

Definition at line 75 of file uwicrp-module-sink.cpp.

Member Function Documentation

◆ command()

int UwIcrpSink::command ( int  argc,
const char *const *  argv 
)
protectedvirtual

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.

Definition at line 105 of file uwicrp-module-sink.cpp.

◆ getAckPktHeaderSize()

static const int UwIcrpSink::getAckPktHeaderSize ( )
inlinestaticprotected

Returns the size in byte of a hdr_uwicrp_ack packet header.

Returns
The size of a hdr_uwicrp_ack packet header.

Definition at line 163 of file uwicrp-module-sink.h.

◆ getDataPktHeaderSize()

static const int UwIcrpSink::getDataPktHeaderSize ( )
inlinestaticprotected

Returns the size in byte of a hdr_uwicrp_data packet header.

Returns
The size of a hdr_uwicrp_data packet header.

Definition at line 174 of file uwicrp-module-sink.h.

◆ getStatusPktHeaderSize()

static const int UwIcrpSink::getStatusPktHeaderSize ( )
inlinestaticprotected

Returns the size in byte of a hdr_uwicrp_status packet header.

Returns
The size of a hdr_uwicrp_status packet header.

Definition at line 185 of file uwicrp-module-sink.h.

◆ initialize()

void UwIcrpSink::initialize ( )
protectedvirtual

Initializes a UwIcrpSink node.

It sends to the lower layers a Sync message asking for the IP of the node.

See also
UWIPClMsgReqAddr(int src)
sendSyncClMsgDown(ClMessage* m)

Definition at line 96 of file uwicrp-module-sink.cpp.

◆ initStatusPkt()

void UwIcrpSink::initStatusPkt ( Packet *  p_old,
Packet *  p_new 
)
protectedvirtual

Initializes a Status Packet previously allocated.

Parameters
Packet*Pointer to a PT_UWICRP_STATUS Packet to use to retrieve the information to initialize the new packet.
Packet*Pointer to a PT_UWICRP_STATUS Packet to initialize.

Definition at line 221 of file uwicrp-module-sink.cpp.

◆ printIP()

string UwIcrpSink::printIP ( const uint8_t  _ip)
protectedvirtual

Return 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 261 of file uwicrp-module-sink.cpp.

◆ recv()

void UwIcrpSink::recv ( Packet *  p)
protectedvirtual

Performs the reception of packets from upper and lower layers.

Parameters
Packet*Pointer to the packet will be received.

Definition at line 144 of file uwicrp-module-sink.cpp.

◆ recvAsyncClMsg()

int UwIcrpSink::recvAsyncClMsg ( ClMessage *  m)
protectedvirtual

Initializes a UwIcrpSink node.

It sends to the lower layers a Sync message asking for the IP of the node.

See also
UWIPClMsgReqAddr(int src)
sendSyncClMsgDown(ClMessage* m)

Definition at line 86 of file uwicrp-module-sink.cpp.

◆ recvSyncClMsg()

int UwIcrpSink::recvSyncClMsg ( ClMessage *  m)
protectedvirtual

Cross-Layer messages synchronous interpreter.

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

Definition at line 80 of file uwicrp-module-sink.cpp.

◆ sendBackAck()

void UwIcrpSink::sendBackAck ( const Packet *  p)
protectedvirtual

Creates an ack packet and sends it to the previous hop using the information contained in the header of the data packet passed as input parameter.

It is an ack to the previous hop, and not to the source of the packet.

Parameters
Packet*Pointer to a Data packet to acknowledge.

Definition at line 269 of file uwicrp-module-sink.cpp.

Member Data Documentation

◆ ipAddr_

uint8_t UwIcrpSink::ipAddr_
protected

IP of the current node.

Definition at line 190 of file uwicrp-module-sink.h.

◆ numberofackpkt_

long UwIcrpSink::numberofackpkt_ = 0
staticprivate

Comulative number of Ack packets processed by UwIcrpSink objects.

Definition at line 196 of file uwicrp-module-sink.h.

◆ numberofstatuspkt_

long UwIcrpSink::numberofstatuspkt_ = 0
staticprivate

Comulative number of Status packets processed by UwIcrpSink objects.

Definition at line 198 of file uwicrp-module-sink.h.

◆ printDebug_

int UwIcrpSink::printDebug_
protected

Flag to enable or disable dirrefent levels of debug.

Definition at line 191 of file uwicrp-module-sink.h.


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