![]() |
NetSim Source Code Help
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <errno.h>
#include <stdint.h>
#include <stdbool.h>
#include <direct.h>
#include <malloc.h>
#include <assert.h>
#include <dlfcn.h>
#include "Linux.h"
#include "Memory.h"
#include "IP_Addressing.h"
#include "Stack.h"
#include "Packet.h"
#include "MetricsWriter.h"
Go to the source code of this file.
Macros | |
#define | _CRT_SECURE_NO_DEPRECATE |
#define | _CRT_SECURE_NO_WARNINGS |
#define | _LICENSE_CHECK |
#define | _NETSIM_MEMORY_LEAK_TEST_ |
#define | _CRTDBG_MAP_ALLOC |
#define | _NETSIM_MAIN_H_ |
#define | HINSTANCE void* |
#define | VERSION 132 |
#define | __CALLBACK__ |
#define | __IN__ |
#define | __OUT__ |
#define | fn_NetSim_LoadAppDllFunction(hsharedlib, path, sharedlibName, funName) fn_NetSim_LoadAppDllFunction_dbg(hsharedlib,path,sharedlibName,funName,__LINE__,__FILE__); |
#define | fn_NetSim_Utilities_LoadSharedlibFunction(hsharedlib, sharedlibName, funName) fn_NetSim_Utilities_LoadSharedlibFunction_dbg(hsharedlib,sharedlibName,funName,__LINE__,__FILE__) |
#define | fn_NetSim_Packet_FreePacket(pstruPacket) fn_NetSim_Packet_FreePacket_dbg(&(pstruPacket),__LINE__,__FILE__) |
#define | fn_NetSim_Packet_AddPacketToList(pstruBuffer, pstruPacket, nInsertionType) fn_NetSim_Packet_AddPacketToList_dbg(pstruBuffer,pstruPacket,nInsertionType /* 1- head,2-Tail,3-Order of event time*/,__LINE__,__FILE__) |
#define | fn_NetSim_Packet_CopyPacket(pstruPacket) fn_NetSim_Packet_CopyPacket_dbg(pstruPacket,__LINE__,__FILE__) |
#define | fn_NetSim_Packet_CopyPacketList(pstruPacket) fn_NetSim_Packet_CopyPacketList_dbg(pstruPacket,__LINE__,__FILE__) |
#define | fn_NetSim_Packet_CreatePacket(layer) fn_NetSim_Packet_CreatePacket_dbg(layer,__LINE__,__FILE__) |
#define | fn_NetSim_WritePacketTrace(pstruPacket) fn_NetSim_WritePacketTrace_dbg(pstruPacket,__LINE__,__FILE__) |
#define | fnpAddEvent(pstruEvent) fnAddEvent_F(pstruEvent,__LINE__,__FILE__) |
#define | ANSI_COLOR_RED "\x1b[31m" |
#define | ANSI_COLOR_GREEN "\x1b[32m" |
#define | ANSI_COLOR_YELLOW "\x1b[33m" |
#define | ANSI_COLOR_BLUE "\x1b[34m" |
#define | ANSI_COLOR_MAGENTA "\x1b[35m" |
#define | ANSI_COLOR_CYAN "\x1b[36m" |
#define | ANSI_COLOR_RESET "\x1b[0m" |
#define | ANSI_BOLD_TEXT "\x1b[1m" |
Enumerations | |
enum | NETSIM_VERSIONTYPE { NETSIM_PRO =VERSION*10+5 , NETSIM_STANDARD =VERSION*10+4 , NETSIM_ACEDEMIC =VERSION*10+3 , NETSIM_DEMO =VERSION*10+2 , NETSIM_COMER =VERSION*10+1 } |
Functions | |
FARPROC | fn_NetSim_LoadAppDllFunction_dbg (HINSTANCE *hdll, const char *path, const char *dllName, const char *funName, int line, char *file) |
FARPROC | fn_NetSim_Utilities_LoadSharedlibFunction_dbg (HINSTANCE *hsharedlib, const char *sharedlibName, const char *funName, int line, const char *file) |
int | ReportError (bool isStopOnError, const char *msg, int line, const char *file, int flag,...) |
int | fn_NetSim_Packet_AddPacketToList_dbg (NetSim_BUFFER *pstruBuffer, NetSim_PACKET *pstruPacket, int nInsertionType, int line, const char *file) |
unsigned long long int | fnAddEvent_F (struct stru_NetSim_EventDetails *pstruEvent, int line, const char *file) |
bool | fn_NetSim_Stack_RegisterCallBackFunction (int nSubeventId, int(*_fnCallBack)()) |
int | fn_NetSim_Anim_MoveNode (NETSIM_ID src, double x, double y, double time) |
bool | CHECK_FOR_USER_DLL (const char *dllName) |
Variables | |
static const char | libext [] = ".so" |
#define fn_NetSim_LoadAppDllFunction | ( | hsharedlib, | |
path, | |||
sharedlibName, | |||
funName | |||
) | fn_NetSim_LoadAppDllFunction_dbg(hsharedlib,path,sharedlibName,funName,__LINE__,__FILE__); |
#define fn_NetSim_Packet_AddPacketToList | ( | pstruBuffer, | |
pstruPacket, | |||
nInsertionType | |||
) | fn_NetSim_Packet_AddPacketToList_dbg(pstruBuffer,pstruPacket,nInsertionType /* 1- head,2-Tail,3-Order of event time*/,__LINE__,__FILE__) |
#define fn_NetSim_Packet_CopyPacket | ( | pstruPacket | ) | fn_NetSim_Packet_CopyPacket_dbg(pstruPacket,__LINE__,__FILE__) |
#define fn_NetSim_Packet_CopyPacketList | ( | pstruPacket | ) | fn_NetSim_Packet_CopyPacketList_dbg(pstruPacket,__LINE__,__FILE__) |
#define fn_NetSim_Packet_CreatePacket | ( | layer | ) | fn_NetSim_Packet_CreatePacket_dbg(layer,__LINE__,__FILE__) |
#define fn_NetSim_Packet_FreePacket | ( | pstruPacket | ) | fn_NetSim_Packet_FreePacket_dbg(&(pstruPacket),__LINE__,__FILE__) |
#define fn_NetSim_Utilities_LoadSharedlibFunction | ( | hsharedlib, | |
sharedlibName, | |||
funName | |||
) | fn_NetSim_Utilities_LoadSharedlibFunction_dbg(hsharedlib,sharedlibName,funName,__LINE__,__FILE__) |
#define fn_NetSim_WritePacketTrace | ( | pstruPacket | ) | fn_NetSim_WritePacketTrace_dbg(pstruPacket,__LINE__,__FILE__) |
#define fnpAddEvent | ( | pstruEvent | ) | fnAddEvent_F(pstruEvent,__LINE__,__FILE__) |
typedef enum enum_AppProtocol APPLICATION_LAYER_PROTOCOL |
typedef enum enum_Distribution DISTRIBUTION |
typedef enum enum_EventType EVENT_TYPE |
typedef enum enum_InterfaceType INTERFACE_TYPE |
typedef enum enum_isConfigured ISCONFIGURED |
typedef enum enum_LayerType LAYER_TYPE |
typedef enum enum_LinkMode LINK_MODE |
typedef enum enum_LinkState LINK_STATE |
typedef enum enum_LinkType LINK_TYPE |
typedef enum enum_MACProtocol MAC_LAYER_PROTOCOL |
typedef struct stru_ApplicationInformation NetSim_APPLICATIONINFO |
typedef struct stru_NetSim_ApplicationLayer NetSim_APPLICATIONLAYER |
typedef struct stru_NetSim_Device_Buffer NetSim_BUFFER |
typedef struct stru_NetSim_Coordinates NetSim_COORDINATES |
typedef struct stru_NetSim_Device NetSim_DEVICE |
typedef struct stru_NetSim_Interface NetSIm_DEVICEINTERFACE |
typedef struct stru_NetSim_EventDetails NetSim_EVENTDETAILS |
typedef struct stru_NetSim_Links NetSim_LINKS |
typedef struct stru_NetSim_MAC_NW_Interface NetSim_MAC_NW_INTERFACE |
typedef struct stru_NetSim_MacLayer NetSim_MACLAYER |
typedef char* NETSIM_Name |
typedef struct stru_NetSim_NetworkLayer NetSim_NETWORKLAYER |
typedef struct stru_NetSim_Packet NetSim_PACKET |
typedef struct stru_NetSim_Packet_AppLayer NetSim_PACKET_APPLAYER |
typedef struct stru_NetSim_Packet_MACLayer NetSim_PACKET_MACLAYER |
typedef struct stru_NetSim_Packet_NetworkLayer NetSim_PACKET_NETWORKLAYER |
typedef struct stru_NetSim_Packet_PhyLayer NetSim_PACKET_PHYLAYER |
typedef struct stru_NetSim_Packet_TransportLayer NetSim_PACKET_TRANSPORTLAYER |
typedef struct stru_NetSim_PhysicalLayer NetSim_PHYSICALLAYER |
typedef struct stru_NetSim_SocketInterface NetSim_SOCKETINTERFACE |
typedef struct stru_NetSim_TransportLayer NetSim_TRANSPORTLAYER |
typedef enum enum_DeviceType netsimDEVICE_TYPE |
typedef enum enum_NWProtocol NETWORK_LAYER_PROTOCOL |
typedef enum enum_Segment PACKET_FRAGMENT |
typedef enum enum_PacketPriority PACKET_PRIORITY |
typedef enum enum_PacketStatus PACKET_STATUS |
typedef enum enum_PacketType PACKET_TYPE |
typedef enum enum_PhyMedium PHYSICAL_LAYER_MEDIUM |
typedef struct stru_NetSim_Device * ptrNetSim_DEVICE |
typedef struct stru_NetSim_Interface * ptrNetSim_DEVICEINTERFACE |
typedef enum enum_Packet_QOS QUALITY_OF_SERVICE |
typedef enum enum_SchedulingType SCHEDULING_TYPE |
typedef enum enum_ServiceType SERVICE_TYPE |
typedef enum enum_SimulationEndType SIMULATION_END_TYPE |
typedef struct stru_NetSim_SimulationParameter SIMULATIONPARAMETER |
typedef enum enum_SuppressionModel SUPPRESSION_MODEL |
typedef enum enum_TransmissionType TRANSMISSION_TYPE |
typedef enum enum_TrxProtocol TRANSPORT_LAYER_PROTOCOL |
typedef enum emum_wireshark_option WIRESHARK_OPTION |
enum NETSIM_VERSIONTYPE |
bool CHECK_FOR_USER_DLL | ( | const char * | dllName | ) |
int fn_NetSim_Anim_MoveNode | ( | NETSIM_ID | src, |
double | x, | ||
double | y, | ||
double | time | ||
) |
FARPROC fn_NetSim_LoadAppDllFunction_dbg | ( | HINSTANCE * | hdll, |
const char * | path, | ||
const char * | dllName, | ||
const char * | funName, | ||
int | line, | ||
char * | file | ||
) |
int fn_NetSim_Packet_AddPacketToList_dbg | ( | NetSim_BUFFER * | pstruBuffer, |
NetSim_PACKET * | pstruPacket, | ||
int | nInsertionType, | ||
int | line, | ||
const char * | file | ||
) |
bool fn_NetSim_Stack_RegisterCallBackFunction | ( | int | nSubeventId, |
int(*)() | _fnCallBack | ||
) |
FARPROC fn_NetSim_Utilities_LoadSharedlibFunction_dbg | ( | HINSTANCE * | hsharedlib, |
const char * | sharedlibName, | ||
const char * | funName, | ||
int | line, | ||
const char * | file | ||
) |
unsigned long long int fnAddEvent_F | ( | struct stru_NetSim_EventDetails * | pstruEvent, |
int | line, | ||
const char * | file | ||
) |
int ReportError | ( | bool | isStopOnError, |
const char * | msg, | ||
int | line, | ||
const char * | file, | ||
int | flag, | ||
... | |||
) |