40#ifndef UWICRP_MODULE_NODE_H
41#define UWICRP_MODULE_NODE_H
80 virtual void expire(Event *e);
132 virtual int command(
int,
const char *
const *);
139 virtual void recv(Packet *);
168 virtual void initPkt(Packet *);
223 virtual string printIP(
const uint8_t);
259 static inline const int
270 static inline const int
281 static inline const int
AckWaiting class is used to handle the timer of acks.
AckWaiting(UwIcrpNode *m)
virtual void expire(Event *e)
UwIcrpNode class is used to represent the routing layer of a node.
virtual void clearAllRouteTable()
Clears completely the routing table of the node.
virtual void addRouteEntry(Packet *)
Adds the information received from a Status packet in the routing table of the node.
virtual void sendBackAck(const Packet *p)
Creates an ack packet after the reception a data packet received correctly.
nsaddr_t str2addr(const char *)
Returns a nsaddr_t address from an IP written as a string in the form "x.x.x.x".
uint8_t ipSink_
IP of the sink associated.
virtual string printIP(const uint8_t)
Return a string with an IP in the classic form "x.x.x.x" converting an ns2 nsaddr_t address.
virtual void ackLost()
Resets all the routing information because the lost of an ack.
double max_validity_time_
Maximum validity time of a route.
virtual void initPktAck(Packet *p)
Initializes an Ack packet (previously allocated).
static const int getStatusPktHeaderSize()
Returns the size in byte of a hdr_uwicrp_status packet header.
virtual int command(int, const char *const *)
TCL command interpreter.
static long numberofstatuspkt_
Comulative number of Status packets processed by UwIcrpNode objects.
virtual bool addIpInList(Packet *, nsaddr_t)
Adds an IP passed as argument in the header of a Data packet passed as argument.
virtual void initialize()
Initializes a UwIcrpNode node.
uint8_t ipAddr_
IP of the current node.
static long numberofackpkt_
Comulative number of Ack packets processed by UwIcrpNode objects.
static const int getAckPktHeaderSize()
Returns the size in byte of a hdr_uwicrp_ack packet header.
routing_table_entry route_table[HOP_TABLE_LENGTH]
Node routing table.
virtual int recvAsyncClMsg(ClMessage *)
Initializes a UwIcrpSink node.
AckWaiting ackwaitingTmr_
AckWaiting object.
virtual void initPkt(Packet *)
Initializes a Data packet (previously allocated).
static long numberofdatapkt_
Comulative number of Data packets processed by UwIcrpNode objects.
virtual bool isIpInList(Packet *, nsaddr_t)
Checks if a specific IP is in the header of the packet passed as argument.
virtual void printHopTable()
Prints in the stdout the routing table of the current node.
virtual int findInRouteTable(nsaddr_t)
Seeks for an entry in the routing table that contains information to a specific address passed as arg...
static const int getDataPktHeaderSize()
Returns the size in byte of a hdr_uwicrp_data packet header.
UwIcrpNode()
Constructor of UwIcrpNode class.
~UwIcrpNode()
Destructor of UwIcrpNode class.
virtual int recvSyncClMsg(ClMessage *)
Cross-Layer messages synchronous interpreter.
virtual void recv(Packet *)
Performs the reception of packets from upper and lower layers.
int printDebug_
Flag to enable or disable dirrefent levels of debug.
virtual void clearRouteTable(const int &)
Removes a specific entry in the routing table of the node.
double timer_ack_waiting_
Ack waiting timer.
hdr_uwicrp_ack describes acks packets used by UWICRP.
hdr_uwicrp_data describes data packets used by UWICRP
hdr_uwicrp_status describes status packets used by UWICRP
routing_table_entry describes an entry in the routing table used by UWICRP.
Common structures and definition used by UWICRP.
static const int HOP_TABLE_LENGTH
Maximum length of the routing table of a node FOR UWICRP.
Provides the Ack Messages header description.
Provides the Data Messages header description.
Provides the Status Messages header description.
Cross layer messages definition for the UWIP Module.
Provides the UWIP packets header description. Definition of the class that define the network layer.