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 ric_app */
22 #include "ric_stub_sctp.h"
25 #define RIC_NAME "ORAN_OAM_RIC"
26 #define DU_IP_V4_ADDR "10.0.2.20"
27 #define RIC_IP_V4_ADDR "10.0.2.30"
28 #define DU_IP_V6_ADDR "0000:0000:0000:0000:0000:0000:0000:0001"
29 #define RIC_IP_V6_ADDR "0000:0000:0000:0000:0000:0000:0000:0011"
31 #define RIC_PORT 38482
41 /*******************************************************************
43 * @brief Handles SCTP notification
47 * Function : sctpNtfyInd
50 * Handles SCTP notification
52 * @params[in] sctp notification
55 ******************************************************************/
56 void sctpNtfyInd(CmInetSctpNotification *ntfy)
63 openlog("RIC_STUB",LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
65 /*******************************************************************
67 * @brief Main function of E2 APP
74 * - Reads RIC related configurations
75 * - Initialize SCTP Parameters
76 * - Start SCTP receiver thread
79 * @return ROK - success
82 * ****************************************************************/
88 DU_LOG("\nStarting RIC_STUB");
89 /* Read RIC configurations */
92 /* Start RIC-SCTP to listen on incoming connection */
98 /*******************************************************************
100 * @brief Read RIC related configuration
104 * Function : readRicCfg
107 * - Read RIC related configuration
110 * @return ROK - success
113 * ****************************************************************/
117 U32 ipv4_du, ipv4_ric;
119 DU_LOG("\nReading RIC configurations");
121 cmInetAddr((S8*)DU_IP_V4_ADDR, &ipv4_du);
122 cmInetAddr((S8*)RIC_IP_V4_ADDR, &ipv4_ric);
124 ricCfgParams.ricId = RIC_ID;
125 strcpy(ricCfgParams.ricName, RIC_NAME);
127 /* DU IP Address and Port*/
128 ricCfgParams.sctpParams.duIpAddr.ipV4Addr = ipv4_du;
129 ricCfgParams.sctpParams.duIpAddr.ipV6Pres = false;
130 ricCfgParams.sctpParams.duPort = DU_PORT;
132 /* RIC IP Address and Port*/
133 ricCfgParams.sctpParams.ricIpAddr.ipV4Addr = ipv4_ric;
134 ricCfgParams.sctpParams.ricIpAddr.ipV6Pres = false;
135 ricCfgParams.sctpParams.ricPort = RIC_PORT;
138 ricCfgParams.plmn.mcc[0] = PLMN_MCC0;
139 ricCfgParams.plmn.mcc[1] = PLMN_MCC1;
140 ricCfgParams.plmn.mcc[2] = PLMN_MCC2;
141 ricCfgParams.plmn.mnc[0] = PLMN_MNC0;
142 ricCfgParams.plmn.mnc[1] = PLMN_MNC1;
143 ricCfgParams.plmn.mnc[2] = PLMN_MNC2;
145 } /* End of readCuCfg */
146 /**********************************************************************
148 **********************************************************************/