20#define DEFAULT_ARP_RETRY_INTERVAL 10
21#define DEFAULT_ARP_RETRY_LIMIT 3
24#define HARDWARE_ADDRESS_LENGTH 6
25#define ARP_ETHERNET_HEADER_LENGTH 14
26#define IPV4_PROTOCOL_ADDREES_LENGTH 4
27#define IPV4_ARP_PACKET_SIZE 28
28#define IPV4_ARP_PACKET_SIZE_WITH_ETH_HEADER 42
29#define IPV4_NETWORK_OVERHEADS 20
30#define IPV6_PROTOCOL_ADDREES_LENGTH 16
31#define IPV6_ARP_PACKET_SIZE 52
32#define IPV6_ARP_PACKET_SIZE_WITH_ETH_HEADER 66
33#define IPV6_NETWORK_OVERHEADS 40
int fn_NetSim_ARP_FreePacket_F(NetSim_PACKET *)
int fn_NetSim_ARP_Metrics_F(char *)
ARP_TABLE * fn_Netsim_CopyArpTable(ARP_TABLE *)
Function to Copy the ARP_TABLE from source to destination. Returm destination ARP Table head pointer ...
char * fn_NetSim_ARP_Trace(int nSubEvent)
Return the subevent name with respect to the subevent number for writting event trace.
NETSIM_IPAddress szBroadcastIPaddress
enum enum_Transmission_Type ARP_FRAME_TX_FLAG
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)
int fn_Netsim_ARP_CheckDestinationDevice(NetSim_EVENTDETAILS *, struct stru_NetSim_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)
STATIC_TABLE_CONFIG * g_pstruStaticTableConfig
int fn_NetSim_ARP_Run()
Function to run ARP protocol.
int fn_NetSim_ARP_CopyPacket_F(NetSim_PACKET *, NetSim_PACKET *)
int fn_NetSim_ARP_Metrics(char *)
Function to write ARP Metrics into Metrics.txt.
int fn_NetSim_ARP_Init_F(struct stru_NetSim_Network *, NetSim_EVENTDETAILS *, char *, char *, int, void **fnPointer)
enum enum_ARP_PrptocolType PROTOCOLTYPE
char * fn_NetSim_ARP_ConfigPacketTrace()
int fn_NetSim_ARP_Finish()
Function to free the ARP protocol variable and Unload the primitives.
enum enum_ArpControlPacket_Type ARP_CONTROL_PACKET
enum_ARP_EthernetFrameType
int fn_NetSim_ARP_Finish_F()
int fn_NetSim_ARP_Configure(void **var)
Function for configuring ARP parameters.
char * fn_NetSim_ARP_WritePacketTrace(NetSim_PACKET *pstruPacket, char **ppszTrace)
enum enum_ARP_HardwareType HARDWARETYPE
int fn_NetSim_ARP_Request_Timeout(NetSim_EVENTDETAILS *pstruEventDetails, struct stru_NetSim_Network *NETWORK)
int fn_NetSim_Arp_Drop_Buffered_Packet(NETSIM_ID nDeviceId, NETSIM_ID nInterfaceId, NETSIM_IPAddress szDestIPadd, int *nPacketDropCount)
int fn_NetSim_StaticArpTable_Read(char *pszARPstasticTablePath)
Function to Read the static table and assign to the ARP_TABLE.
enum_ArpControlPacket_Type
enum enum_ARP_Subevent_Type SUB_EVENT
int fn_NetSim_ARP_FreePacket(NetSim_PACKET *)
Function to free the allocated memory for the ARP packet.
enum enum_Static_Arp_Status STATIC_ARP_STATUS
int fn_NetSim_Add_PacketTo_Buffer(NETSIM_ID nDeviceId, NetSim_PACKET *pstruNewPacket, NETSIM_IPAddress szDestIPadd, NETSIM_ID nInterfaceId)
enum enum_ARP_opcode OPCODE
@ UPDATE_ARP_TABLE_FWD_PKT
int fn_NetSim_ARP_Configure_F(void **var)
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.
enum_ARP_Table_Entries_Type
int fn_NetSim_Generate_ARP_Request(NetSim_EVENTDETAILS *pstruEventDetails, struct stru_NetSim_Network *NETWORK)
char * fn_NetSim_ARP_Trace_F(int nSubEvent)
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.
void fn_NetSim_DeleteArpTable(ARP_TABLE **)
Function to Delete/ deallocate the memory assigned to the ARP_TABLE.
enum enum_ARP_EthernetFrameType ETHERNET_TYPE
enum enum_ARP_Table_Entries_Type ENTRY_TYPE
int fn_NetSim_ARP_CopyPacket(NetSim_PACKET *, NetSim_PACKET *)
Function to copy the ARP packet from source to destination.
#define _declspec(dllexport)
This function is used to trigger the update.
NetSim_EVENTDETAILS * pstruEventDetails_Formal
NetSim_EVENTDETAILS char * pszAppPath_Formal
NetSim_EVENTDETAILS char char int nVersion_Type
NetSim_EVENTDETAILS char char * pszWritePath_Formal
NetSim_EVENTDETAILS char char int void ** fnPointer
int fn_NetSim_Read_ARP_Table()
EXPORTED struct stru_NetSim_Network * NETWORK
EXPORTED struct stru_NetSim_EventDetails * pstruEventDetails
int * pnArpRequestFlag
Set when generate Request.
ARP_BUFFER * pstruPacketBuffer
int * pnArpRetryCount
To keep track of number of retries.
int nArpRetryLimit
Store the ARP_RETRY_LIMIT from the config file.
int nStaticTableFlag
Check ARP_TABLE intialized by static table or not.
ARP_METRICS * pstruArpMetrics
NetSim specific ARP metrics structure.
ARP_TABLE * pstruArpTable
int nArpRetryInterval
Store the ARP_RETRY_INTERVAL from the config file
int * pnArpReplyFlag
Set when receive the Reply.
int nArpRequestSentCount
Number of requests sent from the source
int nPacketsInBuffer
Number of packets in the buffer
int nArpReplyReceivedCount
Number of replies received from destination.
int nArpReplySentCount
Number of replies sent from the destination.
Structure for Static ARP Table configuration.
STATIC_ARP_STATUS nStaticArpFlag
char * pszFilePath
Stores File path.
char * pszFileName
Stores File Name.
PNETSIM_MACADDRESS szMACAddress
MAC address or Hardware address of the device
ENTRY_TYPE nType
0-Static,1-Dynamic.
struct stru_ARP_Table * pstruNextEntry
Next entry pointer.
NETSIM_IPAddress szIPAddress
IP address of the deivce
This Arp packet structure is according to RFC 826.
PNETSIM_MACADDRESS szDestMac
Destination MAC address.
unsigned short int usn_ar$pln
Protocol address length 1 byte,specifies the sizes of the protocol address in bytes.
ETHERNET_TYPE nEther_type
Ethernet Type.
NETSIM_IPAddress sz_ar$spa
Protocol address of the sender.
PNETSIM_MACADDRESS sz_ar$tha
Hardware address of target (if know) otherwise empty 6 bytes.
OPCODE n_ar$op
Operation REQUEST/REPLY 2 bytes.
unsigned short int usn_ar$hln
H/W address length 1 byte ,specifies the sizes of the H/W address in bytes.
HARDWARETYPE n_ar$hrd
Hardware Type 2 bytes.
PNETSIM_MACADDRESS sz_ar$sha
Hardware address of the sender.
PNETSIM_MACADDRESS szSrcMac
Source MAC address.
PROTOCOLTYPE n_ar$pro
Protocol Type 2 bytes.
NETSIM_IPAddress sz_ar$tpa
Protocol address of target.
struct stru_ArpDataPacket_Buffer * pstruNextBuffer
NETSIM_IPAddress szDestAdd
Store the destination IP address.
NetSim_PACKET * pstruPacket
Store the packet
NETSIM_ID nBufferInterfaceID
Store the InterfaceId while buffering the packet.