Cell and Network slicing configuration over o1.
[o-du/l2.git] / src / o1 / CmInterface.h
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2020] [HCL Technologies Ltd.]                               #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18
19 /* This file contains C interface for ODU and stubs to get startup
20    configuration
21 */
22
23 #ifndef __CM_INTERFACE_H__
24 #define __CM_INTERFACE_H__
25
26 #include <stdint.h>
27 #include <CommonMessages.h>
28
29 #define IPV4_LEN 16
30 #define PORT_LEN 10
31
32
33
34 //RRM POLICY MACRO
35
36 #define MAX_MEMBER_LIST 2
37 #define ID_MAX_LEN 64
38 #define MAX_LEN 100
39 #define MAX_POLICY 2
40 #define MAX_POLICY_LIST 4
41 #define MCC_LEN 3
42 #define MNC_LEN 3
43 #define SD_LEN 3
44
45 //NRCELLDU MACRO
46 #define MAX_SUPPORTED_PLMN 2
47
48 #ifdef __cplusplus
49 extern "C"
50 {
51 #endif
52
53 typedef struct
54 {
55    char DU_IPV4_Addr[IPV4_LEN];
56    char CU_IPV4_Addr[IPV4_LEN];
57    char RIC_IPV4_Addr[IPV4_LEN];
58    uint16_t CU_Port;
59    uint16_t DU_Port;
60    uint16_t RIC_Port;
61 }StartupConfig;
62
63 //RRM POLICY STRUCT
64
65 typedef struct rRMPolicyMemberList
66 {
67    uint8_t mcc[MCC_LEN];
68    uint8_t mnc[MNC_LEN];
69    uint8_t sd[SD_LEN];
70    uint8_t sst;
71 }RRMPolicyMemberList;
72
73 typedef enum
74 {
75   PRB,
76   PRB_UL,
77   PRB_DL,
78   RRC,
79   DRB
80 }RrmResourceType;
81
82 typedef struct rrmPolicyList
83 {
84    char id[ID_MAX_LEN];
85    RrmResourceType resourceType;
86    uint8_t rRMMemberNum;
87    RRMPolicyMemberList rRMPolicyMemberList[MAX_MEMBER_LIST];
88    uint8_t rRMPolicyMaxRatio;
89    uint8_t rRMPolicyMinRatio;
90    uint8_t rRMPolicyDedicatedRatio;
91 }RrmPolicyList;
92
93 //NRCELLDU STRUCT
94
95 typedef enum
96 {
97    DISABLED,      //value 0
98    ENABLED,       //value 1
99 }OpState;
100
101 typedef enum
102 {
103    LOCKED,         //value 0
104    UNLOCKED,       //value 1
105    SHUTTING_DOWN,   //value 2
106 }AdminState;
107
108 typedef enum
109 {
110    IDLE,
111    INACTIVE,
112    ACTIVE,
113 }CellState;
114
115 typedef struct plmnInfo
116 {
117    uint8_t mcc[MCC_LEN];
118    uint8_t mnc[MNC_LEN];
119    uint8_t sd[SD_LEN];
120    uint8_t sst;
121 }PlmnInfo;
122
123
124 typedef struct nRCellDU
125 {
126    uint32_t             cellLocalId;
127    OpState              operationalState;
128    AdminState           administrativeState;
129    CellState            cellState;
130    PlmnInfo             plmnList[MAX_SUPPORTED_PLMN];
131    uint32_t             nRPCI;
132    uint32_t             nRTAC;
133    uint32_t             arfcnDL;
134    uint32_t             arfcnUL;
135    uint32_t             arfcnSUL;
136    uint32_t             ssbFrequency;
137    uint32_t             ssbPeriodicity;
138    uint32_t             ssbSubCarrierSpacing;
139    uint32_t             ssbOffset;
140    uint32_t             ssbDuration;
141    uint32_t             bSChannelBwUL;
142    uint32_t             bSChannelBwDL;
143    uint32_t             bSChannelBwSUL;
144 }NRCellDU;
145
146 //ME, GNB and NRCELLDU ID's struct
147 typedef struct managedElement
148 {
149    char meId[ID_MAX_LEN];
150    char gnbId[ID_MAX_LEN];
151    char nrCellDuId[ID_MAX_LEN];
152 }ManagedElement;
153
154
155 uint8_t getStartupConfig(StartupConfig *cfg);
156 uint8_t getStartupConfigForStub(StartupConfig *cfg);
157 bool setCellOpState(uint16_t cellId, OpState opState, \
158                              CellState cellState);
159
160 #ifndef ODU_TEST_STUB
161 //Defined in odu high
162 bool bringCellUp(uint16_t cellId);
163 bool bringCellDown(uint16_t cellId);
164 uint8_t setRrmPolicy(RrmPolicyList rrmPolicy[],uint8_t policyNum);
165 uint8_t setCellParam();
166 #endif //ODU_TEST_STUB
167 #ifdef __cplusplus
168 }
169 #endif
170
171 #endif
172
173 /**********************************************************************
174          End of file
175 **********************************************************************/