NetSim Source Code Help
Loading...
Searching...
No Matches
RIP.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stru_Router_RIP_Routing_database
 Routing database structure Reference : RFC 2453, November 1998, Page 8. More...
 
struct  stru_NetSim_RIP_Packet
 
struct  stru_RIPEntry
 
struct  stru_RIP
 

Macros

#define RIP_PACKET_SIZE_WITH_HEADER   512
 
#define RIP_PORT   520
 
#define EXPIRED_ROUTE   16
 
#define _RIP_Trace
 

Typedefs

typedef struct stru_NetSim_Router DEVICE_ROUTER
 
typedef struct stru_Router_Buffer BUFFER_ROUTER
 
typedef struct stru_NetSim_RIP_Packet RIP_PACKET
 
typedef struct stru_Router_RIP_Routing_database RIP_ROUTING_DATABASE
 
typedef struct stru_RIP_TempRouting_database RIP_TEMPROUTING_DATABASE
 
typedef struct stru_RIPEntry RIP_ENTRY
 
typedef enum enum_RIP_command RIP_COMMAND
 
typedef enum enum_RIP_Subevent_Type SUB_EVENT
 

Enumerations

enum  enum_RIP_Subevent_Type { SEND_RIP_UPDATE_PKT =APP_PROTOCOL_RIP*100+1 , RIP_TIMEOUT , RIP_GARBAGE_COLLECTION , ROUTING_TABLE_UPDATION }
 
enum  enum_RIP_command { REQUEST =1 , RESPONSE }
 This enumeration is to denote the command field in RIP packet. More...
 
enum  enum_RIP_ControlPacketType { RIP_Packet = APP_PROTOCOL_RIP*100+1 }
 

Functions

int fn_NetSim_RIP_InitialTable_Creation (NETSIM_ID nDeviceId)
 This function is for forming the initial table for each router
More...
 
int fn_NetSim_RIP_UpdatingEntriesinRoutingDatabase (struct stru_NetSim_Network *, int, NETSIM_IPAddress, NETSIM_IPAddress, NETSIM_IPAddress, NETSIM_ID, double, unsigned int)
 This function is used to update the database of router. More...
 
 _declspec (dllexport) int fn_NetSim_RIP_ReceivingOf_RIP_Message(struct stru_NetSim_Network *
 This function is used receive the updates from neighbor routers. More...
 
NetSim_EVENTDETAILS NetSim_EVENTDETAILS *int fn_NetSim_RIP_Run_F ()
 
int fn_NetSim_RIPTrace (struct stru_NetSim_Network *, NETSIM_ID, int)
 
int fn_NetSim_RIP_Init_F (struct stru_NetSim_Network *, NetSim_EVENTDETAILS *, char *, char *, int, void **fnPointer)
 
int fn_NetSim_RIP_Finish_F ()
 
char * fn_NetSim_RIP_Trace_F (int nSubEvent)
 
int fn_NetSim_RIP_FreePacket_F (NetSim_PACKET *)
 
NetSim_PACKET *int fn_NetSim_RIP_CopyPacket_F (NetSim_PACKET *, NetSim_PACKET *)
 
int fn_NetSim_RIP_Metrics_F (PMETRICSWRITER metricsWriter)
 
int fn_NetSim_RIP_DistanceVectorAlgorithm (struct stru_NetSim_Network *NETWORK, NetSim_EVENTDETAILS *pstruEventDetails)
 
int fn_NetSim_RIP_Update_Timer (struct stru_NetSim_Network *pstruNETWORK, NetSim_EVENTDETAILS *pstruEventDetails)
 
int fn_NetSim_RIP_Timeout_Timer (struct stru_NetSim_Network *pstruNETWORK, NetSim_EVENTDETAILS *pstruEventDetails)
 
int fn_NetSim_RIP_Garbage_Collection_Timer (struct stru_NetSim_Network *pstruNETWORK, NetSim_EVENTDETAILS *pstruEventDetails)
 
bool isRIPConfigured (NETSIM_ID d)
 
DEVICE_ROUTERget_RIP_var (NETSIM_ID d)
 
void set_RIP_var (NETSIM_ID d, DEVICE_ROUTER *rip)
 

Variables

FILE * fpRIPTrace
 
NetSim_EVENTDETAILSpstruEventDetails_Formal
 
NetSim_EVENTDETAILS char * pszAppPath_Formal
 
NetSim_EVENTDETAILS char char * pszWritePath_Formal
 
NetSim_EVENTDETAILS char char int nVersion_Type
 
NetSim_EVENTDETAILS char char int void ** fnPointer
 

Macro Definition Documentation

◆ _RIP_Trace

#define _RIP_Trace

Definition at line 32 of file RIP.h.

◆ EXPIRED_ROUTE

#define EXPIRED_ROUTE   16

Definition at line 31 of file RIP.h.

◆ RIP_PACKET_SIZE_WITH_HEADER

#define RIP_PACKET_SIZE_WITH_HEADER   512

Definition at line 28 of file RIP.h.

◆ RIP_PORT

#define RIP_PORT   520

Definition at line 29 of file RIP.h.

Typedef Documentation

◆ BUFFER_ROUTER

Definition at line 37 of file RIP.h.

◆ DEVICE_ROUTER

Definition at line 36 of file RIP.h.

◆ RIP_COMMAND

Definition at line 42 of file RIP.h.

◆ RIP_ENTRY

typedef struct stru_RIPEntry RIP_ENTRY

Definition at line 41 of file RIP.h.

◆ RIP_PACKET

Definition at line 38 of file RIP.h.

◆ RIP_ROUTING_DATABASE

Definition at line 39 of file RIP.h.

◆ RIP_TEMPROUTING_DATABASE

typedef struct stru_RIP_TempRouting_database RIP_TEMPROUTING_DATABASE

Definition at line 40 of file RIP.h.

◆ SUB_EVENT

Definition at line 43 of file RIP.h.

Enumeration Type Documentation

◆ enum_RIP_command

This enumeration is to denote the command field in RIP packet.

Enumerator
REQUEST 
RESPONSE 

Definition at line 58 of file RIP.h.

◆ enum_RIP_ControlPacketType

Enumeration for App Layer Packet Type

Enumerator
RIP_Packet 

Definition at line 66 of file RIP.h.

◆ enum_RIP_Subevent_Type

Enumeration for RIP Sub event Types

Enumerator
SEND_RIP_UPDATE_PKT 
RIP_TIMEOUT 
RIP_GARBAGE_COLLECTION 
ROUTING_TABLE_UPDATION 

Definition at line 48 of file RIP.h.

Function Documentation

◆ _declspec()

_declspec ( dllexport  )

This function is used receive the updates from neighbor routers.

Function to copy the RIP packet from source to destination.

Function to free the allocated memory for the RIP packet.

Return the subevent name with respect to the subevent number for writting event trace.

Function to free the RIP protocol variable and Unload the primitives.

This function is used to trigger the update.

Function for configuring RIP parameters

Function for Intializing RIP protocol

Function to run RIP protocol

◆ fn_NetSim_RIP_CopyPacket_F()

NetSim_PACKET *int fn_NetSim_RIP_CopyPacket_F ( NetSim_PACKET ,
NetSim_PACKET  
)
Here is the caller graph for this function:

◆ fn_NetSim_RIP_DistanceVectorAlgorithm()

int fn_NetSim_RIP_DistanceVectorAlgorithm ( struct stru_NetSim_Network NETWORK,
NetSim_EVENTDETAILS pstruEventDetails 
)
This function runs the distance vector routing algorithm for optimized routing of packets from
source to destination. The optimization is done per a particular metric, i.e the shortest distance.
This algorithm runs inside a single Autonomous System
static struct stru_802_11_Phy_Parameters_HT a

Definition at line 27 of file DistanceVectorAlgorithm.c.

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

◆ fn_NetSim_RIP_Finish_F()

int fn_NetSim_RIP_Finish_F ( )
Here is the caller graph for this function:

◆ fn_NetSim_RIP_FreePacket_F()

int fn_NetSim_RIP_FreePacket_F ( NetSim_PACKET )
Here is the caller graph for this function:

◆ fn_NetSim_RIP_Garbage_Collection_Timer()

int fn_NetSim_RIP_Garbage_Collection_Timer ( struct stru_NetSim_Network pstruNETWORK,
NetSim_EVENTDETAILS pstruEventDetails 
)
Until the garbage-collection timer expires, the route is included in all
updates sent by the router. When the garbage collection timer expires, the route is deleted
from the routing table

Definition at line 27 of file GarbageCollectionTimer.c.

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

◆ fn_NetSim_RIP_Init_F()

int fn_NetSim_RIP_Init_F ( struct stru_NetSim_Network ,
NetSim_EVENTDETAILS ,
char *  ,
char *  ,
int  ,
void **  fnPointer 
)
Here is the caller graph for this function:

◆ fn_NetSim_RIP_InitialTable_Creation()

int fn_NetSim_RIP_InitialTable_Creation ( NETSIM_ID  nDeviceId)

This function is for forming the initial table for each router

◆ fn_NetSim_RIP_Metrics_F()

int fn_NetSim_RIP_Metrics_F ( PMETRICSWRITER  metricsWriter)
Here is the caller graph for this function:

◆ fn_NetSim_RIP_Run_F()

NetSim_EVENTDETAILS NetSim_EVENTDETAILS *int fn_NetSim_RIP_Run_F ( )

This function is used to execute the RIP functionalities.

Definition at line 223 of file RIP.c.

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

◆ fn_NetSim_RIP_Timeout_Timer()

int fn_NetSim_RIP_Timeout_Timer ( struct stru_NetSim_Network pstruNETWORK,
NetSim_EVENTDETAILS pstruEventDetails 
)
The timeout is initialized when a route is established, and any time
an update message is received for the route. If 180 seconds elapse from
the last time the timeout was initialized, the route is considered to
have expired

Definition at line 25 of file TimeoutTimer.c.

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

◆ fn_NetSim_RIP_Trace_F()

char * fn_NetSim_RIP_Trace_F ( int  nSubEvent)
Here is the caller graph for this function:

◆ fn_NetSim_RIP_Update_Timer()

int fn_NetSim_RIP_Update_Timer ( struct stru_NetSim_Network pstruNETWORK,
NetSim_EVENTDETAILS pstruEventDetails 
)
Every 30 seconds, the RIP process is awakened to send an unsolicited response message
containing the complete routing table to every neighboring router.
1. Create the RIP packet
2. Add the RIP packets in the WAN ports of the current router
3. Add the packet in the socket buffer for transmitting the RIP packet

Definition at line 26 of file UpdateTimer.c.

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

◆ fn_NetSim_RIP_UpdatingEntriesinRoutingDatabase()

int fn_NetSim_RIP_UpdatingEntriesinRoutingDatabase ( struct stru_NetSim_Network ,
int  ,
NETSIM_IPAddress  ,
NETSIM_IPAddress  ,
NETSIM_IPAddress  ,
NETSIM_ID  ,
double  ,
unsigned int   
)

This function is used to update the database of router.

Here is the caller graph for this function:

◆ fn_NetSim_RIPTrace()

int fn_NetSim_RIPTrace ( struct stru_NetSim_Network ,
NETSIM_ID  ,
int   
)
Here is the caller graph for this function:

◆ get_RIP_var()

DEVICE_ROUTER * get_RIP_var ( NETSIM_ID  d)
Here is the caller graph for this function:

◆ isRIPConfigured()

bool isRIPConfigured ( NETSIM_ID  d)

◆ set_RIP_var()

void set_RIP_var ( NETSIM_ID  d,
DEVICE_ROUTER rip 
)

Variable Documentation

◆ fnPointer

NetSim_EVENTDETAILS char char int void** fnPointer

Definition at line 178 of file RIP.h.

◆ fpRIPTrace

FILE* fpRIPTrace

Definition at line 33 of file RIP.h.

◆ nVersion_Type

NetSim_EVENTDETAILS char char int nVersion_Type

Definition at line 178 of file RIP.h.

◆ pstruEventDetails_Formal

NetSim_EVENTDETAILS* pstruEventDetails_Formal

Definition at line 178 of file RIP.h.

◆ pszAppPath_Formal

NetSim_EVENTDETAILS char* pszAppPath_Formal

Definition at line 178 of file RIP.h.

◆ pszWritePath_Formal

NetSim_EVENTDETAILS char char* pszWritePath_Formal

Definition at line 178 of file RIP.h.