NetSim Source Code Help
Loading...
Searching...
No Matches
IEEE1609.c
Go to the documentation of this file.
1/************************************************************************************
2* Copyright (C) 2020 *
3* TETCOS, Bangalore. India *
4* *
5* Tetcos owns the intellectual property rights in the Product and its content. *
6* The copying, redistribution, reselling or publication of any or all of the *
7* Product or its content without express prior written consent of Tetcos is *
8* prohibited. Ownership and / or any other right relating to the software and all *
9* intellectual property rights therein shall remain at all times with Tetcos. *
10* *
11* Author: Shashi Kant Suman *
12* *
13* ---------------------------------------------------------------------------------*/
14#include "main.h"
15#include "Protocol.h"
16#include "IEEE1609.h"
17
18//Function Prototype
25 int nVersion_Type);
27
28_declspec(dllexport) int fn_NetSim_IEEE1609_Configure(void** var)
29{
31}
32
33_declspec(dllexport) int fn_NetSim_IEEE1609_Init(struct stru_NetSim_Network *NETWORK_Formal,
37 int nVersion_Type)
38{
39 return fn_NetSim_IEEE1609_Init_F(NETWORK_Formal,
43}
44
46{
48 {
49#pragma region WSMP
53 break;
57 break;
58#pragma endregion WSMP
59
60 case MAC_OUT_EVENT:
62 fnCallProtocol(GET_IEEE1609_CURR_MAC_VAR->secondary_protocol);
63 break;
66 fnCallProtocol(GET_IEEE1609_CURR_MAC_VAR->secondary_protocol);
67 break;
70 fnCallProtocol(GET_IEEE1609_CURR_MAC_VAR->secondary_protocol);
71 break;
72 case MAC_IN_EVENT:
74 fnCallProtocol(GET_IEEE1609_CURR_MAC_VAR->secondary_protocol);
75 break;
76 case TIMER_EVENT:
78 break;
79 }
80 return 0;
81}
82
83/**
84This function is called by NetworkStack.dll, while writing the event trace
85to get the sub event as a string.
86*/
87_declspec(dllexport) char* fn_NetSim_IEEE1609_Trace(int nSubEvent)
88{
89 return GetStringIEEE1609_Subevent(nSubEvent);
90}
91
92/**
93This function is called by NetworkStack.dll, to free the WLAN protocol
94pstruMacData->Packet_MACProtocol.
95*/
97{
98 return 0;
99}
100
101/**
102This function is called by NetworkStack.dll, to copy the WLAN protocol
103pstruMacData->Packet_MACProtocol from source packet to destination.
104*/
105_declspec(dllexport) int fn_NetSim_IEEE1609_CopyPacket(NetSim_PACKET* pstruDestPacket, NetSim_PACKET* pstruSrcPacket)
106{
107 return 0;
108}
109
110/**
111This function call WLAN Metrics function in lib file to write the Metrics in Metrics.txt
112*/
114{
115 return 0;
116}
117
118/**
119This function is to configure the WLAN protocol packet trace parameter.
120This function return a string which has the parameters separated by comma.
121*/
122_declspec(dllexport) char* fn_NetSim_IEEE1609_ConfigPacketTrace(const void* xmlNetSimNode)
123{
124 return "";
125}
126
127/**
128This function is called while writing the Packet trace for WLAN protocol.
129This function is called for every packet while writing the packet trace.
130*/
131_declspec(dllexport) int fn_NetSim_IEEE1609_WritePacketTrace(NetSim_PACKET* pstruPacket, char** ppszTrace)
132{
133 return 1;
134}
135
136/**
137This function is called by NetworkStack.dll, once simulation end to free the
138allocated memory for the network.
139*/
141{
143}
144
146{
148 {
149 case CHANNEL_SWITCH_END:
151 break;
152 case CHANNEL_SWITCH_START:
154 break;
155 default:
156 fnNetSimError("Unknown timer event %d for IEEE1609 protocol\n", pstruEventDetails->nSubEventType);
157 break;
158 }
159}
160
162{
166}
void fn_NetSim_IEEE1609_ChannelSwitch_Start()
Definition: Channel.c:62
void fn_NetSim_IEEE1609_ChannelSwitch_End()
Definition: Channel.c:30
int fn_NetSim_IEEE1609_Init(struct stru_NetSim_Network *NETWORK_Formal, NetSim_EVENTDETAILS *pstruEventDetails_Formal, char *pszAppPath_Formal, char *pszWritePath_Formal, int nVersion_Type)
Definition: IEEE1609.c:33
int fn_NetSim_IEEE1609_FreePacket(NetSim_PACKET *pstruPacket)
Definition: IEEE1609.c:96
int fn_NetSim_IEEE1609_Metrics(PMETRICSWRITER metricsWriter)
Definition: IEEE1609.c:113
void fn_NetSim_IEEE1609_TimerEvent()
Definition: IEEE1609.c:145
int fn_NetSim_IEEE1609_CopyPacket(NetSim_PACKET *pstruDestPacket, NetSim_PACKET *pstruSrcPacket)
Definition: IEEE1609.c:105
int fn_NetSim_IEEE1609_Run()
Definition: IEEE1609.c:45
int fn_NetSim_IEEE1609_Finish_F()
int fn_NetSim_IEEE1609_Init_F(struct stru_NetSim_Network *NETWORK_Formal, NetSim_EVENTDETAILS *pstruEventDetails_Formal, char *pszAppPath_Formal, char *pszWritePath_Formal, int nVersion_Type)
int fn_NetSim_IEEE1609_WritePacketTrace(NetSim_PACKET *pstruPacket, char **ppszTrace)
Definition: IEEE1609.c:131
char * fn_NetSim_IEEE1609_Trace(int nSubEvent)
Definition: IEEE1609.c:87
void restart_transmission()
Definition: IEEE1609.c:161
int fn_NetSim_IEEE1609_Configure(void **var)
Definition: IEEE1609.c:28
char * fn_NetSim_IEEE1609_ConfigPacketTrace(const void *xmlNetSimNode)
Definition: IEEE1609.c:122
int fn_NetSim_IEEE1609_Configure_F(void **)
int fn_NetSim_IEEE1609_Finish()
Definition: IEEE1609.c:140
void fn_NetSim_WSNP_SendWSMPacket()
Definition: WSMP.c:36
int fn_NetSim_WSNP_ReceiveWSMPacket()
Definition: WSMP.c:116
#define GET_IEEE1609_CURR_MAC_VAR
#define _declspec(dllexport)
This function is used to trigger the update.
Definition: Linux.h:41
#define fnNetSimError(x,...)
Definition: Linux.h:56
void * PMETRICSWRITER
Definition: MetricsWriter.h:27
int fnCallProtocol(int nProtocol)
NetSim_EVENTDETAILS * pstruEventDetails_Formal
Definition: RIP.h:178
NetSim_EVENTDETAILS char * pszAppPath_Formal
Definition: RIP.h:178
NetSim_EVENTDETAILS char char int nVersion_Type
Definition: RIP.h:178
NetSim_EVENTDETAILS char char * pszWritePath_Formal
Definition: RIP.h:178
@ NETWORK_OUT_EVENT
Definition: Stack.h:108
@ TIMER_EVENT
Definition: Stack.h:114
@ NETWORK_IN_EVENT
Definition: Stack.h:109
@ TRANSPORT_IN_EVENT
Definition: Stack.h:111
@ PHYSICAL_OUT_EVENT
Definition: Stack.h:104
@ MAC_OUT_EVENT
Definition: Stack.h:106
@ MAC_IN_EVENT
Definition: Stack.h:107
@ TRANSPORT_OUT_EVENT
Definition: Stack.h:110
@ PHYSICAL_IN_EVENT
Definition: Stack.h:105
EXPORTED struct stru_NetSim_EventDetails * pstruEventDetails
Definition: Stack.h:837
#define fnpAddEvent(pstruEvent)
Definition: main.h:191
EVENT_TYPE nEventType
Definition: Stack.h:747
NETSIM_ID nProtocolId
Definition: Stack.h:748
NETSIM_ID nSubEventType
Definition: Stack.h:757