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

Go to the source code of this file.

Macros

#define _CRT_SECURE_NO_DEPRECATE
 

Functions

static PNETSIM_MACADDRESS read_table (ARP_VARIABLES *arp, NETSIM_IPAddress ip)
 
int fn_NetSim_Read_ARP_Table ()
 

Macro Definition Documentation

◆ _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE

Definition at line 25 of file ReadArpTable.c.

Function Documentation

◆ fn_NetSim_Read_ARP_Table()

int fn_NetSim_Read_ARP_Table ( )

Definition at line 61 of file ReadArpTable.c.

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

◆ read_table()

static PNETSIM_MACADDRESS read_table ( ARP_VARIABLES arp,
NETSIM_IPAddress  ip 
)
static
Function: Read ARP Table
When packet want to transmit the MAC OUT EVENT, the job of Address Resolution Protocol
is to update the destination MAC address in the MAC data of the packet. To do that it
follows the below steps.
1. Check the destination is in the same LAN. If yes, set the nDestinationId as well as
DestinationIP from the packet you received. if not,then set the nDestinationId ZERO
for the DefaultGateway and the DestinationIP as the GatewayIP.
2. Then check the DestinationIP entry present in the ARP table. If present,
set the nDestinationPresentFlag.
3 If nDestinationPresentFlag is set (ONE)then update the DestMAc of MACdata of packet
and forward to MAC layer by keeping the packet in the AccessBuffer of AccessInterface.
4. If nDestinationPresentFlag is not set and pnArpRequestFlag[nDestinationId](request flag
for the destination) is also not set, then buffer the packet and add event by adding
subevent type as GENERATE_ARP_REQUEST.
5. If nDestinationPresentFlag is not set pnArpRequestFlag[nDestinationId] is set, then just
buffer the packet.
@ GENERATE_ARP_REQUEST
Definition: ARP.h:58
@ ONE
Definition: Stack.h:77
@ ZERO
Definition: Stack.h:76

Definition at line 49 of file ReadArpTable.c.

Here is the caller graph for this function: