NetSim Source Code Help v14.4
All 13 Components
 
Loading...
Searching...
No Matches
RouteMaint.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#include "main.h"
15#include "AODV.h"
16#include "List.h"
17/**
18This 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}