NetSim Source Code Help
Loading...
Searching...
No Matches
RouteMaint.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 "
AODV.h
"
16
#include "
List.h
"
17
/**
18
This function generates a route error.
19
*/
20
_declspec
(dllexport)
int
fn_NetSim_AODV_PacketDropNotification
(
NetSim_PACKET
* packet)
21
{
22
set_aodv_curr
();
23
AODV_DEVICE_VAR
* var =
AODV_DEV_VAR
(
pstruEventDetails
->
nDeviceId
);
24
if
(var->
nRerrCount
>10)
25
{
26
AODV_GENERATE_RERR
(
pstruEventDetails
->
nDeviceId
,
27
packet->
pstruNetworkData
->
szNextHopIp
);
28
var->
nRerrCount
=1;
29
}
30
var->
nRerrCount
++;
31
return
1;
32
}
AODV.h
set_aodv_curr
void set_aodv_curr()
AODV_GENERATE_RERR
#define AODV_GENERATE_RERR(DevId, UnreachableIP)
Definition:
AODV.h:409
AODV_DEV_VAR
#define AODV_DEV_VAR(devId)
Definition:
AODV.h:413
_declspec
#define _declspec(dllexport)
This function is used to trigger the update.
Definition:
Linux.h:41
List.h
fn_NetSim_AODV_PacketDropNotification
int fn_NetSim_AODV_PacketDropNotification(NetSim_PACKET *packet)
Definition:
RouteMaint.c:20
pstruEventDetails
EXPORTED struct stru_NetSim_EventDetails * pstruEventDetails
Definition:
Stack.h:837
main.h
stru_AODV_DeviceVariable
Definition:
AODV.h:378
stru_AODV_DeviceVariable::nRerrCount
unsigned int nRerrCount
Definition:
AODV.h:386
stru_NetSim_EventDetails::nDeviceId
NETSIM_ID nDeviceId
Definition:
Stack.h:750
stru_NetSim_Packet_NetworkLayer::szNextHopIp
NETSIM_IPAddress szNextHopIp
Definition:
Packet.h:201
stru_NetSim_Packet
Definition:
Packet.h:255
stru_NetSim_Packet::pstruNetworkData
struct stru_NetSim_Packet_NetworkLayer * pstruNetworkData
Definition:
Packet.h:275
ALL
Component 4
AODV
RouteMaint.c
Generated on Fri Dec 9 2022 10:22:46 for NetSim Source Code Help by
1.9.5