NetSim Source Code Help
Loading...
Searching...
No Matches
ARP.h File Reference
#include "NetSim_utility.h"
Include dependency graph for ARP.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stru_Arp_Packet
 This Arp packet structure is according to RFC 826. More...
 
struct  stru_ARP_Table
 
struct  stru_ArpDataPacket_Buffer
 
struct  stru_ARP_Metrics
 
struct  stru_ARP_Interface_Variables
 
struct  stru_ARP_Static_Table_Configuration
 Structure for Static ARP Table configuration. More...
 

Macros

#define DEFAULT_ARP_RETRY_INTERVAL   10
 
#define DEFAULT_ARP_RETRY_LIMIT   3
 
#define HARDWARE_ADDRESS_LENGTH   6
 Lenghth of 48 bit MAC address in bytes. More...
 
#define ARP_ETHERNET_HEADER_LENGTH   14
 Bytes :6(Dest Mac add)+6(src Mac add)+2(frame type). More...
 
#define IPV4_PROTOCOL_ADDREES_LENGTH   4
 Length of 32 bit IP address in bytes. More...
 
#define IPV4_ARP_PACKET_SIZE   28
 Bytes:2(H/Wtype)+2(ProtocolType)+1(H/Wlength)+1(ProtocolLength)+ 2(opcode)+6(srcMac)+4(srcIP)+6(TargetMac)+4(TargetIP). More...
 
#define IPV4_ARP_PACKET_SIZE_WITH_ETH_HEADER   42
 ARP frame size in Bytes: 28 + 14. More...
 
#define IPV4_NETWORK_OVERHEADS   20
 In bytes for IPV4.
More...
 
#define IPV6_PROTOCOL_ADDREES_LENGTH   16
 Length of 128 bit IP address in bytes. More...
 
#define IPV6_ARP_PACKET_SIZE   52
 bytes:2(H/Wtype)+2(ProtocolType)+1(H/Wlength)+1(ProtocolLength)+ 2(opcode)+6(srcMac)+16(srcIP)+6(TargetMac)+16(TargetIP).
More...
 
#define IPV6_ARP_PACKET_SIZE_WITH_ETH_HEADER   66
 ARP frame size in Bytes: 52 + 14. More...
 
#define IPV6_NETWORK_OVERHEADS   40
 In bytes for IPV6 (320 bits).
More...
 

Typedefs

typedef struct stru_ARP_Table ARP_TABLE
 
typedef struct stru_Arp_Packet ARP_PACKET
 
typedef struct stru_ARP_Interface_Variables ARP_VARIABLES
 
typedef struct stru_ArpDataPacket_Buffer ARP_BUFFER
 
typedef struct stru_ARP_Metrics ARP_METRICS
 
typedef struct stru_ARP_Static_Table_Configuration STATIC_TABLE_CONFIG
 
typedef enum enum_ARP_Subevent_Type SUB_EVENT
 
typedef enum enum_ARP_opcode OPCODE
 
typedef enum enum_ARP_EthernetFrameType ETHERNET_TYPE
 
typedef enum enum_ARP_HardwareType HARDWARETYPE
 
typedef enum enum_ARP_PrptocolType PROTOCOLTYPE
 
typedef enum enum_ArpControlPacket_Type ARP_CONTROL_PACKET
 
typedef enum enum_Transmission_Type ARP_FRAME_TX_FLAG
 
typedef enum enum_ARP_Table_Entries_Type ENTRY_TYPE
 
typedef enum enum_Static_Arp_Status STATIC_ARP_STATUS
 

Enumerations

enum  enum_ARP_Subevent_Type {
  READ_ARP_TABLE = NW_PROTOCOL_ARP*100+1 , GENERATE_ARP_REQUEST , GENERATE_ARP_REPLY , UPDATE_ARP_TABLE_FWD_PKT ,
  ARP_REQUEST_TIMEOUT
}
 
enum  enum_ARP_opcode { ares_opSREQUEST =1 , ares_opSREPLY }
 
enum  enum_ARP_EthernetFrameType { ADDRESS_RESOLUTION = 0x8060 }
 
enum  enum_ARP_HardwareType { ETHERNET = 0x0001 , IEEE802 = 0x0006 }
 
enum  enum_ARP_PrptocolType { ARP_TO_RESOLVE_IP = 0x8000 }
 
enum  enum_ArpControlPacket_Type { REQUEST_PACKET = NW_PROTOCOL_ARP*100+1 , REPLY_PACKET }
 
enum  enum_ARP_Table_Entries_Type { STATIC , DYNAMIC }
 
enum  enum_Static_Arp_Status { DISABLE , ENABLE }
 

Functions

int fn_NetSim_StaticArpTable_Read (char *pszARPstasticTablePath)
 Function to Read the static table and assign to the ARP_TABLE. More...
 
int fn_NetSim_Add_IP_MAC_AddressTo_ARP_Table (ARP_TABLE **, NETSIM_IPAddress, PNETSIM_MACADDRESS, int)
 Function to add the new entry to the ARP_TABLE(IP add, MAC add and Type) More...
 
ARP_TABLEfn_Netsim_CopyArpTable (ARP_TABLE *)
 Function to Copy the ARP_TABLE from source to destination. Returm destination ARP Table head pointer reference. More...
 
void fn_NetSim_DeleteArpTable (ARP_TABLE **)
 Function to Delete/ deallocate the memory assigned to the ARP_TABLE. More...
 
int fn_Netsim_ARP_CheckDestinationDevice (NetSim_EVENTDETAILS *, struct stru_NetSim_Network *)
 
int fn_NetSim_Arp_Drop_Buffered_Packet (NETSIM_ID nDeviceId, NETSIM_ID nInterfaceId, NETSIM_IPAddress szDestIPadd, int *nPacketDropCount)
 
int fn_NetSim_Add_PacketTo_Buffer (NETSIM_ID nDeviceId, NetSim_PACKET *pstruNewPacket, NETSIM_IPAddress szDestIPadd, NETSIM_ID nInterfaceId)
 
int fn_NetSim_ARP_Configure (void **var)
 Function for configuring ARP parameters. More...
 
int fn_NetSim_ARP_Configure_F (void **var)
 
int fn_NetSim_ARP_Init (struct stru_NetSim_Network *NETWORK_Formal, NetSim_EVENTDETAILS *pstruEventDetails_Formal, char *pszAppPath_Formal, char *pszWritePath_Formal, int nVersion_Type, void **fnPointer)
 Function for Intializing ARP protocol. More...
 
int fn_NetSim_ARP_Init_F (struct stru_NetSim_Network *, NetSim_EVENTDETAILS *, char *, char *, int, void **fnPointer)
 
int fn_NetSim_ARP_Run ()
 Function to run ARP protocol. More...
 
int fn_NetSim_ARP_Finish ()
 Function to free the ARP protocol variable and Unload the primitives. More...
 
int fn_NetSim_ARP_Finish_F ()
 
char * fn_NetSim_ARP_Trace (int nSubEvent)
 Return the subevent name with respect to the subevent number for writting event trace. More...
 
char * fn_NetSim_ARP_Trace_F (int nSubEvent)
 
int fn_NetSim_ARP_FreePacket (NetSim_PACKET *)
 Function to free the allocated memory for the ARP packet. More...
 
int fn_NetSim_ARP_FreePacket_F (NetSim_PACKET *)
 
int fn_NetSim_ARP_CopyPacket (NetSim_PACKET *, NetSim_PACKET *)
 Function to copy the ARP packet from source to destination. More...
 
int fn_NetSim_ARP_CopyPacket_F (NetSim_PACKET *, NetSim_PACKET *)
 
int fn_NetSim_ARP_Metrics (char *)
 Function to write ARP Metrics into Metrics.txt. More...
 
int fn_NetSim_ARP_Metrics_F (char *)
 
char * fn_NetSim_ARP_ConfigPacketTrace ()
 
char * fn_NetSim_ARP_WritePacketTrace (NetSim_PACKET *pstruPacket, char **ppszTrace)
 
int fn_NetSim_ipv4_network_check (char *, char *, char *)
 Function used to check the destination is in the same subnet or not from IPV4.lib. More...
 
int fn_NetSim_Generate_ARP_Request (NetSim_EVENTDETAILS *pstruEventDetails, struct stru_NetSim_Network *NETWORK)
 
int fn_NetSim_Read_ARP_Table (NetSim_EVENTDETAILS *pstruEventDetails, struct stru_NetSim_Network *NETWORK)
 
int fn_NetSim_ARP_Request_Timeout (NetSim_EVENTDETAILS *pstruEventDetails, struct stru_NetSim_Network *NETWORK)
 
int fn_NetSim_Generate_ARP_Reply (NetSim_EVENTDETAILS *pstruEventDetails, struct stru_NetSim_Network *NETWORK)
 
int fn_NetSim_Update_ARP_Table_ForwardPacket (NetSim_EVENTDETAILS *pstruEventDetails, struct stru_NetSim_Network *NETWORK)
 

Variables

NETSIM_IPAddress szBroadcastIPaddress
 
STATIC_TABLE_CONFIGg_pstruStaticTableConfig
 

Macro Definition Documentation

◆ ARP_ETHERNET_HEADER_LENGTH

#define ARP_ETHERNET_HEADER_LENGTH   14

Bytes :6(Dest Mac add)+6(src Mac add)+2(frame type).

Definition at line 25 of file ARP.h.

◆ DEFAULT_ARP_RETRY_INTERVAL

#define DEFAULT_ARP_RETRY_INTERVAL   10

Definition at line 20 of file ARP.h.

◆ DEFAULT_ARP_RETRY_LIMIT

#define DEFAULT_ARP_RETRY_LIMIT   3

Definition at line 21 of file ARP.h.

◆ HARDWARE_ADDRESS_LENGTH

#define HARDWARE_ADDRESS_LENGTH   6

Lenghth of 48 bit MAC address in bytes.

Definition at line 24 of file ARP.h.

◆ IPV4_ARP_PACKET_SIZE

#define IPV4_ARP_PACKET_SIZE   28

Bytes:2(H/Wtype)+2(ProtocolType)+1(H/Wlength)+1(ProtocolLength)+ 2(opcode)+6(srcMac)+4(srcIP)+6(TargetMac)+4(TargetIP).

Definition at line 27 of file ARP.h.

◆ IPV4_ARP_PACKET_SIZE_WITH_ETH_HEADER

#define IPV4_ARP_PACKET_SIZE_WITH_ETH_HEADER   42

ARP frame size in Bytes: 28 + 14.

Definition at line 28 of file ARP.h.

◆ IPV4_NETWORK_OVERHEADS

#define IPV4_NETWORK_OVERHEADS   20

In bytes for IPV4.

Definition at line 29 of file ARP.h.

◆ IPV4_PROTOCOL_ADDREES_LENGTH

#define IPV4_PROTOCOL_ADDREES_LENGTH   4

Length of 32 bit IP address in bytes.

Definition at line 26 of file ARP.h.

◆ IPV6_ARP_PACKET_SIZE

#define IPV6_ARP_PACKET_SIZE   52

bytes:2(H/Wtype)+2(ProtocolType)+1(H/Wlength)+1(ProtocolLength)+ 2(opcode)+6(srcMac)+16(srcIP)+6(TargetMac)+16(TargetIP).

Definition at line 31 of file ARP.h.

◆ IPV6_ARP_PACKET_SIZE_WITH_ETH_HEADER

#define IPV6_ARP_PACKET_SIZE_WITH_ETH_HEADER   66

ARP frame size in Bytes: 52 + 14.

Definition at line 32 of file ARP.h.

◆ IPV6_NETWORK_OVERHEADS

#define IPV6_NETWORK_OVERHEADS   40

In bytes for IPV6 (320 bits).

Definition at line 33 of file ARP.h.

◆ IPV6_PROTOCOL_ADDREES_LENGTH

#define IPV6_PROTOCOL_ADDREES_LENGTH   16

Length of 128 bit IP address in bytes.

Definition at line 30 of file ARP.h.

Typedef Documentation

◆ ARP_BUFFER

Definition at line 40 of file ARP.h.

◆ ARP_CONTROL_PACKET

Definition at line 49 of file ARP.h.

◆ ARP_FRAME_TX_FLAG

typedef enum enum_Transmission_Type ARP_FRAME_TX_FLAG

Definition at line 50 of file ARP.h.

◆ ARP_METRICS

typedef struct stru_ARP_Metrics ARP_METRICS

Definition at line 41 of file ARP.h.

◆ ARP_PACKET

typedef struct stru_Arp_Packet ARP_PACKET

Definition at line 38 of file ARP.h.

◆ ARP_TABLE

typedef struct stru_ARP_Table ARP_TABLE

Definition at line 37 of file ARP.h.

◆ ARP_VARIABLES

Definition at line 39 of file ARP.h.

◆ ENTRY_TYPE

Definition at line 51 of file ARP.h.

◆ ETHERNET_TYPE

Definition at line 46 of file ARP.h.

◆ HARDWARETYPE

Definition at line 47 of file ARP.h.

◆ OPCODE

typedef enum enum_ARP_opcode OPCODE

Definition at line 45 of file ARP.h.

◆ PROTOCOLTYPE

Definition at line 48 of file ARP.h.

◆ STATIC_ARP_STATUS

Definition at line 52 of file ARP.h.

◆ STATIC_TABLE_CONFIG

Definition at line 42 of file ARP.h.

◆ SUB_EVENT

Definition at line 44 of file ARP.h.

Enumeration Type Documentation

◆ enum_ARP_EthernetFrameType

Enumeration for Ethernet frame type

Enumerator
ADDRESS_RESOLUTION 

Definition at line 70 of file ARP.h.

◆ enum_ARP_HardwareType

Enumeration for hardware type

Enumerator
ETHERNET 
IEEE802 

Definition at line 75 of file ARP.h.

◆ enum_ARP_opcode

Enumeration for Operation code to specify Packet Type

Enumerator
ares_opSREQUEST 
ares_opSREPLY 

Definition at line 64 of file ARP.h.

◆ enum_ARP_PrptocolType

Enumeration for protocol type

Enumerator
ARP_TO_RESOLVE_IP 

Definition at line 81 of file ARP.h.

◆ enum_ARP_Subevent_Type

Enumeration for Sub event Type

Enumerator
READ_ARP_TABLE 
GENERATE_ARP_REQUEST 
GENERATE_ARP_REPLY 
UPDATE_ARP_TABLE_FWD_PKT 
ARP_REQUEST_TIMEOUT 

Definition at line 55 of file ARP.h.

◆ enum_ARP_Table_Entries_Type

Enumeration for ARP Table entries type

Enumerator
STATIC 
DYNAMIC 

Definition at line 92 of file ARP.h.

◆ enum_ArpControlPacket_Type

Enumeration for ARP control packet type

Enumerator
REQUEST_PACKET 
REPLY_PACKET 

Definition at line 86 of file ARP.h.

◆ enum_Static_Arp_Status

Enumeration for static ARP status

Enumerator
DISABLE 
ENABLE 

Definition at line 98 of file ARP.h.

Function Documentation

◆ fn_NetSim_Add_IP_MAC_AddressTo_ARP_Table()

int fn_NetSim_Add_IP_MAC_AddressTo_ARP_Table ( ARP_TABLE **  ,
NETSIM_IPAddress  ,
PNETSIM_MACADDRESS  ,
int   
)

Function to add the new entry to the ARP_TABLE(IP add, MAC add and Type)

Here is the caller graph for this function:

◆ fn_NetSim_Add_PacketTo_Buffer()

int fn_NetSim_Add_PacketTo_Buffer ( NETSIM_ID  nDeviceId,
NetSim_PACKET pstruNewPacket,
NETSIM_IPAddress  szDestIPadd,
NETSIM_ID  nInterfaceId 
)
Here is the caller graph for this function:

◆ fn_Netsim_ARP_CheckDestinationDevice()

int fn_Netsim_ARP_CheckDestinationDevice ( NetSim_EVENTDETAILS pstruEventDetails,
struct stru_NetSim_Network NETWORK 
)

This function is called for NETWORK_IN_EVENT with packet type = REQUEST_PACKET. Check the request packet received device is the destination. If so it add the GENERATE ARP REPLY sub event, else update the table and drop the request packet.

Definition at line 176 of file Arp.c.

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

◆ fn_NetSim_ARP_ConfigPacketTrace()

char * fn_NetSim_ARP_ConfigPacketTrace ( )

This function will return the string to write packet trace heading.

Definition at line 157 of file Arp.c.

◆ fn_NetSim_ARP_Configure()

int fn_NetSim_ARP_Configure ( void **  var)

Function for configuring ARP parameters.

This function is called by NetworkStack.dll, while configuring the device for ARP protocol.

Definition at line 128 of file Arp.c.

Here is the call graph for this function:

◆ fn_NetSim_ARP_Configure_F()

int fn_NetSim_ARP_Configure_F ( void **  var)
Here is the caller graph for this function:

◆ fn_NetSim_ARP_CopyPacket()

int fn_NetSim_ARP_CopyPacket ( NetSim_PACKET pstruDestPacket,
NetSim_PACKET pstruSrcPacket 
)

Function to copy the ARP packet from source to destination.

This function is called by NetworkStack.dll, to copy the ARP protocol details from source packet to destination.

Definition at line 143 of file Arp.c.

Here is the call graph for this function:

◆ fn_NetSim_ARP_CopyPacket_F()

int fn_NetSim_ARP_CopyPacket_F ( NetSim_PACKET ,
NetSim_PACKET  
)
Here is the caller graph for this function:

◆ fn_NetSim_Arp_Drop_Buffered_Packet()

int fn_NetSim_Arp_Drop_Buffered_Packet ( NETSIM_ID  nDeviceId,
NETSIM_ID  nInterfaceId,
NETSIM_IPAddress  szDestIPadd,
int *  nPacketDropCount 
)
Here is the caller graph for this function:

◆ fn_NetSim_ARP_Finish()

int fn_NetSim_ARP_Finish ( )

Function to free the ARP protocol variable and Unload the primitives.

This function is called by NetworkStack.dll, once simulation end to free the allocated memory for the network.

Definition at line 111 of file Arp.c.

Here is the call graph for this function:

◆ fn_NetSim_ARP_Finish_F()

int fn_NetSim_ARP_Finish_F ( )
Here is the caller graph for this function:

◆ fn_NetSim_ARP_FreePacket()

int fn_NetSim_ARP_FreePacket ( NetSim_PACKET pstruPacket)

Function to free the allocated memory for the ARP packet.

This function is called by NetworkStack.dll, to free the ARP protocol.

Definition at line 135 of file Arp.c.

Here is the call graph for this function:

◆ fn_NetSim_ARP_FreePacket_F()

int fn_NetSim_ARP_FreePacket_F ( NetSim_PACKET )
Here is the caller graph for this function:

◆ fn_NetSim_ARP_Init()

int fn_NetSim_ARP_Init ( struct stru_NetSim_Network NETWORK_Formal,
NetSim_EVENTDETAILS pstruEventDetails_Formal,
char *  pszAppPath_Formal,
char *  pszWritePath_Formal,
int  nVersion_Type,
void **  fnPointer 
)

Function for Intializing ARP protocol.

The Following functions are present in the Arp.lib.
so NetworkStack.dll can not call Arp.lib. It is calling Arp.dll.
From Arp.dll, Arp.lib functions are called.

Definition at line 99 of file Arp.c.

Here is the call graph for this function:

◆ fn_NetSim_ARP_Init_F()

int fn_NetSim_ARP_Init_F ( struct stru_NetSim_Network ,
NetSim_EVENTDETAILS ,
char *  ,
char *  ,
int  ,
void **  fnPointer 
)
Here is the caller graph for this function:

◆ fn_NetSim_ARP_Metrics()

int fn_NetSim_ARP_Metrics ( char *  )

Function to write ARP Metrics into Metrics.txt.

◆ fn_NetSim_ARP_Metrics_F()

int fn_NetSim_ARP_Metrics_F ( char *  )

◆ fn_NetSim_ARP_Request_Timeout()

int fn_NetSim_ARP_Request_Timeout ( NetSim_EVENTDETAILS pstruEventDetails,
struct stru_NetSim_Network NETWORK 
)
Function: ARP Request Timeout
When we generate Arp Request, we will add the Timeout event with the present
event time + ARP_RETRY_INTERVAL. At that time this function is called.
Do the following to generate Request
1. Check the destination entry present in the table and set nDestinationPresentFlag.
2. if nDestinationPresentFlag =0 Check RetryCont<RetryLimit.
3. if true generate ARP request, reset pnArpRequestFlag, increament nArpRequestSentCount.
4. else drop the buffered packets and reset the RetryCount and RequestFlag.
3. if nDestinationPresentFlag set,drop temp packet and reset RetryCount and RequestFlag

*if(szNextHopIp)

Definition at line 32 of file RequestTimeOut.c.

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

◆ fn_NetSim_ARP_Run()

int fn_NetSim_ARP_Run ( )

Function to run ARP protocol.

This function is called by NetworkStack.dll, whenever the event gets triggered
inside the NetworkStack.dll for the ARP protocol

Definition at line 22 of file Arp.c.

Here is the call graph for this function:

◆ fn_NetSim_ARP_Trace()

char * fn_NetSim_ARP_Trace ( int  nSubEvent)

Return the subevent name with respect to the subevent number for writting event trace.

This function is called by NetworkStack.dll, while writing the evnt trace to get the sub event as a string.

Definition at line 120 of file Arp.c.

Here is the call graph for this function:

◆ fn_NetSim_ARP_Trace_F()

char * fn_NetSim_ARP_Trace_F ( int  nSubEvent)
Here is the caller graph for this function:

◆ fn_NetSim_ARP_WritePacketTrace()

char * fn_NetSim_ARP_WritePacketTrace ( NetSim_PACKET pstruPacket,
char **  ppszTrace 
)

This function will return the string to write packet trace.

Definition at line 164 of file Arp.c.

◆ fn_Netsim_CopyArpTable()

ARP_TABLE * fn_Netsim_CopyArpTable ( ARP_TABLE )

Function to Copy the ARP_TABLE from source to destination. Returm destination ARP Table head pointer reference.

◆ fn_NetSim_DeleteArpTable()

void fn_NetSim_DeleteArpTable ( ARP_TABLE **  )

Function to Delete/ deallocate the memory assigned to the ARP_TABLE.

◆ 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:

◆ 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:

◆ fn_NetSim_ipv4_network_check()

int fn_NetSim_ipv4_network_check ( char *  ,
char *  ,
char *   
)

Function used to check the destination is in the same subnet or not from IPV4.lib.

◆ fn_NetSim_Read_ARP_Table()

int fn_NetSim_Read_ARP_Table ( NetSim_EVENTDETAILS pstruEventDetails,
struct stru_NetSim_Network NETWORK 
)

◆ fn_NetSim_StaticArpTable_Read()

int fn_NetSim_StaticArpTable_Read ( char *  pszARPstasticTablePath)

Function to Read the static table and assign to the ARP_TABLE.

◆ fn_NetSim_Update_ARP_Table_ForwardPacket()

int fn_NetSim_Update_ARP_Table_ForwardPacket ( NetSim_EVENTDETAILS pstruEventDetails,
struct stru_NetSim_Network NETWORK 
)
Function: Update Arp Table and Farward Packet
This function is called whenever the NETWORK_IN_EVENT triggred with the control
packet as REPLY_PACKET. That is ARP reply is received. Then call this function to
update the MAC address and forward the buffred packet. Do the following,
1.Update the ARP table by updating the destination IP and MAC address
2.Take the buffered packet, update the destination MAC address and add the 20 byte IP header.
3.Add the packet to access buffer to forward the packet to next layer.

Definition at line 38 of file UpdateArpTable.c.

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

Variable Documentation

◆ g_pstruStaticTableConfig

STATIC_TABLE_CONFIG* g_pstruStaticTableConfig

Definition at line 171 of file ARP.h.

◆ szBroadcastIPaddress

NETSIM_IPAddress szBroadcastIPaddress

Definition at line 168 of file ARP.h.