![]() |
NetSim Source Code Help
|
#include "NetSim_utility.h"

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 } |
Variables | |
| NETSIM_IPAddress | szBroadcastIPaddress |
| STATIC_TABLE_CONFIG * | g_pstruStaticTableConfig |
| #define ARP_ETHERNET_HEADER_LENGTH 14 |
| #define HARDWARE_ADDRESS_LENGTH 6 |
| #define IPV4_ARP_PACKET_SIZE 28 |
| #define IPV4_ARP_PACKET_SIZE_WITH_ETH_HEADER 42 |
| #define IPV4_PROTOCOL_ADDREES_LENGTH 4 |
| #define IPV6_ARP_PACKET_SIZE 52 |
| #define IPV6_ARP_PACKET_SIZE_WITH_ETH_HEADER 66 |
| #define IPV6_NETWORK_OVERHEADS 40 |
| #define IPV6_PROTOCOL_ADDREES_LENGTH 16 |
| typedef struct stru_ArpDataPacket_Buffer ARP_BUFFER |
| typedef enum enum_ArpControlPacket_Type ARP_CONTROL_PACKET |
| typedef enum enum_Transmission_Type ARP_FRAME_TX_FLAG |
| typedef struct stru_ARP_Metrics ARP_METRICS |
| typedef struct stru_Arp_Packet ARP_PACKET |
| typedef struct stru_ARP_Table ARP_TABLE |
| typedef struct stru_ARP_Interface_Variables ARP_VARIABLES |
| typedef enum enum_ARP_Table_Entries_Type ENTRY_TYPE |
| typedef enum enum_ARP_EthernetFrameType ETHERNET_TYPE |
| typedef enum enum_ARP_HardwareType HARDWARETYPE |
| typedef enum enum_ARP_opcode OPCODE |
| typedef enum enum_ARP_PrptocolType PROTOCOLTYPE |
| typedef enum enum_Static_Arp_Status STATIC_ARP_STATUS |
| typedef struct stru_ARP_Static_Table_Configuration STATIC_TABLE_CONFIG |
| typedef enum enum_ARP_Subevent_Type SUB_EVENT |
| enum enum_ARP_opcode |
| 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_Add_PacketTo_Buffer | ( | NETSIM_ID | nDeviceId, |
| NetSim_PACKET * | pstruNewPacket, | ||
| NETSIM_IPAddress | szDestIPadd, | ||
| NETSIM_ID | nInterfaceId | ||
| ) |

| 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.


| char * fn_NetSim_ARP_ConfigPacketTrace | ( | ) |
| int fn_NetSim_ARP_Configure | ( | void ** | var | ) |
| int fn_NetSim_ARP_Configure_F | ( | void ** | var | ) |

| int fn_NetSim_ARP_CopyPacket | ( | NetSim_PACKET * | pstruDestPacket, |
| NetSim_PACKET * | pstruSrcPacket | ||
| ) |
| int fn_NetSim_ARP_CopyPacket_F | ( | NetSim_PACKET * | , |
| NetSim_PACKET * | |||
| ) |

| int fn_NetSim_Arp_Drop_Buffered_Packet | ( | NETSIM_ID | nDeviceId, |
| NETSIM_ID | nInterfaceId, | ||
| NETSIM_IPAddress | szDestIPadd, | ||
| int * | nPacketDropCount | ||
| ) |

| int fn_NetSim_ARP_Finish | ( | ) |
| int fn_NetSim_ARP_Finish_F | ( | ) |

| int fn_NetSim_ARP_FreePacket | ( | NetSim_PACKET * | pstruPacket | ) |
| int fn_NetSim_ARP_FreePacket_F | ( | NetSim_PACKET * | ) |

| 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 | ||
| ) |
| int fn_NetSim_ARP_Init_F | ( | struct stru_NetSim_Network * | , |
| NetSim_EVENTDETAILS * | , | ||
| char * | , | ||
| char * | , | ||
| int | , | ||
| void ** | fnPointer | ||
| ) |

| int fn_NetSim_ARP_Metrics | ( | char * | ) |
Function to write ARP Metrics into Metrics.txt.
| int fn_NetSim_ARP_Metrics_F | ( | char * | ) |
| int fn_NetSim_ARP_Request_Timeout | ( | NetSim_EVENTDETAILS * | pstruEventDetails, |
| struct stru_NetSim_Network * | NETWORK | ||
| ) |
*if(szNextHopIp)
Definition at line 32 of file RequestTimeOut.c.


| int fn_NetSim_ARP_Run | ( | ) |
| char * fn_NetSim_ARP_Trace | ( | int | nSubEvent | ) |
| char * fn_NetSim_ARP_Trace_F | ( | int | nSubEvent | ) |

| char * fn_NetSim_ARP_WritePacketTrace | ( | NetSim_PACKET * | pstruPacket, |
| char ** | ppszTrace | ||
| ) |
Function to Copy the ARP_TABLE from source to destination. Returm destination ARP Table head pointer reference.
| void fn_NetSim_DeleteArpTable | ( | ARP_TABLE ** | ) |
Function to Delete/ deallocate the memory assigned to the ARP_TABLE.
| int fn_NetSim_Generate_ARP_Reply | ( | NetSim_EVENTDETAILS * | pstruEventDetails, |
| struct stru_NetSim_Network * | NETWORK | ||
| ) |
Definition at line 31 of file GenerateArpReply.c.


| int fn_NetSim_Generate_ARP_Request | ( | NetSim_EVENTDETAILS * | pstruEventDetails, |
| struct stru_NetSim_Network * | NETWORK | ||
| ) |
Definition at line 36 of file GenerateArpRequest.c.


| 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.
| int fn_NetSim_Read_ARP_Table | ( | NetSim_EVENTDETAILS * | pstruEventDetails, |
| struct stru_NetSim_Network * | NETWORK | ||
| ) |
| int fn_NetSim_StaticArpTable_Read | ( | char * | pszARPstasticTablePath | ) |
Function to Read the static table and assign to the ARP_TABLE.
| int fn_NetSim_Update_ARP_Table_ForwardPacket | ( | NetSim_EVENTDETAILS * | pstruEventDetails, |
| struct stru_NetSim_Network * | NETWORK | ||
| ) |
Definition at line 38 of file UpdateArpTable.c.


| STATIC_TABLE_CONFIG* g_pstruStaticTableConfig |
| NETSIM_IPAddress szBroadcastIPaddress |