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"
25 #define CU_NAME "ORAN_OAM_CU"
26 #define DU_IP_V4_ADDR "10.0.2.20"
27 #define CU_IP_V4_ADDR "10.0.2.25"
28 #define DU_IP_V6_ADDR "0000:0000:0000:0000:0000:0000:0000:0001"
29 #define CU_IP_V6_ADDR "0000:0000:0000:0000:0000:0000:0000:0011"
33 /*******************************************************************
35 * @brief Handles SCTP notification
39 * Function : sctpNtfyInd
42 * Handles SCTP notification
44 * @params[in] sctp notification
47 ******************************************************************/
48 void sctpNtfyInd(CmInetSctpNotification *ntfy)
53 /*******************************************************************
55 * @brief Main function of CU APP
62 * - Reads CU related configurations
63 * - Initialize SCTP Parameters
64 * - Start SCTP receiver thread
67 * @return ROK - success
70 * ****************************************************************/
74 printf("\nStarting cu_app");
76 /* Read CU configurations */
79 /* Initializing SCTP global parameters */
80 sctpActvInit(0, 0, 0, 0);
82 /* Start CU-SCTP to listen on incoming connection */
88 /*******************************************************************
90 * @brief Read CU related configuration
94 * Function : readCuCfg
97 * - RRead CU related configuration
100 * @return ROK - success
103 * ****************************************************************/
107 U32 ipv4_du, ipv4_cu;
109 printf("\nReading CU configurations");
111 cmInetAddr((S8*)DU_IP_V4_ADDR, &ipv4_du);
112 cmInetAddr((S8*)CU_IP_V4_ADDR, &ipv4_cu);
113 //U32 ipv6_int = inet_addr(DU_IP_V6_ADDR);
115 cuCfgParams.cuId = CU_ID;
116 strcpy(cuCfgParams.cuName, CU_NAME);
118 /* DU IP Address and Port*/
119 cuCfgParams.sctpParams.duIpAddr.ipV4Pres = true;
120 cuCfgParams.sctpParams.duIpAddr.ipV4Addr = ipv4_du;
121 cuCfgParams.sctpParams.duIpAddr.ipV6Pres = false;
122 //strcpy(cuCfgParams.sctpParams.duIpAddr.ipV6Addr, (char*)DU_IP_V6_ADDR);
123 cuCfgParams.sctpParams.duPort = DU_PORT;
125 /* CU IP Address and Port*/
126 cuCfgParams.sctpParams.cuIpAddr.ipV4Pres = true;
127 cuCfgParams.sctpParams.cuIpAddr.ipV4Addr = ipv4_cu;
128 cuCfgParams.sctpParams.cuIpAddr.ipV6Pres = false;
129 //strcpy(cuCfgParams.sctpParams.cuIpAddr.ipV6Addr, DU_IP_V6_ADDR);
130 cuCfgParams.sctpParams.cuPort = CU_PORT;
132 } /* End of readCuCfg */
133 /**********************************************************************
135 **********************************************************************/