|
DESERT 4.0.0
|
#include <uwicrp-module-sink.h>


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 |
UwIcrpSink class is used to represent the routing layer of a node.
| UwIcrpSink::UwIcrpSink | ( | ) |
Constructor of UwIcrpSink class.
References printDebug_.
| UwIcrpSink::~UwIcrpSink | ( | ) |
Destructor of UwIcrpSink class.
|
protectedvirtual |
TCL command interpreter. It implements the following OTcl methods:
| argc | Number of arguments in argv. |
| argv | Array of strings which are the command parameters (Note that argv[0] is the name of the object). |
References getAckPktHeaderSize(), getDataPktHeaderSize(), getStatusPktHeaderSize(), initialize(), ipAddr_, numberofackpkt_, and numberofstatuspkt_.

|
inlinestaticprotected |
Returns the size in byte of a hdr_uwicrp_ack packet header.
Referenced by command().
|
inlinestaticprotected |
Returns the size in byte of a hdr_uwicrp_data packet header.
Referenced by command().
|
inlinestaticprotected |
Returns the size in byte of a hdr_uwicrp_status packet header.
Referenced by command().
|
protectedvirtual |
Initializes a UwIcrpSink node. It sends to the lower layers a Sync message asking for the IP of the node.
References ipAddr_.
Referenced by command().
|
protectedvirtual |
Initializes a Status Packet previously allocated.
| 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. |
References hdr_uwicrp_status::creation_time(), hdr_uwip::daddr(), ipAddr_, hdr_uwicrp_data::list_of_hops(), hdr_uwicrp_status::list_of_hops(), hdr_uwicrp_data::list_of_hops_length(), hdr_uwicrp_status::list_of_hops_length(), hdr_uwicrp_data::pointer_to_list_of_hops(), hdr_uwicrp_status::pointer_to_list_of_hops(), PT_UWICRP_STATUS, and hdr_uwip::saddr().
Referenced by recv().

|
protectedvirtual |
Return a string with an IP in the classic form "x.x.x.x" converting an ns2 nsaddr_t address.
| nsaddr_t& | ns2 address |
Referenced by recv().
|
protectedvirtual |
Performs the reception of packets from upper and lower layers.
| Packet* | Pointer to the packet will be received. |
References initStatusPkt(), ipAddr_, numberofstatuspkt_, printDebug_, printIP(), PT_UWICRP_ACK, PT_UWICRP_STATUS, and sendBackAck().

|
protectedvirtual |
Initializes a UwIcrpSink node. It sends to the lower layers a Sync message asking for the IP of the node.
References UWIPClMsgSendAddr::getAddr(), ipAddr_, and UWIP_CLMSG_SEND_ADDR.

|
protectedvirtual |
Cross-Layer messages synchronous interpreter.
| ClMessage* | an instance of ClMessage that represent the message received |
|
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.
| Packet* | Pointer to a Data packet to acknowledge. |
References hdr_uwip::daddr(), ipAddr_, numberofackpkt_, and PT_UWICRP_ACK.
Referenced by recv().

|
protected |
IP of the current node.
Referenced by command(), initialize(), initStatusPkt(), recv(), recvAsyncClMsg(), and sendBackAck().
|
staticprivate |
Comulative number of Ack packets processed by UwIcrpSink objects.
Referenced by command(), and sendBackAck().
|
staticprivate |
Comulative number of Status packets processed by UwIcrpSink objects.
|
protected |
Flag to enable or disable dirrefent levels of debug.
Referenced by recv(), and UwIcrpSink().