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

Go to the source code of this file.

Functions

static void add_event_link_up ()
 
static int fn_NetSim_P2P_CalulateReceivedPower ()
 
int P2P_MacOut_Handler ()
 
int P2P_MacIn_Handler ()
 
int P2P_PhyOut_Handler ()
 
int P2P_PhyIn_Handler ()
 
int fn_NetSim_P2P_Run ()
 
PHY_MODULATION getModulationFromString (char *val)
 
static void configure_wireless_P2P (NETSIM_ID d, NETSIM_ID in, void *xmlNetSimNode)
 
int fn_NetSim_P2P_Configure (void **var)
 
int fn_NetSim_P2P_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_P2P_Finish ()
 
char * fn_NetSim_P2P_Trace (int nSubEvent)
 
int fn_NetSim_P2P_FreePacket (NetSim_PACKET *pstruPacket)
 
int fn_NetSim_P2P_CopyPacket (NetSim_PACKET *pstruDestPacket, NetSim_PACKET *pstruSrcPacket)
 
int fn_NetSim_P2P_Metrics (PMETRICSWRITER metricsWriter)
 
char * fn_NetSim_P2P_ConfigPacketTrace (const void *xmlNetSimNode)
 
int fn_NetSim_P2P_WritePacketTrace (NetSim_PACKET *pstruPacket, char **ppszTrace)
 
static void p2p_gettxinfo (NETSIM_ID nTxId, NETSIM_ID nTxInterface, NETSIM_ID nRxId, NETSIM_ID nRxInterface, PTX_INFO Txinfo)
 
static bool CheckFrequencyInterfrence (double dFrequency1, double dFrequency2, double bandwidth)
 
static bool check_interference (NETSIM_ID t, NETSIM_ID ti, NETSIM_ID r, NETSIM_ID ri)
 
static int p2p_CalculateReceivedPower (NETSIM_ID tx, NETSIM_ID txi, NETSIM_ID rx, NETSIM_ID rxi)
 
int fn_NetSim_P2P_LinkStateChanged (NETSIM_ID linkId, LINK_STATE newState)
 

Function Documentation

◆ add_event_link_up()

static void add_event_link_up ( )
static

Definition at line 399 of file P2P.c.

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

◆ check_interference()

static bool check_interference ( NETSIM_ID  t,
NETSIM_ID  ti,
NETSIM_ID  r,
NETSIM_ID  ri 
)
static

Definition at line 307 of file P2P.c.

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

◆ CheckFrequencyInterfrence()

static bool CheckFrequencyInterfrence ( double  dFrequency1,
double  dFrequency2,
double  bandwidth 
)
static

Definition at line 289 of file P2P.c.

Here is the caller graph for this function:

◆ configure_wireless_P2P()

static void configure_wireless_P2P ( NETSIM_ID  d,
NETSIM_ID  in,
void *  xmlNetSimNode 
)
static

Definition at line 93 of file P2P.c.

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

◆ fn_NetSim_P2P_CalulateReceivedPower()

static int fn_NetSim_P2P_CalulateReceivedPower ( )
static

Definition at line 325 of file P2P.c.

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

◆ fn_NetSim_P2P_ConfigPacketTrace()

char * fn_NetSim_P2P_ConfigPacketTrace ( const void *  xmlNetSimNode)

This function will return the string to write packet trace heading.

Definition at line 256 of file P2P.c.

◆ fn_NetSim_P2P_Configure()

int fn_NetSim_P2P_Configure ( void **  var)

This function is called by NetworkStack.dll, while configuring the device Mac/Phy layer for P2P protocol.

Definition at line 128 of file P2P.c.

Here is the call graph for this function:

◆ fn_NetSim_P2P_CopyPacket()

int fn_NetSim_P2P_CopyPacket ( NetSim_PACKET pstruDestPacket,
NetSim_PACKET pstruSrcPacket 
)

This function is called by NetworkStack.dll, to copy the P2P protocol from source packet to destination.

Definition at line 240 of file P2P.c.

◆ fn_NetSim_P2P_Finish()

int fn_NetSim_P2P_Finish ( )

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

Definition at line 200 of file P2P.c.

◆ fn_NetSim_P2P_FreePacket()

int fn_NetSim_P2P_FreePacket ( NetSim_PACKET pstruPacket)

This function is called by NetworkStack.dll, to free the P2P protocol

Definition at line 232 of file P2P.c.

◆ fn_NetSim_P2P_Init()

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

This function initializes the P2P parameters.

Definition at line 184 of file P2P.c.

Here is the call graph for this function:

◆ fn_NetSim_P2P_LinkStateChanged()

int fn_NetSim_P2P_LinkStateChanged ( NETSIM_ID  linkId,
LINK_STATE  newState 
)

Definition at line 356 of file P2P.c.

Here is the caller graph for this function:

◆ fn_NetSim_P2P_Metrics()

int fn_NetSim_P2P_Metrics ( PMETRICSWRITER  metricsWriter)

This function write the Metrics in Metrics.txt

Definition at line 248 of file P2P.c.

◆ fn_NetSim_P2P_Run()

int fn_NetSim_P2P_Run ( )

This function is called by NetworkStack.dll, whenever the event gets triggered inside the NetworkStack.dll for the Mac/Phy layer P2P protocol It includes MAC_OUT, MAC_IN, PHY_OUT, PHY_IN and TIMER_EVENT.

Definition at line 41 of file P2P.c.

Here is the call graph for this function:

◆ fn_NetSim_P2P_Trace()

char * fn_NetSim_P2P_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 224 of file P2P.c.

◆ fn_NetSim_P2P_WritePacketTrace()

int fn_NetSim_P2P_WritePacketTrace ( NetSim_PACKET pstruPacket,
char **  ppszTrace 
)

This function will return the string to write packet trace.

Definition at line 264 of file P2P.c.

◆ getModulationFromString()

PHY_MODULATION getModulationFromString ( char *  val)

Definition at line 74 of file P2P.c.

Here is the caller graph for this function:

◆ p2p_CalculateReceivedPower()

static int p2p_CalculateReceivedPower ( NETSIM_ID  tx,
NETSIM_ID  txi,
NETSIM_ID  rx,
NETSIM_ID  rxi 
)
static

Definition at line 314 of file P2P.c.

Here is the caller graph for this function:

◆ p2p_gettxinfo()

static void p2p_gettxinfo ( NETSIM_ID  nTxId,
NETSIM_ID  nTxInterface,
NETSIM_ID  nRxId,
NETSIM_ID  nRxInterface,
PTX_INFO  Txinfo 
)
static

Definition at line 269 of file P2P.c.

Here is the caller graph for this function:

◆ P2P_MacIn_Handler()

int P2P_MacIn_Handler ( )

Definition at line 92 of file P2P_Mac.c.

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

◆ P2P_MacOut_Handler()

int P2P_MacOut_Handler ( )

Definition at line 28 of file P2P_Mac.c.

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

◆ P2P_PhyIn_Handler()

int P2P_PhyIn_Handler ( )

Definition at line 317 of file P2P_Phy.c.

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

◆ P2P_PhyOut_Handler()

int P2P_PhyOut_Handler ( )

Definition at line 243 of file P2P_Phy.c.

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