13#define _CRT_SECURE_NO_DEPRECATE
45 unsigned int unProtocolId;
66 szDestIPadd = szNextHopIp;
88 fnNetSimError(
"ARP--- Packet nexthop and gateway in different LAN\nSrc IP = %s\tDest IP =%s\n",sip,dip);
NETSIM_IPAddress szBroadcastIPaddress
#define IPV4_PROTOCOL_ADDREES_LENGTH
Length of 32 bit IP address in bytes.
#define IPV4_ARP_PACKET_SIZE_WITH_ETH_HEADER
ARP frame size in Bytes: 28 + 14.
#define IPV6_NETWORK_OVERHEADS
In bytes for IPV6 (320 bits).
#define IPV6_PROTOCOL_ADDREES_LENGTH
Length of 128 bit IP address in bytes.
#define IPV4_NETWORK_OVERHEADS
In bytes for IPV4.
#define HARDWARE_ADDRESS_LENGTH
Lenghth of 48 bit MAC address in bytes.
#define IPV6_ARP_PACKET_SIZE_WITH_ETH_HEADER
ARP frame size in Bytes: 52 + 14.
int fn_NetSim_Generate_ARP_Request(NetSim_EVENTDETAILS *pstruEventDetails, struct stru_NetSim_Network *NETWORK)
NETSIM_IPAddress IP_COPY(NETSIM_IPAddress ip)
#define IP_TO_STR(ip, ipstr)
#define IP_IS_IN_SAME_NETWORK_IPV4(ip1, ip2, subnet)
#define IP_COMPARE(ip1, ip2)
#define fnNetSimError(x,...)
#define fnpAllocateMemory(count, size)
bool fn_NetSim_GetBufferStatus(NetSim_BUFFER *pstruBuffer)
NETSIM_ID get_first_dest_from_packet(NetSim_PACKET *packet)
void remove_dest_from_packet(NetSim_PACKET *packet, NETSIM_ID dest)
void add_dest_to_packet(NetSim_PACKET *packet, NETSIM_ID dest)
NETWORK_LAYER_PROTOCOL fn_NetSim_Stack_GetNWProtocol(NETSIM_ID nDeviceId)
EXPORTED PNETSIM_MACADDRESS BROADCAST_MAC
#define DEVICE_NWADDRESS(DeviceId, InterfaceId)
MAC_LAYER_PROTOCOL fn_NetSim_Stack_GetMacProtocol(NETSIM_ID nDeviceId, NETSIM_ID nInterfaceId)
EXPORTED struct stru_NetSim_Network * NETWORK
EXPORTED struct stru_NetSim_EventDetails * pstruEventDetails
#define DEVICE_INTERFACE(DeviceId, InterfaceId)
#define fn_NetSim_Packet_CopyPacket(pstruPacket)
#define fn_NetSim_Packet_CreatePacket(layer)
#define fnpAddEvent(pstruEvent)
#define fn_NetSim_Packet_AddPacketToList(pstruBuffer, pstruPacket, nInsertionType)
int * pnArpRequestFlag
Set when generate Request.
int * pnArpRetryCount
To keep track of number of retries.
ARP_METRICS * pstruArpMetrics
NetSim specific ARP metrics structure.
int nArpRetryInterval
Store the ARP_RETRY_INTERVAL from the config file
int nArpRequestSentCount
Number of requests sent from the source
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_NetSim_Packet * pPacket
PNETSIM_MACADDRESS szDestMac
PNETSIM_MACADDRESS szSourceMac
NETWORK_LAYER_PROTOCOL nNetworkProtocol
NETSIM_IPAddress szDestIP
void * Packet_NetworkProtocol
NETSIM_IPAddress szNextHopIp
NETSIM_IPAddress szSourceIP
struct stru_NetSim_Packet_NetworkLayer * pstruNetworkData
unsigned int nControlDataType
struct stru_NetSim_Packet * pstruNextPacket
PACKET_PRIORITY nPacketPriority
struct stru_NetSim_Packet_MACLayer * pstruMacData
char str_ip[_NETSIM_IP_LEN]