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 */
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]);\
85 /* O-RAN.WG3.E2AP-R003-v03.00 : Section 9.2.26 */
108 typedef struct ricSubscription
110 RicRequestId requestId;
111 uint8_t numOfActions;
112 ActionInfo actionSequence[MAX_RIC_ACTION];
118 uint16_t revisionCounter;
119 uint8_t numOfSubscription;
120 RicSubscription subscriptionList[MAX_RIC_REQUEST];
125 InterfaceType interfaceType;
126 uint64_t componentId;
132 uint8_t ricTransIdCounter;
133 uint16_t numOfRanFunction;
134 RanFunction ranFunction[MAX_RAN_FUNCTION];
135 E2NodeComponent e2NodeComponent;
138 typedef struct ricCfgParams
141 char ricName[RIC_DU_NAME_LEN_MAX];
142 RicSctpParams sctpParams;
146 typedef struct cuGlobalCb
148 RicCfgParams ricCfgParams;
150 DuDb duInfo[MAX_DU_SUPPORTED];
157 uint8_t numOfRanFunAccepted;
158 RanFunction ranFunAcceptedList[MAX_RAN_FUNCTION];
159 uint8_t numOfRanFuneRejected;
160 RanFunction ranFunRejectedList[MAX_RAN_FUNCTION];
163 typedef struct actionFailed
172 uint8_t numActionModified;
173 uint8_t actionModifiedList[MAX_RIC_ACTION];
174 uint8_t numActionModFailed;
175 ActionFailed actionModFailedList[MAX_RIC_ACTION];
176 uint8_t numActionRemoved;
177 uint8_t actionRemovedList[MAX_RIC_ACTION];
178 uint8_t numActionRemovalFailed;
179 ActionFailed actionRemovalFailedList[MAX_RIC_ACTION];
183 void cuAppInmsgHdlr(Buffer *mBuf);
184 void sctpNtfyInd(CmInetSctpNotification *ntfy);
188 /**********************************************************************
190 **********************************************************************/