NetSim Source Code Help
Loading...
Searching...
No Matches
ReceivingRIP.c
Go to the documentation of this file.
1/************************************************************************************
2* Copyright (C) 2020
3*
4* TETCOS, Bangalore. India *
5
6* Tetcos owns the intellectual property rights in the Product and its content. *
7* The copying, redistribution, reselling or publication of any or all of the *
8* Product or its content without express prior written consent of Tetcos is *
9* prohibited. Ownership and / or any other right relating to the software and all *
10* intellectual property rights therein shall remain at all times with Tetcos. *
11
12* Author: Thangarasu.K *
13* ---------------------------------------------------------------------------------*/
14#define _CRT_SECURE_NO_DEPRECATE
15#include "main.h"
16#include "Routing.h"
17/**
18~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 The RIP message from the neighbor routers are received in this function, After receiving
20 the RIP message trigger the timeout timer event
21~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 */
24{
25 NETSIM_ID nDeviceId;
26 double dEventTime;
27 RIP_ENTRY *pstruEntry;
28 // NetSim packet To store the RIP packet
29 NetSim_PACKET *pstruControlPacket = NULL;
30 // RIP PACKET to store RIP packet data
31 RIP_PACKET *pstruPacketRip = NULL;
32 pstruControlPacket=pstruEventDetails->pPacket;
33 pstruPacketRip=pstruControlPacket->pstruAppData->Packet_AppProtocol;
34 pstruEntry=pstruPacketRip->pstruRIPEntry;
35 NETWORK=pstruNETWORK;
37 dEventTime=pstruEventDetails->dEventTime;
44 while(pstruEntry!=NULL)
45 {
47 //Assign the packet size as 512
52 // Add the timeout timer with the event time to trigger the timeout event
55 pstruEntry=pstruEntry->pstru_RIP_NextEntry;
56 }
57 return 0;
58}
59
60
unsigned int NETSIM_ID
Definition: Animation.h:45
#define _declspec(dllexport)
This function is used to trigger the update.
Definition: Linux.h:41
@ RIP_TIMEOUT
Definition: RIP.h:51
@ ROUTING_TABLE_UPDATION
Definition: RIP.h:53
#define RIP_PACKET_SIZE_WITH_HEADER
Definition: RIP.h:28
DEVICE_ROUTER * get_RIP_var(NETSIM_ID d)
int fn_NetSim_RIP_ReceivingOf_RIP_Message(struct stru_NetSim_Network *pstruNETWORK, NetSim_EVENTDETAILS *pstruEventDetails)
Definition: ReceivingRIP.c:23
@ APP_PROTOCOL_RIP
Definition: Stack.h:154
EXPORTED struct stru_NetSim_Network * NETWORK
Definition: Stack.h:742
@ TIMER_EVENT
Definition: Stack.h:114
@ APPLICATION_IN_EVENT
Definition: Stack.h:113
EXPORTED struct stru_NetSim_EventDetails * pstruEventDetails
Definition: Stack.h:837
#define fnpAddEvent(pstruEvent)
Definition: main.h:191
NETSIM_ID nApplicationId
Definition: Stack.h:752
EVENT_TYPE nEventType
Definition: Stack.h:747
NETSIM_ID nProtocolId
Definition: Stack.h:748
struct stru_NetSim_Packet * pPacket
Definition: Stack.h:754
NETSIM_ID nSubEventType
Definition: Stack.h:757
NETSIM_ID nDeviceId
Definition: Stack.h:750
struct stru_NetSim_Packet_AppLayer * pstruAppData
Definition: Packet.h:273
struct stru_RIPEntry * pstruRIPEntry
Definition: RIP.h:105
union stru_NetSim_Router::uni_Interior_Routing uniInteriorRouting
Definition: RIP.h:129
struct stru_RIPEntry * pstru_RIP_NextEntry
Definition: RIP.h:137
unsigned short int nStatus
Definition: RIP.h:148
int n_timeout_timer
Definition: RIP.h:143