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 /* This functions contains main() for cu_app */
22 #include "cu_stub_sctp.h"
23 #include "cu_stub_egtp.h"
26 #define CU_NAME "ORAN_OAM_CU"
27 #define DU_IP_V4_ADDR "10.0.2.20"
28 #define CU_IP_V4_ADDR "10.0.2.25"
29 #define DU_IP_V6_ADDR "0000:0000:0000:0000:0000:0000:0000:0001"
30 #define CU_IP_V6_ADDR "0000:0000:0000:0000:0000:0000:0000:0011"
33 #define DU_EGTP_PORT 39001
34 #define CU_EGTP_PORT 39002
44 /*******************************************************************
46 * @brief Handles SCTP notification
50 * Function : sctpNtfyInd
53 * Handles SCTP notification
55 * @params[in] sctp notification
58 ******************************************************************/
59 void sctpNtfyInd(CmInetSctpNotification *ntfy)
66 openlog("CU_STUB",LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
68 /*******************************************************************
70 * @brief Main function of CU APP
77 * - Reads CU related configurations
78 * - Initialize SCTP Parameters
79 * - Start SCTP receiver thread
82 * @return ROK - success
85 * ****************************************************************/
90 DU_LOG("\nStarting CU_STUB");
91 /* Read CU configurations */
98 /* Initializing SCTP global parameters */
101 /* Start CU-SCTP to listen on incoming connection */
108 /*******************************************************************
110 * @brief Read CU related configuration
114 * Function : readCuCfg
117 * - RRead CU related configuration
120 * @return ROK - success
123 * ****************************************************************/
127 U32 ipv4_du, ipv4_cu;
129 DU_LOG("\nReading CU configurations");
131 cmInetAddr((S8*)DU_IP_V4_ADDR, &ipv4_du);
132 cmInetAddr((S8*)CU_IP_V4_ADDR, &ipv4_cu);
133 //U32 ipv6_int = inet_addr(DU_IP_V6_ADDR);
135 cuCfgParams.cuId = CU_ID;
136 strcpy(cuCfgParams.cuName, CU_NAME);
138 /* DU IP Address and Port*/
139 cuCfgParams.sctpParams.duIpAddr.ipV4Addr = ipv4_du;
140 cuCfgParams.sctpParams.duIpAddr.ipV6Pres = false;
141 cuCfgParams.sctpParams.duPort = DU_PORT;
143 /* CU IP Address and Port*/
144 cuCfgParams.sctpParams.cuIpAddr.ipV4Addr = ipv4_cu;
145 cuCfgParams.sctpParams.cuIpAddr.ipV6Pres = false;
146 cuCfgParams.sctpParams.cuPort = CU_PORT;
149 cuCfgParams.plmn.mcc[0] = PLMN_MCC0;
150 cuCfgParams.plmn.mcc[1] = PLMN_MCC1;
151 cuCfgParams.plmn.mcc[2] = PLMN_MCC2;
152 cuCfgParams.plmn.mnc[0] = PLMN_MNC0;
153 cuCfgParams.plmn.mnc[1] = PLMN_MNC1;
154 cuCfgParams.plmn.mnc[2] = PLMN_MNC2;
157 cuCfgParams.rrcVersion.rrcVer = RRC_VER;
158 cuCfgParams.rrcVersion.extRrcVer = EXT_RRC_VER;
161 /* EGTP Parameters */
162 cuCfgParams.egtpParams.localIp.ipV4Pres = TRUE;
163 cuCfgParams.egtpParams.localIp.ipV4Addr = ipv4_cu;
164 cuCfgParams.egtpParams.localPort = CU_EGTP_PORT;
165 cuCfgParams.egtpParams.destIp.ipV4Pres = TRUE;
166 cuCfgParams.egtpParams.destIp.ipV4Addr = ipv4_du;
167 cuCfgParams.egtpParams.destPort = DU_EGTP_PORT;
168 cuCfgParams.egtpParams.minTunnelId = 0;
169 cuCfgParams.egtpParams.maxTunnelId = 10;
171 } /* End of readCuCfg */
172 /**********************************************************************
174 **********************************************************************/