NetSim Source Code Help
Loading...
Searching...
No Matches
GenerateArpRequest.c File Reference
#include "main.h"
#include "ARP.h"
Include dependency graph for GenerateArpRequest.c:

Go to the source code of this file.

Macros

#define _CRT_SECURE_NO_DEPRECATE
 

Functions

int fn_NetSim_Generate_ARP_Request (NetSim_EVENTDETAILS *pstruEventDetails, struct stru_NetSim_Network *NETWORK)
 

Macro Definition Documentation

◆ _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE

Definition at line 13 of file GenerateArpRequest.c.

Function Documentation

◆ fn_NetSim_Generate_ARP_Request()

int fn_NetSim_Generate_ARP_Request ( NetSim_EVENTDETAILS pstruEventDetails,
struct stru_NetSim_Network NETWORK 
)
Function: Generate ARP Request
Whenever the ARP Table do not have the destination device MAC address, this function
is called to generate BROARDCAST ARP request. Once the Request packet generated, if
reply won't get, before generating the next request, it has to wait till the
ARP_RETRY_INTERVAL (default 10secs) The number of retries is equal to ARP_RETRY_LIMIT
(default 3). So ARP Request packet generated, buffer the packet till you get reply or
RequestSentCount reaches ARP_RETRY_LIMIT. If you got the reply, farward the buffered
packet, else drop the buffered packets.
Do the following to generate Request
1. Check the RequestFlag. First time it is 0, buffer the packet, Generate the request
and set the flag to 1.
2.Add the relent filelds hardware type, protocol type,MAC address lenth, IP adress length
SrcAddIP, DestAddIP,SrcMacAdd etc relevent fields for ARP request
3.Add the request packet to access buffer to farward the packet to next layer.
4. Generate the Request TimeOut event by adding the ARP_RETRY_INTERVAL to the current event time.
5.When the RequestFlag is 1, buffer the packets

Definition at line 36 of file GenerateArpRequest.c.

Here is the call graph for this function:
Here is the caller graph for this function: