NetSim Source Code Help v14.4
All 13 Components
 
Loading...
Searching...
No Matches
AODV_CheckRouteFound.c
1/************************************************************************************
2* Copyright (C) 2023 *
3* TETCOS, Bangalore. India *
4* *
5* Tetcos owns the intellectual property rights in the Product and its content. *
6* The copying, redistribution, reselling or publication of any or all of the *
7* Product or its content without express prior written consent of Tetcos is *
8* prohibited. Ownership and / or any other right relating to the software and all *
9* intellectual property rights therein shall remain at all times with Tetcos. *
10* *
11* Author: Shashi Kant Suman *
12* *
13* ---------------------------------------------------------------------------------*/
14
15#include "main.h"
16#include "AODV.h"
17#include "List.h"
18/**
19This function checks if the route to target is present in Route Table
20*/
21bool fn_NetSim_AODV_CheckRouteFound(NETSIM_IPAddress ip, NetSim_EVENTDETAILS* pstruEventDetails)
22{
23 AODV_ROUTETABLE* table = AODV_DEV_VAR(pstruEventDetails->nDeviceId)->routeTable;
24 while(table)
25 {
26 if(!IP_COMPARE(table->DestinationIPAddress,ip))
27 {
28 if(table->Lifetime > pstruEventDetails->dEventTime &&
29 table->routingFlags != AODV_RoutingFlag_InValid)
30 return true;
31 }
32 table = (AODV_ROUTETABLE*)LIST_NEXT(table);
33 }
34 return false;
35}