NetSim Source Code Help
Loading...
Searching...
No Matches
Application.c File Reference
#include "main.h"
#include "Application.h"
#include "CoAP.h"
Include dependency graph for Application.c:

Go to the source code of this file.

Functions

void encryptBlock (uint8_t *data, uint32_t *len, uint32_t *key)
 
int fn_NetSim_Application_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_Application_Configure (void **var)
 
int fn_NetSim_Application_Run ()
 
char * fn_NetSim_Application_Trace (int nSubEvent)
 
int fn_NetSim_Application_FreePacket (NetSim_PACKET *pstruPacket)
 
int fn_NetSim_Application_CopyPacket (NetSim_PACKET *pstruDestPacket, NetSim_PACKET *pstruSrcPacket)
 
int fn_NetSim_Application_Metrics (PMETRICSWRITER metricsWriter)
 
char * fn_NetSim_Application_ConfigPacketTrace ()
 
int fn_NetSim_Application_WritePacketTrace (NetSim_PACKET *pstruPacket, char **ppszTrace)
 
int fn_NetSim_Application_Finish ()
 
static PACKET_PRIORITY get_priority_based_on_qos (QUALITY_OF_SERVICE qos)
 
NetSim_PACKETfn_NetSim_Application_GeneratePacket (ptrAPPLICATION_INFO info, double ldArrivalTime, NETSIM_ID nSourceId, UINT destCount, NETSIM_ID *nDestination, unsigned long long int nPacketId, APPLICATION_TYPE nAppType, QUALITY_OF_SERVICE nQOS, unsigned int sourcePort, unsigned int destPort)
 
int fn_NetSim_Application_GenerateNextPacket (ptrAPPLICATION_INFO appInfo, NETSIM_ID nSource, UINT destCount, NETSIM_ID *nDestination, double time)
 
void copy_payload (UINT8 real[], NetSim_PACKET *packet, unsigned int *payload, ptrAPPLICATION_INFO info)
 
int fn_NetSim_Add_DummyPayload (NetSim_PACKET *packet, ptrAPPLICATION_INFO info)
 
double get_random_startupdelay ()
 

Function Documentation

◆ copy_payload()

void copy_payload ( UINT8  real[],
NetSim_PACKET packet,
unsigned int *  payload,
ptrAPPLICATION_INFO  info 
)

Definition at line 619 of file Application.c.

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

◆ encryptBlock()

void encryptBlock ( uint8_t *  data,
uint32_t *  len,
uint32_t *  key 
)

Definition at line 47 of file Encryption.c.

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

◆ fn_NetSim_Add_DummyPayload()

int fn_NetSim_Add_DummyPayload ( NetSim_PACKET packet,
ptrAPPLICATION_INFO  info 
)

Definition at line 641 of file Application.c.

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

◆ fn_NetSim_Application_ConfigPacketTrace()

char * fn_NetSim_Application_ConfigPacketTrace ( )

This function is used to configure the packet trace

Definition at line 249 of file Application.c.

◆ fn_NetSim_Application_Configure()

int fn_NetSim_Application_Configure ( void **  var)

This function is used to configure the applications like application id, source count, source id, destination count etc.

Definition at line 45 of file Application.c.

Here is the call graph for this function:

◆ fn_NetSim_Application_CopyPacket()

int fn_NetSim_Application_CopyPacket ( NetSim_PACKET pstruDestPacket,
NetSim_PACKET pstruSrcPacket 
)

This function is called by NetworkStack.dll, to copy the application related information to a new packet

Definition at line 234 of file Application.c.

◆ fn_NetSim_Application_Finish()

int fn_NetSim_Application_Finish ( )

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

Definition at line 264 of file Application.c.

Here is the call graph for this function:

◆ fn_NetSim_Application_FreePacket()

int fn_NetSim_Application_FreePacket ( NetSim_PACKET pstruPacket)

This function is called by NetworkStack.dll, to free the application information from a packets.

Definition at line 226 of file Application.c.

◆ fn_NetSim_Application_GenerateNextPacket()

int fn_NetSim_Application_GenerateNextPacket ( ptrAPPLICATION_INFO  appInfo,
NETSIM_ID  nSource,
UINT  destCount,
NETSIM_ID nDestination,
double  time 
)

This function is used to generate the next packet

Definition at line 377 of file Application.c.

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

◆ fn_NetSim_Application_GeneratePacket()

NetSim_PACKET * fn_NetSim_Application_GeneratePacket ( ptrAPPLICATION_INFO  info,
double  ldArrivalTime,
NETSIM_ID  nSourceId,
UINT  destCount,
NETSIM_ID nDestination,
unsigned long long int  nPacketId,
APPLICATION_TYPE  nAppType,
QUALITY_OF_SERVICE  nQOS,
unsigned int  sourcePort,
unsigned int  destPort 
)

This function is used to generate the packets for application

Definition at line 311 of file Application.c.

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

◆ fn_NetSim_Application_Init()

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

This function is used to initialize the parameter for all the application based on the traffic type

Definition at line 34 of file Application.c.

Here is the call graph for this function:

◆ fn_NetSim_Application_Metrics()

int fn_NetSim_Application_Metrics ( PMETRICSWRITER  metricsWriter)

This function writes the Application metrics in Metrics.txt

Definition at line 241 of file Application.c.

Here is the call graph for this function:

◆ fn_NetSim_Application_Run()

int fn_NetSim_Application_Run ( )

This function is called by NetworkStack.dll, whenever the event gets triggered
inside the NetworkStack.dll for applications. This is the main function for the application. It processes APPLICATION_OUT, APPLICATION_IN and TIMER events.

Definition at line 55 of file Application.c.

Here is the call graph for this function:

◆ fn_NetSim_Application_Trace()

char * fn_NetSim_Application_Trace ( int  nSubEvent)

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

Definition at line 209 of file Application.c.

◆ fn_NetSim_Application_WritePacketTrace()

int fn_NetSim_Application_WritePacketTrace ( NetSim_PACKET pstruPacket,
char **  ppszTrace 
)

This function is used to write the packet trace

Definition at line 256 of file Application.c.

◆ get_priority_based_on_qos()

static PACKET_PRIORITY get_priority_based_on_qos ( QUALITY_OF_SERVICE  qos)
static

Definition at line 288 of file Application.c.

Here is the caller graph for this function:

◆ get_random_startupdelay()

double get_random_startupdelay ( )

Definition at line 665 of file Application.c.