Added code for MAC-PHY interface, DU_APP, F1AP, SCTP and CU stub
[o-du/l2.git] / src / cu_app / cu_util.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
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                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
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 *******************************************************************************/
18
19 /* This file contains configurations for CU */
20
21 #include "cu_mgr_main.h"
22
23 #define CU_ID 1
24 #define CU_NAME "Oran_OAM_CU"
25 #define DU_IP_V4_ADDR "127.0.0.1"
26 #define CU_IP_V4_ADDR "127.0.0.2"
27 #define DU_IP_V6_ADDR "0000:0000:0000:0000:0000:0000:0000:0001"
28 #define CU_IP_V6_ADDR "0000:0000:0000:0000:0000:0000:0000:0011"
29 #define DU_PORT 38472
30 #define CU_PORT 38472 
31
32 /*******************************************************************
33  *
34  * @brief Read CU related configuration
35  *
36  * @details
37  *
38  *    Function : readCuCfg
39  *
40  *    Functionality:
41  *            - RRead CU related configuration
42  *
43  * @params[in] 
44  * @return ROK     - success
45  *         RFAILED - failure
46  *
47  * ****************************************************************/
48
49 void readCuCfg()
50 {
51    printf("\nReading CU configurations");
52    
53    cuCfgParams.cuId = CU_ID;
54    strcpy(cuCfgParams.cuName, CU_NAME);
55  
56    /* DU IP Address and Port*/
57    cuCfgParams.sctpParams.duIpAddr.ipV4Pres = true;
58    strcpy(cuCfgParams.sctpParams.duIpAddr.ipV4Addr, (char*)DU_IP_V4_ADDR);
59    cuCfgParams.sctpParams.duIpAddr.ipV6Pres = false;
60    strcpy(cuCfgParams.sctpParams.duIpAddr.ipV6Addr, (char*)DU_IP_V6_ADDR);
61    cuCfgParams.sctpParams.duPort = DU_PORT;
62
63    /* CU IP Address and Port*/
64    cuCfgParams.sctpParams.cuIpAddr.ipV4Pres = true;
65    strcpy(cuCfgParams.sctpParams.cuIpAddr.ipV4Addr, (char*)CU_IP_V4_ADDR);
66    printf("\nCU IP Address %s",cuCfgParams.sctpParams.cuIpAddr.ipV4Addr);
67    cuCfgParams.sctpParams.cuIpAddr.ipV6Pres = false;
68    printf("\nCU IP Address %s",cuCfgParams.sctpParams.cuIpAddr.ipV4Addr);
69    strcpy(cuCfgParams.sctpParams.cuIpAddr.ipV6Addr, DU_IP_V6_ADDR);
70    cuCfgParams.sctpParams.cuPort = CU_PORT;
71    
72 } /* End of readCuCfg */
73
74 /**********************************************************************
75          End of file
76 **********************************************************************/