NetSim Source Code Help
Loading...
Searching...
No Matches
RREQ.c File Reference
#include "main.h"
#include "AODV.h"
#include "List.h"
Include dependency graph for RREQ.c:

Go to the source code of this file.

Functions

double fn_NetSim_AODV_AddTimeOut (NETSIM_IPAddress dest, NetSim_EVENTDETAILS *pstruEventDetails, double time)
 
double fnGetTimeoutTime (int ttl, int count)
 
int fn_NetSim_AODV_InsertInRREQSeenTable (AODV_DEVICE_VAR *devVar, NETSIM_IPAddress orginator, unsigned int nRREQId, double dTime)
 
int fnIncreaseTTL (AODV_DEVICE_VAR *devVar, NETSIM_IPAddress ip)
 
int fn_NetSim_AODV_InterstInRREQSentTable (AODV_DEVICE_VAR *devVar, NETSIM_IPAddress dest, int ttl, double dTimout)
 
int fnDeleteRREQSentTable (AODV_DEVICE_VAR *devVar, AODV_RREQ_SENT_TABLE *table)
 
bool fnCheckRREQSeenTable (AODV_DEVICE_VAR *devVar, AODV_RREQ *rreq)
 
NetSim_PACKETfn_NetSim_AODV_GenerateRREQ (NetSim_EVENTDETAILS *pstruEventDetails)
 
AODV_RREQ_SENT_TABLEfnFindSentTable (AODV_DEVICE_VAR *devVar, NETSIM_IPAddress ip)
 
int fn_NetSim_AODV_RetryRREQ (NetSim_EVENTDETAILS *pstruEventDetails)
 
int fn_NetSim_AODV_ProcessRREQ (NetSim_EVENTDETAILS *pstruEventDetails)
 
int fn_NetSim_AODV_ForwardRREQ (NetSim_EVENTDETAILS *pstruEventDetails)
 

Variables

static unsigned int nRREQId =0
 

Function Documentation

◆ fn_NetSim_AODV_AddTimeOut()

double fn_NetSim_AODV_AddTimeOut ( NETSIM_IPAddress  dest,
NetSim_EVENTDETAILS pstruEventDetails,
double  time 
)

This function adds the RREQ timeout event.

Definition at line 153 of file RREQ.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_AODV_ForwardRREQ()

int fn_NetSim_AODV_ForwardRREQ ( NetSim_EVENTDETAILS pstruEventDetails)

This function forwards the RREQ. It creates, a control packet, adds the necessary header and adds the Network Out Event.

Definition at line 358 of file RREQ.c.

Here is the call graph for this function:

◆ fn_NetSim_AODV_GenerateRREQ()

NetSim_PACKET * fn_NetSim_AODV_GenerateRREQ ( NetSim_EVENTDETAILS pstruEventDetails)

This function is used to genereate an AODV Route Request Packet. It Adds the RREQ entry in the RREQ sent table.

Definition at line 36 of file RREQ.c.

Here is the call graph for this function:

◆ fn_NetSim_AODV_InsertInRREQSeenTable()

int fn_NetSim_AODV_InsertInRREQSeenTable ( AODV_DEVICE_VAR devVar,
NETSIM_IPAddress  orginator,
unsigned int  nRREQId,
double  dTime 
)

This function inserts the data of a RREQ in the RREQ seen table. It contains the originator IP address.

Definition at line 138 of file RREQ.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_AODV_InterstInRREQSentTable()

int fn_NetSim_AODV_InterstInRREQSentTable ( AODV_DEVICE_VAR devVar,
NETSIM_IPAddress  dest,
int  ttl,
double  dTimout 
)

This functions inserts a RREQ querry in the RREQ sent table

Definition at line 100 of file RREQ.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_AODV_ProcessRREQ()

int fn_NetSim_AODV_ProcessRREQ ( NetSim_EVENTDETAILS pstruEventDetails)

This function process the AODV RREQ. It checks for duplicate entry of the received RREQ packet. If the RREQ packet was received previously, it frees the packet. Else, it adds the RREQ in the AODV seen table, Inserts the reverse route in the Route table. If the device has the Route to the target, it generates a RREP. else it forwards the RREQ.

Definition at line 285 of file RREQ.c.

Here is the call graph for this function:

◆ fn_NetSim_AODV_RetryRREQ()

int fn_NetSim_AODV_RetryRREQ ( NetSim_EVENTDETAILS pstruEventDetails)

This function is used to retry an AODV route request. If the table is NULL or if the table timeout is greater than present time or if the number of RREQ exceeds the RREQ_RETRY_LIMIT, then RREQ is not sent again.

Else, a RREQ packet is generated and a NETWORK_OUT_EVENT is added.

Definition at line 179 of file RREQ.c.

Here is the call graph for this function:

◆ fnCheckRREQSeenTable()

bool fnCheckRREQSeenTable ( AODV_DEVICE_VAR devVar,
AODV_RREQ rreq 
)

This function checks if the RREQ is there in the AODV seen table

Definition at line 342 of file RREQ.c.

Here is the caller graph for this function:

◆ fnDeleteRREQSentTable()

int fnDeleteRREQSentTable ( AODV_DEVICE_VAR devVar,
AODV_RREQ_SENT_TABLE table 
)

This function deletes the RREQ snet table

Definition at line 273 of file RREQ.c.

Here is the caller graph for this function:

◆ fnFindSentTable()

AODV_RREQ_SENT_TABLE * fnFindSentTable ( AODV_DEVICE_VAR devVar,
NETSIM_IPAddress  ip 
)

This function is used to find if a RREQ to the given ip is sent. This is searched in the RREQ_SENT_TABLE. If an entry is encountered, the corresponding table is returned. Else NULL is returned.

Definition at line 86 of file RREQ.c.

Here is the caller graph for this function:

◆ fnGetTimeoutTime()

double fnGetTimeoutTime ( int  ttl,
int  count 
)

This function returns the traversal time

Definition at line 264 of file RREQ.c.

Here is the caller graph for this function:

◆ fnIncreaseTTL()

int fnIncreaseTTL ( AODV_DEVICE_VAR devVar,
NETSIM_IPAddress  ip 
)

This function increases the TTL of the RREQ sent table

Definition at line 122 of file RREQ.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ nRREQId

unsigned int nRREQId =0
static

Definition at line 18 of file RREQ.c.