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 uint8_t numOfActions;
120 ActionInfo actionSequence[MAX_RIC_ACTION];
126 uint16_t revisionCounter;
127 CmLListCp subscriptionList;
132 InterfaceType interfaceType;
133 uint64_t componentId;
139 uint8_t ricTransIdCounter;
140 uint16_t numOfRanFunction;
141 RanFunction ranFunction[MAX_RAN_FUNCTION];
142 CmLListCp e2NodeComponent;
145 typedef struct ricCfgParams
148 char ricName[RIC_DU_NAME_LEN_MAX];
149 RicSctpParams sctpParams;
153 typedef struct cuGlobalCb
155 RicCfgParams ricCfgParams;
157 DuDb duInfo[MAX_DU_SUPPORTED];
164 uint8_t numOfRanFunAccepted;
165 RanFunction ranFunAcceptedList[MAX_RAN_FUNCTION];
166 uint8_t numOfRanFuneRejected;
167 RanFunction ranFunRejectedList[MAX_RAN_FUNCTION];
170 typedef struct actionFailed
179 uint8_t numActionModified;
180 uint8_t actionModifiedList[MAX_RIC_ACTION];
181 uint8_t numActionModFailed;
182 ActionFailed actionModFailedList[MAX_RIC_ACTION];
183 uint8_t numActionRemoved;
184 uint8_t actionRemovedList[MAX_RIC_ACTION];
185 uint8_t numActionRemovalFailed;
186 ActionFailed actionRemovalFailedList[MAX_RIC_ACTION];
189 typedef struct e2NodeCfgItem
191 E2NodeComponent componentInfo;
195 typedef struct e2NodeCfgList
197 uint16_t addedE2NodeCount;
198 E2NodeConfigItem addedE2Node[MAX_E2_NODE_COMPONENT];
199 uint16_t updatedE2NodeCount;
200 E2NodeConfigItem updatedE2Node[MAX_E2_NODE_COMPONENT];
201 uint16_t removedE2NodeCount;
202 E2NodeConfigItem removedE2Node[MAX_E2_NODE_COMPONENT];
205 typedef struct ricSubsActionInfo
207 ConfigType configType;
211 typedef struct ricSubsModReq
213 uint16_t numOfActionToBeAdded;
214 ActionInfo actionToBeAdded[MAX_RIC_ACTION];
215 uint16_t numOfActionToBeModify;
216 ActionInfo actionToBeModify[MAX_RIC_ACTION];
217 uint16_t numOfActionToBeRemove;
218 ActionInfo actionToBeRemove[MAX_RIC_ACTION];
222 void cuAppInmsgHdlr(Buffer *mBuf);
223 void sctpNtfyInd(CmInetSctpNotification *ntfy);
227 /**********************************************************************
229 **********************************************************************/