1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
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 #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
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 *******************************************************************************/
19 #ifndef __RIC_MGR_MAIN_H__
20 #define __RIC_MGR_MAIN_H__
23 #define RIC_NAME "ORAN_OAM_RIC"
25 #define DU_IP_V6_ADDR "0000:0000:0000:0000:0000:0000:0000:0001"
26 #define RIC_IP_V6_ADDR "0000:0000:0000:0000:0000:0000:0000:0011"
29 #define LOCAL_IP_RIC "192.168.130.80"
31 #define E2_SCTP_PORT 36421
32 #define NUM_E2_ASSOC 1
33 #define REMOTE_IP_DU (char*[]){"192.168.130.81", "192.168.130.83"}
45 #define RIC_DU_NAME_LEN_MAX 30 /* Max length of RIC/DU name string */
47 #define RIC_APP_MEM_REG 1
49 #define MAX_RAN_FUNCTION 256 /* O-RAN.WG3.E2AP-R003-v03.00 : Section 9.1.2.2 : maxofRANfunctionID */
50 #define MAX_NUM_TRANSACTION 256 /* As per, O-RAN WG3 E2AP v3.0, section 9.2.33 */
51 #define MAX_E2_NODE_COMPONENT 1024 /* O-RAN.WG3.E2AP-R003-v03.00 : Section 9.1.2.2 : maxofE2nodeComponents */
52 #define MAX_RIC_ACTION 16 /* O-RAN.WG3.E2AP-R003-v03.00 : Section 9.1.1.1 : maxofRICActionID */
53 #define MAX_RIC_REQUEST 5 /* As per O-RAN.WG3.E2AP-R003-v03.00 : Section 9.2.7, max request is 65535. \
54 * But for our internal testing purpose, keeping it to 5 for now */
56 /* allocate and zero out a static buffer */
57 #define RIC_ALLOC(_datPtr, _size) \
60 _ret = SGetSBuf(RIC_APP_MEM_REG, RIC_POOL, \
61 (Data **)&_datPtr, _size); \
63 memset(_datPtr, 0, _size); \
68 /* free a static buffer */
69 #define RIC_FREE(_datPtr, _size) \
70 SPutSBuf(RIC_APP_MEM_REG, RIC_POOL, \
71 (Data *)_datPtr, _size);
73 #define SEARCH_DU_DB(_duIdx, _duId, _duDb){\
75 for(_duIdx=0; _duIdx < ricCb.numDu; _duIdx++)\
77 if(ricCb.duInfo[_duIdx].duId == _duId)\
79 _duDb = (&ricCb.duInfo[_duIdx]);\
92 /* O-RAN.WG3.E2AP-R003-v03.00 : Section 9.2.26 */
106 uint16_t requestorId;
115 typedef struct ricSubscription
117 RicRequestId requestId;
119 CmLListCp actionSequence;
125 uint16_t revisionCounter;
126 CmLListCp subscriptionList;
131 InterfaceType interfaceType;
132 uint64_t componentId;
138 uint8_t ricTransIdCounter;
139 uint16_t numOfRanFunction;
140 RanFunction ranFunction[MAX_RAN_FUNCTION];
141 CmLListCp e2NodeComponent;
144 typedef struct ricCfgParams
147 char ricName[RIC_DU_NAME_LEN_MAX];
148 RicSctpParams sctpParams;
152 typedef struct cuGlobalCb
154 RicCfgParams ricCfgParams;
156 DuDb duInfo[MAX_DU_SUPPORTED];
159 extern RicGlobalCb ricCb;
163 uint8_t numOfRanFunAccepted;
164 RanFunction ranFunAcceptedList[MAX_RAN_FUNCTION];
165 uint8_t numOfRanFuneRejected;
166 RanFunction ranFunRejectedList[MAX_RAN_FUNCTION];
169 typedef struct actionFailed
178 uint8_t numActionModified;
179 uint8_t actionModifiedList[MAX_RIC_ACTION];
180 uint8_t numActionModFailed;
181 ActionFailed actionModFailedList[MAX_RIC_ACTION];
182 uint8_t numActionRemoved;
183 uint8_t actionRemovedList[MAX_RIC_ACTION];
184 uint8_t numActionRemovalFailed;
185 ActionFailed actionRemovalFailedList[MAX_RIC_ACTION];
188 typedef struct e2NodeCfgItem
190 E2NodeComponent componentInfo;
194 typedef struct e2NodeCfgList
196 uint16_t addedE2NodeCount;
197 E2NodeConfigItem addedE2Node[MAX_E2_NODE_COMPONENT];
198 uint16_t updatedE2NodeCount;
199 E2NodeConfigItem updatedE2Node[MAX_E2_NODE_COMPONENT];
200 uint16_t removedE2NodeCount;
201 E2NodeConfigItem removedE2Node[MAX_E2_NODE_COMPONENT];
204 typedef struct ricSubsActionInfo
206 ConfigType configType;
210 typedef struct ricSubsModReq
212 uint16_t numOfActionToBeAdded;
213 ActionInfo actionToBeAdded[MAX_RIC_ACTION];
214 uint16_t numOfActionToBeModify;
215 ActionInfo actionToBeModify[MAX_RIC_ACTION];
216 uint16_t numOfActionToBeRemove;
217 ActionInfo actionToBeRemove[MAX_RIC_ACTION];
221 void cuAppInmsgHdlr(Buffer *mBuf);
222 void sctpNtfyInd(CmInetSctpNotification *ntfy);
226 /**********************************************************************
228 **********************************************************************/