NetSim Source Code Help
Loading...
Searching...
No Matches
CheckRouteFound.c
Go to the documentation of this file.
1
/************************************************************************************
2
* Copyright (C) 2020 *
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
#include "
main.h
"
15
#include "
DSR.h
"
16
#include "
List.h
"
17
/**
18
This function checks if the route cache of the device has the route to the Destination
19
*/
20
bool
fn_NetSim_DSR_CheckRouteFound
(
NETSIM_IPAddress
destAddress,
DSR_DEVICE_VAR
* devVar,
NETSIM_IPAddress
* nextHop,
double
dTime,
DSR_ROUTE_CACHE
** cache)
21
{
22
*cache =
DSR_FIND_CACHE
(devVar,destAddress,dTime);
23
if
(*cache)
24
{
25
//Update the next hop
26
*nextHop = (*cache)->address[1];
27
return
true
;
28
}
29
return
false
;
30
}
31
32
fn_NetSim_DSR_CheckRouteFound
bool fn_NetSim_DSR_CheckRouteFound(NETSIM_IPAddress destAddress, DSR_DEVICE_VAR *devVar, NETSIM_IPAddress *nextHop, double dTime, DSR_ROUTE_CACHE **cache)
Definition:
CheckRouteFound.c:20
DSR.h
DSR_FIND_CACHE
#define DSR_FIND_CACHE(devVar, address, dTime)
Definition:
DSR.h:726
List.h
main.h
stru_DSR_DeviceVar
Definition:
DSR.h:654
stru_DSR_RouteCache
Definition:
DSR.h:573
stru_ip
Definition:
IP_Addressing.h:35
ALL
Component 4
DSR
CheckRouteFound.c
Generated on Fri Dec 9 2022 10:22:46 for NetSim Source Code Help by
1.9.5