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

Go to the source code of this file.

Macros

#define _CRT_SECURE_NO_DEPRECATE
 

Functions

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

Macro Definition Documentation

◆ _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE

Definition at line 15 of file GenerateArpReply.c.

Function Documentation

◆ fn_NetSim_Generate_ARP_Reply()

int fn_NetSim_Generate_ARP_Reply ( NetSim_EVENTDETAILS pstruEventDetails,
struct stru_NetSim_Network NETWORK 
)
This function is called whenever the NETWORK_IN_EVENT triggred with the control
packet as REQUEST_PACKET. That is ARP request is received. Then call this
function to generate REPLY_PACKET. Do the following to generate Reply
1.Check for the hardware type, protocol type,MAC address lenth, IP adress length
are correct matching.
2. Check the Source IP and MAC entry present in the table, if not update the table.
3. Check the packet received device is the destination, if not, dicard the packet,
else Generate the REPLY_PACKET by updating its MAC address.
4.Add the control packet to access buffer to farward the packet to next layer.
@ REPLY_PACKET
Definition: ARP.h:89
@ REQUEST_PACKET
Definition: ARP.h:88
@ NETWORK_IN_EVENT
Definition: Stack.h:109
void IP(uint state[], uchar in[])
Definition: des.c:116

Definition at line 31 of file GenerateArpReply.c.

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