1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2020] [HCL Technologies Ltd.] #
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 file contains definitions of startup configuration structure */
23 #include "GlobalDefs.h"
24 #include "TcpClient.h"
28 /*******************************************************************
30 * @brief Get the startup config from Netconf
34 * Function : getStartupConfig
37 * - Get the start up IP and port for DU,CU and RIC
39 * @params[in] pointer to StartupConfig
40 * @return ROK - success
42 ******************************************************************/
43 uint8_t getStartupConfig(StartupConfig *cfg)
45 O1_LOG("\nCONFIG : getStartupConfig ------ \n");
47 msg.msgType = CONFIGURATION;
48 msg.action = GET_STARTUP_CONFIG;
49 if (openSocket(TCP_SERVER_IP,TCP_PORT) == RFAILED)
53 if (sendData(&msg,sizeof(msg)) < 0 )
58 if (receiveData(cfg, sizeof(StartupConfig)) < 0)
63 O1_LOG("\nCONFIG : ip du %s\n",cfg->DU_IPV4_Addr );
64 O1_LOG("\nCONFIG : ip cu %s\n",cfg->CU_IPV4_Addr );
65 O1_LOG("\nCONFIG : ip ric %s\n",cfg->RIC_IPV4_Addr );
66 O1_LOG("\nCONFIG : port cu %hu\n",cfg->CU_Port);
67 O1_LOG("\nCONFIG : port du %hu\n",cfg->DU_Port);
68 O1_LOG("\nCONFIG : port ric %hu\n",cfg->RIC_Port);
75 /**********************************************************************
77 **********************************************************************/