NetSim Source Code Help
Loading...
Searching...
No Matches
LTENR_Association.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
15#pragma region HEADER_FILES
16#include "stdafx.h"
17#pragma endregion
18
19#pragma region ASSOCIATION_INIT
21{
22 for (NETSIM_ID d = 0; d < NETWORK->nDeviceCount; d++)
23 {
24 for (NETSIM_ID i = 0; i < DEVICE(d + 1)->nNumOfInterface; i++)
25 {
26 if (!isLTE_NRInterface(d + 1, i + 1))
27 continue;
28
29 ptrLTENR_PROTODATA data = LTENR_PROTODATA_GET(d + 1, i + 1);
30
31 if (!data || data->deviceType != LTENR_DEVICETYPE_GNB)
32 continue;
33
34 NetSim_LINKS* link = DEVICE_PHYLAYER(d + 1, i + 1)->pstruNetSimLinks;
35
36 if (link->nLinkType == LinkType_P2P)
37 continue;
38
40 {
42 i + 1,
45 }
46 }
47 }
48}
49
50#pragma endregion
51
52#pragma region ASSOCIATION_CALLBACK
53#define MAX_ASSOCIATION_CALLBACK 100
56 bool);
59
61 NETSIM_ID gnbIf,
62 NETSIM_ID ueId,
63 NETSIM_ID ueIf,
64 bool isAssociated))
65{
68}
69
71 NETSIM_ID gnbIf,
72 NETSIM_ID ueId,
73 NETSIM_ID ueIf,
74 bool isAssociated)
75{
76 UINT i;
77 for (i = 0; i < associationCallbackCount; i++)
78 fnpAssociationCallback[i](gnbId, gnbIf, ueId, ueIf, isAssociated);
79}
80
81#pragma endregion
unsigned int NETSIM_ID
Definition: Animation.h:45
#define NETSIM_ID
Definition: CLIInterface.h:46
@ LTENR_DEVICETYPE_GNB
Definition: LTE_NR.h:72
void LTENR_ASSOCIATEINFO_ADD(NETSIM_ID d, NETSIM_ID in, NETSIM_ID rd, NETSIM_ID rin)
bool isLTE_NRInterface(NETSIM_ID d, NETSIM_ID i)
ptrLTENR_PROTODATA LTENR_PROTODATA_GET(NETSIM_ID d, NETSIM_ID in)
void fn_NetSim_LTENR_InitAssociation()
void fn_NetSim_LTENR_RegisterCallBackForAssociation(void(*fnCallBack)(NETSIM_ID gnbId, NETSIM_ID gnbIf, NETSIM_ID ueId, NETSIM_ID ueIf, bool isAssociated))
static void LTENR_ASSOCIATION_CALL_CALLBACK(NETSIM_ID gnbId, NETSIM_ID gnbIf, NETSIM_ID ueId, NETSIM_ID ueIf, bool isAssociated)
static fnAssociationCallback fnpAssociationCallback[MAX_ASSOCIATION_CALLBACK]
static UINT associationCallbackCount
void(* fnAssociationCallback)(NETSIM_ID, NETSIM_ID, NETSIM_ID, NETSIM_ID, bool)
#define MAX_ASSOCIATION_CALLBACK
#define c
#define UINT
Definition: Linux.h:38
#define DEVICE(DeviceId)
Definition: Stack.h:769
EXPORTED struct stru_NetSim_Network * NETWORK
Definition: Stack.h:742
#define DEVICE_PHYLAYER(DeviceId, InterfaceId)
Definition: Stack.h:788
@ LinkType_P2P
Definition: Stack.h:315
LTENR_DEVICETYPE deviceType
Definition: LTE_NR.h:440