f73c392665c0e7668b009237c8e865a252e5e1f7
[o-du/l2.git] / src / du_app / du_cfg.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 all utility functions */
20 #include "common_def.h"
21
22 #include <libxml/parser.h>
23 #include <libxml/tree.h>
24 #include <libxml/xmlmemory.h>
25 #include <arpa/inet.h>
26
27 #include "du_tmr.h"
28 #include "legtp.h"
29 #include "lrg.h"
30 #include "lkw.x"
31 #include "lrg.x"
32 #include "du_app_mac_inf.h"
33 #include "du_app_rlc_inf.h"
34 #include "du_e2ap_mgr.h"
35 #include "du_cfg.h"
36 #include "du_mgr.h"
37 #include "du_utils.h"
38 #include "du_f1ap_conversions.h"
39 #include "OCTET_STRING.h"
40 #include "BIT_STRING.h"
41 #include "odu_common_codec.h"
42 #include "MIB.h"
43 #include "SearchSpace.h"
44 #include "SIB-TypeInfo.h"
45 #include "SchedulingInfo.h"
46 #include "SI-SchedulingInfo.h"
47 #include "ConnEstFailureControl.h"
48 #include "PLMN-IdentityInfo.h"
49 #include "PDSCH-TimeDomainResourceAllocation.h"
50 #include "BCCH-Config.h"
51 #include "PagingCycle.h"
52 #include "PCCH-Config.h"
53 #include "TimeAlignmentTimer.h"
54 #include "BCCH-DL-SCH-Message.h"
55 #include "RACH-ConfigGeneric.h"
56 #include "PUSCH-TimeDomainResourceAllocation.h"
57 #include "PUCCH-ConfigCommon.h"
58 #include "SubcarrierSpacing.h"
59 #include "TDD-UL-DL-Pattern.h"
60 #include "RACH-ConfigCommon.h"
61 #include "BWP-DownlinkCommon.h"
62 #include "BWP-UplinkCommon.h"
63 #include "TDD-UL-DL-ConfigCommon.h"
64 #include "du_sys_info_hdl.h"
65
66 #ifdef O1_ENABLE
67 #include "CmInterface.h"
68 extern StartupConfig g_cfg;
69 extern NRCellDU cellParams;
70 #endif
71
72 char encBuf[ENC_BUF_MAX_LEN];
73
74 /*******************************************************************
75  *
76  * @brief Configures the DU Parameters
77  *
78  * @details
79  *
80  *    Function : calcSliv
81  *
82  *    Functionality:
83  *       - calculate SLIV value from start and length field
84  *
85  * @params[in] start symbol
86  * @params[in] length of symbols
87  * @return SLIV value
88  *
89  * ****************************************************************/
90 uint16_t calcSliv(uint8_t startSymbol, uint8_t lengthSymbol)
91 {
92    uint16_t sliv = 0;
93    if((lengthSymbol-1) <= 7)
94    {
95       sliv = NUM_SYMBOLS_PER_SLOT * (lengthSymbol-1) + startSymbol;
96    }
97    else
98    {
99       sliv = NUM_SYMBOLS_PER_SLOT * (NUM_SYMBOLS_PER_SLOT - lengthSymbol + 1) \
100              + (NUM_SYMBOLS_PER_SLOT - 1 - startSymbol);
101    }
102    return sliv;
103 }
104
105 /*******************************************************************
106  *
107  * @brief Configures the DU Parameters
108  *
109  * @details
110  *
111  *    Function : readCfg
112  *
113  *    Functionality:
114  *       - Initializes the DuCfg members.  
115  *       - Calls readMacCfg()  
116  *
117  * @params[in] system task ID
118  * @return ROK     - success
119  *         RFAILED - failure
120  *
121  * ****************************************************************/
122
123 uint8_t readCfg()
124 {
125    CmLList *node;
126    uint8_t srvdCellIdx, bandIdx, sliceIdx, plmnIdx, ranFuncIdx, eventTriggerStyleIdx, reportStyleIdx, tnlAssocIdx;
127    uint8_t brdcstPlmnIdx, freqBandIdx, srvdPlmnIdx;
128    MibParams mib;
129    Sib1Params sib1;
130    SupportedSliceList *taiSliceSuppLst;
131    uint8_t measurementInfoIdx =0, measurementInfoLen=0;
132    char shortName[] = SHORT_NAME;
133    char serviceModelOID[]= SERVICE_MODEL_OID;
134    char  description[] = DESCRIPTION;
135    char event_trigger_style_name[]= EVENT_TRIGGER_STYLE_NAME;
136    char ric_report_style_name[]= REPORT_STYLE_NAME;
137
138 #ifndef O1_ENABLE
139    /* Note: Added these below variable for local testing*/
140    Snssai snssai[NUM_OF_SUPPORTED_SLICE] = {{1,{2,3,4}},{5,{6,7,8}}};
141 #endif
142
143    duCb.e2apDb.e2TransInfo.transIdCounter = 0;
144    duCb.e2apDb.numOfRanFunction = 1;
145    for(ranFuncIdx =0; ranFuncIdx<duCb.e2apDb.numOfRanFunction; ranFuncIdx++)
146    {
147       duCb.e2apDb.ranFunction[ranFuncIdx].id = ranFuncIdx + 1;
148       memcpy(&duCb.e2apDb.ranFunction[ranFuncIdx].name.shortName, shortName, sizeof(shortName));
149       memcpy(&duCb.e2apDb.ranFunction[ranFuncIdx].name.serviceModelOID, serviceModelOID, sizeof(serviceModelOID));
150       memcpy(&duCb.e2apDb.ranFunction[ranFuncIdx].name.description, description, sizeof(description));
151       duCb.e2apDb.ranFunction[ranFuncIdx].revisionCounter = 0;
152       
153       duCb.e2apDb.ranFunction[ranFuncIdx].numOfEventTriggerStyleSupported  = NUM_OF_EVENT_TRIGGER_STYLE_SUPPORTED;
154       for(eventTriggerStyleIdx=0; eventTriggerStyleIdx<duCb.e2apDb.ranFunction[ranFuncIdx].numOfEventTriggerStyleSupported; eventTriggerStyleIdx++)
155       {
156          duCb.e2apDb.ranFunction[ranFuncIdx].eventTriggerStyleList[eventTriggerStyleIdx].styleType = EVENT_TRIGGER_STYLE_TYPE;
157          duCb.e2apDb.ranFunction[ranFuncIdx].eventTriggerStyleList[eventTriggerStyleIdx].formatType = EVENT_TRIGGER_STYLE_FORMAT_TYPE;
158          memcpy(duCb.e2apDb.ranFunction[ranFuncIdx].eventTriggerStyleList[eventTriggerStyleIdx].name, event_trigger_style_name, sizeof(event_trigger_style_name));
159       }
160       
161       duCb.e2apDb.ranFunction[ranFuncIdx].numOfReportStyleSupported= NUM_OF_RIC_REPORT_STYLE_SUPPORTED;
162       for(reportStyleIdx=0; reportStyleIdx<duCb.e2apDb.ranFunction[ranFuncIdx].numOfReportStyleSupported; reportStyleIdx++)
163       {
164          duCb.e2apDb.ranFunction[ranFuncIdx].reportStyleList[reportStyleIdx].reportStyle.styleType = REPORT_STYLE_TYPE;
165          duCb.e2apDb.ranFunction[ranFuncIdx].reportStyleList[reportStyleIdx].reportStyle.formatType = REPORT_ACTION_FORMAT_TYPE;
166          memcpy(duCb.e2apDb.ranFunction[ranFuncIdx].reportStyleList[reportStyleIdx].reportStyle.name, ric_report_style_name, sizeof(ric_report_style_name));
167          
168          for(measurementInfoIdx =0; measurementInfoIdx<NUM_OF_MEASUREMENT_INFO_SUPPORTED(CONFIG_ADD); measurementInfoIdx++)
169          {
170             measurementInfoLen= strlen(MEASUREMENT_TYPE_NAME[measurementInfoIdx]);
171             MeasurementInfoForAction *measurementInfoForAction;
172             DU_ALLOC(measurementInfoForAction, sizeof(MeasurementInfoForAction));
173             if(measurementInfoForAction)
174             {
175                measurementInfoForAction->measurementTypeId = measurementInfoIdx+1;
176                memcpy(measurementInfoForAction->measurementTypeName, MEASUREMENT_TYPE_NAME[measurementInfoIdx], measurementInfoLen+1);
177             }
178             DU_ALLOC(node, sizeof(CmLList));
179             if(node)
180             {
181                node->node = (PTR) measurementInfoForAction;
182                cmLListAdd2Tail(&duCb.e2apDb.ranFunction[ranFuncIdx].reportStyleList[reportStyleIdx].measurementInfoList, node);
183             }
184             else
185             {
186
187                DU_FREE(measurementInfoForAction, sizeof(MeasurementInfoForAction));
188             }
189          }
190       }
191       
192       duCb.e2apDb.ranFunction[ranFuncIdx].ricIndicationHeaderFormat = RIC_INDICATION_HEADER_FORMAT;
193       duCb.e2apDb.ranFunction[ranFuncIdx].ricIndicationMessageFormat = RIC_INDICATION_MESSAGE_FORMAT; 
194
195       cmLListInit(&duCb.e2apDb.ranFunction[ranFuncIdx].subscriptionList);
196    }
197    memset(duCb.e2apDb.e2TransInfo.e2InitTransaction, 0, MAX_NUM_TRANSACTION * sizeof(E2TransInfo));
198    memset(duCb.e2apDb.e2TransInfo.ricInitTransaction, 0, MAX_NUM_TRANSACTION * sizeof(E2TransInfo));
199    
200    for(srvdCellIdx=0; srvdCellIdx<DEFAULT_CELLS; srvdCellIdx++)
201    { 
202       memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn, 0, sizeof(Plmn));
203       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[0] = PLMN_MCC0;
204       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[1] = PLMN_MCC1;
205       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mcc[2] = PLMN_MCC2;
206       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mnc[0] = PLMN_MNC0;
207       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrCgi.plmn.mnc[1] = PLMN_MNC1;
208
209       /*Cell ID */
210  #ifdef O1_ENABLE
211       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrPci = cellParams.nRPCI;
212  #else
213       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.nrPci = NR_PCI;
214 #endif
215       /* List of Available PLMN */
216       for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
217       {
218          /* As per spec 38.473, Plmn identity consists of 3 digit from mcc
219           * followed by either 2 digit or 3 digits of mnc */ 
220
221          memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn, 0,\
222          sizeof(Plmn));
223  #ifdef O1_ENABLE
224          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[0] = cellParams.plmnList[srvdPlmnIdx].mcc[0];
225          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[1] = cellParams.plmnList[srvdPlmnIdx].mcc[1];
226          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[2] = cellParams.plmnList[srvdPlmnIdx].mcc[2];
227          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[0] = cellParams.plmnList[srvdPlmnIdx].mnc[0];
228          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[1] = cellParams.plmnList[srvdPlmnIdx].mnc[1];
229          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[2] = cellParams.plmnList[srvdPlmnIdx].mnc[2];
230  #else
231          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[0] = PLMN_MCC0;
232          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[1] = PLMN_MCC1;
233          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mcc[2] = PLMN_MCC2;
234          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[0] = PLMN_MNC0;
235          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].plmn.mnc[1] = PLMN_MNC1;
236 #endif
237       }
238       /* List of Extended PLMN */
239       for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
240       {
241          /* As per spec 38.473, Plmn identity consists of 3 digit from mcc
242           * followed by either 2 digit or 3 digits of mnc */ 
243
244          memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn, 0, sizeof(Plmn));
245          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[0] = PLMN_MCC0;
246          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[1] = PLMN_MCC1;
247          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mcc[2] = PLMN_MCC2;
248          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mnc[0] = PLMN_MNC0;
249          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].extPlmn.mnc[1] = PLMN_MNC1;
250       } 
251       /* List of Supporting Slices */
252       for(srvdPlmnIdx=0; srvdPlmnIdx<MAX_PLMN; srvdPlmnIdx++)
253       {
254          taiSliceSuppLst = &duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellInfo.srvdPlmn[srvdPlmnIdx].\
255          taiSliceSuppLst;
256          
257          /* TODO Calculte the exact number of supported slices once will get
258           * cell configuration from O1 */
259          taiSliceSuppLst->numSupportedSlices = NUM_OF_SUPPORTED_SLICE;
260          if(taiSliceSuppLst->numSupportedSlices > MAX_NUM_OF_SLICE_ITEMS)
261          {
262             DU_LOG("\nERROR --> DU_APP: readCfg(): Number of supported slice [%d] is more than 1024",\
263             taiSliceSuppLst->numSupportedSlices);
264             return RFAILED;
265          }
266
267          DU_ALLOC(taiSliceSuppLst->snssai, taiSliceSuppLst->numSupportedSlices*sizeof(Snssai*));
268          if(taiSliceSuppLst->snssai == NULLP)
269          {
270             DU_LOG("\nERROR --> DU_APP: readCfg():Memory allocation failed");
271             return RFAILED;
272          }
273          
274          for(sliceIdx=0; sliceIdx<taiSliceSuppLst->numSupportedSlices; sliceIdx++)
275          {
276             DU_ALLOC(taiSliceSuppLst->snssai[sliceIdx], sizeof(Snssai));
277             if(taiSliceSuppLst->snssai[sliceIdx] == NULLP)
278             {
279                DU_LOG("\nERROR --> DU_APP: readCfg():Memory allocation failed");
280                return RFAILED;
281             }
282 #ifdef O1_ENABLE
283             memcpy(taiSliceSuppLst->snssai[sliceIdx]->sd, cellParams.plmnList[sliceIdx].sd, \
284                   SD_SIZE*sizeof(uint8_t));
285             taiSliceSuppLst->snssai[sliceIdx]->sst = cellParams.plmnList[sliceIdx].sst;
286 #else
287             memcpy(taiSliceSuppLst->snssai[sliceIdx], &snssai[sliceIdx], sizeof(Snssai));
288 #endif
289          }
290       }
291
292       /* NR Mode info */
293 #ifdef NR_TDD
294       /* NR TDD Mode info */
295 #ifdef O1_ENABLE      
296       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = cellParams.arfcnUL;
297       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL;
298       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);                
299 #else
300       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.nrArfcn = NR_UL_ARFCN;
301       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
302       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrScs = NR_SCS;                 
303 #endif      
304       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.sulInfo.sulTxBw.nrb = NRB_273;         
305
306       for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
307       {
308          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[freqBandIdx].nrFreqBand =\
309                                                                                                                      NR_FREQ_BAND;
310          for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
311          {
312             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.tdd.nrFreqInfo.freqBand[freqBandIdx].sulBand[bandIdx]\
313                = SUL_BAND;      
314          }
315       }
316 #else
317       /* NR FDD Mode info */
318 #ifdef O1_ENABLE
319       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = cellParams.arfcnUL;
320       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL;
321       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
322       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
323       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = cellParams.arfcnDL;
324       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = cellParams.arfcnSUL;
325       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
326       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
327 #else
328       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.nrArfcn = NR_UL_ARFCN;
329       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
330       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrScs = NR_SCS;
331       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrScs = NR_SCS;
332       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.nrArfcn = NR_DL_ARFCN;
333       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulArfcn = SUL_ARFCN;
334       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrScs = NR_SCS;
335       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrScs = NR_SCS;
336 #endif
337       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
338       for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
339       {
340          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[freqBandIdx].\
341          nrFreqBand = NR_FREQ_BAND;
342          for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
343          {
344             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulNrFreqInfo.freqBand[freqBandIdx].\
345             sulBand[bandIdx] = SUL_BAND;
346          }
347       }
348       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.sulInfo.sulTxBw.nrb = NRB_106;
349       for(freqBandIdx=0; freqBandIdx<MAX_NRCELL_BANDS; freqBandIdx++)
350       {
351          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[freqBandIdx].\
352          nrFreqBand = NR_FREQ_BAND;
353          for(bandIdx=0; bandIdx<MAX_NRCELL_BANDS; bandIdx++)
354          {
355             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlNrFreqInfo.freqBand[freqBandIdx].\
356             sulBand[bandIdx] = SUL_BAND;
357          }
358       }
359
360       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.ulTxBw.nrb = NRB_106;
361       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.f1Mode.mode.fdd.dlTxBw.nrb = NRB_106;
362 #endif
363
364       /*Measurement Config and Cell Config */ 
365       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.measTimeCfgDuration = TIME_CFG; 
366
367       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellDir = DL_UL; 
368
369       duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.cellType=CELL_TYPE;
370
371       /* Broadcast PLMN Identity */
372       for(brdcstPlmnIdx=0; brdcstPlmnIdx<MAX_BPLMN_NRCELL_MINUS_1; brdcstPlmnIdx++)
373       { 
374          for(plmnIdx=0; plmnIdx<MAX_PLMN; plmnIdx++)
375          {
376             memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx],\
377             0, sizeof(Plmn));
378             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[0] =\
379             PLMN_MCC0;
380             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[1] =\
381             PLMN_MCC1;
382             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mcc[2] =\
383             PLMN_MCC2;
384             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mnc[0] =\
385             PLMN_MNC0;
386             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].plmn[plmnIdx].mnc[1] =\
387             PLMN_MNC1;
388          }
389          /* Extended PLMN List */        
390          for(plmnIdx=0; plmnIdx<MAX_PLMN; plmnIdx++)
391          {
392             memset(&duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
393             extPlmn[plmnIdx], 0, sizeof(Plmn));
394             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
395             extPlmn[plmnIdx].mcc[0] = PLMN_MCC0;
396             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
397             extPlmn[plmnIdx].mcc[1] = PLMN_MCC1;
398             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
399             extPlmn[plmnIdx].mcc[2] = PLMN_MCC2;
400             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
401             extPlmn[plmnIdx].mnc[0] = PLMN_MNC0;
402             duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].\
403             extPlmn[plmnIdx].mnc[1] = PLMN_MNC1;
404          }
405 #ifdef O1_ENABLE
406          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.epsTac = cellParams.nRTAC; //TODO : to check and fill
407          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.tac = cellParams.nRTAC;
408          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].tac = cellParams.nRTAC;
409          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].nrCellId = cellParams.cellLocalId;
410 #else       
411          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.epsTac = DU_TAC; //TODO : to check and fill
412          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.tac = DU_TAC;
413          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].tac = DU_TAC;
414          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].nrCellId = NR_CELL_ID;
415 #endif     
416          duCfgParam.srvdCellLst[srvdCellIdx].duCellInfo.brdcstPlmnInfo[brdcstPlmnIdx].ranac = NR_RANAC;
417       }
418
419       /*gnb DU System Info mib msg*/
420       BuildMibMsg();
421       DU_ALLOC(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg, encBufSize);
422       if(!(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg))
423       {
424          DU_LOG("\nERROR  -->  DU APP : Memory allocation failure at readCfg");
425          return RFAILED;
426       }
427       memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibMsg, encBuf, encBufSize);
428       duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.mibLen = encBufSize;
429
430       /*gnb DU System Info mib msg*/
431       BuildSib1Msg();
432       DU_ALLOC(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\
433             encBufSize);
434       if(!(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg))
435       {
436          DU_LOG("\nERROR  -->  DU APP : Memory allocation failure at readCfg");
437          return RFAILED;
438       }
439       memcpy(duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Msg,\
440             encBuf,encBufSize);
441       duCfgParam.srvdCellLst[srvdCellIdx].duSysInfo.sib1Len = encBufSize;
442
443    }
444
445    return ROK;
446 }
447
448 /*******************************************************************
449  *
450  * @brief Copy Slice Cfg in temp structre in duCfgParams 
451  *
452  * @details
453  *
454  *    Function : cpyRrmPolicyInDuCfgParams
455  *
456  *    Functionality:
457  *      - Copy Slice Cfg in temp structre in duCfgParams 
458  *
459  * @params[in] RrmPolicy rrmPolicy[], uint8_t policyNum, uint8_t memberList
460  * @return ROK     - success
461  *         RFAILED - failure
462  *
463  * ****************************************************************/
464 uint8_t cpyRrmPolicyInDuCfgParams(RrmPolicyList rrmPolicy[], uint8_t policyNum, MacSliceCfgReq *tempSliceCfg)
465 {
466    uint8_t policyIdx = 0, memberListIdx = 0;
467    if(policyNum)
468    {
469       tempSliceCfg->numOfRrmPolicy = policyNum;
470       DU_ALLOC_SHRABL_BUF(tempSliceCfg->listOfRrmPolicy, tempSliceCfg->numOfRrmPolicy  * sizeof(MacSliceRrmPolicy*));
471       if(!tempSliceCfg->listOfRrmPolicy)
472       {
473          DU_LOG("\nERROR  --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
474          return RFAILED;
475       }
476
477       for(policyIdx = 0; policyIdx<tempSliceCfg->numOfRrmPolicy; policyIdx++)
478       {
479          DU_ALLOC_SHRABL_BUF(tempSliceCfg->listOfRrmPolicy[policyIdx], sizeof(MacSliceRrmPolicy));
480          if(!tempSliceCfg->listOfRrmPolicy[policyIdx])
481          {
482             DU_LOG("\nERROR  --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
483             return RFAILED;
484          }
485
486          tempSliceCfg->listOfRrmPolicy[policyIdx]->resourceType = rrmPolicy[policyIdx].resourceType;
487
488          tempSliceCfg->listOfRrmPolicy[policyIdx]->numOfRrmPolicyMem = rrmPolicy[policyIdx].rRMMemberNum;
489
490          if(tempSliceCfg->listOfRrmPolicy[policyIdx]->numOfRrmPolicyMem)
491          {
492             DU_ALLOC_SHRABL_BUF(tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList,\
493             tempSliceCfg->listOfRrmPolicy[policyIdx]->numOfRrmPolicyMem * sizeof(RrmPolicyMemberList*));
494
495             if(!tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList)
496             {
497                DU_LOG("\nERROR  --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
498                return RFAILED;
499             }
500
501
502             for(memberListIdx = 0; memberListIdx<tempSliceCfg->listOfRrmPolicy[policyIdx]->numOfRrmPolicyMem; memberListIdx++)
503             {
504                DU_ALLOC_SHRABL_BUF(tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx], sizeof(RrmPolicyMemberList));
505                if(!tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx])
506                {
507                   DU_LOG("\nERROR  --> DU APP : Memory allocation failed in cpyRrmPolicyInDuCfgParams");
508                   return RFAILED;
509                }
510                memcpy(&tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx]->snssai.sd,\
511                &rrmPolicy[policyIdx].rRMPolicyMemberList[memberListIdx].sd, 3 * sizeof(uint8_t));
512                memcpy(&tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx]->snssai.sst,\
513                &rrmPolicy[policyIdx].rRMPolicyMemberList[memberListIdx].sst, sizeof(uint8_t));
514                memcpy(&tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx]->plmn.mcc,\
515                &rrmPolicy[policyIdx].rRMPolicyMemberList[memberListIdx].mcc, 3 * sizeof(uint8_t));
516                memcpy(&tempSliceCfg->listOfRrmPolicy[policyIdx]->rRMPolicyMemberList[memberListIdx]->plmn.mnc,\
517                &rrmPolicy[policyIdx].rRMPolicyMemberList[memberListIdx].mnc, 3 * sizeof(uint8_t));
518             }
519             tempSliceCfg->listOfRrmPolicy[policyIdx]->policyRatio.maxRatio = rrmPolicy[policyIdx].rRMPolicyMaxRatio;
520             tempSliceCfg->listOfRrmPolicy[policyIdx]->policyRatio.minRatio = rrmPolicy[policyIdx].rRMPolicyMinRatio;
521             tempSliceCfg->listOfRrmPolicy[policyIdx]->policyRatio.dedicatedRatio = rrmPolicy[policyIdx].rRMPolicyDedicatedRatio;
522          }
523       }
524    }
525
526    return ROK;
527 }
528
529 /*******************************************************************
530  *
531  * @brief Fill SCTP Parameters
532  *
533  * @details
534  *
535  *    Function : parseSctpParams
536  *
537  *    Functionality: Fill SCTP Parameters
538  *
539  * @params[in] XML document pointer
540  *             XML namespace
541  *             Current node in XML
542  *             Pointer to structure to be filled
543  * @return ROK     - success
544  *         RFAILED - failure
545  *
546  * ****************************************************************/
547 uint8_t parseSctpParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SctpParams *sctp)
548 {
549    uint8_t max_du_port = 0;
550    uint16_t f1_sctp_port = 0;
551    uint16_t e2_sctp_port = 0;
552
553    memset(sctp, 0, sizeof(SctpParams));
554    cur = cur->xmlChildrenNode;
555    while (cur != NULL) 
556    {
557 #ifdef O1_ENABLE
558       sctp->duPort[F1_INTERFACE] = g_cfg.DU_Port;
559       sctp->duPort[E2_INTERFACE] = g_cfg.RIC_Port;
560       sctp->cuPort = g_cfg.CU_Port;
561       sctp->ricPort = g_cfg.RIC_Port;
562 #else
563       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_DU_PORT")) && (cur->ns == ns))
564       {
565          max_du_port = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
566          if (max_du_port == 2 )
567          {
568             sctp->duPort[F1_INTERFACE] = f1_sctp_port;     /* DU Port idx  0  */
569             sctp->duPort[E2_INTERFACE] = e2_sctp_port;    /* RIC Port idx 1  */
570          }
571       }
572
573       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_SCTP_PORT")) && (cur->ns == ns))
574       {
575          f1_sctp_port = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
576       }
577       if ((!xmlStrcmp(cur->name, (const xmlChar *)"E2_SCTP_PORT")) && (cur->ns == ns))
578       {
579          e2_sctp_port = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
580       }
581
582       sctp->cuPort = f1_sctp_port;
583       sctp->ricPort = e2_sctp_port;
584 #endif
585       cur = cur->next;
586    }
587    return ROK;
588 }
589
590 /*******************************************************************
591  *
592  * @brief Fill EGTP Parameters
593  *
594  * @details
595  *
596  *    Function : parseEgtpParams
597  *
598  *    Functionality: Fill EGTP Parmeters
599  *
600  * @params[in] XML document pointer
601  *             XML namespace
602  *             Current node in XML
603  *             Pointer to structure to be filled
604  * @return ROK     - success
605  *         RFAILED - failure
606  *
607  * ****************************************************************/
608 uint8_t parseEgtpParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1EgtpParams *egtp) 
609 {
610    memset(egtp, 0, sizeof(F1EgtpParams));
611    cur = cur->xmlChildrenNode;
612    while (cur != NULL) 
613    {
614       if ((!xmlStrcmp(cur->name, (const xmlChar *)"LOCAL_F1_EGTP_PORT")) && (cur->ns == ns))
615       {
616          egtp->localPort = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
617       }
618       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DEST_F1_EGTP_PORT")) && (cur->ns == ns))
619       {
620          egtp->destPort = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
621       }
622       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MIN_TEID")) && (cur->ns == ns))
623       {
624          egtp->minTunnelId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
625       }
626       cur = cur -> next;
627    }
628    return ROK;
629 }
630
631 /*******************************************************************
632  *
633  * @brief Fill MIB configuration 
634  *
635  * @details
636  *
637  *    Function : parseMibParams
638  *
639  *    Functionality: Fill MIB configuration
640  *
641  * @params[in] XML document pointer
642  *             XML namespace
643  *             Current node in XML
644  *             Pointer to structure to be filled
645  * @return ROK     - success
646  *         RFAILED - failure
647  *
648  * ****************************************************************/
649 uint8_t parseMibParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, MibParams *mib)
650 {
651    memset(mib, 0, sizeof(MibParams));
652    cur = cur -> xmlChildrenNode;
653    while(cur != NULL)
654    {
655       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SYS_FRAME_NUM")) && (cur->ns == ns))
656       {
657          mib->sysFrmNum = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
658       }
659       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SUB_CARR_SPACE")) && (cur->ns == ns))
660       {
661          mib->subCarrierSpacingCommon = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
662       }
663       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_SC_OFFSET")) && (cur->ns == ns))
664       {
665          mib->ssb_SubcarrierOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
666       }
667       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DMRS_TYPEA_POSITION")) && (cur->ns == ns))
668       {
669          mib->dmrs_TypeA_Position = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
670       }
671       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_0_INDEX")) && (cur->ns == ns))
672       {
673          mib->controlResourceSetZero = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
674       }
675       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCHSPACE_0_INDEX")) && (cur->ns == ns))
676       {
677          mib->searchSpaceZero = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
678       }
679       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_BARRED")) && (cur->ns == ns))
680       {
681          mib->cellBarred = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
682       }
683       if ((!xmlStrcmp(cur->name, (const xmlChar *)"INTRA_FREQ_RESELECT")) && (cur->ns == ns))
684       {
685          mib->intraFreqReselection = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
686       }
687       cur = cur -> next;
688    }
689    return ROK;
690 }
691
692 /*******************************************************************
693  *
694  * @brief Fill PLMN ID
695  *
696  * @details
697  *
698  *    Function : parsePlmn
699  *
700  *    Functionality: Fill PLMN ID
701  *
702  * @params[in] XML document pointer
703  *             XML namespace
704  *             Current node in XML
705  *             Pointer to structure to be filled
706  * @return ROK     - success
707  *         RFAILED - failure
708  *
709  * ****************************************************************/
710 uint8_t parsePlmn(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Plmn *plmn)
711 {
712    xmlNodePtr child = NULLP;
713
714    memset(plmn, 0, sizeof(Plmn));
715    cur = cur->xmlChildrenNode;
716    while(cur != NULL)
717    {
718       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MCC")) && (cur->ns == ns))
719       {
720          child = cur->xmlChildrenNode;
721          while (child != NULL)
722          {
723             if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MCC0")) && (child->ns == ns))
724             {
725                plmn->mcc[0] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
726             }
727
728             if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MCC1")) && (child->ns == ns))
729             {
730                plmn->mcc[1] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
731             }
732
733             if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MCC2")) && (child->ns == ns))
734             {
735                plmn->mcc[2] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
736             }
737
738             child = child->next;
739          }
740       }
741
742       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MNC")) && (cur->ns == ns))
743       {
744          child = cur->xmlChildrenNode;
745          while (child != NULL)
746          {
747             if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MNC0")) && (child->ns == ns))
748             {
749                plmn->mnc[0] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));  
750             }
751
752             if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MNC1")) && (child->ns == ns))
753             {
754                plmn->mnc[1] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
755             }
756
757             if ((!xmlStrcmp(child->name, (const xmlChar *)"PLMN_MNC2")) && (child->ns == ns))
758             {
759                plmn->mnc[2] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
760             }
761
762             child = child->next;
763          }
764       }
765
766       cur = cur -> next;
767    }
768    return ROK;
769 }
770
771 /*******************************************************************
772  *
773  * @brief Fill NR CGI
774  *
775  * @details
776  *
777  *    Function : parseNrCgi
778  *
779  *    Functionality: Fill NR CGI
780  *
781  * @params[in] XML document pointer
782  *             XML namespace
783  *             Current node in XML
784  *             Pointer to structure to be filled
785  * @return ROK     - success
786  *         RFAILED - failure
787  *
788  * ****************************************************************/
789 uint8_t parseNrCgi(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, NrEcgi *nrCgi)
790 {
791    memset(nrCgi, 0, sizeof(NrEcgi));
792    cur = cur->xmlChildrenNode;
793    while(cur != NULL)
794    {
795       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns))
796       {
797          if(parsePlmn(doc, ns, cur, &nrCgi->plmn) != ROK)
798          {
799             return RFAILED;
800          }
801       }
802
803       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_ID")) && (cur->ns == ns))
804       {
805          nrCgi-> cellId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
806       }
807
808       cur = cur -> next;
809    }
810    return ROK;
811 }
812
813 /*******************************************************************
814  *
815  * @brief Fill SNSSAI
816  *
817  * @details
818  *
819  *    Function : parseSnssai
820  *
821  *    Functionality: Fill SNSSAI
822  *
823  * @params[in] XML document pointer
824  *             XML namespace
825  *             Current node in XML
826  *             Pointer to structure to be filled
827  * @return ROK     - success
828  *         RFAILED - failure
829  *
830  * ****************************************************************/
831 uint8_t parseSnssai(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Snssai *snssai)
832 {
833    uint8_t sdIdx = 0;
834    xmlNodePtr child;
835
836    memset(snssai, 0, sizeof(Snssai));
837    cur = cur ->xmlChildrenNode;
838    while(cur != NULL)
839    {
840       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SST")) && (cur->ns == ns))
841       {
842          snssai->sst = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
843       }
844
845       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SD_SIZE")) && (cur->ns == ns))
846       {
847          child = cur->xmlChildrenNode;
848          while(child != NULL)
849          {
850             if ((!xmlStrcmp(child->name, (const xmlChar *)"SD")) && (child->ns == ns))
851             {
852                snssai->sd[sdIdx] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
853                sdIdx++;
854             }
855             child = child -> next;
856          }
857       }
858
859       cur = cur -> next;
860    }
861    return ROK;
862 }
863
864 /*******************************************************************
865  *
866  * @brief Fill Supported Slice List
867  *
868  * @details
869  *
870  *    Function : parseSupportedSliceList
871  *
872  *    Functionality: Fill Supported Slice List
873  *
874  * @params[in] XML document pointer
875  *             XML namespace
876  *             Current node in XML
877  *             Pointer to structure to be filled
878  * @return ROK     - success
879  *         RFAILED - failure
880  *
881  * ****************************************************************/
882 uint8_t parseSupportedSliceList(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SupportedSliceList *sliceSuppLst)
883 {
884    uint8_t sliceIdx = 0;
885    xmlNodePtr child = NULLP;
886
887    memset(sliceSuppLst, 0, sizeof(SupportedSliceList));
888    cur = cur->xmlChildrenNode;
889    while(cur != NULL)
890    {
891       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_SUPPORT_SLICE")) && (cur->ns == ns))
892       {
893          sliceSuppLst->numSupportedSlices = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
894          if(sliceSuppLst->numSupportedSlices > MAX_NUM_OF_SLICE_ITEMS)
895          {
896             DU_LOG("\nERROR --> DU_APP: %s: Number of supported slice [%d] is more than 1024",\
897                   __func__, sliceSuppLst->numSupportedSlices);
898             return RFAILED;
899          }
900       }
901
902       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SNSSAI_LIST")) && (cur->ns == ns))
903       {
904          DU_ALLOC_SHRABL_BUF(sliceSuppLst->snssai, (sliceSuppLst->numSupportedSlices) * sizeof(Snssai*));
905          if (sliceSuppLst->snssai == NULLP)
906          {
907             DU_LOG("\nERROR  --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
908             return RFAILED;
909          }
910
911          for (sliceIdx = 0; sliceIdx < sliceSuppLst->numSupportedSlices; sliceIdx++)
912          {
913             DU_ALLOC_SHRABL_BUF(sliceSuppLst->snssai[sliceIdx], sizeof(Snssai));
914             if (sliceSuppLst->snssai[sliceIdx] == NULLP)
915             {
916                DU_LOG("\nERROR  --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
917                return RFAILED;
918             }
919             else
920             {
921 #ifdef O1_ENABLE
922                memcpy(sliceSuppLst->snssai[sliceIdx]->sd, cellParams.plmnList[sliceIdx].sd, SD_SIZE*sizeof(uint8_t));
923                sliceSuppLst->snssai[sliceIdx]->sst = cellParams.plmnList[sliceIdx].sst;
924 #endif
925             }
926          }
927
928 #ifndef O1_ENABLE
929          sliceIdx = 0;
930          child = cur->xmlChildrenNode;
931          while (child != NULL)
932          {
933             if ((!xmlStrcmp(child->name, (const xmlChar *)"SNSSAI")) && (child->ns == ns))
934             {
935                if(parseSnssai(doc, ns, child, sliceSuppLst->snssai[sliceIdx]) != ROK)
936                {
937                   return RFAILED;
938                }
939                sliceIdx++;
940             }
941             child = child->next;
942          }
943 #endif
944       }
945
946       cur = cur -> next;
947    }
948    return ROK;
949 }
950
951 #ifdef XML_BASED_CONFIG
952 /*******************************************************************
953  *
954  * @brief Fill Served PLMN
955  *
956  * @details
957  *
958  *    Function : parseF1SrvdPlmn
959  *
960  *    Functionality: Fill Served PLMN
961  *
962  * @params[in] XML document pointer
963  *             XML namespace
964  *             Current node in XML
965  *             Pointer to structure to be filled
966  * @return ROK     - success
967  *         RFAILED - failure
968  *
969  * ****************************************************************/
970 uint8_t parseF1SrvdPlmn(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1SrvdPlmn *srvdPlmn, uint8_t srvdPlmnIdx)
971 {
972    memset(srvdPlmn, 0, sizeof(F1SrvdPlmn));
973    cur = cur->xmlChildrenNode;
974    while(cur != NULL)
975    {
976 #ifdef O1_ENABLE
977       fillPlmnFromO1(&srvdPlmn ->plmn, srvdPlmnIdx);
978 #else
979       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns))
980       {
981          if(parsePlmn(doc, ns, cur, &srvdPlmn->plmn) != ROK)
982          {
983             return RFAILED;
984          }
985       }
986 #endif 
987
988       if ((!xmlStrcmp(cur->name, (const xmlChar *)"EXT_PLMN")) && (cur->ns == ns))
989       {
990          if(parsePlmn(doc, ns, cur, &srvdPlmn->extPlmn) != ROK)
991          {
992             return RFAILED;
993          }
994       }
995
996       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_SLICE_SUPP_LST")) && (cur->ns == ns))
997       {
998          if(parseSupportedSliceList(doc, ns, cur, &srvdPlmn->taiSliceSuppLst) != ROK)
999          {
1000             return RFAILED;
1001          }
1002       }
1003
1004       cur = cur -> next;
1005    }
1006    return ROK;
1007 }
1008
1009 /*******************************************************************
1010  *
1011  * @brief Fill cell information
1012  *
1013  * @details
1014  *
1015  *    Function : parseF1CellInfo
1016  *
1017  *    Functionality: Fill cell information
1018  *
1019  * @params[in] XML document pointer
1020  *             XML namespace
1021  *             Current node in XML
1022  *             Pointer to structure to be filled
1023  * @return ROK     - success
1024  *         RFAILED - failure
1025  *
1026  * ****************************************************************/
1027 uint8_t parseF1CellInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1CellInfo *f1CellInfo)
1028 {
1029    memset(f1CellInfo, 0, sizeof(F1CellInfo));
1030    cur = cur->xmlChildrenNode;
1031    while(cur != NULL)
1032    {
1033       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_CGI")) && (cur->ns == ns))
1034       {
1035          if(parseNrCgi(doc, ns, cur, &f1CellInfo->nrCgi) != ROK)
1036          {
1037             return RFAILED;
1038          }
1039       }
1040
1041 #ifdef O1_ENABLE
1042       f1CellInfo->nrPci = cellParams.nRPCI;
1043 #else
1044       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_PCI")) && (cur->ns == ns))
1045       {
1046          f1CellInfo->nrPci = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1047       }
1048 #endif   
1049
1050       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_SRVD_PLMN")) && (cur->ns == ns))
1051       {
1052          if(parseF1SrvdPlmn(doc, ns, cur, &f1CellInfo->srvdPlmn[0], 0) != ROK)
1053          {
1054             return RFAILED;
1055          }
1056       }
1057
1058       cur = cur -> next;
1059    }
1060    return ROK;
1061 }
1062
1063 /*******************************************************************
1064  *
1065  * @brief Fill Frequency Band
1066  *
1067  * @details
1068  *
1069  *    Function : parseF1FreqBand
1070  *
1071  *    Functionality: Fill Frequency Band
1072  *
1073  * @params[in] XML document pointer
1074  *             XML namespace
1075  *             Current node in XML
1076  *             Pointer to structure to be filled
1077  * @return ROK     - success
1078  *         RFAILED - failure
1079  *
1080  * ****************************************************************/
1081 uint8_t parseF1FreqBand(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1FreqBand *freqBand)
1082 {
1083    uint8_t sulIdx = 0;
1084    uint16_t sulValue = 0;
1085    xmlNodePtr child;
1086    xmlNodePtr sulChild;
1087
1088    memset(freqBand, 0, sizeof(F1FreqBand));
1089    cur = cur->xmlChildrenNode;
1090    while(cur != NULL)
1091    {
1092       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_FREQ_BAND")) && (cur->ns == ns))
1093       {
1094          freqBand->nrFreqBand = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1095       }
1096
1097       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SUL_BAND_LIST")) && (cur->ns == ns))
1098       {
1099          child = cur->xmlChildrenNode;
1100          while (child != NULL) 
1101          {
1102             if ((!xmlStrcmp(child->name, (const xmlChar *)"LIST")) && (child->ns == ns)) 
1103             {
1104                sulChild = child->xmlChildrenNode;
1105                sulIdx = 0;
1106                while (sulChild != NULL) 
1107                {
1108                   if ((!xmlStrcmp(sulChild->name, (const xmlChar *)"SUL_BAND")) && (sulChild->ns == ns)) 
1109                   {
1110                      sulValue = atoi((char *)xmlNodeListGetString(doc, sulChild->xmlChildrenNode, 1));
1111                      if (sulIdx < MAX_NRCELL_BANDS) 
1112                      {
1113                         freqBand->sulBand[sulIdx] = sulValue;
1114                         sulIdx++;
1115                      } 
1116                      else 
1117                      {
1118                         DU_LOG("ERROR  -->  DU_APP : %s :  SUL_BAND array overflow\n", __func__);
1119                         return RFAILED;
1120                      }
1121                   }
1122                   sulChild = sulChild->next;
1123                }
1124             }
1125             child = child->next;
1126          }
1127       }
1128       cur = cur -> next;
1129    }
1130    return ROK;
1131 }
1132
1133 /*******************************************************************
1134  *
1135  * @brief Fill Frequency Band List
1136  *
1137  * @details
1138  *
1139  *    Function : parseF1FreqBandList
1140  *
1141  *    Functionality: Fill Frequency Band List
1142  *
1143  * @params[in] XML document pointer
1144  *             XML namespace
1145  *             Current node in XML
1146  *             Pointer to structure to be filled
1147  * @return ROK     - success
1148  *         RFAILED - failure
1149  *
1150  * ****************************************************************/
1151 uint8_t parseF1FreqBandList(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1NrFreqInfo *nrFreqInfo)
1152 {
1153    uint8_t idx = 0;
1154
1155    xmlNodePtr child;
1156    cur = cur->xmlChildrenNode;
1157    while(cur != NULL)
1158    {
1159       if ((!xmlStrcmp(cur->name, (const xmlChar *)"LIST")) && (cur->ns == ns))
1160       {
1161          child = cur->xmlChildrenNode;
1162          while(child != NULL)
1163          {
1164             if ((!xmlStrcmp(child->name, (const xmlChar *)"F1_FREQ_BAND")) && (child->ns == ns))
1165             {
1166                if(parseF1FreqBand(doc, ns, child, &nrFreqInfo->freqBand[idx]) != ROK)
1167                {
1168                   return RFAILED;
1169                }
1170                idx++;
1171             }
1172             child = child -> next;
1173          }
1174       }
1175
1176       cur = cur -> next;
1177    }
1178    return ROK;
1179 }
1180
1181 /*******************************************************************
1182  *
1183  * @brief Fill Transmission Bandwidth
1184  *
1185  * @details
1186  *
1187  *    Function : parseF1TxBw
1188  *
1189  *    Functionality: Fill Transmission Bandwidth
1190  *
1191  * @params[in] XML document pointer
1192  *             XML namespace
1193  *             Current node in XML
1194  *             Pointer to structure to be filled
1195  * @return ROK     - success
1196  *         RFAILED - failure
1197  *
1198  * ****************************************************************/
1199 uint8_t parseF1TxBw(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1TxBw *txBw)
1200 {
1201    memset(txBw, 0, sizeof(F1TxBw));
1202    cur = cur->xmlChildrenNode;
1203    while(cur != NULL)
1204    {
1205       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_SCS")) && (cur->ns == ns))
1206       {
1207          txBw->nrScs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1208       }
1209
1210       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NRB")) && (cur->ns == ns))
1211       {
1212          txBw->nrb =  atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1213       }
1214
1215       cur = cur -> next;
1216    }
1217    return ROK;
1218 }
1219
1220 /*******************************************************************
1221  *
1222  * @brief Fill SUL Info
1223  *
1224  * @details
1225  *
1226  *    Function : parseF1SulInfo
1227  *
1228  *    Functionality: Fill SUL Info
1229  *
1230  * @params[in] XML document pointer
1231  *             XML namespace
1232  *             Current node in XML
1233  *             Pointer to structure to be filled
1234  * @return ROK     - success
1235  *         RFAILED - failure
1236  *
1237  * ****************************************************************/
1238 uint8_t parseF1SulInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1SulInfo *sulInfo)
1239 {
1240    memset(sulInfo, 0, sizeof(F1SulInfo));
1241    cur = cur->xmlChildrenNode;
1242    while(cur != NULL)
1243    {
1244       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SUL_ARFCN")) && (cur->ns == ns))
1245       {
1246          sulInfo->sulArfcn = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1247       }
1248
1249       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_TX_BW")) && (cur->ns == ns))
1250       {
1251          if(parseF1TxBw(doc, ns, cur, &sulInfo->sulTxBw) != ROK)
1252          {
1253             return RFAILED;
1254          }
1255       }
1256
1257       cur = cur -> next;
1258    }
1259    return ROK;
1260 }
1261
1262 /*******************************************************************
1263  *
1264  * @brief Fill NR Frequency Info 
1265  *
1266  * @details
1267  *
1268  *    Function : parseF1NrFreqInfo
1269  *
1270  *    Functionality: Fill NR Frequency Info
1271  *
1272  * @params[in] XML document pointer
1273  *             XML namespace
1274  *             Current node in XML
1275  *             Pointer to structure to be filled
1276  * @return ROK     - success
1277  *         RFAILED - failure
1278  *
1279  * ****************************************************************/
1280 uint8_t parseF1NrFreqInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1NrFreqInfo *nrFreqInfo)
1281 {
1282    memset(nrFreqInfo, 0, sizeof(F1NrFreqInfo));
1283    cur = cur->xmlChildrenNode;
1284    while(cur != NULL)
1285    {
1286       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_ARFCN")) && (cur->ns == ns))
1287       {
1288          nrFreqInfo->nrArfcn = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1289       }
1290
1291       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_SUL_INFO")) && (cur->ns == ns))
1292       {
1293          if(parseF1SulInfo(doc, ns, cur, &nrFreqInfo->sulInfo) != ROK)
1294          {
1295             return RFAILED;
1296          }
1297       }
1298
1299       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_FREQ_BAND_LIST")) && (cur->ns == ns))
1300       {
1301          if(parseF1FreqBandList(doc, ns, cur, nrFreqInfo) != ROK)
1302          {
1303             return RFAILED;
1304          }
1305       }
1306
1307       cur = cur -> next;
1308    }
1309    return ROK;
1310 }
1311
1312 /*******************************************************************
1313  *
1314  * @brief Fill NR FDD Info
1315  *
1316  * @details
1317  *
1318  *    Function : parseF1NrFddInfo 
1319  *
1320  *    Functionality: Fill NR FDD Info
1321  *
1322  * @params[in] XML document pointer
1323  *             XML namespace
1324  *             Current node in XML
1325  *             Pointer to structure to be filled
1326  * @return ROK     - success
1327  *         RFAILED - failure
1328  *
1329  * ****************************************************************/
1330 uint8_t parseF1NrFddInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1NrFddInfo *fddInfo)
1331 {
1332    memset(fddInfo, 0, sizeof(F1NrFddInfo));
1333    cur = cur->xmlChildrenNode;
1334    while(cur != NULL)
1335    {
1336       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_FREQ_INFO_UL")) && (cur->ns == ns))
1337       {
1338          if(parseF1NrFreqInfo(doc, ns, cur, &fddInfo->ulNrFreqInfo) != ROK)
1339          {
1340             return RFAILED;
1341          }
1342       }
1343
1344       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_FREQ_INFO_DL")) && (cur->ns == ns))
1345       {
1346          if(parseF1NrFreqInfo(doc, ns, cur, &fddInfo->dlNrFreqInfo) != ROK)
1347          {
1348             return RFAILED;
1349          }
1350       }
1351
1352       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_TX_BW_UL")) && (cur->ns == ns))
1353       {
1354          if(parseF1TxBw(doc, ns, cur, &fddInfo->ulTxBw) != ROK)
1355          {
1356             return RFAILED;
1357          }
1358       }
1359
1360       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_TX_BW_DL")) && (cur->ns == ns))
1361       {
1362          if(parseF1TxBw(doc, ns, cur, &fddInfo->dlTxBw) != ROK)
1363          {
1364             return RFAILED;
1365          }
1366       }
1367
1368       cur = cur -> next;
1369    }
1370    return ROK;
1371 }
1372
1373 /*******************************************************************
1374  *
1375  * @brief Fill NR TDD Info
1376  *
1377  * @details
1378  *
1379  *    Function : parseF1NrTddInfo
1380  *
1381  *    Functionality: Fill NR TDD Info
1382  *
1383  * @params[in] XML document pointer
1384  *             XML namespace
1385  *             Current node in XML
1386  *             Pointer to structure to be filled
1387  * @return ROK     - success
1388  *         RFAILED - failure
1389  *
1390  * ****************************************************************/
1391 uint8_t parseF1NrTddInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1NrTddInfo *tddInfo)
1392 {
1393    memset(tddInfo, 0, sizeof(F1NrTddInfo));
1394    cur = cur->xmlChildrenNode;
1395    while(cur != NULL)
1396    {
1397       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_FREQ_INFO")) && (cur->ns == ns))
1398       {
1399          if(parseF1NrFreqInfo(doc, ns, cur, &tddInfo->nrFreqInfo) != ROK)
1400          {
1401             return RFAILED;
1402          }
1403       }
1404
1405       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_TX_BW")) && (cur->ns == ns))
1406       {
1407          if(parseF1TxBw(doc, ns, cur, &tddInfo->nrTxBw) != ROK)
1408          {
1409             return RFAILED;
1410          }
1411       }
1412
1413       cur = cur -> next;
1414    }
1415    return ROK;
1416 }
1417
1418 /*******************************************************************
1419  *
1420  * @brief Fill NR Mode Info
1421  *
1422  * @details
1423  *
1424  *    Function : parseNrModeInfo
1425  *
1426  *    Functionality: Fill NR Mode Info
1427  *
1428  * @params[in] XML document pointer
1429  *             XML namespace
1430  *             Current node in XML
1431  *             Pointer to structure to be filled
1432  * @return ROK     - success
1433  *         RFAILED - failure
1434  *
1435  * ****************************************************************/
1436 uint8_t parseNrModeInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, NrModeInfo *nrModeInfo)
1437 {
1438    char  modeCfg[10];
1439
1440    memset(nrModeInfo, 0, sizeof(NrModeInfo));
1441    cur = cur->xmlChildrenNode;
1442    while(cur != NULL)
1443    {
1444       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_MODE")) && (cur->ns == ns))
1445       {
1446          strcpy((char*)modeCfg, (char*)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));      
1447       }
1448
1449       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_FDD_INFO")) && (cur->ns == ns))
1450       {
1451          if(strcmp(modeCfg, "FDD") == 0)
1452          {
1453             if(parseF1NrFddInfo(doc, ns, cur, &nrModeInfo->mode.fdd) != ROK)
1454             {
1455                return RFAILED;
1456             }
1457          }
1458       }
1459
1460       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_NR_TDD_INFO")) && (cur->ns == ns))
1461       {
1462          if(strcmp(modeCfg, "TDD") == 0)
1463          {
1464             if(parseF1NrTddInfo(doc, ns, cur, &nrModeInfo->mode.tdd) != ROK)
1465             {
1466                return RFAILED;
1467             }
1468          }
1469       }
1470
1471       cur = cur -> next;
1472    }
1473    return ROK;
1474 }
1475
1476 /*******************************************************************
1477  *
1478  * @brief Fill Broadcast PLMN Information
1479  *
1480  * @details
1481  *
1482  *    Function : parseF1BrdcstPlmnInfo
1483  *
1484  *    Functionality: Fill Broadcast PLMN Information
1485  *
1486  * @params[in] XML document pointer
1487  *             XML namespace
1488  *             Current node in XML
1489  *             Pointer to structure to be filled
1490  * @return ROK     - success
1491  *         RFAILED - failure
1492  *
1493  * ****************************************************************/
1494 uint8_t parseF1BrdcstPlmnInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1BrdcstPlmnInfo *brdcstPlmnInfo)
1495 {
1496    memset(brdcstPlmnInfo, 0, sizeof(F1BrdcstPlmnInfo));
1497    cur = cur->xmlChildrenNode;
1498    while(cur != NULL)
1499    {
1500       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns))
1501       {
1502          if(parsePlmn(doc, ns, cur, &brdcstPlmnInfo->plmn[0]) != ROK)
1503          {
1504             return RFAILED;
1505          }
1506       }
1507
1508       if ((!xmlStrcmp(cur->name, (const xmlChar *)"EXT_PLMN")) && (cur->ns == ns))
1509       {
1510          if(parsePlmn(doc, ns, cur, &brdcstPlmnInfo->extPlmn[0]) != ROK)
1511          {
1512             return RFAILED;
1513          }
1514       } 
1515
1516       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns))
1517       {
1518          brdcstPlmnInfo->tac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1519       }
1520
1521       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_CELL_ID")) && (cur->ns == ns))
1522       {
1523          brdcstPlmnInfo->nrCellId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1524       }
1525
1526       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_RANAC")) && (cur->ns == ns))
1527       {
1528          brdcstPlmnInfo->ranac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1529       }
1530
1531       cur = cur -> next;
1532    }
1533    return ROK;
1534 }
1535
1536 /*******************************************************************
1537  *
1538  * @brief Fill DU Cell Information 
1539  *
1540  * @details
1541  *
1542  *    Function : parseF1DuCellInfo
1543  *
1544  *    Functionality: Fill DU Cell Information
1545  *
1546  * @params[in] XML document pointer
1547  *             XML namespace
1548  *             Current node in XML
1549  *             Pointer to structure to be filled
1550  * @return ROK     - success
1551  *         RFAILED - failure
1552  *
1553  * ****************************************************************/
1554 uint8_t parseF1DuCellInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1DuCellInfo *duCellInfo)
1555 {
1556    memset(duCellInfo, 0, sizeof(F1DuCellInfo));
1557    cur = cur->xmlChildrenNode;
1558    while(cur != NULL)
1559    {
1560       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_CELL_INFO")) && (cur->ns == ns))
1561       {
1562          if(parseF1CellInfo(doc, ns, cur, &duCellInfo->cellInfo) != ROK)
1563          {
1564             return RFAILED;
1565          }
1566       }
1567
1568       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns))
1569       {
1570          duCellInfo->tac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1571       }
1572
1573       if ((!xmlStrcmp(cur->name, (const xmlChar *)"EPS_TAC")) && (cur->ns == ns))
1574       {
1575          duCellInfo->epsTac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1576       }
1577
1578       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_MODE_INFO")) && (cur->ns == ns))
1579       {
1580          if(parseNrModeInfo(doc, ns, cur, &duCellInfo->f1Mode) != ROK)
1581          {
1582             return RFAILED;
1583          }
1584       }
1585
1586       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIME_CFG")) && (cur->ns == ns))
1587       {
1588          duCellInfo->measTimeCfgDuration = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1589       }
1590
1591       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_CELL_DIR")) && (cur->ns == ns))
1592       {
1593          duCellInfo->cellDir = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1594       }
1595
1596       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_CELL_TYPE")) && (cur->ns == ns))
1597       {
1598          duCellInfo->cellType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1599       }
1600
1601       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_BRDCST_PLMN_INFO")) && (cur->ns == ns))
1602       {
1603          if(parseF1BrdcstPlmnInfo(doc, ns, cur, &duCellInfo->brdcstPlmnInfo[0]) != ROK)
1604          {
1605             return RFAILED;
1606          }
1607       }
1608
1609       cur = cur -> next;
1610    }
1611    return ROK;
1612 }
1613
1614 /*******************************************************************
1615  *
1616  * @brief Fill DU served cell information 
1617  *
1618  * @details
1619  *
1620  *    Function : parseF1DuServedCellInfo
1621  *
1622  *    Functionality: Fill DU served cell information
1623  *
1624  * @params[in] XML document pointer
1625  *             XML namespace
1626  *             Current node in XML
1627  *             Pointer to structure to be filled
1628  * @return ROK     - success
1629  *         RFAILED - failure
1630  *
1631  * ****************************************************************/
1632 uint8_t parseF1DuServedCellInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, F1DuSrvdCellInfo *srvdCellInfo)
1633 {
1634    memset(srvdCellInfo, 0, sizeof(F1DuSrvdCellInfo));
1635    cur = cur->xmlChildrenNode;
1636    while(cur != NULL)
1637    {
1638       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_DU_CELL_INFO")) && (cur->ns == ns))
1639       {
1640          if(parseF1DuCellInfo(doc, ns, cur, &srvdCellInfo->duCellInfo) != ROK)
1641          {
1642             return RFAILED;
1643          }
1644       }
1645       cur = cur -> next;
1646    }
1647
1648    if(fillDuSrvdCellSysInfo(&srvdCellInfo->duSysInfo) != ROK)
1649    {
1650       return RFAILED;
1651    }
1652    return ROK;
1653 }
1654
1655 /*******************************************************************
1656  *
1657  * @brief Fill DU Served Cell System Information
1658  *
1659  * @details
1660  *
1661  *    Function : fillDuSrvdCellSysInfo
1662  *
1663  *    Functionality: Fill DU Served Cell System Information
1664  *
1665  * @params[in] Served Cell System Information
1666  * @return ROK     - success
1667  *         RFAILED - failure
1668  *
1669  * ****************************************************************/
1670 uint8_t fillDuSrvdCellSysInfo(F1DuSysInfo *sysInfo)
1671 {
1672    /* GNB DU System Info MIB msg */
1673    BuildMibMsg();
1674    DU_ALLOC(sysInfo->mibMsg, encBufSize);
1675    if(!(sysInfo->mibMsg))
1676    {
1677       DU_LOG("\nERROR  -->  DU APP : %s : Memory allocation failure at line %d", __func__, __LINE__);
1678       return RFAILED;
1679    }
1680    memcpy(sysInfo->mibMsg, encBuf, encBufSize);
1681    sysInfo->mibLen = encBufSize;
1682
1683    /* GNB DU System Info SIB1 msg */
1684    BuildSib1Msg();
1685    DU_ALLOC(sysInfo->sib1Msg, encBufSize);
1686    if(!(sysInfo->sib1Msg))
1687    {
1688       DU_LOG("\nERROR  -->  DU APP : %s : Memory allocation failure at line %d", __func__, __LINE__);
1689       return RFAILED;
1690    }
1691    memcpy(sysInfo->sib1Msg, encBuf,encBufSize);
1692    sysInfo->sib1Len = encBufSize;
1693
1694    return ROK;
1695 }
1696
1697 #ifdef O1_ENABLED
1698 /*******************************************************************
1699  *
1700  * @brief Fill PLMN received from O1 interface
1701  *
1702  * @details
1703  *
1704  *    Function : fillPlmnFromO1
1705  *
1706  *    Functionality: Fill PLMN received from O1 interface
1707  *
1708  * @params[in] XML document pointer
1709  *             XML namespace
1710  *             Current node in XML
1711  *             Pointer to structure to be filled
1712  * @return ROK     - success
1713  *         RFAILED - failure
1714  *
1715  * ****************************************************************/
1716 void fillPlmnFromO1(Plmn *PLMN, uint8_t srvdPlmnIdx)
1717 {
1718    PLMN->mcc[0] = cellParams.plmnList[srvdPlmnIdx].mcc[0];
1719    PLMN->mcc[1] = cellParams.plmnList[srvdPlmnIdx].mcc[1];
1720    PLMN->mcc[2] = cellParams.plmnList[srvdPlmnIdx].mcc[2];
1721    PLMN->mnc[0] = cellParams.plmnList[srvdPlmnIdx].mnc[0];
1722    PLMN->mnc[1] = cellParams.plmnList[srvdPlmnIdx].mnc[1];
1723    PLMN->mnc[2] = cellParams.plmnList[srvdPlmnIdx].mnc[2];
1724 }
1725 #endif
1726 #endif
1727
1728 /*******************************************************************
1729  *
1730  * @brief Fill Beamforming Configuration
1731  *
1732  * @details
1733  *
1734  *    Function : parseBeamformingConfig
1735  *
1736  *    Functionality: Fill Beamforming Configuration
1737  *
1738  * @params[in] XML document pointer
1739  *             XML namespace
1740  *             Current node in XML
1741  *             Pointer to structure to be filled
1742  * @return ROK     - success
1743  *         RFAILED - failure
1744  *
1745  * ****************************************************************/
1746 uint8_t parseBeamformingConfig(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, BeamformingConf *beamformingCfg)
1747 {
1748    memset(beamformingCfg, 0, sizeof(BeamformingConf));
1749    cur = cur -> xmlChildrenNode;
1750    while(cur != NULL)
1751    {
1752       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_BEAMS")) && (cur->ns == ns))
1753       {
1754          beamformingCfg->numOfBeams = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1755       }
1756
1757       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TX_RUS")) && (cur->ns == ns))
1758       {
1759          beamformingCfg->numTxRUs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1760       }
1761
1762       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_IDX")) && (cur->ns == ns))
1763       {
1764          beamformingCfg->beamIdx = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1765       }
1766
1767       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_TYPE")) && (cur->ns == ns))
1768       {
1769          beamformingCfg->beamType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1770       }
1771
1772       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_AZIMUTH")) && (cur->ns == ns))
1773       {
1774          beamformingCfg->beamAzimuth = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1775       }
1776
1777       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_TILT")) && (cur->ns == ns))
1778       {
1779          beamformingCfg->beamTilt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1780       }
1781
1782       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_HORIZ_WIDTH")) && (cur->ns == ns))
1783       {
1784          beamformingCfg->beamHorizWidth = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1785       }
1786
1787       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_VERT_WIDTH")) && (cur->ns == ns))
1788       {
1789          beamformingCfg->beamVertWidth = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1790       }
1791
1792       if ((!xmlStrcmp(cur->name, (const xmlChar *)"COVER_SHAPE")) && (cur->ns == ns))
1793       {
1794          beamformingCfg->coverageShape = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1795       }
1796
1797       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DIGI_TILT")) && (cur->ns == ns))
1798       {
1799          beamformingCfg->digitalTilt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1800       }
1801
1802       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DIGI_AZIMUTH")) && (cur->ns == ns))
1803       {
1804          beamformingCfg->digitalAzimuth = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1805       }
1806
1807       cur = cur -> next;
1808    }
1809    return ROK;
1810 }
1811
1812 /*******************************************************************
1813  *
1814  * @brief Fill Precoding Configuration
1815  *
1816  * @details
1817  *
1818  *    Function : parsePrecodingConfig
1819  *
1820  *    Functionality:  Fill Precoding Configuration
1821  *
1822  * @params[in] XML document pointer
1823  *             XML namespace
1824  *             Current node in XML
1825  *             Pointer to structure to be filled
1826  * @return ROK     - success
1827  *         RFAILED - failure
1828  *
1829  * ****************************************************************/
1830 uint8_t parsePrecodingConfig(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PrecodingConf *precodCfg)
1831 {
1832    memset(precodCfg, 0, sizeof(PrecodingConf));
1833    cur = cur -> xmlChildrenNode;
1834    while(cur != NULL)
1835    {
1836       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_LAYERS")) && (cur->ns == ns))
1837       {
1838          precodCfg->numLayers = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1839       }
1840
1841       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_ANT_PORTS")) && (cur->ns == ns))
1842       {
1843          precodCfg->numAntPorts  = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1844       }
1845
1846       cur = cur -> next;
1847    }
1848    return ROK;
1849 }
1850
1851 /*******************************************************************
1852  *
1853  * @brief Fill PRACH FDM Information
1854  *
1855  * @details
1856  *
1857  *    Function : parsePrachFdmInfo
1858  *
1859  *    Functionality: Fill PRACH FDM Information
1860  *
1861  * @params[in] XML document pointer
1862  *             XML namespace
1863  *             Current node in XML
1864  *             Pointer to structure to be filled
1865  * @return ROK     - success
1866  *         RFAILED - failure
1867  *
1868  * ****************************************************************/
1869 uint8_t parsePrachFdmInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PrachFdmInfo *prachFdmInfo)
1870 {
1871    memset(prachFdmInfo, 0, sizeof(PrachFdmInfo));
1872    cur = cur -> xmlChildrenNode;
1873    while(cur != NULL)
1874    {
1875       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROOT_SEQ_IDX")) && (cur->ns == ns))
1876       {
1877          prachFdmInfo->rootSeqIdx = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1878       }
1879
1880       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_ROOT_SEQ")) && (cur->ns == ns))
1881       {
1882          prachFdmInfo->numRootSeq = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1883       }
1884
1885       if ((!xmlStrcmp(cur->name, (const xmlChar *)"K1")) && (cur->ns == ns))
1886       {
1887          prachFdmInfo->k1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1888       }
1889
1890       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ZERO_CORR_ZONE_CFG")) && (cur->ns == ns))
1891       {
1892          prachFdmInfo->zeroCorrZoneCfg = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1893       }
1894
1895       cur = cur -> next;
1896    }
1897    return ROK;
1898 }
1899
1900 /*******************************************************************
1901  *
1902  * @brief Fill PRACH configuration
1903  *
1904  * @details
1905  *
1906  *    Function : parsePrachCfg
1907  *
1908  *    Functionality: Fill PRACH configuration
1909  *
1910  * @params[in] XML document pointer
1911  *             XML namespace
1912  *             Current node in XML
1913  *             Pointer to structure to be filled
1914  * @return ROK     - success
1915  *         RFAILED - failure
1916  *
1917  * ****************************************************************/
1918 uint8_t parsePrachCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PrachCfg *prachCfg)
1919 {
1920    xmlNodePtr child;
1921    uint8_t fdmIdx = 0;
1922    uint8_t maxNumRbs = 0;
1923    uint8_t prachMaxPrb = 0;
1924
1925    memset(prachCfg, 0, sizeof(PrachCfg));
1926    cur = cur -> xmlChildrenNode;
1927    while(cur != NULL)
1928    {
1929       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_SEQ_LEN")) && (cur->ns == ns))
1930       {
1931          prachCfg->prachSeqLen = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1932       }
1933
1934       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns))
1935       {
1936          prachCfg->prachSubcSpacing = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1937       }
1938
1939       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_CONFIG_IDX")) && (cur->ns == ns))
1940       {
1941          prachCfg->prachCfgIdx = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1942       }
1943
1944       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_PRACH_FDM")) && (cur->ns == ns))
1945       {
1946          prachCfg->msg1Fdm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1947       }
1948
1949       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FDM_LIST")) && (cur->ns == ns))
1950       {
1951          child = cur->xmlChildrenNode;
1952          while(child != NULL)
1953          {
1954             if ((!xmlStrcmp(child->name, (const xmlChar *)"FDM_INFO")) && (child->ns == ns))
1955             {
1956                if(parsePrachFdmInfo(doc, ns, child, &prachCfg->fdm[fdmIdx]) != ROK)
1957                {
1958                   return RFAILED;
1959                }
1960                fdmIdx++;
1961             }
1962             child = child -> next;
1963          }
1964       }
1965
1966       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_RESTRICTED_SET_CFG")) && (cur->ns == ns))
1967       {
1968          prachCfg->prachRstSetCfg = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1969       }
1970
1971       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PER_RACH")) && (cur->ns == ns))
1972       {
1973          prachCfg->ssbPerRach = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1974       }
1975
1976       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RA_PREAMBLE")) && (cur->ns == ns))
1977       {
1978          prachCfg->totalNumRaPreamble = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1979       }
1980
1981       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CB_PREAMBLE_PER_SSB")) && (cur->ns == ns))
1982       {
1983          prachCfg->numCbPreamblePerSsb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1984       }
1985
1986       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_RB")) && (cur->ns == ns))
1987       {
1988          maxNumRbs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1989       }
1990
1991       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_MAX_PRB")) && (cur->ns == ns))
1992       {
1993          prachMaxPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1994       }
1995
1996       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RSRP_THRESHOLD_SSB")) && (cur->ns == ns))
1997       {
1998          prachCfg->rsrpThreshSsb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1999       }
2000
2001       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RA_RSP_WINDOW")) && (cur->ns == ns))
2002       {
2003          prachCfg->raRspWindow = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2004       }
2005
2006       cur = cur -> next;
2007    }
2008
2009    prachCfg->msg1FreqStart = maxNumRbs - prachMaxPrb;
2010    return ROK;
2011 }
2012
2013 /*******************************************************************
2014  *
2015  * @brief Fill CSI RS configuration
2016  *
2017  * @details
2018  *
2019  *    Function : parseCsiRsCfg
2020  *
2021  *    Functionality: Fill CSI RS configuration
2022  *
2023  * @params[in] XML document pointer
2024  *             XML namespace
2025  *             Current node in XML
2026  *             Pointer to structure to be filled
2027  * @return ROK     - success
2028  *         RFAILED - failure
2029  *
2030  * ****************************************************************/
2031 uint8_t parseCsiRsCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, CsiRsCfg *csiRsCfg)
2032 {
2033    memset(csiRsCfg, 0, sizeof(CsiRsCfg));
2034    cur = cur -> xmlChildrenNode;
2035    while(cur != NULL)
2036    {
2037       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_FREQ")) && (cur->ns == ns))
2038       {
2039          csiRsCfg->csiFreqDomainAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2040       }
2041
2042       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_PORTS")) && (cur->ns == ns))
2043       {
2044          csiRsCfg->csiNrofPorts = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2045       }
2046
2047       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_OFDM_PORT")) && (cur->ns == ns))
2048       {
2049          csiRsCfg->csirsfirstOFDMSymbolInTimeDomain = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2050       }
2051
2052       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_OFDM_PORT_2")) && (cur->ns == ns))
2053       {
2054          csiRsCfg->csirsfirstOFDMSymbolInTimeDomain2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2055       }
2056
2057       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_DM_TYPE")) && (cur->ns == ns))
2058       {
2059          csiRsCfg->csirscdmType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2060       }
2061
2062       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_DENSITY")) && (cur->ns == ns))
2063       {
2064          csiRsCfg->csirsdensity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2065       }
2066
2067       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_DENSITY_DOT_5")) && (cur->ns == ns))
2068       {
2069          csiRsCfg->csirsdensitydot5 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2070       }
2071
2072       if ((!xmlStrcmp(cur->name, (const xmlChar *)"POWER_CONTROL_OFFSET")) && (cur->ns == ns))
2073       {
2074          csiRsCfg->powerControlOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2075       }
2076
2077       if ((!xmlStrcmp(cur->name, (const xmlChar *)"POWER_CONTROL_OFFSET_SS")) && (cur->ns == ns))
2078       {
2079          csiRsCfg->powerControlOffsetSS = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2080       }
2081
2082       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PERIODICITY_OFFSET")) && (cur->ns == ns))
2083       {
2084          csiRsCfg->periodicityAndOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2085       }
2086
2087       cur = cur -> next;
2088    }
2089    return ROK;
2090 }
2091
2092 /*******************************************************************
2093  *
2094  * @brief Fill SSB Configuration
2095  *
2096  * @details
2097  *
2098  *    Function : parseSsbCfg
2099  *
2100  *    Functionality: Fill SSB Configuration
2101  *
2102  * @params[in] XML document pointer
2103  *             XML namespace
2104  *             Current node in XML
2105  *             Pointer to structure to be filled
2106  * @return ROK     - success
2107  *         RFAILED - failure
2108  *
2109  * ****************************************************************/
2110 uint8_t parseSsbCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SsbCfg *ssbCfg)
2111 {
2112    xmlNodePtr child;
2113    uint8_t ssbMaskIdx = 0;
2114
2115    memset(ssbCfg, 0, sizeof( SsbCfg));
2116    cur = cur -> xmlChildrenNode;
2117    while(cur != NULL)
2118    {
2119 #ifdef O1_ENABLE
2120       ssbCfg->scsCmn = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
2121       ssbCfg->ssbPeriod = convertSSBPeriodicityToEnum(cellParams.ssbPeriodicity);
2122       ssbCfg->ssbScOffset = cellParams.ssbOffset;
2123 #else
2124       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_CMN")) && (cur->ns == ns))
2125       {
2126          ssbCfg->scsCmn = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2127       }
2128
2129       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PERIOD")) && (cur->ns == ns))
2130       {
2131          ssbCfg->ssbPeriod = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2132       }
2133
2134       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_SC_OFFSET")) && (cur->ns == ns))
2135       {
2136          ssbCfg->ssbScOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2137       }
2138 #endif
2139
2140       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_OFFSET_PT_A")) && (cur->ns == ns))
2141       {
2142          ssbCfg->ssbOffsetPointA = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2143       }
2144
2145       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PBSC_PWR")) && (cur->ns == ns))
2146       {
2147          ssbCfg->ssbPbchPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2148       }
2149
2150       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_MASK_LIST")) && (cur->ns == ns))
2151       {
2152          child = cur -> xmlChildrenNode;
2153          while(child != NULL)
2154          {
2155             if ((!xmlStrcmp(child->name, (const xmlChar *)"SSB_MASK")) && (child->ns == ns))
2156             {
2157                ssbCfg->ssbMask[ssbMaskIdx] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
2158                ssbMaskIdx++;
2159             }
2160             child = child -> next;
2161          }
2162       }
2163
2164       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_ID")) && (cur->ns == ns))
2165       {
2166          ssbCfg->beamId[0] = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2167       }
2168
2169       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BETA_PSS")) && (cur->ns == ns))
2170       {
2171          ssbCfg->betaPss = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2172       }
2173
2174       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BCH_PAYLOAD_FLAG")) && (cur->ns == ns))
2175       {
2176          ssbCfg->bchPayloadFlag = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2177       }
2178
2179       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DMRS_TYPE_A_POS")) && (cur->ns == ns))
2180       {
2181          ssbCfg->dmrsTypeAPos = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2182       }
2183
2184       cur = cur -> next;
2185    }
2186
2187    if(BuildMibPdu() != ROK)
2188    {
2189       DU_LOG("\nERROR  -->  Failed to build MIB PDU");
2190       memset(&ssbCfg->mibPdu, 0, 3*sizeof(uint8_t));
2191    }
2192    else
2193    {
2194       memcpy(&ssbCfg->mibPdu, encBuf, encBufSize);
2195    }
2196
2197    return ROK;
2198 }
2199
2200 /*******************************************************************
2201  *
2202  * @brief Fill Carrier Configuration
2203  *
2204  * @details
2205  *
2206  *    Function : parseCarrierCfg
2207  *
2208  *    Functionality: Fill Carrier Configuration
2209  *
2210  * @params[in] XML document pointer
2211  *             XML namespace
2212  *             Current node in XML
2213  *             Pointer to structure to be filled
2214  * @return ROK     - success
2215  *         RFAILED - failure
2216  *
2217  * ****************************************************************/
2218 uint8_t parseCarrierCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CarrierCfg *carrierCfg)
2219 {
2220    memset(carrierCfg, 0, sizeof(CarrierCfg));
2221    cur = cur -> xmlChildrenNode;
2222    while(cur != NULL)
2223    {
2224 #ifdef O1_ENABLE
2225       carrierCfg->dlBw = cellParams.bSChannelBwDL;
2226       carrierCfg->arfcnDL = cellParams.arfcnDL;
2227       carrierCfg->ulBw = cellParams.bSChannelBwUL;
2228       carrierCfg->arfcnUL = cellParams.arfcnUL;
2229 #else
2230       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DL_BW")) && (cur->ns == ns))
2231       {
2232          carrierCfg->dlBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2233       }
2234
2235       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_DL_ARFCN")) && (cur->ns == ns))
2236       {
2237          carrierCfg->arfcnDL = convertArfcnToFreqKhz(atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)));
2238       }
2239
2240       if ((!xmlStrcmp(cur->name, (const xmlChar *)"UL_BW")) && (cur->ns == ns))
2241       {
2242          carrierCfg->ulBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2243       }
2244
2245       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_UL_ARFCN")) && (cur->ns == ns))
2246       {
2247          carrierCfg->arfcnUL = convertArfcnToFreqKhz(atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)));
2248       }
2249 #endif
2250
2251       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TX_ANT")) && (cur->ns == ns))
2252       {
2253          carrierCfg->numTxAnt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2254       }
2255
2256       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RX_ANT")) && (cur->ns == ns))
2257       {
2258          carrierCfg->numRxAnt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2259       }
2260
2261       cur = cur -> next;
2262    }
2263    return ROK;
2264 }
2265
2266 /*******************************************************************
2267  *
2268  * @brief Fill PLMN Information List
2269  *
2270  * @details
2271  *
2272  *    Function : parsePlmnInfo
2273  *
2274  *    Functionality: Fill PLMN Information List
2275  *
2276  * @params[in] XML document pointer
2277  *             XML namespace
2278  *             Current node in XML
2279  *             Pointer to structure to be filled
2280  * @return ROK     - success
2281  *         RFAILED - failure
2282  *
2283  * ****************************************************************/
2284 uint8_t parsePlmnInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PlmnInfoList *plmnInfoList)
2285 {
2286
2287    memset(plmnInfoList, 0, sizeof(PlmnInfoList));
2288    cur = cur -> xmlChildrenNode;
2289    while(cur != NULL)
2290    {
2291       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns))
2292       {
2293          if(parsePlmn(doc, ns, cur,&plmnInfoList->plmn) != ROK)
2294          {
2295             return RFAILED;
2296          }
2297       }
2298
2299       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_SLICE_SUPP_LST")) && (cur->ns == ns))
2300       {
2301          if(parseSupportedSliceList(doc, ns, cur,&plmnInfoList -> suppSliceList) != ROK)
2302          {
2303             return RFAILED;
2304          }
2305       }
2306
2307       cur = cur -> next;
2308    }
2309    return ROK;
2310 }
2311
2312 /*******************************************************************
2313  *
2314  * @brief Fill PUCCH Configuration Common
2315  *
2316  * @details
2317  *
2318  *    Function : parsePucchConfigCommon
2319  *
2320  *    Functionality: Fill PUCCH Configuration Common
2321  *
2322  * @params[in] XML document pointer
2323  *             XML namespace
2324  *             Current node in XML
2325  *             Pointer to structure to be filled
2326  * @return ROK     - success
2327  *         RFAILED - failure
2328  *
2329  * ****************************************************************/
2330 uint8_t parsePucchConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PucchConfigCommon *pucchCfgCmn)
2331 {
2332    memset(pucchCfgCmn, 0, sizeof(PucchConfigCommon));
2333    cur = cur -> xmlChildrenNode;
2334    while(cur != NULL)
2335    {
2336       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_RSRC_COMMON")) && (cur->ns == ns))
2337       {
2338          pucchCfgCmn->pucchResourceCommon = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2339       }
2340
2341       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_NEITHER_HOPPING")) && (cur->ns == ns))
2342       {
2343          pucchCfgCmn->pucchGroupHopping = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2344       }
2345
2346       cur = cur -> next;
2347    }
2348    return ROK;
2349 }
2350
2351 /*******************************************************************
2352  *
2353  * @brief Fill PUSCH Common Time Allocation
2354  *
2355  * @details
2356  *
2357  *    Function :  parsePuschTimeDomRsrcAlloc
2358  *
2359  *    Functionality: Fill PUSCH Common Time Allocation
2360  *
2361  * @params[in] XML document pointer
2362  *             XML namespace
2363  *             Current node in XML
2364  *             Pointer to structure to be filled
2365  * @return ROK     - success
2366  *         RFAILED - failure
2367  *
2368  * ****************************************************************/
2369 uint8_t parsePuschTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschTimeDomRsrcAlloc *puschTimeDomRsrsAlloc)
2370 {
2371    memset(puschTimeDomRsrsAlloc, 0, sizeof(PuschTimeDomRsrcAlloc));
2372    cur = cur -> xmlChildrenNode;
2373    while(cur != NULL)
2374    {
2375       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_K2_CFG")) && (cur->ns == ns))
2376       {
2377          puschTimeDomRsrsAlloc->k2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2378       }
2379
2380       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_MAPPING_TYPE")) && (cur->ns == ns))
2381       {
2382          puschTimeDomRsrsAlloc->mappingType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2383       }
2384
2385       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_START_SYMBOL")) && (cur->ns == ns))
2386       {
2387          puschTimeDomRsrsAlloc->startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2388       }
2389
2390       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_LENGTH_SYMBOL")) && (cur->ns == ns))
2391       {
2392          puschTimeDomRsrsAlloc->symbolLength= atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2393       }
2394
2395       cur = cur -> next;
2396    }
2397
2398    puschTimeDomRsrsAlloc -> startSymbolAndLength = \
2399       calcSliv(puschTimeDomRsrsAlloc->startSymbol, puschTimeDomRsrsAlloc->symbolLength);
2400    return ROK;
2401 }
2402
2403 /*******************************************************************
2404  *
2405  * @brief Fill PUSCH Configuration Common 
2406  *
2407  * @details
2408  *
2409  *    Function : parsePuschConfigCommon
2410  *
2411  *    Functionality: Fill PUSCH Configuration Common
2412  *
2413  * @params[in] XML document pointer
2414  *             XML namespace
2415  *             Current node in XML
2416  *             Pointer to structure to be filled
2417  * @return ROK     - success
2418  *         RFAILED - failure
2419  *
2420  * ****************************************************************/
2421 uint8_t parsePuschConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschConfigCommon *puschCfgCmn)
2422 {
2423    uint8_t idx = 0;
2424    xmlNodePtr child = NULLP;
2425
2426    memset(puschCfgCmn, 0, sizeof(PuschConfigCommon));
2427    cur = cur -> xmlChildrenNode;
2428    while(cur != NULL)
2429    {
2430       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRC_ALLOC")) && (cur->ns == ns))
2431       {
2432          puschCfgCmn->numTimeDomRsrcAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2433       }
2434
2435       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_COMM_TIME_ALLOC_LIST")) && (cur->ns == ns))
2436       {
2437          child = cur->xmlChildrenNode;
2438          while(child != NULL)
2439          {
2440             if ((!xmlStrcmp(child->name, (const xmlChar *)"PUSCH_COMM_TIME_ALLOC")) && (child->ns == ns))
2441             {
2442                if(parsePuschTimeDomRsrcAlloc(doc, ns, child, &puschCfgCmn->timeDomRsrcAllocList[idx]) != ROK)
2443                {
2444                   return RFAILED;
2445                }
2446                idx++;
2447             }
2448             child = child -> next;
2449          }
2450       }
2451       cur = cur -> next;
2452    }
2453    return ROK;
2454 }
2455
2456 /*******************************************************************
2457  *
2458  * @brief Fill BWP Configuration
2459  *
2460  * @details
2461  *
2462  *    Function : parseBwp
2463  *
2464  *    Functionality: Fill BWP Configuration
2465  *
2466  * @params[in] XML document pointer
2467  *             XML namespace
2468  *             Current node in XML
2469  *             Pointer to structure to be filled
2470  * @return ROK     - success
2471  *         RFAILED - failure
2472  *
2473  * ****************************************************************/
2474 uint8_t parseBwp(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpParams *bwp)
2475 {
2476    memset(bwp, 0, sizeof(BwpParams));
2477    cur = cur -> xmlChildrenNode;
2478    while(cur != NULL)
2479    {
2480       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FIRST_PRB")) && (cur->ns == ns))
2481       {
2482          bwp->firstPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2483       }
2484
2485       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_PRB")) && (cur->ns == ns))
2486       {
2487          bwp->numPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2488       }
2489
2490       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns))
2491       {
2492          bwp->scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2493       }
2494
2495       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NORMAL_CYCLIC_PREFIX")) && (cur->ns == ns))
2496       {
2497          bwp->cyclicPrefix = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2498       }
2499
2500       cur = cur -> next;
2501    }
2502    return ROK;
2503 }
2504
2505 /*******************************************************************
2506  *
2507  * @brief Fill UL BWP Configuration
2508  *
2509  * @details
2510  *
2511  *    Function : parseBwpULConfig 
2512  *
2513  *    Functionality: Fill UL BWP Configuration
2514  *
2515  * @params[in] XML document pointer
2516  *             XML namespace
2517  *             Current node in XML
2518  *             Pointer to structure to be filled
2519  * @return ROK     - success
2520  *         RFAILED - failure
2521  *
2522  * ****************************************************************/
2523 uint8_t parseBwpULConfig(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpUlConfig *bwpUlCfg)
2524 {
2525    memset(bwpUlCfg, 0, sizeof(BwpUlConfig));
2526    cur = cur -> xmlChildrenNode;
2527    while(cur != NULL)
2528    {
2529       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_PARAMS")) && (cur->ns == ns))
2530       {
2531          if(parseBwp(doc, ns, cur, &bwpUlCfg->bwp) != ROK)
2532          {
2533             return RFAILED;
2534          }
2535       }
2536
2537       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_CFG_COMMON")) && (cur->ns == ns))
2538       {
2539          if(parsePucchConfigCommon(doc, ns, cur, &bwpUlCfg->pucchCommon) != ROK)
2540          {
2541             return RFAILED;
2542          }
2543       }
2544
2545       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_CFG_COMMON")) && (cur->ns == ns))
2546       {
2547          if(parsePuschConfigCommon(doc, ns, cur, &bwpUlCfg->puschCommon) != ROK)
2548          {
2549             return RFAILED;
2550          }
2551       }
2552       cur = cur -> next;
2553    }
2554    return ROK;
2555 }
2556
2557 /*******************************************************************
2558  *
2559  * @brief Fill Page Configuration
2560  *
2561  * @details
2562  *
2563  *    Function : parsePageCfg
2564  *
2565  *    Functionality: Fill Page Configuration
2566  *
2567  * @params[in] XML document pointer
2568  *             XML namespace
2569  *             Current node in XML
2570  *             Pointer to structure to be filled
2571  * @return ROK     - success
2572  *         RFAILED - failure
2573  *
2574  * ****************************************************************/
2575 uint8_t parsePageCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SchPageCfg *pageCfg)
2576 {
2577    char *poPresent;
2578
2579    memset(pageCfg, 0, sizeof(SchPageCfg));
2580    cur = cur -> xmlChildrenNode;
2581    while(cur != NULL)
2582    {
2583       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_PO")) && (cur->ns == ns))
2584       {
2585          pageCfg->numPO = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2586       }
2587
2588       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PO_PRESENT")) && (cur->ns == ns))
2589       {
2590          poPresent = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
2591          if(!strcmp(poPresent, "TRUE"))
2592          {
2593             pageCfg->poPresent = true;
2594          }
2595          else
2596          {
2597             pageCfg->poPresent = false;
2598          }
2599       }
2600
2601       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PAGING_OCC")) && (cur->ns == ns))
2602       {
2603          pageCfg->pagingOcc[0] = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2604       }
2605
2606       cur = cur -> next;
2607    }
2608    return ROK;
2609 }
2610
2611 /*******************************************************************
2612  *
2613  * @brief Fill SIB1 PDCCH Configuration
2614  *
2615  * @details
2616  *
2617  *    Function : parsePdcchCfgSib1
2618  *
2619  *    Functionality: Fill SIB1 PDCCH Configuration
2620  *
2621  * @params[in] XML document pointer
2622  *             XML namespace
2623  *             Current node in XML
2624  *             Pointer to structure to be filled
2625  * @return ROK     - success
2626  *         RFAILED - failure
2627  *
2628  * ****************************************************************/
2629 uint8_t parsePdcchCfgSib1(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdcchConfigSib1 *pdcchConfigSib1)
2630 {
2631    memset(pdcchConfigSib1, 0, sizeof(PdcchConfigSib1));
2632    cur = cur -> xmlChildrenNode;
2633    while(cur != NULL)
2634    {
2635       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_ZERO_INDEX")) && (cur->ns == ns))
2636       {
2637          pdcchConfigSib1->coresetZeroIndex = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2638       }
2639
2640       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCH_SPACE_ZERO_INDEX")) && (cur->ns == ns))
2641       {
2642          pdcchConfigSib1->searchSpaceZeroIndex = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2643       }
2644
2645       cur = cur -> next;
2646    }
2647    return ROK;
2648 }
2649
2650 /*******************************************************************
2651  *
2652  * @brief Fill SIB1 Cell Configuration
2653  *
2654  * @details
2655  *
2656  *    Function : parseSib1CellCfg 
2657  *
2658  *    Functionality: Fill SIB1 Cell Configuration
2659  *
2660  * @params[in] XML document pointer
2661  *             XML namespace
2662  *             Current node in XML
2663  *             Pointer to structure to be filled
2664  * @return ROK     - success
2665  *         RFAILED - failure
2666  *
2667  * ****************************************************************/
2668 uint8_t parseSib1CellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Sib1CellCfg *sib1CellCfg)
2669 {
2670    memset(sib1CellCfg, 0, sizeof( Sib1CellCfg));
2671    cur = cur -> xmlChildrenNode;
2672    while(cur != NULL)
2673    {
2674       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCH_PAGE_CFG")) && (cur->ns == ns))
2675       {
2676          if(parsePageCfg(doc, ns, cur, &sib1CellCfg->pagingCfg) != ROK)
2677          {
2678             return RFAILED;
2679          }
2680       }
2681
2682       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CONFIG_SIB1")) && (cur->ns == ns))
2683       {
2684          if(parsePdcchCfgSib1(doc, ns, cur, &sib1CellCfg->pdcchCfgSib1) != ROK)
2685          {
2686             return RFAILED;
2687          }
2688       }
2689
2690       cur = cur -> next;
2691    }
2692
2693    sib1CellCfg->sib1PduLen = duCfgParam.srvdCellLst[0].duSysInfo.sib1Len;
2694    if(sib1CellCfg->sib1PduLen > 0)
2695    {
2696       DU_ALLOC_SHRABL_BUF(sib1CellCfg->sib1Pdu, sib1CellCfg->sib1PduLen);
2697       if(!sib1CellCfg->sib1Pdu)
2698       {
2699          DU_LOG("\nERROR  --> DU APP : %s: Memory allocation failed at line %d", __func__, __LINE__);
2700          return RFAILED;
2701       }
2702       memcpy(sib1CellCfg->sib1Pdu, duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg, sib1CellCfg->sib1PduLen);
2703    }
2704    return ROK;
2705 }
2706
2707 /*******************************************************************
2708  *
2709  * @brief Fill Aggregation Level Candidates Information
2710  *
2711  * @details
2712  *
2713  *    Function : parseCandidateInfo 
2714  *
2715  *    Functionality: Fill Aggregation Level Candidates Information
2716  *
2717  * @params[in] XML document pointer
2718  *             XML namespace
2719  *             Current node in XML
2720  *             Pointer to structure to be filled
2721  * @return ROK     - success
2722  *         RFAILED - failure
2723  *
2724  * ****************************************************************/
2725 uint8_t parseCandidateInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CandidatesInfo *candInfo)
2726 {
2727    memset(candInfo, 0, sizeof(CandidatesInfo));
2728    cur = cur -> xmlChildrenNode;
2729    while(cur != NULL)
2730    {
2731       if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL1")) && (cur->ns == ns))
2732       {
2733          candInfo->aggLevel1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2734       }
2735
2736       if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL2")) && (cur->ns == ns))
2737       {
2738          candInfo->aggLevel2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2739       }
2740
2741       if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL4")) && (cur->ns == ns))
2742       {
2743          candInfo->aggLevel4 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2744       }
2745
2746       if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL8")) && (cur->ns == ns))
2747       {
2748          candInfo->aggLevel8 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2749       }
2750
2751       if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL16")) && (cur->ns == ns))
2752       {
2753          candInfo->aggLevel16 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2754       }
2755
2756       cur = cur -> next;
2757    }
2758    return ROK;
2759 }
2760
2761 /*******************************************************************
2762  *
2763  * @brief Fill Search Space Connfiguration
2764  *
2765  * @details
2766  *
2767  *    Function : parseSearchSpaceCfg
2768  *
2769  *    Functionality: Fill Search Space Configuration
2770  *
2771  * @params[in] XML document pointer
2772  *             XML namespace
2773  *             Current node in XML
2774  *             Pointer to structure to be filled
2775  * @return ROK     - success
2776  *         RFAILED - failure
2777  *
2778  * ****************************************************************/
2779 uint8_t parseSearchSpaceCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SearchSpaceCfg *searchSpaceCfg)
2780 {
2781    memset(searchSpaceCfg, 0, sizeof(SearchSpaceCfg));
2782    cur = cur -> xmlChildrenNode;
2783    while(cur != NULL)
2784    {
2785       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCHSPACE_1_INDEX")) && (cur->ns == ns))
2786       {
2787          searchSpaceCfg->searchSpaceId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2788       }
2789
2790       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_0_INDEX")) && (cur->ns == ns))
2791       {
2792          searchSpaceCfg->coresetId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2793       }
2794
2795       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SS_MONITORING_SLOT_SL1")) && (cur->ns == ns))
2796       {
2797          searchSpaceCfg->monitoringSlot = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2798       }
2799
2800       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DURATION")) && (cur->ns == ns))
2801       {
2802          searchSpaceCfg->duration = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2803       }
2804
2805       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SS_MONITORING_SYMBOL")) && (cur->ns == ns))
2806       {
2807          searchSpaceCfg->monitoringSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2808       }
2809
2810       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CANDIDATE_INFO")) && (cur->ns == ns))
2811       {
2812          if(parseCandidateInfo(doc, ns, cur, &searchSpaceCfg->candidate) != ROK)
2813          {
2814             return RFAILED;
2815          }
2816       }
2817
2818       cur = cur -> next;
2819    }
2820    return ROK;
2821 }
2822
2823 /*******************************************************************
2824  *
2825  * @brief Fill PDCCH Configuration Common
2826  *
2827  * @details
2828  *
2829  *    Function : parsePdcchCfgCommon
2830  *
2831  *    Functionality: Fill PDCCH Configuration Common
2832  *
2833  * @params[in] XML document pointer
2834  *             XML namespace
2835  *             Current node in XML
2836  *             Pointer to structure to be filled
2837  * @return ROK     - success
2838  *         RFAILED - failure
2839  *
2840  * ****************************************************************/
2841 uint8_t parsePdcchCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdcchConfigCommon *pdcchCfgCm)
2842 {
2843    memset(pdcchCfgCm, 0, sizeof(PdcchConfigCommon));
2844    cur = cur -> xmlChildrenNode;
2845    while(cur != NULL)
2846    {
2847       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCH_SPACE_CFG")) && (cur->ns == ns))
2848       {
2849          if(parseSearchSpaceCfg(doc, ns, cur, &pdcchCfgCm->commonSearchSpace) != ROK)
2850          {
2851             return RFAILED;
2852          }
2853       }
2854
2855       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RA_SEARCH_SPACE_INDEX")) && (cur->ns == ns))
2856       {
2857          pdcchCfgCm->raSearchSpaceId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2858       }
2859
2860       cur = cur -> next;
2861    }
2862
2863    return ROK;
2864 }
2865
2866 /*******************************************************************
2867  *
2868  * @brief Fill PDSCH Common Time Domain Resource Allocation
2869  *
2870  * @details
2871  *
2872  *    Function : parsePdschCmnTimeDomRsrcAlloc
2873  *
2874  *    Functionality: Fill PDSCH Common Time Domain Resource Allocation
2875  *
2876  * @params[in] XML document pointer
2877  *             XML namespace
2878  *             Current node in XML
2879  *             Pointer to structure to be filled
2880  * @return ROK     - success
2881  *         RFAILED - failure
2882  *
2883  * ****************************************************************/
2884 uint8_t parsePdschCmnTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,\
2885       PdschCfgCommTimeDomRsrcAlloc *pdschTimeDomRsrcAlloc)
2886 {
2887    memset(pdschTimeDomRsrcAlloc, 0, sizeof(PdschCfgCommTimeDomRsrcAlloc));
2888    cur = cur -> xmlChildrenNode;
2889    while(cur != NULL)
2890    {
2891       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_K0_CFG")) && (cur->ns == ns))
2892       {
2893          pdschTimeDomRsrcAlloc->k0 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2894       }
2895       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_MAPPING_TYPE")) && (cur->ns == ns))
2896       {
2897          pdschTimeDomRsrcAlloc->mappingType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2898       }
2899       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_START_SYMBOL")) && (cur->ns == ns))
2900       {
2901          pdschTimeDomRsrcAlloc->startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2902       }
2903       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_LENGTH_SYMBOL")) && (cur->ns == ns))
2904       {
2905          pdschTimeDomRsrcAlloc->lengthSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2906       }
2907
2908       cur = cur -> next;
2909    }
2910    return ROK;
2911 }
2912
2913 /*******************************************************************
2914  *
2915  * @brief Fill PDSCH Configuration Common
2916  *
2917  * @details
2918  *
2919  *    Function : parsePdschConfigCommon
2920  *
2921  *    Functionality: Fill PDSCH Configuration Common
2922  *
2923  * @params[in] XML document pointer
2924  *             XML namespace
2925  *             Current node in XML
2926  *             Pointer to structure to be filled
2927  * @return ROK     - success
2928  *         RFAILED - failure
2929  *
2930  * ****************************************************************/
2931 uint8_t parsePdschConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PdschConfigCommon *pdschCfgCmn)
2932 {
2933    uint8_t idx = 0;
2934    xmlNodePtr child = NULLP;
2935    xmlNodePtr pdschNode = NULLP;
2936
2937    memset(pdschCfgCmn, 0, sizeof(PdschConfigCommon));
2938    cur = cur -> xmlChildrenNode;
2939    while(cur != NULL)
2940    {
2941       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRC_ALLOC")) && (cur->ns == ns))
2942       {
2943          pdschCfgCmn->numTimeDomAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2944       }
2945
2946       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_COMM_TIME_ALLOC_LIST")) && (cur->ns == ns))
2947       {
2948          child = cur->xmlChildrenNode;
2949          while(child != NULL)  
2950          {
2951             if ((!xmlStrcmp(child->name, (const xmlChar *)"PDSCH_COMM_TIME_ALLOC")) && (child->ns == ns))
2952             {   
2953                if(parsePdschCmnTimeDomRsrcAlloc(doc, ns, child, &pdschCfgCmn->timeDomRsrcAllocList[idx]) != ROK)
2954                {
2955                   return RFAILED;
2956                }
2957                idx++;
2958             }
2959             child = child -> next;
2960          }
2961       }
2962       cur = cur -> next;
2963    }
2964    return ROK;
2965 }
2966
2967 /*******************************************************************
2968  *
2969  * @brief Fill DL BWP Configuration
2970  *
2971  * @details
2972  *
2973  *    Function : parseBwpDLConfig
2974  *
2975  *    Functionality: Fill DL BWP Configuration
2976  *
2977  * @params[in] XML document pointer
2978  *             XML namespace
2979  *             Current node in XML
2980  *             Pointer to structure to be filled
2981  * @return ROK     - success
2982  *         RFAILED - failure
2983  *
2984  * ****************************************************************/
2985 uint8_t parseBwpDLConfig(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpDlConfig *bwpDlCfg)
2986 {
2987    memset(bwpDlCfg, 0, sizeof(BwpDlConfig));
2988    cur = cur -> xmlChildrenNode;
2989    while(cur != NULL)
2990    {
2991       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_PARAMS")) && (cur->ns == ns))
2992       {
2993          if(parseBwp(doc, ns, cur, &bwpDlCfg->bwp) != ROK)
2994          {
2995             return RFAILED;
2996          }
2997       }
2998
2999       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CFG_COMMON")) && (cur->ns == ns))
3000       {
3001          if(parsePdcchCfgCommon(doc, ns, cur, &bwpDlCfg->pdcchCommon) != ROK)
3002          {
3003             return RFAILED;
3004          }
3005       }
3006
3007       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_CFG_COMMON")) && (cur->ns == ns))
3008       {
3009          if(parsePdschConfigCommon(doc, ns, cur, &bwpDlCfg->pdschCommon) != ROK)
3010          {
3011             return RFAILED;
3012          }
3013       }
3014
3015       cur = cur -> next;
3016    }
3017    return ROK;
3018 }
3019
3020 /*******************************************************************
3021  *
3022  * @brief Fill Cell Configuration
3023  *
3024  * @details
3025  *
3026  *    Function : parseCellCfg
3027  *
3028  *    Functionality: Fill Cell Configuration
3029  *
3030  * @params[in] XML document pointer
3031  *             XML namespace
3032  *             Current node in XML
3033  *             Pointer to structure to be filled
3034  * @return ROK     - success
3035  *         RFAILED - failure
3036  *
3037  * ****************************************************************/
3038 uint8_t parseCellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CellCfg *cellCfg)
3039 {
3040    memset(cellCfg, 0, sizeof(CellCfg));
3041    cur = cur -> xmlChildrenNode;
3042    while(cur != NULL)
3043    {
3044 #ifdef O1_ENABLE   
3045       cellCfg->opState = cellParams.operationalState;
3046       cellCfg->adminState = cellParams.administrativeState;
3047       cellCfg->cellState = cellParams.cellState;
3048       cellCfg->phyCellId = cellParams.nRPCI;
3049       cellCfg->tac = cellParams.nRTAC;
3050       cellCfg->ssbFreq = cellParams.ssbFrequency;
3051 #else
3052       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_OP_STATE")) && (cur->ns == ns))
3053       {
3054          cellCfg->opState = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3055       }
3056
3057       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_ADMIN_STATE")) && (cur->ns == ns))
3058       {
3059          cellCfg->adminState = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3060       }
3061
3062       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_CELL_STATE")) && (cur->ns == ns))
3063       {
3064          cellCfg->cellState = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3065       }
3066
3067       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_PCI")) && (cur->ns == ns))
3068       {
3069          cellCfg->phyCellId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3070       }
3071
3072       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns))
3073       {
3074          cellCfg->tac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3075       }
3076
3077       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_FREQUENCY")) && (cur->ns == ns))
3078       {
3079          cellCfg->ssbFreq = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3080       }
3081 #endif
3082
3083       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN_INFO")) && (cur->ns == ns))
3084       {
3085          if(parsePlmnInfo(doc, ns, cur, &cellCfg->plmnInfoList[0]) != ROK)
3086          {
3087             return RFAILED;
3088          }
3089       }
3090
3091       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns))
3092       {
3093          cellCfg->subCarrSpacing  = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3094       }
3095
3096       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DUPLEX_MODE")) && (cur->ns == ns))
3097       {
3098          cellCfg->dupType  = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3099       }
3100
3101       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB1_CELL_CFG")) && (cur->ns == ns))
3102       {
3103          if(parseSib1CellCfg(doc, ns, cur, &cellCfg->sib1Cfg) != ROK)
3104          {
3105             return RFAILED;
3106          }
3107       }
3108
3109       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_DL_CFG")) && (cur->ns == ns))
3110       {
3111          if(parseBwpDLConfig(doc, ns, cur, &cellCfg->initialDlBwp) != ROK)
3112          {
3113             return RFAILED;
3114          }
3115       }
3116
3117       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_UL_CFG")) && (cur->ns == ns))
3118       {
3119          if(parseBwpULConfig(doc, ns, cur, &cellCfg->initialUlBwp) != ROK)
3120          {
3121             return RFAILED;
3122          }
3123       }
3124       cur = cur -> next;
3125    }
3126    return ROK;
3127 }
3128
3129 #ifdef NR_TDD
3130 /*******************************************************************
3131  *
3132  * @brief Fill TDD slot configuration
3133  *
3134  * @details
3135  *
3136  *    Function : parseTddCfg
3137  *
3138  *    Functionality: Fill TDD slot configuration
3139  *
3140  * @params[in] XML document pointer
3141  *             XML namespace
3142  *             Current node in XML
3143  *             Pointer to structure to be filled
3144  * @return ROK     - success
3145  *         RFAILED - failure
3146  *
3147  * ****************************************************************/
3148 uint8_t parseTddCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TDDCfg *tddCfg)
3149 {
3150    memset(tddCfg, 0, sizeof(TDDCfg));
3151    cur = cur -> xmlChildrenNode;
3152    while(cur != NULL)
3153    {
3154       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TDD_PERIODICITY")) && (cur->ns == ns))
3155       {
3156          tddCfg->tddPeriod = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3157       }
3158
3159       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SLOTS")) && (cur->ns == ns))
3160       {
3161          tddCfg->nrOfDlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3162       }
3163
3164       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SYMBOLS")) && (cur->ns == ns))
3165       {
3166          tddCfg->nrOfDlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3167       }
3168
3169       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SLOTS")) && (cur->ns == ns))
3170       {
3171          tddCfg->nrOfUlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3172       }
3173
3174       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SYMBOLS")) && (cur->ns == ns))
3175       {
3176          tddCfg->nrOfUlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3177       }
3178
3179       cur = cur -> next;
3180    }
3181    return ROK;
3182 }
3183 #endif
3184
3185 /*******************************************************************
3186  *
3187  * @brief Fill MAC Cell Configuration
3188  *
3189  * @details
3190  *
3191  *    Function : parseMacCellCfg
3192  *
3193  *    Functionality: Fill MAC Cell Configuration
3194  *
3195  * @params[in] XML document pointer
3196  *             XML namespace
3197  *             Current node in XML
3198  *             Pointer to structure to be filled
3199  * @return ROK     - success
3200  *         RFAILED - failure
3201  *
3202  * ****************************************************************/
3203 uint8_t parseMacCellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,MacCellCfg *macCellCfg)
3204 {
3205    memset(macCellCfg, 0, sizeof(MacCellCfg));
3206    cur = cur -> xmlChildrenNode;
3207    while(cur != NULL)
3208    {
3209 #ifdef O1_ENABLE
3210       macCellCfg->cellId = cellParams.cellLocalId;
3211 #else
3212       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_ID")) && (cur->ns == ns))
3213       {
3214          macCellCfg->cellId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3215       }
3216 #endif
3217
3218       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CARRIER_CFG")) && (cur->ns == ns))
3219       {
3220          if(parseCarrierCfg(doc, ns, cur, &macCellCfg->carrCfg) != ROK)
3221          {
3222             return RFAILED;
3223          }
3224       }
3225
3226       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_CFG")) && (cur->ns == ns))
3227       {
3228          if(parseCellCfg(doc, ns, cur, &macCellCfg->cellCfg) != ROK)
3229          {
3230             return RFAILED;
3231          }
3232       }
3233
3234       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_CFG")) && (cur->ns == ns))
3235       {
3236          if(parseSsbCfg(doc, ns, cur, &macCellCfg->ssbCfg) != ROK)
3237          {
3238             return RFAILED;
3239          }
3240       }
3241
3242       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_CFG")) && (cur->ns == ns))
3243       {
3244          if(parseCsiRsCfg(doc, ns, cur, &macCellCfg->csiRsCfg) != ROK)
3245          {
3246             return RFAILED;
3247          }
3248       }
3249
3250       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_CFG")) && (cur->ns == ns))
3251       {
3252          if(parsePrachCfg(doc, ns, cur, &macCellCfg->prachCfg) != ROK)
3253          {
3254             return RFAILED;
3255          }
3256       }
3257
3258 #ifdef NR_TDD
3259       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TDD_CFG")) && (cur->ns == ns))
3260       {
3261          if(parseTddCfg(doc, ns, cur, &macCellCfg->tddCfg) != ROK)
3262          {
3263             return RFAILED;
3264          }
3265       }
3266 #endif 
3267
3268       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRE_CODE_CFG")) && (cur->ns == ns))
3269       {
3270          if(parsePrecodingConfig(doc, ns, cur, &macCellCfg->precodingConf) != ROK)
3271          {
3272             return RFAILED;
3273          }
3274       }
3275
3276       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_FORM_CFG")) && (cur->ns == ns))
3277       {
3278          if(parseBeamformingConfig(doc, ns, cur, &macCellCfg->beamCfg) != ROK)
3279          {
3280             return RFAILED;
3281          }
3282       }
3283
3284       cur = cur -> next;
3285    }
3286    return ROK;
3287 }
3288
3289 /*******************************************************************
3290  *
3291  * @brief Fill PUSCH Configuration Common Time Domain 
3292  *    Resource Allocation
3293  *
3294  * @details
3295  *
3296  *    Function : parsePuschCmnTimeDomRsrcAlloc
3297  *
3298  *    Functionality: Fill PUSCH Configuration Common Time Domain
3299  *       Resource Allocation
3300  *
3301  * @params[in] XML document pointer
3302  *             XML namespace
3303  *             Current node in XML
3304  *             Pointer to structure to be filled
3305  * @return ROK     - success
3306  *         RFAILED - failure
3307  *
3308  * ****************************************************************/
3309 uint8_t parsePuschCmnTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschCfgCmnTimeDomAlloc *puschCmnTimeDomAlloc)
3310 {
3311    uint16_t startSymbol;
3312    uint16_t lenSymbol;
3313
3314    memset(puschCmnTimeDomAlloc, 0, sizeof(PuschCfgCmnTimeDomAlloc));
3315    cur = cur -> xmlChildrenNode;
3316    while(cur != NULL)
3317    {
3318       if ((!xmlStrcmp(cur->name, (const xmlChar *)"K2")) && (cur->ns == ns))
3319       {
3320          puschCmnTimeDomAlloc->k2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3321       }
3322       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAP_TYPE")) && (cur->ns == ns))
3323       {
3324          puschCmnTimeDomAlloc->mapType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3325       }
3326       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_START_SYMBOL")) && (cur->ns == ns))
3327       {
3328          startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3329       }
3330       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_LENGTH_SYMBOL")) && (cur->ns == ns))
3331       {
3332          lenSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3333       }
3334       cur = cur -> next;
3335    }
3336    puschCmnTimeDomAlloc->sliv = calcSliv(startSymbol, lenSymbol);
3337    return ROK;
3338 }
3339
3340 /*******************************************************************
3341  *
3342  * @brief Fill PUSCH Configuration Common
3343  *
3344  * @details
3345  *
3346  *    Function : parsePuschCfgCommon
3347  *
3348  *    Functionality: Fill PUSCH Configuration Common
3349  *
3350  * @params[in] XML document pointer
3351  *             XML namespace
3352  *             Current node in XML
3353  *             Pointer to structure to be filled
3354  * @return ROK     - success
3355  *         RFAILED - failure
3356  *
3357  * ****************************************************************/
3358 uint8_t parsePuschCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschCfgCommon *puschCfgCmn)
3359 {
3360    uint8_t rsrcIdx = 0;
3361    xmlNodePtr child = NULLP;
3362    xmlNodePtr rsrcNode = NULLP;
3363
3364    memset(puschCfgCmn, 0, sizeof(PuschCfgCommon));
3365    cur = cur -> xmlChildrenNode;
3366    while(cur != NULL)
3367    {
3368       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_CFG_PRESENT")) && (cur->ns == ns))
3369       {
3370          puschCfgCmn->puschCfgPresent = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3371       }
3372
3373       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_MSG3_DELTA_PREAMBLE")) && (cur->ns == ns))
3374       {
3375          puschCfgCmn->msg3DeltaPreamble = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3376       }
3377
3378       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_P0_NOMINAL_WITH_GRANT")) && (cur->ns == ns))
3379       {
3380          puschCfgCmn->p0NominalWithGrant = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3381       }
3382
3383       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRC_ALLOC")) && (cur->ns == ns))
3384       {
3385          puschCfgCmn->numTimeDomRsrcAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3386       }
3387
3388       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_TIME_DOM_RSRC_ALLOC_LIST")) && (cur->ns == ns))
3389       {
3390          child = cur->xmlChildrenNode;
3391          while (child != NULL)
3392          {
3393             if ((!xmlStrcmp(child->name, (const xmlChar *)"PUSCH_TIME_DOM_RSRC_ALLOC")) && (child->ns == ns))
3394             {
3395                if(parsePuschCmnTimeDomRsrcAlloc(doc, ns, child, &puschCfgCmn->timeDomAllocList[rsrcIdx]) != ROK)
3396                {
3397                   return RFAILED;
3398                }
3399                rsrcIdx++;
3400             }
3401             child = child->next;
3402          }
3403       }
3404       cur = cur -> next;
3405    }
3406    return ROK;
3407 }
3408
3409 /*******************************************************************
3410  *
3411  * @brief Fill PUCCH Configuration Common 
3412  *
3413  * @details
3414  *
3415  *    Function : parsePucchCfgCommon
3416  *
3417  *    Functionality: Fill PUCCH Configuration Common
3418  *
3419  * @params[in] XML document pointer
3420  *             XML namespace
3421  *             Current node in XML
3422  *             Pointer to structure to be filled
3423  * @return ROK     - success
3424  *         RFAILED - failure
3425  *
3426  * ****************************************************************/
3427 uint8_t parsePucchCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PucchCfgCommon *pucchCfgCmn)
3428 {
3429    memset(pucchCfgCmn, 0, sizeof(PucchCfgCommon));
3430    cur = cur -> xmlChildrenNode;
3431    while(cur != NULL)
3432    {
3433       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns))
3434       {
3435          pucchCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3436       }
3437
3438       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_RSRC_COMMON")) && (cur->ns == ns))
3439       {
3440          pucchCfgCmn->rsrcComm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3441       }
3442
3443       if ((!xmlStrcmp(cur->name, (const xmlChar *)"GRP_HOP")) && (cur->ns == ns))
3444       {
3445          pucchCfgCmn->grpHop = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3446       }
3447
3448       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_P0_NOMINAL")) && (cur->ns == ns))
3449       {
3450          pucchCfgCmn->p0Nominal = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3451       }
3452
3453       cur = cur -> next;
3454    }
3455    return ROK;
3456 }
3457
3458 /*******************************************************************
3459  *
3460  * @brief Fill RACH Configuration Common
3461  *
3462  * @details
3463  *
3464  *    Function : parseRachCfgCommon
3465  *
3466  *    Functionality: Fill RACH Configuration Common
3467  *
3468  * @params[in] XML document pointer
3469  *             XML namespace
3470  *             Current node in XML
3471  *             Pointer to structure to be filled
3472  * @return ROK     - success
3473  *         RFAILED - failure
3474  *
3475  * ****************************************************************/
3476 uint8_t parseRachCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RachCfgCommon *rachCfgCmn)
3477 {
3478    long   maxNumRb;
3479    long   prachMaxPrb;
3480
3481    memset(rachCfgCmn, 0, sizeof(RachCfgCommon));
3482    cur = cur -> xmlChildrenNode;
3483    while(cur != NULL)
3484    {
3485       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns))
3486       {
3487          rachCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3488       }
3489
3490       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_CONFIG_IDX")) && (cur->ns == ns))
3491       {
3492          rachCfgCmn->prachCfgIdx = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3493       }
3494
3495       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MSG_1_FDM")) && (cur->ns == ns))
3496       {
3497          rachCfgCmn->msg1Fdm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3498       }
3499
3500       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_RB")) && (cur->ns == ns))
3501       {
3502          maxNumRb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3503       }
3504       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_MAX_PRB")) && (cur->ns == ns))
3505       {
3506          prachMaxPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3507       }
3508
3509       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ZERO_CORRELATION_ZONE_CFG")) && (cur->ns == ns))
3510       {
3511          rachCfgCmn->zeroCorrZoneCfg = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3512       }
3513
3514       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_PREAMBLE_RCVD_TGT_PWR")) && (cur->ns == ns))
3515       {
3516          rachCfgCmn->preambleRcvdTgtPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3517       }
3518
3519       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PREAMBLE_TRANS_MAX")) && (cur->ns == ns))
3520       {
3521          rachCfgCmn->preambleTransMax = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3522       }
3523
3524       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PWR_RAMPING_STEP")) && (cur->ns == ns))
3525       {
3526          rachCfgCmn->pwrRampingStep = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3527       }
3528
3529       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RA_RSP_WINDOW")) && (cur->ns == ns))
3530       {
3531          rachCfgCmn->raRspWindow = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3532       }
3533
3534       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RA_PREAMBLE")) && (cur->ns == ns))
3535       {
3536          rachCfgCmn->numRaPreamble = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3537       }
3538
3539       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_SSB_PER_RACH_OCC")) && (cur->ns == ns))
3540       {
3541          rachCfgCmn->numSsbPerRachOcc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3542       }
3543
3544       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CB_PREAMBLE_PER_SSB")) && (cur->ns == ns))
3545       {
3546          rachCfgCmn->numCbPreamblePerSsb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3547       }
3548
3549       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONT_RES_TIMER")) && (cur->ns == ns))
3550       {
3551          rachCfgCmn->contResTimer = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3552       }
3553
3554       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RSRP_THRESHOLD_SSB")) && (cur->ns == ns))
3555       {
3556          rachCfgCmn->rsrpThreshSsb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3557       }
3558
3559       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROOT_SEQ_IDX_PRESENT")) && (cur->ns == ns))
3560       {
3561          rachCfgCmn->rootSeqIdxPresent = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3562       }
3563
3564       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROOT_SEQ_IDX")) && (cur->ns == ns))
3565       {
3566          rachCfgCmn->rootSeqIdx = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3567       }
3568
3569       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_SUBCARRIER_SPACING")) && (cur->ns == ns))
3570       {
3571          rachCfgCmn->msg1Scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3572       }
3573
3574       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_RESTRICTED_SET_CFG")) && (cur->ns== ns))
3575       {
3576          rachCfgCmn->restrictedSetCfg = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3577       }
3578
3579       cur = cur -> next;
3580    }
3581
3582    rachCfgCmn->msg1FreqStart = ((maxNumRb) - (prachMaxPrb));
3583    return ROK;
3584 }
3585
3586 /*******************************************************************
3587  *
3588  * @brief Fill SCS Specific Carrier
3589  *
3590  * @details
3591  *
3592  *    Function : parseScsSpecCarrier
3593  *
3594  *    Functionality: Fill SCS Specific Carrier
3595  *
3596  * @params[in] XML document pointer
3597  *             XML namespace
3598  *             Current node in XML
3599  *             Pointer to structure to be filled
3600  * @return ROK     - success
3601  *         RFAILED - failure
3602  *
3603  * ****************************************************************/
3604 uint8_t parseScsSpecCarrier(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, ScsSpecCarrier *scsSpecCrr)
3605 {
3606    memset(scsSpecCrr, 0, sizeof(ScsSpecCarrier));
3607
3608 #ifdef O1_ENABLE
3609    scsSpecCrr->scsOffset = cellParams.ssbOffset;
3610    scsSpecCrr->scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
3611    scsSpecCrr->scsBw = cellParams.bSChannelBwUL;
3612 #else
3613    cur = cur -> xmlChildrenNode;
3614    while(cur != NULL)
3615    {
3616       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_SUBCARRIER_OFFSET")) && (cur->ns == ns))
3617       {
3618          scsSpecCrr->scsOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3619       }
3620
3621       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns))
3622       {
3623          scsSpecCrr->scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3624       }
3625
3626       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_BW")) && (cur->ns == ns))
3627       {
3628          scsSpecCrr->scsBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3629       }
3630       cur = cur -> next;
3631    }
3632 #endif   
3633    return ROK;
3634 }
3635
3636 /*******************************************************************
3637  *
3638  * @brief Fill UL Config Common 
3639  *
3640  * @details
3641  *
3642  *    Function : parseUlCfgCommon
3643  *
3644  *    Functionality: Fill UL Config Common
3645  *
3646  * @params[in] XML document pointer
3647  *             XML namespace
3648  *             Current node in XML
3649  *             Pointer to structure to be filled
3650  * @return ROK     - success
3651  *         RFAILED - failure
3652  *
3653  * ****************************************************************/
3654 uint8_t parseUlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,UlCfgCommon *ulCfgCmn)
3655 {
3656    memset(ulCfgCmn, 0, sizeof(UlCfgCommon));
3657    cur = cur -> xmlChildrenNode;
3658    while(cur != NULL)
3659    {
3660       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_FREQ_BAND")) && (cur->ns == ns))
3661       {
3662          ulCfgCmn->freqBandInd = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3663       }
3664
3665       if ((!xmlStrcmp(cur->name, (const xmlChar *)"UL_P_MAX")) && (cur->ns == ns))
3666       {
3667          ulCfgCmn->pMax = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3668       }
3669
3670       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FREQ_LOC_BW")) && (cur->ns == ns))
3671       {
3672          ulCfgCmn->locAndBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3673       }
3674
3675       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIME_ALLIGN_TIMER_COMM")) && (cur->ns == ns))
3676       {
3677          ulCfgCmn->timeAlignTimerComm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3678       }
3679
3680       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_SPEC_CARRIER")) && (cur->ns == ns))
3681       {
3682          if(parseScsSpecCarrier(doc, ns, cur, &ulCfgCmn->ulScsCarrier) != ROK)
3683          {
3684             return RFAILED;
3685          }
3686       }
3687
3688       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RACH_CFG_COMMON")) && (cur->ns == ns))
3689       {
3690          if(parseRachCfgCommon(doc, ns, cur, &ulCfgCmn->rachCfg) != ROK)
3691          {
3692             return RFAILED;
3693          }
3694       }
3695
3696       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_CFG_COMMON")) && (cur->ns == ns))
3697       {
3698          if(parsePuschCfgCommon(doc, ns, cur, &ulCfgCmn->puschCfg) != ROK)
3699          {
3700             return RFAILED;
3701          }
3702       }
3703       
3704       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_CFG_COMMON")) && (cur->ns == ns))
3705       {
3706          if(parsePucchCfgCommon(doc, ns, cur, &ulCfgCmn->pucchCfg) != ROK)
3707          {
3708             return RFAILED;
3709          }
3710       }
3711
3712       cur = cur -> next;
3713    }
3714    return ROK;
3715 }
3716
3717 /*******************************************************************
3718  *
3719  * @brief Fill TDD UL DL Configuration Common
3720  *
3721  * @details
3722  *
3723  *    Function : parseTddUlDlCfgCommon
3724  *
3725  *    Functionality: Fill TDD UL DL Configuration Common
3726  *
3727  * @params[in] XML document pointer
3728  *             XML namespace
3729  *             Current node in XML
3730  *             Pointer to structure to be filled
3731  * @return ROK     - success
3732  *         RFAILED - failure
3733  *
3734  * ****************************************************************/
3735 uint8_t parseTddUlDlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TddUlDlCfgCommon *tddUlDlCfgCmn)
3736 {
3737    memset(tddUlDlCfgCmn, 0, sizeof(TddUlDlCfgCommon));
3738    cur = cur -> xmlChildrenNode;
3739    while(cur != NULL)
3740    {
3741       if ((!xmlStrcmp(cur->name, (const xmlChar *)"REF_SCS")) && (cur->ns == ns))
3742       {
3743          tddUlDlCfgCmn->refScs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3744       }
3745
3746       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TX_PRD")) && (cur->ns == ns))
3747       {
3748          tddUlDlCfgCmn->txPrd = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3749       }
3750
3751       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SLOTS")) && (cur->ns == ns))
3752       {
3753          tddUlDlCfgCmn->numDlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3754       }
3755
3756       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SYMBOLS")) && (cur->ns == ns))
3757       {
3758          tddUlDlCfgCmn->numDlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3759       }
3760
3761       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SLOTS")) && (cur->ns == ns))
3762       {
3763          tddUlDlCfgCmn->numUlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3764       }
3765
3766       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SYMBOLS")) && (cur->ns == ns))
3767       {
3768          tddUlDlCfgCmn->numUlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3769       }
3770
3771       cur = cur -> next;
3772    }
3773    return ROK;
3774 }
3775
3776 /*******************************************************************
3777  *
3778  * @brief Fill PCCH Configuration 
3779  *
3780  * @details
3781  *
3782  *    Function : parsePcchCfg
3783  *
3784  *    Functionality: Fill PCCH Configuration
3785  *
3786  * @params[in] XML document pointer
3787  *             XML namespace
3788  *             Current node in XML
3789  *             Pointer to structure to be filled
3790  * @return ROK     - success
3791  *         RFAILED - failure
3792  *
3793  * ****************************************************************/
3794 uint8_t parsePcchCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PcchCfg *pcchCfg)
3795 {
3796    xmlNodePtr child = NULLP;
3797    uint8_t  idx = 0;
3798
3799    memset(pcchCfg, 0, sizeof(PcchCfg));
3800    cur = cur -> xmlChildrenNode;
3801    while(cur != NULL)
3802    {
3803       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DEFAULT_PAGING_CYCLE")) && (cur->ns == ns))
3804       {
3805          pcchCfg->dfltPagingCycle = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3806       }
3807
3808       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAND_PAGING_FRAME_OFFSET")) && (cur->ns == ns))
3809       {
3810          pcchCfg->nAndPagingFrmOffsetType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3811       }
3812
3813       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PAGE_FRAME_OFFSET")) && (cur->ns == ns))
3814       {
3815          pcchCfg->pageFrameOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3816       }
3817
3818       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NS")) && (cur->ns == ns))
3819       {
3820          pcchCfg->ns = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3821       }
3822
3823       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FIRST_PDCCH_MONITORING_TYPE")) && (cur->ns == ns))
3824       {
3825          pcchCfg->firstPDCCHMontioringType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3826       }
3827
3828       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FIRST_PDCCH_LIST")) && (cur->ns == ns))
3829       {
3830          child = cur->xmlChildrenNode;
3831          while (child != NULL)
3832          {
3833             if ((!xmlStrcmp(child->name, (const xmlChar *)"FIRST_PDCCH_MONITORING_INFO")) && (child->ns == ns))
3834             {
3835                pcchCfg->firstPDCCHMontioringInfo[idx] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
3836                idx++;
3837             }
3838             child = child->next;
3839          }
3840       }
3841       cur = cur -> next;
3842    }
3843    return ROK;
3844 }
3845
3846 /*******************************************************************
3847  *
3848  * @brief Fill PDSCH Time Domain Resource Allocation
3849  *
3850  * @details
3851  *
3852  *    Function : parsePdschTimeDomRsrcAlloc
3853  *
3854  *    Functionality: Fill PDSCH Time Domain Resource Allocation
3855  *
3856  * @params[in] XML document pointer
3857  *             XML namespace
3858  *             Current node in XML
3859  *             Pointer to structure to be filled
3860  * @return ROK     - success
3861  *         RFAILED - failure
3862  *
3863  * ****************************************************************/
3864 uint8_t parsePdschTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdschTimeDomainRsrcAlloc *pdschTimeDomRsrcAlloc)
3865 {
3866    uint16_t startSymbol;
3867    uint16_t lenSymbol;
3868
3869    memset(pdschTimeDomRsrcAlloc, 0, sizeof(PdschTimeDomainRsrcAlloc));
3870    cur = cur -> xmlChildrenNode;
3871    while(cur != NULL)
3872    {
3873       if ((!xmlStrcmp(cur->name, (const xmlChar *)"K0")) && (cur->ns == ns))
3874       {
3875          pdschTimeDomRsrcAlloc->k0 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3876       }
3877
3878       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAP_TYPE")) && (cur->ns == ns))
3879       {
3880          pdschTimeDomRsrcAlloc->mapType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3881       }
3882
3883       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_START_SYMBOL")) && (cur->ns == ns))
3884       {
3885          startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3886       }
3887
3888       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_LENGTH_SYMBOL")) && (cur->ns == ns))
3889       {
3890          lenSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3891       }
3892
3893       cur = cur -> next;
3894    }
3895    pdschTimeDomRsrcAlloc->sliv = calcSliv(startSymbol, lenSymbol);
3896    return ROK;
3897 }
3898
3899 /*******************************************************************
3900  *
3901  * @brief Fill PDSCH Configuration Common
3902  *
3903  * @details
3904  *
3905  *    Function : parsePdschCfgCommon
3906  *
3907  *    Functionality: Fill PDSCH Configuration Common
3908  *
3909  * @params[in] XML document pointer
3910  *             XML namespace
3911  *             Current node in XML
3912  *             Pointer to structure to be filled
3913  * @return ROK     - success
3914  *         RFAILED - failure
3915  *
3916  * ****************************************************************/
3917 uint8_t parsePdschCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdschCfgCommon *pdschCfgCmn)
3918 {
3919    uint8_t     idx = 0;
3920    xmlNodePtr  child = NULLP; 
3921
3922    memset(pdschCfgCmn, 0, sizeof(PdschCfgCommon));
3923    cur = cur -> xmlChildrenNode;
3924    while(cur != NULL)
3925    {
3926       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns))
3927       {
3928          pdschCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3929       }
3930
3931       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRS_ALLOC")) && (cur->ns == ns))
3932       {
3933          pdschCfgCmn->numTimeDomRsrcAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3934       }
3935
3936       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_TIME_DOM_RSRC_ALLOC_LIST")) && (cur->ns == ns))
3937       {
3938          child = cur->xmlChildrenNode;
3939          while (child != NULL)
3940          {
3941             if ((!xmlStrcmp(child->name, (const xmlChar *)"PDSCH_TIME_DOM_RSRC_ALLOC")) && (child->ns == ns))
3942             {
3943                if(parsePdschTimeDomRsrcAlloc(doc, ns, child, &pdschCfgCmn->timeDomAlloc[idx]) != ROK)
3944                {
3945                   return RFAILED;
3946                }
3947                idx++;
3948             }
3949             child = child->next;
3950          }
3951       }
3952       cur = cur -> next;
3953    }
3954    return ROK;
3955 }
3956
3957 /*******************************************************************
3958  *
3959  * @brief Fill BCCH Configuration
3960  *
3961  * @details
3962  *
3963  *    Function : parseBcchCfg
3964  *
3965  *    Functionality: Fill BCCH Configuration
3966  *
3967  * @params[in] XML document pointer
3968  *             XML namespace
3969  *             Current node in XML
3970  *             Pointer to structure to be filled
3971  * @return ROK     - success
3972  *         RFAILED - failure
3973  *
3974  * ****************************************************************/
3975 uint8_t parseBcchCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, BcchCfg *bcchCfg)
3976 {
3977    memset(bcchCfg, 0, sizeof(BcchCfg));
3978    cur = cur -> xmlChildrenNode;
3979    while(cur != NULL)
3980    {
3981       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MOB_PRD_COEFF")) && (cur->ns == ns))
3982       {
3983          bcchCfg->modPrdCoeff = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3984       }
3985       cur = cur -> next;
3986    }
3987    return ROK;
3988 }
3989
3990 /*******************************************************************
3991  *
3992  * @brief Fill PDCCH Configuration Common
3993  *
3994  * @details
3995  *
3996  *    Function : parsePdcchConfigCommon
3997  *
3998  *    Functionality: Fill PDCCH Configuration Common
3999  *
4000  * @params[in] XML document pointer
4001  *             XML namespace
4002  *             Current node in XML
4003  *             Pointer to structure to be filled
4004  * @return ROK     - success
4005  *         RFAILED - failure
4006  *
4007  * ****************************************************************/
4008 uint8_t parsePdcchConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PdcchCfgCommon *pdccgCfgCmn)
4009 {
4010    uint8_t idx = 0;
4011    xmlNodePtr child = NULLP;
4012
4013    memset(pdccgCfgCmn, 0, sizeof( PdcchCfgCommon));
4014    cur = cur -> xmlChildrenNode;
4015    while(cur != NULL)
4016    {
4017       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns))
4018       {
4019          pdccgCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4020       }
4021
4022       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_0_INDEX")) && (cur->ns == ns))
4023       {
4024          pdccgCfgCmn->ctrlRsrcSetZero = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4025       }
4026
4027       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCHSPACE_0_INDEX")) && (cur->ns == ns))
4028       {
4029          pdccgCfgCmn->searchSpcZero = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4030       }
4031
4032       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID")) && (cur->ns == ns))
4033       {
4034          pdccgCfgCmn->searchSpcId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4035       }
4036
4037       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CTRL_RSRC_SET_ID")) && (cur->ns == ns))
4038       {
4039          pdccgCfgCmn->ctrlRsrcSetId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4040       }
4041
4042       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MONITOR_SLOT_PERIOD_OFFSET_PRESENT")) && (cur->ns == ns))
4043       {
4044          pdccgCfgCmn->monitorSlotPrdAndOffPresent = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4045       }
4046
4047       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MONITOR_LIST")) && (cur->ns == ns))
4048       {
4049          child = cur->xmlChildrenNode;
4050          while (child)
4051          {
4052             if ((!xmlStrcmp(child->name, (const xmlChar *)"MONITOR_SYMBOL_IN_SLOT")) && (child->ns == ns))
4053             {
4054                pdccgCfgCmn->monitorSymbolsInSlot[idx] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
4055                idx++;
4056             }
4057             child = child->next;
4058          }
4059       }
4060
4061       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_CANDIDATE_AGG_LVL_1")) && (cur->ns == ns))
4062       {
4063          pdccgCfgCmn->numCandAggLvl1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4064       }
4065
4066       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_CANDIDATE_AGG_LVL_2")) && (cur->ns == ns))
4067       {
4068          pdccgCfgCmn->numCandAggLvl2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4069       }
4070
4071       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_CANDIDATE_AGG_LVL_4")) && (cur->ns == ns))
4072       {
4073          pdccgCfgCmn->numCandAggLvl4 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4074       }
4075
4076       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_CANDIDATE_AGG_LVL_8")) && (cur->ns == ns))
4077       {
4078          pdccgCfgCmn->numCandAggLvl8 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4079       }
4080
4081       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_CANDIDATE_AGG_LVL_16")) && (cur->ns == ns))
4082       {
4083          pdccgCfgCmn->numCandAggLvl16 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4084       }
4085
4086       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCH_SPACE_TYPE")) && (cur->ns == ns))
4087       {
4088          pdccgCfgCmn->searchSpcType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4089       }
4090
4091       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_DCI_FORMAT")) && (cur->ns == ns))
4092       {
4093          pdccgCfgCmn->commSrchSpcDciFrmt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4094       }
4095
4096       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID_SIB1")) && (cur->ns == ns))
4097       {
4098          pdccgCfgCmn->searchSpcSib1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4099       }
4100
4101       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID_PAGING")) && (cur->ns == ns))
4102       {
4103          pdccgCfgCmn->pagingSearchSpc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4104       }
4105
4106       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID_RA")) && (cur->ns == ns))
4107       {
4108          pdccgCfgCmn->raSearchSpc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4109       }
4110
4111       cur = cur -> next;
4112    }
4113    return ROK;
4114 }
4115
4116 /*******************************************************************
4117  *
4118  * @brief Fill DL Configuration Common
4119  *
4120  * @details
4121  *
4122  *    Function : parseDlCfgCommon
4123  *
4124  *    Functionality: Fill DL Configuration Common
4125  *
4126  * @params[in] XML document pointer
4127  *             XML namespace
4128  *             Current node in XML
4129  *             Pointer to structure to be filled
4130  * @return ROK     - success
4131  *         RFAILED - failure
4132  *
4133  * ****************************************************************/
4134 uint8_t parseDlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,DlCfgCommon *dlCfgCmn)
4135 {
4136    memset(dlCfgCmn, 0, sizeof(DlCfgCommon));
4137    cur = cur -> xmlChildrenNode;
4138    while(cur != NULL)
4139    {
4140       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_FREQ_BAND")) && (cur->ns == ns))
4141       {
4142          dlCfgCmn->freqBandInd = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4143       }
4144
4145       if ((!xmlStrcmp(cur->name, (const xmlChar *)"OFFSET_TO_POINT_A")) && (cur->ns == ns))
4146       {
4147          dlCfgCmn->offsetToPointA = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4148       }
4149
4150       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FREQ_LOC_BW")) && (cur->ns == ns))
4151       {
4152          dlCfgCmn->locAndBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4153       }
4154
4155       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_SPEC_CARRIER")) && (cur->ns == ns))
4156       {
4157          if(parseScsSpecCarrier(doc, ns, cur, &dlCfgCmn->dlScsCarrier) != ROK)
4158          {
4159             return RFAILED;
4160          }
4161       }
4162
4163       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CFG_COMMON")) && (cur->ns == ns))
4164       {
4165          if(parsePdcchConfigCommon(doc, ns, cur, &dlCfgCmn->pdcchCfg) != ROK)
4166          {
4167             return RFAILED;
4168          }
4169       }
4170
4171       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_CFG_COMMON")) && (cur->ns == ns))
4172       {
4173          if(parsePdschCfgCommon(doc, ns, cur, &dlCfgCmn->pdschCfg) != ROK)
4174          {
4175             return RFAILED;
4176          }
4177       }
4178
4179       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BCCH_CFG")) && (cur->ns == ns))
4180       {
4181          if(parseBcchCfg(doc, ns, cur, &dlCfgCmn->bcchCfg) != ROK)
4182          {
4183             return RFAILED;
4184          }
4185       }
4186
4187       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PCCH_CFG")) && (cur->ns == ns))
4188       {
4189          if(parsePcchCfg(doc, ns, cur, &dlCfgCmn->pcchCfg) != ROK)
4190          {
4191             return RFAILED;
4192          }
4193       }
4194       cur = cur -> next;
4195    }
4196    return ROK;
4197 }
4198 /*******************************************************************
4199  *
4200  * @brief Fill Serving Cell Config Common SIB
4201  *
4202  * @details
4203  *
4204  *    Function : parseSrvCellCfgCmnSib
4205  *
4206  *    Functionality: Fill Serving Cell Config Common SIB
4207  *
4208  * @params[in] XML document pointer
4209  *             XML namespace
4210  *             Current node in XML
4211  *             Pointer to structure to be filled
4212  * @return ROK     - success
4213  *         RFAILED - failure
4214  *
4215  * ****************************************************************/
4216 uint8_t parseSrvCellCfgCmnSib(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SrvCellCfgCommSib *srvCellCfgCmnSib)
4217 {
4218    memset(srvCellCfgCmnSib, 0, sizeof(SrvCellCfgCommSib));
4219    cur = cur -> xmlChildrenNode;
4220    while(cur != NULL)
4221    {
4222 #ifdef O1_ENABLE
4223       srvCellCfgCmnSib->scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
4224 #else
4225       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns))
4226       {
4227          srvCellCfgCmnSib->scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4228       }
4229 #endif
4230       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_POS_INBURST")) && (cur->ns == ns))
4231       {
4232          srvCellCfgCmnSib->ssbPosInBurst = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4233       }
4234
4235       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PERIODICITY")) && (cur->ns == ns))
4236       {
4237          srvCellCfgCmnSib->ssbPrdServingCell = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4238       }
4239
4240       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PBCH_PWR")) && (cur->ns == ns))
4241       {
4242          srvCellCfgCmnSib->ssPbchBlockPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4243       }
4244
4245       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DL_CFG_COMMON")) && (cur->ns == ns))
4246       {
4247          if(parseDlCfgCommon(doc, ns, cur, &srvCellCfgCmnSib->dlCfg) != ROK)
4248          {
4249             return RFAILED;
4250          }
4251       }
4252
4253       if ((!xmlStrcmp(cur->name, (const xmlChar *)"UL_CFG_COMMON")) && (cur->ns == ns))
4254       {
4255          if(parseUlCfgCommon(doc, ns, cur, &srvCellCfgCmnSib->ulCfg) != ROK)
4256          {
4257             return RFAILED;
4258          }
4259       }
4260
4261       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TDD_UL_DL_CFG_COMMON")) && (cur->ns == ns))
4262       {
4263          if(parseTddUlDlCfgCommon(doc, ns, cur, &srvCellCfgCmnSib->tddCfg) != ROK)
4264          {
4265             return RFAILED;
4266          }
4267       }
4268
4269       cur = cur -> next;
4270    }
4271    return ROK;
4272 }
4273
4274 /*******************************************************************
4275  *
4276  * @brief Fill SI Scheduling Information 
4277  *
4278  * @details
4279  *
4280  *    Function : parseSiSchedInfo
4281  *
4282  *    Functionality: Fill SI Scheduling Information
4283  *
4284  * @params[in] XML document pointer
4285  *             XML namespace
4286  *             Current node in XML
4287  *             Pointer to structure to be filled
4288  * @return ROK     - success
4289  *         RFAILED - failure
4290  *
4291  * ****************************************************************/
4292 uint8_t parseSiSchedInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SiSchedInfo *siSchedInfo)
4293 {
4294    memset(siSchedInfo, 0, sizeof(SiSchedInfo));
4295    cur = cur -> xmlChildrenNode;
4296    while(cur != NULL)
4297    {
4298       if ((!xmlStrcmp(cur->name, (const xmlChar *)"WIN_LEN")) && (cur->ns == ns))
4299       {
4300          siSchedInfo->winLen = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4301       }
4302
4303       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BROADCAST_STATUS")) && (cur->ns == ns))
4304       {
4305          siSchedInfo->broadcastSta = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4306       }
4307
4308       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PERIODICITY")) && (cur->ns == ns))
4309       {
4310          siSchedInfo->preiodicity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4311       }
4312
4313       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB_TYPE")) && (cur->ns == ns))
4314       {
4315          siSchedInfo->sibType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4316       }
4317
4318       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB1_VALUE_TAG")) && (cur->ns == ns))
4319       {
4320          siSchedInfo->sibValTag = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4321       }
4322
4323       cur = cur -> next;
4324    }
4325    return ROK;
4326 }
4327
4328 /*******************************************************************
4329  *
4330  * @brief Fill SIB1 Parameters
4331  *
4332  * @details
4333  *
4334  *    Function : parseSib1Params
4335  *
4336  *    Functionality: Fill SIB1 Parameters
4337  *
4338  * @params[in] XML document pointer
4339  *             XML namespace
4340  *             Current node in XML
4341  *             Pointer to structure to be filled
4342  * @return ROK     - success
4343  *         RFAILED - failure
4344  *
4345  * ****************************************************************/
4346 uint8_t parseSib1Params(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,Sib1Params *sib1Params)
4347 {
4348    memset(sib1Params, 0, sizeof(Sib1Params));
4349    cur = cur -> xmlChildrenNode;
4350    while(cur != NULL)
4351    {
4352 #ifdef O1_ENABLE
4353    sib1Params-> tac = cellParams.nRTAC;
4354    sib1Params->cellIdentity = CELL_IDENTITY *  cellParams.cellLocalId;
4355    DU_LOG("\nDEBUG --> DU_APP: readCfg(): OAM CellLocalId=%d", sib1Params->cellIdentity);
4356 #else
4357       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns))
4358       {
4359          sib1Params-> tac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4360       }
4361
4362       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_IDENTITY")) && (cur->ns == ns))
4363       {
4364          sib1Params->cellIdentity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4365       }
4366 #endif
4367
4368       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns))
4369       {
4370          if(parsePlmn(doc, ns, cur, &sib1Params->plmn) != ROK)
4371          {
4372             return RFAILED;
4373          }
4374       }
4375
4376       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RANAC")) && (cur->ns == ns))
4377       {
4378          sib1Params->ranac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4379       }
4380
4381       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_RESVD_OPUSE")) && (cur->ns == ns))
4382       {
4383          sib1Params->cellResvdForOpUse = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4384       }
4385
4386       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONN_EST_FAIL_CNT")) && (cur->ns == ns))
4387       {
4388          sib1Params->connEstFailCnt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4389       }
4390
4391       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONN_EST_FAIL_OFF_VALID")) && (cur->ns == ns))
4392       {
4393          sib1Params->connEstFailOffValidity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4394       }
4395
4396       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONN_EST_FAIL_OFFSET")) && (cur->ns == ns))
4397       {
4398          sib1Params->connEstFailOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4399       }
4400
4401       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SI_SHED_INFO")) && (cur->ns == ns))
4402       {
4403          if(parseSiSchedInfo(doc, ns, cur, &sib1Params->siSchedInfo) != ROK)
4404          {
4405             return RFAILED;
4406          }
4407       }
4408
4409       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SRV_CELL_CFG_COM_SIB")) && (cur->ns == ns))
4410       {
4411          if(parseSrvCellCfgCmnSib(doc, ns, cur, &sib1Params->srvCellCfgCommSib) != ROK)
4412          {
4413             return RFAILED;
4414          }
4415       }
4416
4417       cur = cur -> next;
4418    }
4419    return ROK;
4420 }
4421
4422 #ifndef O1_ENABLE
4423 /*******************************************************************
4424  *
4425  * @brief Fill RRM Policy List
4426  *
4427  * @details
4428  *
4429  *    Function : parseRrmPolicyList
4430  *
4431  *    Functionality: Fill RRM Policy List
4432  *
4433  * @params[in] XML document pointer
4434  *             XML namespace
4435  *             Current node in XML
4436  *             Pointer to structure to be filled
4437  * @return ROK     - success
4438  *         RFAILED - failure
4439  *
4440  * ****************************************************************/
4441 uint8_t parseRrmPolicyList(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,RrmPolicyMemberList *rrmPolicyMemberList)
4442 {
4443    memset(rrmPolicyMemberList, 0, sizeof(RrmPolicyMemberList));
4444    cur = cur->xmlChildrenNode;
4445    while(cur != NULL)
4446    {
4447       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns))
4448       {
4449          if(parsePlmn(doc, ns, cur, &rrmPolicyMemberList->plmn) != ROK)
4450          {
4451             return RFAILED;
4452          }
4453       }
4454
4455       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SNSSAI")) && (cur->ns == ns))
4456       {
4457          if(parseSnssai(doc, ns, cur, &rrmPolicyMemberList->snssai) != ROK)
4458          {
4459             return RFAILED;
4460          }
4461       }
4462
4463       cur = cur -> next;
4464    }
4465    return ROK;
4466 }
4467
4468 /*******************************************************************
4469  *
4470  * @brief Fill RRM Policy Ratio
4471  *
4472  * @details
4473  *
4474  *    Function : parseRrmPolicyRatio
4475  *
4476  *    Functionality: Fill RRM Policy Ratio
4477  *
4478  * @params[in] XML document pointer
4479  *             XML namespace
4480  *             Current node in XML
4481  *             Pointer to structure to be filled
4482  * @return ROK     - success
4483  *         RFAILED - failure
4484  *
4485  * ****************************************************************/
4486 uint8_t parseRrmPolicyRatio(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RrmPolicyRatio *rrmPolicyRatio)
4487 {
4488    memset(rrmPolicyRatio, 0, sizeof(RrmPolicyRatio));
4489    cur = cur -> xmlChildrenNode;
4490    while(cur != NULL)
4491    {
4492       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_RATIO")) && (cur->ns == ns))
4493       {
4494          rrmPolicyRatio->maxRatio = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4495       }
4496
4497       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MIN_RATIO")) && (cur->ns == ns))
4498       {
4499          rrmPolicyRatio->minRatio = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4500       }
4501
4502       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DEDICATED_RATIO")) && (cur->ns == ns))
4503       {
4504          rrmPolicyRatio->dedicatedRatio = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4505       }
4506
4507       cur = cur -> next;
4508    }
4509    return ROK;
4510 }
4511
4512 /*******************************************************************
4513  *
4514  * @brief Fill MAC Slice RRM Policy
4515  *
4516  * @details
4517  *
4518  *    Function : parseMacSliceRrmPolicy
4519  *
4520  *    Functionality: Fill MAC Slice RRM Policy
4521  *
4522  * @params[in] XML document pointer
4523  *             XML namespace
4524  *             Current node in XML
4525  *             Pointer to structure to be filled
4526  * @return ROK     - success
4527  *         RFAILED - failure
4528  *
4529  * ****************************************************************/
4530 uint8_t parseMacSliceRrmPolicy(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, MacSliceRrmPolicy *rrmPolicy)
4531 {
4532    uint8_t memIdx = 0;
4533
4534    memset(rrmPolicy, 0, sizeof(MacSliceRrmPolicy));
4535    cur = cur -> xmlChildrenNode;
4536    while(cur != NULL)
4537    {
4538       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RESOURCE_TYPE")) && (cur->ns == ns))
4539       {
4540          rrmPolicy->resourceType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4541       }
4542
4543       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RRM_POLICY_MEMBER")) && (cur->ns == ns))
4544       {
4545          rrmPolicy->numOfRrmPolicyMem = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4546       }
4547
4548       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RRM_POLICY_MEMBER_LIST")) && (cur->ns == ns))
4549       {
4550          DU_ALLOC_SHRABL_BUF(rrmPolicy->rRMPolicyMemberList,\
4551                rrmPolicy->numOfRrmPolicyMem * sizeof(RrmPolicyMemberList*));
4552
4553          if(!rrmPolicy->rRMPolicyMemberList)
4554          {
4555             DU_LOG("\nERROR  --> DU APP : %s: Memory allocation failed at line %d", __func__, __LINE__);
4556             return RFAILED;
4557          }
4558
4559          for(memIdx = 0; memIdx < rrmPolicy->numOfRrmPolicyMem; memIdx++)
4560          {
4561             DU_ALLOC_SHRABL_BUF(rrmPolicy->rRMPolicyMemberList[memIdx], sizeof(RrmPolicyMemberList));
4562             if (rrmPolicy->rRMPolicyMemberList[memIdx] == NULLP)
4563             {
4564                DU_LOG("\nERROR  --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
4565                return RFAILED;
4566             }
4567
4568             if(parseRrmPolicyList(doc, ns, cur, rrmPolicy->rRMPolicyMemberList[memIdx]) != ROK)
4569             {
4570                return RFAILED;
4571             }
4572          }
4573       }
4574
4575       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RRM_POLICY_RATIO")) && (cur->ns == ns))
4576       {
4577          if(parseRrmPolicyRatio(doc, ns, cur, &rrmPolicy->policyRatio) != ROK)
4578          {
4579             return RFAILED;
4580          }
4581       }
4582
4583       cur = cur -> next;
4584    }
4585    return ROK;
4586 }
4587
4588 /*******************************************************************
4589  *
4590  * @brief Fill MAC Slice Configuration
4591  *
4592  * @details
4593  *
4594  *    Function : parseMacSliceCfgReq
4595  *
4596  *    Functionality: Fill MAC Slice Configuration
4597  *
4598  * @params[in] XML document pointer
4599  *             XML namespace
4600  *             Current node in XML
4601  *             Pointer to structure to be filled
4602  * @return ROK     - success
4603  *         RFAILED - failure
4604  *
4605  * ****************************************************************/
4606 uint8_t parseMacSliceCfgReq(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,MacSliceCfgReq *macSliceCfgReq)
4607 {
4608    uint8_t policyIdx = 0;
4609    memset(macSliceCfgReq, 0, sizeof(MacSliceCfgReq));
4610    cur = cur -> xmlChildrenNode;
4611    while(cur != NULL)
4612    {
4613       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RRM_POLICY")) && (cur->ns == ns))
4614       {
4615          macSliceCfgReq->numOfRrmPolicy = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4616       }
4617
4618       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_SLICE_RRM_POLICY")) && (cur->ns == ns))
4619       {
4620          DU_ALLOC_SHRABL_BUF(macSliceCfgReq->listOfRrmPolicy,  macSliceCfgReq->numOfRrmPolicy * sizeof(MacSliceRrmPolicy*));
4621          if(!macSliceCfgReq->listOfRrmPolicy)
4622          {
4623             DU_LOG("\nERROR  --> DU APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
4624             return RFAILED;
4625          }
4626
4627          for(policyIdx = 0; policyIdx < macSliceCfgReq->numOfRrmPolicy; policyIdx++)
4628          {
4629             DU_ALLOC_SHRABL_BUF(macSliceCfgReq->listOfRrmPolicy[policyIdx], sizeof(MacSliceRrmPolicy));
4630             if (macSliceCfgReq->listOfRrmPolicy[policyIdx] == NULLP)
4631             {
4632                DU_LOG("\nERROR  --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
4633             }
4634             
4635             if(parseMacSliceRrmPolicy(doc, ns, cur, macSliceCfgReq->listOfRrmPolicy[policyIdx]) != ROK)
4636             {
4637                return RFAILED;
4638             }
4639          }
4640       }
4641       cur = cur -> next;
4642    }
4643    return ROK;
4644 }
4645 #endif
4646
4647 #ifdef THREAD_AFFINITY
4648 /*******************************************************************
4649  *
4650  * @brief Set thread affinity to the core configured via XML file
4651  *
4652  * @details
4653  *
4654  *    Function : parseThreadAffinity
4655  *
4656  *    Functionality: Set thread affinity to the core configured 
4657  *       via XML file
4658  *
4659  * @params[in] XML document pointer
4660  *             XML namespace
4661  *             Current node in XML
4662  *             Thread information
4663  * @return ROK     - success
4664  *         RFAILED - failure
4665  *
4666  * ****************************************************************/
4667 uint8_t parseThreadAffinity(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, ThreadInfo *threads)
4668 {
4669    cur = cur -> xmlChildrenNode;
4670    while(cur != NULL)
4671    {
4672       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_APP_CORE")) && (cur->ns == ns))
4673       {
4674          threads->duAppCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4675          ODU_SET_THREAD_AFFINITY(&threads->duAppSTskId, SS_AFFINITY_MODE_EXCL, threads->duAppCoreId, 0);
4676       }
4677
4678       if ((!xmlStrcmp(cur->name, (const xmlChar *)"EGTP_CORE")) && (cur->ns == ns))
4679       {
4680          threads->egtpCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4681          ODU_SET_THREAD_AFFINITY(&threads->egtpSTskId, SS_AFFINITY_MODE_EXCL, threads->egtpCoreId, 0);
4682       }
4683
4684       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RLC_MAC_CORE")) && (cur->ns == ns))
4685       {
4686          threads->rlcMacCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4687          ODU_SET_THREAD_AFFINITY(&threads->rlcMacSTskId, SS_AFFINITY_MODE_EXCL, threads->rlcMacCoreId, 0);
4688       }
4689
4690       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RLC_UL_CORE")) && (cur->ns == ns))
4691       {
4692          threads->rlcUlCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4693          ODU_SET_THREAD_AFFINITY(&threads->rlcUlSTskId, SS_AFFINITY_MODE_EXCL, threads->rlcUlCoreId, 0);
4694       }
4695
4696       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCH_CORE")) && (cur->ns == ns))
4697       {
4698          threads->schCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4699          ODU_SET_THREAD_AFFINITY(&threads->schSTskId, SS_AFFINITY_MODE_EXCL, threads->schCoreId, 0);
4700       }
4701
4702       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCTP_CORE")) && (cur->ns == ns))
4703       {
4704          threads->sctpCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4705          ODU_SET_THREAD_AFFINITY(&threads->sctpSTskId, SS_AFFINITY_MODE_EXCL, threads->sctpCoreId, 0);
4706       }
4707
4708       if ((!xmlStrcmp(cur->name, (const xmlChar *)"LOWER_MAC_CORE")) && (cur->ns == ns))
4709       {
4710          threads->lwrMacCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4711          ODU_SET_THREAD_AFFINITY(&threads->lwrMacSTskId, SS_AFFINITY_MODE_EXCL, threads->lwrMacCoreId, 0);
4712       }
4713
4714       cur = cur -> next;
4715    }
4716    return ROK;
4717 }
4718 #endif
4719
4720 /*******************************************************************
4721  *
4722  * @brief Fill tmrTqCp
4723  *
4724  * @details
4725  *
4726  *    Function : parseTmrTqCp
4727  *
4728  *    Functionality: Fill tmrTqCp
4729  *
4730  * @params[in] XML document pointer
4731  *             XML namespace
4732  *             Current node in XML
4733  *             Pointer to structure to be filled
4734  * @return ROK     - success
4735  *         RFAILED - failure
4736  *
4737  * ****************************************************************/
4738 uint8_t parseTmrTqCp(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, CmTqCp *tmrTqCp)
4739 {
4740    memset(tmrTqCp, 0, sizeof(CmTqCp));
4741    cur = cur ->xmlChildrenNode;
4742    while(cur != NULL)
4743    {
4744       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIMER_LEN")) && (cur->ns == ns))
4745       {
4746          tmrTqCp->tmrLen = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4747       }
4748       cur = cur -> next;
4749    }
4750    return ROK;
4751 }
4752
4753 /*******************************************************************
4754  *
4755  * @brief Fill DU timer Parameters
4756  *
4757  * @details
4758  *
4759  *    Function : parseDuTimerParams
4760  *
4761  *    Functionality: Fill DU timer Parmeters
4762  *
4763  * @params[in] XML document pointer
4764  *             XML namespace
4765  *             Current node in XML
4766  *             Pointer to structure to be filled
4767  * @return ROK     - success
4768  *         RFAILED - failure
4769  *
4770  * ****************************************************************/
4771 uint8_t parseDuTimerParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, DuTimers  *duTimers)
4772 {
4773    memset(duTimers, 0, sizeof(DuTimers));
4774    
4775    cur = cur->xmlChildrenNode;
4776    while (cur != NULL)
4777    {
4778       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIMER_TQ_CP")) && (cur->ns == ns))
4779       {
4780          if(parseTmrTqCp(doc, ns, cur, &duTimers->tmrTqCp) != ROK)
4781          {
4782             return RFAILED;
4783          }
4784          else
4785          {
4786             /* Initialzie the timer queue */   
4787             memset(&(duTimers->tmrTq), 0, sizeof(CmTqType) * duTimers->tmrTqCp.tmrLen);
4788          }
4789       }
4790
4791       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIMER_RESOLUTION")) && (cur->ns == ns))
4792       {
4793          duTimers->tmrRes = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4794       }
4795       cur = cur -> next;
4796    }
4797    return ROK;
4798 }
4799
4800 /*******************************************************************
4801  *
4802  * @brief Fill TNL assoc 
4803  *
4804  * @details
4805  *
4806  *    Function : parseTnlAssoc
4807  *
4808  *    Functionality: Fill TNL assoc
4809  *
4810  * @params[in] XML document pointer
4811  *             XML namespace
4812  *             Current node in XML
4813  *             Pointer to structure to be filled
4814  * @return ROK     - success
4815  *         RFAILED - failure
4816  *
4817  * ****************************************************************/
4818 uint8_t parseTnlAssoc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TNLAssociation *tnlAssoc)
4819 {
4820    char *duIpV4Addr;
4821    char *ricIpV4Addr;
4822    CmInetIpAddr duIp;
4823    CmInetIpAddr ricIp;
4824
4825    memset(tnlAssoc, 0, sizeof(TNLAssociation));
4826    cur = cur ->xmlChildrenNode;
4827    while(cur != NULL)
4828    {
4829       if ((!xmlStrcmp(cur->name, (const xmlChar *)"LOCAL_IP")) && (cur->ns == ns))
4830       {
4831          duIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
4832          cmInetAddr(duIpV4Addr, &(duIp));
4833          tnlAssoc->localIpAddress.ipV4Pres = true;
4834          tnlAssoc->localIpAddress.ipV4Addr = duIp;
4835       }
4836
4837       if ((!xmlStrcmp(cur->name, (const xmlChar *)"LOCAL_PORT")) && (cur->ns == ns))
4838       {
4839          tnlAssoc->localPort = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4840       }
4841
4842       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DESTINATION_IP")) && (cur->ns == ns))
4843       {
4844          ricIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
4845          cmInetAddr(ricIpV4Addr, &(ricIp));
4846          tnlAssoc->destIpAddress.ipV4Pres = true;
4847          tnlAssoc->destIpAddress.ipV4Addr = ricIp;
4848       }
4849
4850       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DESTINATION_PORT")) && (cur->ns == ns))
4851       {
4852          tnlAssoc->destPort = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4853       }
4854
4855       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ASSOC_USAGE")) && (cur->ns == ns))
4856       {
4857          tnlAssoc->usage = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4858       }
4859       cur = cur -> next;
4860    }
4861    return ROK;
4862 }
4863
4864 /*******************************************************************
4865  *
4866  * @brief Fill E2 config Parameters
4867  *
4868  * @details
4869  *
4870  *    Function : parseE2ConfigParams
4871  *
4872  *    Functionality: Fill E2 config Parmeters
4873  *
4874  * @params[in] XML document pointer
4875  *             XML namespace
4876  *             Current node in XML
4877  *             Pointer to structure to be filled
4878  * @return ROK     - success
4879  *         RFAILED - failure
4880  *
4881  * ****************************************************************/
4882 uint8_t parseE2ConfigParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, E2apDb *e2apDb)
4883 {
4884    uint8_t tnlIdx=0;
4885    xmlNodePtr child = NULLP;
4886
4887    memset(e2apDb, 0, sizeof(E2apDb));
4888    cur = cur->xmlChildrenNode;
4889    while (cur != NULL)
4890    {
4891       if ((!xmlStrcmp(cur->name, (const xmlChar *)"E2_NODE_ID")) && (cur->ns == ns))
4892       {
4893          e2apDb->e2NodeId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4894       }
4895
4896       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_TNL_ASSOC")) && (cur->ns == ns))
4897       {
4898          e2apDb->numOfTNLAssoc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4899       }
4900
4901       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TNL_ASSOC_LIST")) && (cur->ns == ns))
4902       {
4903          child = cur->xmlChildrenNode;
4904          while(child != NULL)
4905          {
4906             if ((!xmlStrcmp(child->name, (const xmlChar *)"TNL_ASSOC")) && (child->ns == ns))
4907            {
4908               if(parseTnlAssoc(doc, ns, child,&e2apDb->tnlAssoc[tnlIdx]) != ROK)
4909               {
4910                  return RFAILED;
4911               }
4912               tnlIdx++;
4913
4914            }
4915            child = child -> next;
4916         }
4917      }
4918      cur = cur -> next;
4919    }
4920    return ROK;
4921 }
4922
4923 /*******************************************************************
4924  *
4925  * @brief Fill DU Config Parmeters 
4926  *
4927  * @details
4928  *
4929  *    Function : parseDuCfgParams
4930  *
4931  *    Functionality:
4932  *
4933  * @params[in] XML document pointer
4934  *             XML namespace
4935  *             Current node in XML
4936  * @return ROK     - success
4937  *         RFAILED - failure
4938  *
4939  * ****************************************************************/
4940 uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur)
4941 {
4942    char *tempDuName = "";
4943    char *duIpV4Addr;
4944    char *cuIpV4Addr;
4945    char *ricIpV4Addr;
4946    CmInetIpAddr duIp;
4947    CmInetIpAddr cuIp;
4948    CmInetIpAddr ricIp;
4949
4950    cur = cur->xmlChildrenNode;
4951    while(cur != NULL)
4952    {
4953       if ((!xmlStrcmp(cur->name, (const xmlChar *)"THREAD_AFFINITY")) && (cur->ns == ns))
4954       {
4955 #ifdef THREAD_AFFINITY      
4956          if(parseThreadAffinity(doc, ns, cur, &duCfgParam.threadInfo) != ROK)
4957          {
4958             return RFAILED;
4959          }
4960 #endif         
4961       }
4962
4963       if ((!xmlStrcmp(cur->name, (const xmlChar *)"GNB_ID")) && (cur->ns == ns))
4964       {
4965          duCb.gnbId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4966       }
4967
4968       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_ID")) && (cur->ns == ns))
4969       {
4970          duCfgParam.duId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4971       }
4972
4973       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_NAME")) && (cur->ns == ns))
4974       {
4975          tempDuName =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
4976          DU_ALLOC(duCfgParam.duName, strlen(tempDuName));
4977          if(!duCfgParam.duName)
4978          {
4979             DU_LOG("\nERROR --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
4980             return RFAILED;
4981          }
4982          strcpy((char*)duCfgParam.duName, tempDuName);
4983       }
4984
4985       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_DRB")) && (cur->ns == ns))
4986       {
4987          duCfgParam.maxNumDrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4988       }
4989
4990       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_UE_SUPPORTED")) && (cur->ns == ns))
4991       {
4992          duCfgParam.maxSupportedUes = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4993       }
4994
4995       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_UE")) && (cur->ns == ns))
4996       {
4997          duCfgParam.maxUe = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4998       }
4999
5000 #ifdef O1_ENABLE
5001       if( getStartupConfig(&g_cfg) != ROK )
5002       {
5003          RETVALUE(RFAILED);
5004       }
5005       cmInetAddr((S8*)g_cfg.DU_IPV4_Addr, &duIp);
5006       cmInetAddr((S8*)g_cfg.CU_IPV4_Addr, &cuIp);
5007       cmInetAddr((S8*)g_cfg.RIC_IPV4_Addr, &ricIp);
5008
5009 #else
5010       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_IP_V4_ADDR")) && (cur->ns == ns))
5011       {
5012          duIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5013          cmInetAddr(duIpV4Addr, &(duIp));
5014       }
5015
5016       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CU_IP_V4_ADDR")) && (cur->ns == ns))
5017       {
5018          cuIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5019          cmInetAddr(cuIpV4Addr, &(cuIp));
5020       }
5021
5022       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RIC_IP_V4_ADDR")) && (cur->ns == ns))
5023       {
5024          ricIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5025          cmInetAddr(ricIpV4Addr, &(ricIp));
5026       }
5027 #endif
5028
5029       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCTP")) && (cur->ns == ns))
5030       {
5031          if(parseSctpParams(doc, ns, cur, &duCfgParam.sctpParams) != ROK)
5032          {
5033             return RFAILED;
5034          }
5035          duCfgParam.sctpParams.duIpAddr.ipV4Pres = true;
5036          duCfgParam.sctpParams.duIpAddr.ipV4Addr = duIp;
5037          duCfgParam.sctpParams.cuIpAddr.ipV4Pres = true;
5038          duCfgParam.sctpParams.cuIpAddr.ipV4Addr = cuIp;
5039          duCfgParam.sctpParams.ricIpAddr.ipV4Pres = true;
5040          duCfgParam.sctpParams.ricIpAddr.ipV4Addr = ricIp;
5041       }
5042
5043       if ((!xmlStrcmp(cur->name, (const xmlChar *)"EGTP")) && (cur->ns == ns))
5044       {
5045          if(parseEgtpParams(doc, ns, cur, &duCfgParam.egtpParams) != ROK)
5046          {
5047             return RFAILED;
5048          }
5049          duCfgParam.egtpParams.localIp.ipV4Addr = duIp;
5050          duCfgParam.egtpParams.localIp.ipV4Pres = true;
5051          duCfgParam.egtpParams.destIp.ipV4Pres = true;
5052          duCfgParam.egtpParams.destIp.ipV4Addr = cuIp;
5053          duCfgParam.egtpParams.maxTunnelId = duCfgParam.maxNumDrb * duCfgParam.maxSupportedUes; 
5054       }
5055
5056       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MIB_PARAMS")) && (cur->ns == ns))
5057       {
5058          if(parseMibParams(doc, ns, cur, &duCfgParam.mibParams) != ROK)
5059          {
5060             return RFAILED;
5061          }
5062       }
5063
5064       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB1_PARAMS")) && (cur->ns == ns))
5065       {
5066          if(parseSib1Params(doc, ns, cur, &duCfgParam.sib1Params) != ROK)
5067          {
5068             return RFAILED;
5069          }
5070       }
5071
5072 #ifdef XML_BASED_CONFIG
5073       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_DU_SRVD_CELL_INFO")) && (cur->ns == ns))
5074       {
5075          if(parseF1DuServedCellInfo(doc, ns, cur, &duCfgParam.srvdCellLst[0]) != ROK)
5076          {
5077             return RFAILED;
5078          }
5079       }
5080 #endif      
5081
5082       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_CELL_CFG")) && (cur->ns == ns))
5083       {
5084          if(parseMacCellCfg(doc, ns, cur, &duCfgParam.macCellCfg) != ROK)
5085          {
5086             return RFAILED;
5087          }
5088       }
5089
5090 #ifndef O1_ENABLE
5091       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SLICE_CFG")) && (cur->ns == ns))
5092       {
5093          if(parseMacSliceCfgReq(doc, ns, cur, &duCfgParam.tempSliceCfg) != ROK)
5094          {
5095             return RFAILED;
5096          }
5097       }
5098 #endif      
5099
5100       if((!xmlStrcmp(cur->name, (const xmlChar *)"DU_TIMER_INFO")) && (cur->ns == ns))
5101       {
5102          if(parseDuTimerParams(doc, ns, cur, &duCb.duTimersInfo) != ROK)
5103          {
5104             return RFAILED;
5105          }
5106       }
5107
5108       if((!xmlStrcmp(cur->name, (const xmlChar *)"E2AP_CFG")) && (cur->ns == ns))
5109       {
5110          if(parseE2ConfigParams(doc, ns, cur, &duCb.e2apDb) != ROK)
5111          {
5112             return RFAILED;
5113          }
5114       }
5115       cur = cur -> next;
5116    }
5117    return ROK;
5118 }
5119
5120 /*******************************************************************
5121  *
5122  * @brief Reads config and posts message to du_app on completion
5123  *
5124  * @details
5125  *
5126  *    Function : duReadCfg
5127  *
5128  *    Functionality:
5129  *      - Reads configuration from xml file and stores in DB
5130  *      - Post to du_app for further processing
5131  *
5132  * @params[in] void
5133  * @return ROK     - success
5134  *         RFAILED - failure
5135  *
5136  * ****************************************************************/
5137 uint8_t duReadCfg()
5138 {
5139    const char *filename = "../build/config/odu_config.xml";
5140    xmlDocPtr doc = NULLP;
5141    xmlNodePtr cur = NULLP;
5142    xmlNsPtr ns = NULLP;
5143
5144    doc = xmlParseFile(filename);
5145    if(doc == NULL)
5146    {
5147       DU_LOG("\nERROR  --> DU_APP: Failed to parse the XML file");
5148       return RFAILED;
5149    }
5150
5151    cur = xmlDocGetRootElement(doc);
5152    ns = xmlSearchNsByHref(doc, cur, (const xmlChar *)"urn:o-ran:odu:configuration");
5153    if(ns == NULL)
5154    {
5155       DU_LOG("\nERROR  --> DU_APP: XML Namespace not found.\n");
5156       xmlFreeDoc(doc);
5157       xmlCleanupParser();
5158       return RFAILED;
5159    }
5160
5161    parseDuCfgParams(doc, ns, cur);
5162
5163    xmlFreeDoc(doc);
5164    xmlCleanupParser();
5165
5166    Pst pst;
5167    Buffer *mBuf;
5168
5169    /* Read configs into duCfgParams */
5170    if(readCfg() != ROK)
5171    {
5172       DU_LOG("\nERROR  -->  DU_APP : Reading configuration failed");
5173       return RFAILED;
5174    }
5175    printDuConfig();
5176
5177    /* Fill pst structure */
5178    memset(&(pst), 0, sizeof(Pst));
5179    pst.srcEnt = (Ent)ENTDUAPP;
5180    pst.srcInst = (Inst)DU_INST;
5181    pst.srcProcId = DU_PROC;
5182    pst.dstEnt = pst.srcEnt;
5183    pst.dstInst = pst.srcInst;
5184    pst.dstProcId = pst.srcProcId;
5185    pst.event = EVTCFG;
5186    pst.selector = ODU_SELECTOR_TC;
5187    pst.pool= DU_POOL;
5188
5189    /* Initialize the timer blocks */
5190    cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.e2SetupTimer), 1);
5191    cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.ricServiceUpdateTimer.timer), 1);
5192    cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.e2NodeConfigUpdate.timer), 1);
5193
5194    /* Timer Registration request to system services */
5195    if (ODU_REG_TMR_MT(pst.srcEnt, pst.srcInst, duCb.duTimersInfo.tmrRes, duActvTmr) != ROK)
5196    {
5197       DU_LOG("\nERROR  -->  DU_APP : Failed to register timer");
5198       return RFAILED;
5199    }   
5200               
5201    if(ODU_GET_MSG_BUF(DFLT_REGION, DU_POOL, &mBuf) != ROK)
5202    {
5203       DU_LOG("\nERROR  -->  DU_APP : Memory allocation failed in duReadCfg");
5204       return RFAILED;
5205    }
5206
5207    if (ODU_POST_TASK(&pst, mBuf) != ROK)
5208    {
5209       DU_LOG("\nERROR  -->  DU_APP : ODU_POST_TASK failed in duReadCfg");
5210       return RFAILED;
5211    }
5212
5213    return ROK;
5214 }
5215
5216 /*******************************************************************
5217  *
5218  * @brief Prints all DU Configuration
5219  *
5220  * @details
5221  *
5222  *    Function : printDuConfig
5223  *
5224  *    Functionality:
5225  *      - Prints all DU configurations
5226  *
5227  * @params[in] void
5228  * @return void
5229  *
5230  * ****************************************************************/
5231 void printDuConfig()
5232 {
5233    uint8_t sliceIdx = 0, pfIdx = 0, rsrcIdx = 0, ssbMaskIdx = 0, fdmIdx = 0;
5234    uint8_t monitoringSymbIdx = 0, poIdx = 0, policyIdx = 0, memIdx = 0;
5235    __attribute__((unused)) SctpParams *sctp;
5236    __attribute__((unused)) F1EgtpParams *egtp;
5237    __attribute__((unused)) MibParams *mib;
5238    __attribute__((unused)) F1RrcVersion *f1RrcVersion;
5239    F1DuCellInfo *f1DuCellInfo;
5240    F1CellInfo *f1CellInfo;
5241    __attribute__((unused)) F1DuSysInfo *duSysInfo;
5242    __attribute__((unused)) F1BrdcstPlmnInfo *brdcstPlmnInfo;
5243    NrModeInfo *nrModeInfo; 
5244    __attribute__((unused)) F1NrFddInfo *f1NrFddInfo;
5245    F1SrvdPlmn *srvdPlmn;
5246    SupportedSliceList *sliceSuppLst;
5247    MacCellCfg *macCellCfg;
5248    __attribute__((unused)) CarrierCfg *carrierCfg;
5249    CellCfg *cellCfg;
5250    PlmnInfoList *plmnInfoList;
5251    Sib1CellCfg *sib1Cfg;
5252    SchPageCfg *pageCfg;
5253    __attribute__((unused)) PdcchConfigSib1 *pdcchConfigSib1;
5254    BwpDlConfig *bwpDlCfg;
5255    __attribute__((unused)) BwpParams *bwp;
5256    PdcchConfigCommon *pdcchCfgCmn;
5257    SearchSpaceCfg *searchSpaceCfg;
5258    __attribute__((unused)) CandidatesInfo *candidateInfo;
5259    PdschConfigCommon *pdschCfgCmn;
5260    __attribute__((unused)) PdschCfgCommTimeDomRsrcAlloc *pdschCmnTimeDomRsrcAlloc;
5261    BwpUlConfig *bwpUlCfg;
5262    __attribute__((unused)) PucchConfigCommon *pucchCfgCmn;
5263    PuschConfigCommon *puschCfgCmn;
5264    __attribute__((unused)) PuschTimeDomRsrcAlloc *puschTimeDomRsrcAlloc;
5265    __attribute__((unused)) SsbCfg *ssbCfg;
5266    __attribute__((unused)) CsiRsCfg *csiRsCfg;
5267    PrachCfg *prachCfg;
5268    __attribute__((unused)) PrachFdmInfo *prachFdmInfo;
5269    __attribute__((unused)) PrecodingConf *precodCfg;
5270    __attribute__((unused)) BeamformingConf *beamFormingCfg;
5271    Sib1Params *sib1Params;
5272    __attribute__((unused)) SiSchedInfo *siSchedInfo;
5273    SrvCellCfgCommSib *srvCellCfgCmnSib;
5274    DlCfgCommon *dlCfgCmn;
5275    PdcchCfgCommon *pdcchCfgCommon;
5276    PdschCfgCommon *pdschCfgCommon;
5277    __attribute__((unused)) PdschTimeDomainRsrcAlloc *pdschTimeDomRsrcAlloc;
5278    __attribute__((unused)) BcchCfg *bcchCfg;
5279    __attribute__((unused)) PcchCfg *pcchCfg;
5280    UlCfgCommon *ulCfgCmn;
5281    RachCfgCommon *rachCfgCmn;
5282    PuschCfgCommon *puschCfgCommon;
5283    __attribute__((unused)) PuschCfgCmnTimeDomAlloc *puschCmnTimeDomRsrsAlloc;
5284    PucchCfgCommon *pucchCfgCommon;
5285    __attribute__((unused)) TddUlDlCfgCommon *tddUlDlCfgCmn;
5286    MacSliceCfgReq *macSliceCfg;
5287    MacSliceRrmPolicy *rrmPolicy;
5288    __attribute__((unused)) RrmPolicyRatio *rrmPolicyRatio;
5289    __attribute__((unused)) RrmPolicyMemberList *rrmPolicyMemberList;
5290
5291 #ifdef NR_TDD
5292    F1NrTddInfo *f1NrTddInfo;
5293    TDDCfg *tddCfg;
5294 #endif
5295
5296    DU_LOG("\n ** DU CONFIGURATION ** \n");
5297    DU_LOG("DU ID %d\n", duCfgParam.duId);
5298    DU_LOG("DU Name %s\n", duCfgParam.duName);
5299
5300    DU_LOG("\n ** Thread Affinity ** \n");
5301    DU_LOG("DU APP CORE ID %d\n", duCfgParam.threadInfo.duAppCoreId);
5302    DU_LOG("EGTP CORE ID %d\n", duCfgParam.threadInfo.egtpCoreId);
5303    DU_LOG("SCTP CORE ID %d\n", duCfgParam.threadInfo.sctpCoreId);
5304    DU_LOG("RLC-UL CORE ID %d\n", duCfgParam.threadInfo.rlcUlCoreId);
5305    DU_LOG("RLC-DL and MAC CORE ID %d\n", duCfgParam.threadInfo.rlcMacCoreId);
5306    DU_LOG("SCH CORE ID %d\n", duCfgParam.threadInfo.schCoreId);
5307    DU_LOG("Lower MAC CORE ID %d\n", duCfgParam.threadInfo.lwrMacCoreId);
5308
5309    DU_LOG("MAX NUM DRB %d\n", duCfgParam.maxNumDrb);
5310    DU_LOG("MAX SUPPORTED UE %d\n", duCfgParam.maxSupportedUes);
5311    DU_LOG("MAX UE %d\n",duCfgParam.maxUe);
5312
5313    sctp = &duCfgParam.sctpParams;
5314    DU_LOG("\n ** SCTP PARAMETER ** \n");
5315    DU_LOG("DU IPv4 Address present %u\n", sctp->duIpAddr.ipV4Pres);
5316    DU_LOG("DU IP Address %u\n", sctp->duIpAddr.ipV4Addr);
5317    DU_LOG("CU IPv4 Address present %u\n", sctp->cuIpAddr.ipV4Pres);
5318    DU_LOG("CU IP Address %u\n", sctp->cuIpAddr.ipV4Addr);
5319    DU_LOG("RIC IPv4 Address present %u\n", sctp->ricIpAddr.ipV4Pres);
5320    DU_LOG("RIC IP Address %u\n", sctp->ricIpAddr.ipV4Addr);
5321    DU_LOG("SCTP Port at DU for F1 Interface %d\n", sctp->duPort[F1_INTERFACE]);
5322    DU_LOG("SCTP Port at CU for F1 Interface %d\n", sctp->cuPort);
5323    DU_LOG("SCTP Port at DU for E2 Interface %d\n", sctp->duPort[E2_INTERFACE]);
5324    DU_LOG("SCTP Port at RIC for E2 Interface %d\n", sctp->ricPort);
5325
5326    egtp = &duCfgParam.egtpParams;
5327    DU_LOG("\n ** EGTP PARAMETER ** \n");
5328    DU_LOG("DU IP Address %d\n", egtp->localIp.ipV4Addr);
5329    DU_LOG("CU IP Address %d\n", egtp->destIp.ipV4Addr);
5330    DU_LOG("EGTP Port at DU %d\n", egtp->localPort);
5331    DU_LOG("EGTP Port at CU %d\n", egtp->destPort);
5332    DU_LOG("Minimum Tunnel ID %d\n", egtp->minTunnelId);
5333    DU_LOG("Maximum Tunnel ID %d\n",egtp->maxTunnelId);
5334
5335    mib = &duCfgParam.mibParams;
5336    DU_LOG("\n ** MIB PARAMETER ** \n");
5337    DU_LOG("System Frame Number %d\n", mib->sysFrmNum);
5338    DU_LOG("Subcarrier Spacing Common %ld\n", mib->subCarrierSpacingCommon);
5339    DU_LOG("SSB Subcarrier Offset %ld\n", mib->ssb_SubcarrierOffset);
5340    DU_LOG("DMRS Type-A Position %ld\n", mib->dmrs_TypeA_Position);
5341    DU_LOG("Control Resource Set Zero %ld\n", mib->controlResourceSetZero);
5342    DU_LOG("Search Space Zero %ld\n", mib->searchSpaceZero);
5343    DU_LOG("Cell Barred %ld\n", mib->cellBarred);
5344    DU_LOG("Intra Frequency Reselection %ld\n", mib->intraFreqReselection);
5345    
5346    duSysInfo = &duCfgParam.srvdCellLst[0].duSysInfo;
5347    DU_LOG("\n ** DU System Information ** \n");
5348    DU_LOG("MIB length %d\n", duSysInfo->mibLen);
5349    DU_LOG("MIB message  %s\n", duSysInfo->mibMsg);
5350    DU_LOG("SIB1 length  %d\n", duSysInfo->sib1Len);
5351    DU_LOG("SIB1 message  %s\n", duSysInfo->sib1Msg);
5352    
5353    f1DuCellInfo = &duCfgParam.srvdCellLst[0].duCellInfo;
5354    DU_LOG("\n ** DU Cell Information ** \n");
5355
5356    f1CellInfo = &f1DuCellInfo->cellInfo;
5357    DU_LOG("NR PCI %d\n", f1CellInfo->nrPci);
5358    DU_LOG("DU TAC %d\n", f1DuCellInfo->tac);   
5359    DU_LOG("EPS TAC %d\n", f1DuCellInfo->epsTac);
5360    DU_LOG("Measurement Time Configuration Duration %d\n", f1DuCellInfo->measTimeCfgDuration);
5361    DU_LOG("Cell Direction %d\n", f1DuCellInfo->cellDir);
5362    DU_LOG("Cell Type %d\n", f1DuCellInfo->cellType);
5363
5364    DU_LOG("\n ** Cell  Info : NR CGI ** \n");
5365    DU_LOG("Cell Id %d\n",f1CellInfo->nrCgi.cellId);
5366    DU_LOG("PLMN : mcc[0] %d\n", f1CellInfo->nrCgi.plmn.mcc[0]);
5367    DU_LOG("PLMN : mcc[1] %d\n", f1CellInfo->nrCgi.plmn.mcc[1]);
5368    DU_LOG("PLMN : mcc[2] %d\n", f1CellInfo->nrCgi.plmn.mcc[2]);
5369    DU_LOG("PLMN : mnc[0] %d\n", f1CellInfo->nrCgi.plmn.mnc[0]);
5370    DU_LOG("PLMN : mnc[1] %d\n", f1CellInfo->nrCgi.plmn.mnc[1]);
5371    DU_LOG("PLMN : mnc[2] %d\n", f1CellInfo->nrCgi.plmn.mnc[2]);
5372
5373    srvdPlmn = &f1CellInfo->srvdPlmn[0];
5374    DU_LOG("\n ** Cell  Info : Served PLMN ** \n");
5375    DU_LOG("PLMN : mcc[0] %d\n", srvdPlmn->plmn.mcc[0]);
5376    DU_LOG("PLMN : mcc[1] %d\n", srvdPlmn->plmn.mcc[1]);
5377    DU_LOG("PLMN : mcc[2] %d\n", srvdPlmn->plmn.mcc[2]);
5378    DU_LOG("PLMN : mnc[0] %d\n", srvdPlmn->plmn.mnc[0]);
5379    DU_LOG("PLMN : mnc[1] %d\n", srvdPlmn->plmn.mnc[1]);
5380    DU_LOG("PLMN : mnc[2] %d\n", srvdPlmn->plmn.mnc[2]);
5381    DU_LOG("EXT_PLMN : mcc[0] %d\n", srvdPlmn->extPlmn.mcc[0]);
5382    DU_LOG("EXT_PLMN : mcc[1] %d\n", srvdPlmn->extPlmn.mcc[1]);
5383    DU_LOG("EXT_PLMN : mcc[2] %d\n", srvdPlmn->extPlmn.mcc[2]);
5384    DU_LOG("EXT_PLMN : mnc[0] %d\n", srvdPlmn->extPlmn.mnc[0]);
5385    DU_LOG("EXT_PLMN : mnc[1] %d\n", srvdPlmn->extPlmn.mnc[1]);
5386    DU_LOG("EXT_PLMN : mnc[2] %d\n", srvdPlmn->extPlmn.mnc[2]);
5387
5388    sliceSuppLst = &srvdPlmn->taiSliceSuppLst;
5389    DU_LOG("\n ** Cell  Info : Served PLMN : Supported Slice List ** \n");
5390    DU_LOG("Number of Slices supported %d\n", sliceSuppLst->numSupportedSlices);
5391    for (sliceIdx = 0; sliceIdx < sliceSuppLst->numSupportedSlices; sliceIdx++)
5392    {
5393       DU_LOG("Slice\n");
5394       DU_LOG("\tSST %d\n", (*sliceSuppLst->snssai[sliceIdx]).sst);
5395       DU_LOG("\tSD %d %d %d\n", (*sliceSuppLst->snssai[sliceIdx]).sd[0], (*sliceSuppLst->snssai[sliceIdx]).sd[1], \
5396          (*sliceSuppLst->snssai[sliceIdx]).sd[2]);
5397    }
5398    
5399    brdcstPlmnInfo = &f1DuCellInfo->brdcstPlmnInfo[0];
5400    DU_LOG("\n ** DU Cell Information : Broadcast PLMN Info ** \n");
5401    DU_LOG("TAC %d\n", brdcstPlmnInfo->tac);
5402    DU_LOG("NR Cell Id %d\n", brdcstPlmnInfo->nrCellId);
5403    DU_LOG("RANAC %d\n", brdcstPlmnInfo->ranac);
5404
5405    DU_LOG("PLMN : mcc[0] %d\n", brdcstPlmnInfo->plmn[0].mcc[0]);
5406    DU_LOG("PLMN : mcc[1] %d\n", brdcstPlmnInfo->plmn[0].mcc[1]);
5407    DU_LOG("PLMN : mcc[2] %d\n", brdcstPlmnInfo->plmn[0].mcc[2]);
5408    DU_LOG("PLMN : mnc[0] %d\n", brdcstPlmnInfo->plmn[0].mnc[0]);
5409    DU_LOG("PLMN : mnc[1] %d\n", brdcstPlmnInfo->plmn[0].mnc[1]);
5410    DU_LOG("PLMN : mnc[2] %d\n", brdcstPlmnInfo->plmn[0].mnc[2]);
5411     
5412    DU_LOG("EXT_PLMN : mcc[0] %d\n", brdcstPlmnInfo->extPlmn[0].mcc[0]);
5413    DU_LOG("EXT_PLMN : mcc[1] %d\n", brdcstPlmnInfo->extPlmn[0].mcc[1]);
5414    DU_LOG("EXT_PLMN : mcc[2] %d\n", brdcstPlmnInfo->extPlmn[0].mcc[2]);
5415    DU_LOG("EXT_PLMN : mnc[0] %d\n", brdcstPlmnInfo->extPlmn[0].mnc[0]);
5416    DU_LOG("EXT_PLMN : mnc[1] %d\n", brdcstPlmnInfo->extPlmn[0].mnc[1]);
5417    DU_LOG("EXT_PLMN : mnc[2] %d\n", brdcstPlmnInfo->extPlmn[0].mnc[2]);
5418
5419    nrModeInfo = &f1DuCellInfo->f1Mode;
5420    f1NrFddInfo = &nrModeInfo->mode.fdd;
5421    DU_LOG("\n ** DU Cell Information : NR Mode Info ** \n");
5422 #ifndef NR_TDD   
5423    DU_LOG("\n ** NR Mode Info : FDD ** \n");
5424    DU_LOG("\n ** NR Mode Info : FDD : UL NR Frequency ** \n");
5425    DU_LOG("NR ARFCN %d\n", f1NrFddInfo->ulNrFreqInfo.nrArfcn);
5426    DU_LOG("SUL : ARFCN %d\n",f1NrFddInfo->ulNrFreqInfo.sulInfo.sulArfcn);
5427    DU_LOG("SUL : Transmission BW Subcarrier Spacing %d\n", f1NrFddInfo->ulNrFreqInfo.sulInfo.sulTxBw.nrScs);
5428    DU_LOG("SUL : Number of RBs in Transmission BW %d\n", f1NrFddInfo->ulNrFreqInfo.sulInfo.sulTxBw.nrb);
5429    DU_LOG("NR Frequency Band %d\n", f1NrFddInfo->ulNrFreqInfo.freqBand[0].nrFreqBand);
5430    DU_LOG("SUL Band %d\n", f1NrFddInfo->ulNrFreqInfo.freqBand[0].sulBand[0]);
5431
5432    DU_LOG("\n ** NR Mode Info : FDD : DL NR Frequency ** \n");
5433    DU_LOG("NR ARFCN %d\n", f1NrFddInfo->dlNrFreqInfo.nrArfcn);
5434    DU_LOG("SUL : ARFCN %d\n",f1NrFddInfo->dlNrFreqInfo.sulInfo.sulArfcn);
5435    DU_LOG("SUL : Transmission BW Subcarrier Sapcing %d\n", f1NrFddInfo->dlNrFreqInfo.sulInfo.sulTxBw.nrScs);
5436    DU_LOG("SUL : Number of RBs in Transmission BW %d\n", f1NrFddInfo->dlNrFreqInfo.sulInfo.sulTxBw.nrb);
5437    DU_LOG("NR Frequency Band %d\n", f1NrFddInfo->dlNrFreqInfo.freqBand[0].nrFreqBand);
5438    DU_LOG("SUL Band %d\n", f1NrFddInfo->dlNrFreqInfo.freqBand[0].sulBand[0]);
5439
5440    DU_LOG("\n ** NR Mode Info : FDD : UL Transmission Bandwidth ** \n");
5441    DU_LOG("Subscarrier spacing %d\n", f1NrFddInfo->ulTxBw.nrScs);
5442    DU_LOG("Number of RBs %d\n", f1NrFddInfo->ulTxBw.nrb);
5443   
5444    DU_LOG("\n ** NR Mode Info : FDD : DL Transmission Bandwidth ** \n");
5445    DU_LOG("Subcarrier Spacing %d\n", f1NrFddInfo->dlTxBw.nrScs);
5446    DU_LOG("Number of RBs %d\n", f1NrFddInfo->dlTxBw.nrb);
5447
5448 #else
5449
5450    f1NrTddInfo = &nrModeInfo ->mode.tdd; 
5451
5452    DU_LOG("\n ** NR Mode Info : TDD : NR Frequency ** \n");
5453    DU_LOG("NR ARFCN %d\n", f1NrTddInfo->nrFreqInfo.nrArfcn);
5454    DU_LOG("SUL : ARFCN %d\n",f1NrTddInfo->nrFreqInfo.sulInfo.sulArfcn);
5455    DU_LOG("SUL : Transmission BW Subscarrier Spacing %d\n", f1NrTddInfo->nrFreqInfo.sulInfo.sulTxBw.nrScs);
5456    DU_LOG("SUL : Number of RBs in Transmission BW %d\n", f1NrTddInfo->nrFreqInfo.sulInfo.sulTxBw.nrb);
5457    DU_LOG("NR Frequency Band %d\n", f1NrTddInfo->nrFreqInfo.freqBand[0].nrFreqBand);
5458    DU_LOG("SUL Band %d\n", f1NrTddInfo->nrFreqInfo.freqBand[0].sulBand[0]);
5459
5460    DU_LOG("\n ** NR Mode Info : TDD : NR Transmission Bandwidth ** \n");
5461    DU_LOG("Subcarrier Spacing %d\n", f1NrTddInfo->nrTxBw.nrScs);
5462    DU_LOG("Number of RBs %d\n", f1NrTddInfo->nrTxBw.nrb);
5463 #endif
5464
5465    macCellCfg = &duCfgParam.macCellCfg;
5466    DU_LOG("\n ** MAC CELL CONFIGURATION ** \n");
5467    DU_LOG("Cell Id %d\n", macCellCfg->cellId);
5468
5469    DU_LOG("\n ** MAC Cell Configuration : Carrier Configuration ** \n");
5470    carrierCfg = &macCellCfg ->carrCfg;
5471    DU_LOG("DL Bandwidth %d\n", carrierCfg->dlBw);
5472    DU_LOG("DL ARFCN %d\n", carrierCfg->arfcnDL);
5473    DU_LOG("UL Bandwidth %d\n", carrierCfg->ulBw);
5474    DU_LOG("UL ARFCN %d\n", carrierCfg->arfcnUL);
5475    DU_LOG("Number of Transmission Antenna %d\n", carrierCfg->numTxAnt);
5476    DU_LOG("Number of Received Antenna %d\n", carrierCfg->numRxAnt);
5477
5478    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration ** \n");
5479    cellCfg = &macCellCfg ->cellCfg;
5480    DU_LOG("Operational State %d\n", cellCfg->opState);
5481    DU_LOG("Administration State %d\n", cellCfg->adminState);
5482    DU_LOG("Cell Current State %d\n", cellCfg->cellState);
5483    DU_LOG("NR PCI %d\n", cellCfg->phyCellId);
5484    DU_LOG("TAC: %d\n", cellCfg->tac);
5485    DU_LOG("SSB Freqeuncy %d\n", cellCfg->ssbFreq);
5486    DU_LOG("Subcarrier Spacing: %d\n", cellCfg->subCarrSpacing);
5487    DU_LOG("Duplex Mode %d\n", cellCfg->dupType);
5488
5489    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : PLMN Info List ** \n");
5490    plmnInfoList = &cellCfg ->plmnInfoList[0];
5491    DU_LOG("PLMN : mcc[0] %d\n", plmnInfoList->plmn.mcc[0]);
5492    DU_LOG("PLMN : mcc[1] %d\n", plmnInfoList->plmn.mcc[1]);
5493    DU_LOG("PLMN : mcc[2] %d\n", plmnInfoList->plmn.mcc[2]);
5494    DU_LOG("PLMN : mnc[0] %d\n", plmnInfoList->plmn.mnc[0]);
5495    DU_LOG("PLMN : mnc[1] %d\n", plmnInfoList->plmn.mnc[1]);
5496    DU_LOG("PLMN : mnc[2] %d\n", plmnInfoList->plmn.mnc[2]);
5497
5498    DU_LOG("Number of Slice supported %d\n", plmnInfoList->suppSliceList.numSupportedSlices);
5499    for(sliceIdx = 0; sliceIdx < plmnInfoList->suppSliceList.numSupportedSlices; sliceIdx++)
5500    {
5501       DU_LOG("Slice\n");
5502       DU_LOG("\nSST %d\n", (*plmnInfoList->suppSliceList.snssai[sliceIdx]).sst);
5503       DU_LOG("\nSD %d %d %d\n", (*plmnInfoList->suppSliceList.snssai[sliceIdx]).sd[0], \
5504          (*plmnInfoList->suppSliceList.snssai[sliceIdx]).sd[1],(*plmnInfoList->suppSliceList.snssai[sliceIdx]).sd[2]);
5505    }
5506    
5507    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : SIB1 ** \n");
5508    sib1Cfg = &cellCfg->sib1Cfg;
5509    DU_LOG("SIB1 PDU Length %d\n", sib1Cfg->sib1PduLen);
5510    DU_LOG("SIB1 PDU %s\n", sib1Cfg->sib1Pdu);
5511
5512    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : SIB1 : Paging Configuration ** \n");
5513    pageCfg = &sib1Cfg->pagingCfg;
5514
5515    DU_LOG("Number of Paging Occassion %d\n", pageCfg->numPO);
5516    if (pageCfg->poPresent == true)
5517       DU_LOG("FirstPDCCH-Monitoring Paging Occassion present : TRUE\n");
5518    else 
5519       DU_LOG("FirstPDCCH-Monitoring Paging Occassion present : FALSE\n");
5520
5521    for(pfIdx = 0; pfIdx < MAX_PO_PER_PF; pfIdx++)
5522    {
5523       DU_LOG("Paging Occassion at Paging Frame [%d] : %d\n", pfIdx, pageCfg->pagingOcc[pfIdx]);
5524    }
5525
5526    pdcchConfigSib1 = &sib1Cfg->pdcchCfgSib1;
5527    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : SIB1 : PDCCH ** \n");
5528    DU_LOG("Coreset Zero Index %d\n", pdcchConfigSib1->coresetZeroIndex);
5529    DU_LOG("Search Space Zero Index %d\n", pdcchConfigSib1->searchSpaceZeroIndex);
5530
5531    bwpDlCfg = &cellCfg->initialDlBwp;
5532    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : DL BWP Configuration ** \n");
5533
5534    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : DL BWP : BWP ** \n");
5535    bwp = &bwpDlCfg->bwp;
5536    DU_LOG("First PRB %d\n", bwp->firstPrb);
5537    DU_LOG("Number of PRBs %d\n", bwp->numPrb);
5538    DU_LOG("Subcarrier Spacing %d\n", bwp->scs);
5539    DU_LOG("Cyclic Perfix %d\n", bwp->cyclicPrefix);
5540
5541    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : DL BWP : PDCCH Config Common ** \n");
5542    pdcchCfgCmn = &bwpDlCfg->pdcchCommon;
5543    DU_LOG("RA Search Space ID %d\n", pdcchCfgCmn->raSearchSpaceId);
5544
5545    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : DL BWP : PDCCH Config Common : Search Space ** \n");
5546    searchSpaceCfg = &pdcchCfgCmn->commonSearchSpace;
5547    DU_LOG("Search Space ID %d\n", searchSpaceCfg->searchSpaceId);
5548    DU_LOG("Coreset ID %d\n", searchSpaceCfg->coresetId);
5549    DU_LOG("Monitoring Slot %d\n", searchSpaceCfg->monitoringSlot);
5550    DU_LOG("Duration %d\n", searchSpaceCfg->duration);
5551    DU_LOG("Monitoring Symbol %x\n", searchSpaceCfg->monitoringSymbol);
5552
5553    candidateInfo = &searchSpaceCfg->candidate;
5554    DU_LOG("Number of Candidates in Aggregation Level_1 %d\n", candidateInfo->aggLevel1);
5555    DU_LOG("Number of Candidates in Aggregation Level_2 %d\n", candidateInfo->aggLevel2);
5556    DU_LOG("Number of Candidates in Aggregation Level_4 %d\n", candidateInfo->aggLevel4);
5557    DU_LOG("Number of Candidates in Aggregation Level_8 %d\n", candidateInfo->aggLevel8);
5558    DU_LOG("Number of Candidates in Aggregation Level_16 %d\n", candidateInfo->aggLevel16);
5559
5560    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : DL BWP : PDSCH Config Common ** \n");
5561    pdschCfgCmn = &bwpDlCfg->pdschCommon;
5562    DU_LOG("Number of Time Domain Resource Allocation %d\n", pdschCfgCmn->numTimeDomAlloc);
5563   
5564    for (rsrcIdx = 0; rsrcIdx <  pdschCfgCmn->numTimeDomAlloc; rsrcIdx++)
5565    {
5566       DU_LOG("Time Domain Resource Allocation Idx %d\n", rsrcIdx);
5567       pdschCmnTimeDomRsrcAlloc = &pdschCfgCmn->timeDomRsrcAllocList[rsrcIdx];
5568       DU_LOG("\tK0 %d\n", pdschCmnTimeDomRsrcAlloc->k0);
5569       DU_LOG("\tPDSCH Mapping Type %d\n", pdschCmnTimeDomRsrcAlloc->mappingType);
5570       DU_LOG("\tPDSCH Start Symbol %d\n", pdschCmnTimeDomRsrcAlloc->startSymbol);
5571       DU_LOG("\tPDSCH Symbol Length %d\n", pdschCmnTimeDomRsrcAlloc->lengthSymbol);
5572    }
5573
5574    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : UL BWP Configuration ** \n");
5575    bwpUlCfg = &cellCfg->initialUlBwp;
5576
5577    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : UL BWP : BWP ** \n");
5578    DU_LOG("First PRB %d\n", bwpUlCfg->bwp.firstPrb);
5579    DU_LOG("Number of PRBs %d\n", bwpUlCfg->bwp.numPrb);
5580    DU_LOG("Subcarrier Spacing %d\n", bwpUlCfg->bwp.scs);
5581    DU_LOG("Cyclic Prefix %d\n", bwpUlCfg->bwp.cyclicPrefix);
5582    
5583    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : UL BWP : PUCCH Config Common ** \n");
5584    pucchCfgCmn = &bwpUlCfg->pucchCommon;
5585    DU_LOG("PUCCH Resource Common %d\n", pucchCfgCmn->pucchResourceCommon);
5586    DU_LOG("Group Hopping %d\n", pucchCfgCmn->pucchGroupHopping);
5587
5588    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : UL BWP : PUSCH Config Common ** \n");
5589    puschCfgCmn = &bwpUlCfg ->puschCommon;
5590    DU_LOG("Number of Time Domain Resource Allocation %d\n", puschCfgCmn->numTimeDomRsrcAlloc);
5591    for (rsrcIdx = 0; rsrcIdx <  puschCfgCmn->numTimeDomRsrcAlloc; rsrcIdx++)
5592    {
5593       DU_LOG("Time Domain Resource Allocation Idx %d\n", rsrcIdx);
5594       puschTimeDomRsrcAlloc = &puschCfgCmn->timeDomRsrcAllocList[rsrcIdx];
5595       DU_LOG("\tK2 %d\n", puschTimeDomRsrcAlloc->k2);
5596       DU_LOG("\tPUSCH Mapping Type %d\n", puschTimeDomRsrcAlloc->mappingType);
5597       DU_LOG("\tPUSCH Start Symbol %d\n", puschTimeDomRsrcAlloc->startSymbol);
5598       DU_LOG("\tPUSCH Symbol Length %d\n", puschTimeDomRsrcAlloc->symbolLength);
5599       DU_LOG("\tPUSCH Start Symbol And Length %d\n", puschTimeDomRsrcAlloc->startSymbolAndLength);
5600    }
5601
5602    DU_LOG("\n ** MAC Cell Configuration : SSB Configuration** \n");
5603    ssbCfg = &macCellCfg ->ssbCfg;
5604    DU_LOG("SSB PDCH Power %d\n", ssbCfg->ssbPbchPwr);
5605    DU_LOG("Subcarrier Spacing Common %d\n", ssbCfg->scsCmn);
5606    DU_LOG("SSB Offset from Point A %d\n", ssbCfg->ssbOffsetPointA);
5607    DU_LOG("SSB Periodicity in msec %d\n", ssbCfg->ssbPeriod);
5608    DU_LOG("SSB Subcarrier Offset %d\n", ssbCfg->ssbScOffset);
5609    for (ssbMaskIdx = 0; ssbMaskIdx < SSB_MASK_SIZE; ssbMaskIdx++)
5610    {
5611       DU_LOG("SSB Mask[%d] :%d\n", ssbMaskIdx, ssbCfg->ssbMask[ssbMaskIdx]);
5612    }
5613    DU_LOG("Beam ID %d\n", ssbCfg->beamId[0]);
5614    DU_LOG("BETA PSS %d\n", ssbCfg->betaPss);
5615    DU_LOG("BCH Payloag Flag %d\n", ssbCfg->bchPayloadFlag);
5616    DU_LOG("MIB PDU %d %d %d \n", ssbCfg->mibPdu[0], ssbCfg->mibPdu[1], ssbCfg->mibPdu[2]);
5617    DU_LOG("DMRS Type-A Position %d\n", ssbCfg->dmrsTypeAPos);
5618
5619    DU_LOG("\n ** MAC Cell Configuration : CSI RS Configuration ** \n");
5620    csiRsCfg = &macCellCfg->csiRsCfg;
5621    DU_LOG("Frequency Domain Allocation %s\n", csiRsCfg->csiFreqDomainAlloc);
5622    DU_LOG("Number of Ports %d\n", csiRsCfg->csiNrofPorts);
5623    DU_LOG("First OFDM Symbol in Time Domain %d\n", csiRsCfg->csirsfirstOFDMSymbolInTimeDomain);
5624    DU_LOG("First OFDM Symbol in Timer Domain 2 %d\n", csiRsCfg->csirsfirstOFDMSymbolInTimeDomain2);
5625    DU_LOG("CDM Type %d\n", csiRsCfg->csirscdmType);
5626    DU_LOG("Density %d\n", csiRsCfg->csirsdensity);
5627    DU_LOG("Density dot 5:%d\n", csiRsCfg->csirsdensitydot5);
5628    DU_LOG("Power Control Offset %d\n", csiRsCfg->powerControlOffset);
5629    DU_LOG("Power Control Offset Search Space %d\n", csiRsCfg->powerControlOffsetSS);
5630    DU_LOG("Periodicity And Offset %d\n", csiRsCfg->periodicityAndOffset);
5631
5632    DU_LOG("\n ** MAC Cell Configuration : PRACH Configuration ** \n");
5633    prachCfg = &macCellCfg->prachCfg;
5634    DU_LOG("PRACH Sequence Length %d\n", prachCfg->prachSeqLen);
5635    DU_LOG("Subcarrier Spacing %d\n", prachCfg->prachSubcSpacing);
5636    DU_LOG("Number of PRACH FDM %d\n", prachCfg->msg1Fdm);
5637    DU_LOG("PRACH Configuration Index %d\n", prachCfg->prachCfgIdx);
5638    DU_LOG("PRACH Restricted Set Configuration %d\n", prachCfg->prachRstSetCfg);
5639    DU_LOG("Number of SSB per RACH occassion %d\n", prachCfg->ssbPerRach);
5640    DU_LOG("Number of RA preambles %d\n", prachCfg->totalNumRaPreamble);
5641    DU_LOG("Number of Contention Based Preamble per SSB %d\n", prachCfg->numCbPreamblePerSsb);
5642    DU_LOG("PRACH Frequeny Start Offset %d\n", prachCfg->msg1FreqStart);
5643    DU_LOG("RA Contention Resolution Timer %d\n", prachCfg->raContResTmr);
5644    DU_LOG("RSRP Threshold %d\n", prachCfg->rsrpThreshSsb);
5645    DU_LOG("RA Response Window %d\n", prachCfg->raRspWindow); 
5646    for(fdmIdx = 0; fdmIdx < prachCfg->msg1Fdm; fdmIdx++)
5647    {
5648       prachFdmInfo = &prachCfg->fdm[fdmIdx];
5649       DU_LOG("FDM[%d]\n", fdmIdx);
5650       DU_LOG("\tRoot Sequence Index %d\n", prachFdmInfo->rootSeqIdx);
5651       DU_LOG("\tNumber of Root Sequence %d\n", prachFdmInfo->numRootSeq);
5652       DU_LOG("\tK1 %d\n", prachFdmInfo->k1);
5653       DU_LOG("\tZero Correlation Zone Configuration %d\n", prachFdmInfo->zeroCorrZoneCfg);   
5654    }
5655
5656 #ifdef NR_TDD
5657    DU_LOG("\n ** MAC Cell Configuration : TDD Configuration ** \n");
5658    tddCfg = &macCellCfg->tddCfg;
5659    DU_LOG("TDD Slot Periodicity %d\n", tddCfg->tddPeriod);
5660    DU_LOG("Number of DL Slots %d\n", tddCfg->nrOfDlSlots);
5661    DU_LOG("Number of DL Symbols %d\n", tddCfg->nrOfDlSymbols);
5662    DU_LOG("Number of UL Slots %d\n", tddCfg->nrOfUlSlots);
5663    DU_LOG("Number of UL Symbols %d\n", tddCfg->nrOfUlSymbols);
5664 #endif
5665
5666    DU_LOG("\n ** MAC Cell Configuration : Precoding Configuration ** \n");
5667    precodCfg = &macCellCfg->precodingConf;
5668    DU_LOG("Number of Layers %d\n", precodCfg->numLayers);
5669    DU_LOG("Number of Antenna Ports %d\n", precodCfg->numAntPorts);
5670
5671    DU_LOG("\n ** MAC Cell Config : BEAM FORMING  CFG ** \n");
5672    beamFormingCfg = &macCellCfg ->beamCfg;
5673    DU_LOG("Number of Beams %d\n", beamFormingCfg->numOfBeams);
5674    DU_LOG("Number of Tx RUs %d\n", beamFormingCfg->numTxRUs);
5675    DU_LOG("Beam Index %d\n", beamFormingCfg->beamIdx);
5676    DU_LOG("Beam Type %d\n", beamFormingCfg->beamType);
5677    DU_LOG("Beam Azimuth %d\n", beamFormingCfg->beamAzimuth);
5678    DU_LOG("Beam Tilt %d\n", beamFormingCfg->beamTilt);
5679    DU_LOG("Beam Horizontal Width %d\n", beamFormingCfg->beamHorizWidth);
5680    DU_LOG("Beam Vertical Width %d\n", beamFormingCfg->beamVertWidth);
5681    DU_LOG("Coverage Shape %d\n", beamFormingCfg->coverageShape);
5682    DU_LOG("Digitak Tilt %d\n",beamFormingCfg ->digitalTilt);
5683    DU_LOG("Digital Azimuth %d\n", beamFormingCfg->digitalAzimuth);
5684
5685    DU_LOG("\n ** SIB1 Configuration ** \n");
5686    sib1Params = &duCfgParam.sib1Params;
5687    DU_LOG("TAC %d\n", sib1Params->tac);
5688    DU_LOG("RANAC %ld\n", sib1Params->ranac);
5689    DU_LOG("Cell ID %d\n", sib1Params->cellIdentity);
5690    DU_LOG("Cell Reserved for Operational Use %ld\n", sib1Params->cellResvdForOpUse);
5691    DU_LOG("Connection Establishment Failure Count %ld\n", sib1Params->connEstFailCnt);
5692    DU_LOG("Connection Establishment Failure Offset Valid %ld\n", sib1Params->connEstFailOffValidity);
5693    DU_LOG("Connection Establishment Failure Offset %ld\n", sib1Params->connEstFailOffset);
5694    DU_LOG("PLMN : mcc[0] %d\n", sib1Params->plmn.mcc[0]);
5695    DU_LOG("PLMN : mcc[1] %d\n", sib1Params->plmn.mcc[1]);
5696    DU_LOG("PLMN : mcc[2] %d\n", sib1Params->plmn.mcc[2]);
5697    DU_LOG("PLMN : mnc[0] %d\n", sib1Params->plmn.mnc[0]);
5698    DU_LOG("PLMN : mnc[1] %d\n", sib1Params->plmn.mnc[1]);
5699    DU_LOG("PLMN : mnc[2] %d\n", sib1Params->plmn.mnc[2]);
5700
5701    DU_LOG("\n ** SIB1 : SI Scheduling Info ** \n");
5702    siSchedInfo = &sib1Params ->siSchedInfo;
5703    DU_LOG("Windown Length %ld\n", siSchedInfo->winLen);
5704    DU_LOG("Broadcast Status %ld\n", siSchedInfo->broadcastSta);
5705    DU_LOG("Periodicity %ld\n", siSchedInfo->preiodicity);
5706    DU_LOG("SIB Type %ld\n", siSchedInfo->sibType);
5707    DU_LOG("SIB Value Tag %ld\n", siSchedInfo->sibValTag);
5708
5709    DU_LOG("\n ** SIB1 : Serving Cell Configuration Common SIB ** \n");
5710    srvCellCfgCmnSib = &sib1Params->srvCellCfgCommSib;
5711    DU_LOG("Subcarrier Spacing %ld\n", srvCellCfgCmnSib->scs);
5712    DU_LOG("SSB Position in Burst %d\n", srvCellCfgCmnSib->ssbPosInBurst);
5713    DU_LOG("SSB Periodicity %ld\n", srvCellCfgCmnSib->ssbPrdServingCell);
5714    DU_LOG("SS PBCH Power %ld\n", srvCellCfgCmnSib->ssPbchBlockPwr);
5715
5716    DU_LOG("\n ** SIB1 : Serving Cell Config Common SIB : DL Config Common ** \n");
5717    dlCfgCmn = &srvCellCfgCmnSib->dlCfg;
5718    DU_LOG("Frequency Band Indicator %ld\n", dlCfgCmn->freqBandInd);
5719    DU_LOG("Offset to Point A %ld\n", dlCfgCmn->offsetToPointA);
5720    DU_LOG("Frequency Location And Bandwidth %ld\n", dlCfgCmn->locAndBw);
5721    DU_LOG("Offset to Point A considering Subcarrier Spacing %ld\n", dlCfgCmn->dlScsCarrier.scsOffset);
5722    DU_LOG("Subcarrier Spacing %ld\n", dlCfgCmn->dlScsCarrier.scs);
5723    DU_LOG("Bandwidth considering Subcarrier Spacing %ld\n", dlCfgCmn->dlScsCarrier.scsBw);
5724
5725    DU_LOG("\n ** SIB1 : Serving Cell Config Common SIB : DL Config Common : PDCCH Config Common ** \n");
5726    pdcchCfgCommon = &dlCfgCmn->pdcchCfg;
5727    if(pdcchCfgCommon->present)
5728    {
5729       DU_LOG("Control Resource Set Zero Index %ld\n", pdcchCfgCommon->ctrlRsrcSetZero);
5730       DU_LOG("Search Space Zero Index %ld\n", pdcchCfgCommon->searchSpcZero);
5731       DU_LOG("Search Space ID %ld\n", pdcchCfgCommon->searchSpcId);
5732       DU_LOG("Control Resource Set ID %ld\n", pdcchCfgCommon->ctrlRsrcSetId);
5733       DU_LOG("Monitoring Slot Periodicity and Offset Present %d\n", pdcchCfgCommon->monitorSlotPrdAndOffPresent);
5734       DU_LOG("Monitoring Slot Periodicity and Offset %ld\n", pdcchCfgCommon->monitorSlotPrdAndOff);
5735       for (monitoringSymbIdx = 0; monitoringSymbIdx < 2; monitoringSymbIdx++)
5736       {
5737          DU_LOG("Monitoring Symbols in Slot [%d] %d\n",monitoringSymbIdx,  pdcchCfgCommon->monitorSymbolsInSlot[monitoringSymbIdx]);
5738       }
5739       DU_LOG("Number of Candidates for Aggregation Level_1 %ld\n", pdcchCfgCommon->numCandAggLvl1);
5740       DU_LOG("Number of Candidates for Aggregation Level_2 %ld\n", pdcchCfgCommon->numCandAggLvl2);
5741       DU_LOG("Number of Candidates for Aggregation Level_4 %ld\n", pdcchCfgCommon->numCandAggLvl4);
5742       DU_LOG("Number of Candidates for Aggregation Level_8 %ld\n", pdcchCfgCommon->numCandAggLvl8);
5743       DU_LOG("Number of Candidates for Aggregation Level_16 %ld\n", pdcchCfgCommon->numCandAggLvl16);
5744       DU_LOG("Seach Space Type %d\n", pdcchCfgCommon->searchSpcType);
5745       DU_LOG("Common Search Space DCI Format %d\n", pdcchCfgCommon->commSrchSpcDciFrmt);
5746       DU_LOG("SIB1 Search Space ID %ld\n", pdcchCfgCommon->searchSpcSib1);
5747       DU_LOG("Paging Search Space ID %ld\n", pdcchCfgCommon->pagingSearchSpc);
5748       DU_LOG("RA Search Space ID %ld\n", pdcchCfgCommon->raSearchSpc);
5749    }
5750    else
5751    {
5752       DU_LOG("PDCCH Config Common not Present");
5753    }
5754
5755    DU_LOG("\n ** SIB1 : Serving Cell Config Common : DL Config Common : PDSCH Config Common ** \n");
5756    pdschCfgCommon = &dlCfgCmn->pdschCfg;
5757    DU_LOG("PDSCH Config Common Present %d\n", pdschCfgCommon->present);
5758    if(pdschCfgCommon->present)
5759    {
5760       DU_LOG("Number of Time Domain Resource Allocation %d\n", pdschCfgCommon->numTimeDomRsrcAlloc);
5761       for (rsrcIdx = 0; rsrcIdx < pdschCfgCommon->numTimeDomRsrcAlloc; rsrcIdx++)
5762       {
5763          pdschTimeDomRsrcAlloc = &pdschCfgCommon->timeDomAlloc[rsrcIdx];
5764          DU_LOG("PDSCH Timer Domain Resource Allocation [%d]", rsrcIdx);
5765          DU_LOG("K0 %ld\n", pdschTimeDomRsrcAlloc->k0);
5766          DU_LOG("MappingType %ld\n", pdschTimeDomRsrcAlloc->mapType);
5767          DU_LOG("SLIV %d\n", pdschTimeDomRsrcAlloc->sliv);
5768       }
5769    }
5770    else
5771    {
5772       DU_LOG("PDSCH Config Common not Present");
5773    }
5774
5775    DU_LOG("\n ** SIB1 : Serving Cell Config Common : DL Config Common : BCCH Config Common ** \n");
5776    bcchCfg = &dlCfgCmn->bcchCfg;
5777    DU_LOG("Modification Period Coefficient %ld\n", bcchCfg->modPrdCoeff);
5778
5779    DU_LOG("\n ** SIB1 : Serving Cell Config Common : DL Config Common : PCCH Config Common ** \n");
5780    pcchCfg = &dlCfgCmn->pcchCfg;
5781    DU_LOG("Default Paging Cycle %d\n", pcchCfg->dfltPagingCycle);
5782    DU_LOG("Number of PF in Paging Cycle %d\n", pcchCfg->nAndPagingFrmOffsetType);
5783    DU_LOG("PF Offset %d\n", pcchCfg->pageFrameOffset);
5784    DU_LOG("NS - Number of P0 in PF %d\n", pcchCfg->ns);
5785    DU_LOG("First PDCCH Monitoring Occassion of each P0 Type %d\n", pcchCfg->firstPDCCHMontioringType);
5786    for (poIdx = 0; poIdx < MAX_PO_PER_PF; poIdx++)
5787    {
5788       DU_LOG("First PDCCH Monitoring Occassion in P0 [%d] %d\n", poIdx, pcchCfg->firstPDCCHMontioringInfo[poIdx]);
5789    }
5790
5791    DU_LOG("\n ** SIB1 : Serving Cell Config Common : UL Config Common ** \n");
5792    ulCfgCmn = &srvCellCfgCmnSib->ulCfg;
5793    DU_LOG("Frequency Band Indicator %ld\n", ulCfgCmn->freqBandInd);
5794    DU_LOG("Maximum Transmission Power %ld\n", ulCfgCmn->pMax);
5795    DU_LOG("Frequency Location and Bandwidth %ld\n", ulCfgCmn->locAndBw);
5796    DU_LOG("Time Alignment Timer %ld\n", ulCfgCmn->timeAlignTimerComm);
5797    DU_LOG("Offset to Point A considering Subcarrier Spacing %ld\n", ulCfgCmn->ulScsCarrier.scsOffset);
5798    DU_LOG("Subcarrier Spacing %ld\n", ulCfgCmn->ulScsCarrier.scs);
5799    DU_LOG("Carrier BW considering Subcarrier Spacing %ld\n", ulCfgCmn->ulScsCarrier.scsBw);
5800
5801    DU_LOG("\n ** SIB1 : Serving Cell Config Common : UL Config Common : RACH Config Common ** \n");
5802    rachCfgCmn = &ulCfgCmn ->rachCfg;
5803    if(rachCfgCmn->present)
5804    {
5805       DU_LOG("PRACH Configuration Index %ld\n", rachCfgCmn->prachCfgIdx);
5806       DU_LOG("Number of PRACH FDM %ld\n", rachCfgCmn->msg1Fdm);
5807       DU_LOG("PRACH Frequeny Start Offset %ld\n", rachCfgCmn->msg1FreqStart);
5808       DU_LOG("Zero Correaltion Zone Configuration %ld\n", rachCfgCmn->zeroCorrZoneCfg);
5809       DU_LOG("Target Power Level of Received Preamble %ld\n", rachCfgCmn->preambleRcvdTgtPwr);
5810       DU_LOG("Maximum number of Preamble Transmission %ld\n", rachCfgCmn->preambleTransMax);
5811       DU_LOG("Power Ramping Step %ld\n", rachCfgCmn->pwrRampingStep);
5812       DU_LOG("RA Response Window %ld\n", rachCfgCmn->raRspWindow);
5813       DU_LOG("Total Number of RA Preambles %ld\n", rachCfgCmn->numRaPreamble);
5814       DU_LOG("Number of SSB per RACH Occassion %ld\n", rachCfgCmn->numSsbPerRachOcc);
5815       DU_LOG("Number of Contention Based Preamble per SSB %ld\n", rachCfgCmn->numCbPreamblePerSsb);
5816       DU_LOG("Contention Resolution Timer %ld\n", rachCfgCmn->contResTimer);
5817       DU_LOG("RSRP Threshold %ld\n", rachCfgCmn->rsrpThreshSsb);
5818       DU_LOG("Root Sequence Index Present %d\n", rachCfgCmn->rootSeqIdxPresent);
5819       DU_LOG("Root Sequence Index %ld\n", rachCfgCmn->rootSeqIdx);
5820       DU_LOG("Subcarrier Spacing %ld\n", rachCfgCmn->msg1Scs);
5821       DU_LOG("Restricted Set Configuration %ld\n", rachCfgCmn->restrictedSetCfg);
5822    }
5823    else
5824    {
5825       DU_LOG("RACH Config Common not present\n");
5826    }
5827
5828    DU_LOG("\n ** SIB1 : Serving Cell Config Common : UL Config Common : PUSCH Config Common ** \n");
5829    puschCfgCommon = &ulCfgCmn ->puschCfg;
5830    if(puschCfgCommon->puschCfgPresent)
5831    {
5832       DU_LOG("MSG3 Delta from RACH Preamble %ld\n", puschCfgCommon->msg3DeltaPreamble);
5833       DU_LOG("P0 Nominal With Grant %ld\n", puschCfgCommon->p0NominalWithGrant);
5834       DU_LOG("Number of Time Domain Resource Allocation %d\n", puschCfgCommon->numTimeDomRsrcAlloc);
5835       for(rsrcIdx = 0; rsrcIdx < puschCfgCommon->numTimeDomRsrcAlloc; rsrcIdx++)
5836       {
5837          puschCmnTimeDomRsrsAlloc = &puschCfgCommon ->timeDomAllocList[rsrcIdx];
5838          DU_LOG("Time Domain Resource Alloc [%d]", rsrcIdx);
5839          DU_LOG("\tK2 %ld\n", puschCmnTimeDomRsrsAlloc->k2);
5840          DU_LOG("\tMapping Type %ld\n", puschCmnTimeDomRsrsAlloc->mapType);
5841          DU_LOG("\tSLIV %d\n", puschCmnTimeDomRsrsAlloc->sliv);
5842       }
5843    }
5844    else
5845    {
5846       DU_LOG("PUSCH Config Common not present\n");
5847    }
5848    
5849    DU_LOG("\n ** SIB1 : Serving Cell Config Common : UL Config Common : PUCCH Config Common **\n");
5850    pucchCfgCommon = &ulCfgCmn->pucchCfg;
5851    if(pucchCfgCommon->present)
5852    {
5853       DU_LOG("Resource Common %ld\n", pucchCfgCommon->rsrcComm);
5854       DU_LOG("Group Hopping %ld\n", pucchCfgCommon->grpHop);
5855       DU_LOG("P0 Nominal %ld\n", pucchCfgCommon->p0Nominal);
5856    }
5857    else
5858    {
5859       DU_LOG("PUCCH Config Common not present\n");
5860    }
5861  
5862    DU_LOG("\n ** SIB1 : Serving Cell Config Common : TDD UL DL Config Common ** \n");
5863    tddUlDlCfgCmn = &srvCellCfgCmnSib->tddCfg;
5864    DU_LOG("Reference Subcarrier Spacing %ld\n", tddUlDlCfgCmn->refScs);
5865    DU_LOG("Transmission Periodicity %ld\n", tddUlDlCfgCmn->txPrd);
5866    DU_LOG("Number of DL Slots %ld\n", tddUlDlCfgCmn->numDlSlots);
5867    DU_LOG("Number of DL Symbols %ld\n", tddUlDlCfgCmn->numDlSymbols);
5868    DU_LOG("Number of UL Slots %ld\n", tddUlDlCfgCmn->numUlSlots);
5869    DU_LOG("Number of UL Symbols %ld\n", tddUlDlCfgCmn->numUlSymbols);
5870
5871    DU_LOG("\n ** MAC SLICE CONFIG REQUEST ** \n");
5872    macSliceCfg = &duCfgParam.tempSliceCfg;
5873    DU_LOG("Number of RRM Policy %d\n",macSliceCfg->numOfRrmPolicy);
5874
5875    for(policyIdx = 0; policyIdx < macSliceCfg->numOfRrmPolicy; policyIdx++)
5876    {
5877       rrmPolicy = macSliceCfg->listOfRrmPolicy[policyIdx];
5878       DU_LOG("RRM Policy [%d]\n", policyIdx);
5879       DU_LOG("\tResource Type %d\n", rrmPolicy->resourceType);
5880
5881       rrmPolicyRatio = &rrmPolicy ->policyRatio;
5882       DU_LOG("\tPolicy Maximum Ratio %d\n", rrmPolicyRatio->maxRatio);
5883       DU_LOG("\tPolicy Minimum Ratio %d\n", rrmPolicyRatio->minRatio);
5884       DU_LOG("\tPolicy Deidcated Ration %d\n", rrmPolicyRatio->dedicatedRatio);
5885       DU_LOG("\tNumber of RRM Policy Member %d\n", rrmPolicy->numOfRrmPolicyMem);   
5886       
5887       for(memIdx = 0; memIdx < rrmPolicy->numOfRrmPolicyMem; memIdx++)
5888       {
5889          rrmPolicyMemberList = rrmPolicy->rRMPolicyMemberList[memIdx];
5890          DU_LOG("\tRRM Policy Member [%d]\n", memIdx);
5891          DU_LOG("\t\tPLMN : mcc[0] %d\n", rrmPolicyMemberList->plmn.mcc[0]);
5892          DU_LOG("\t\tPLMN : mcc[1] %d\n", rrmPolicyMemberList->plmn.mcc[1]);
5893          DU_LOG("\t\tPLMN : mcc[2] %d\n", rrmPolicyMemberList->plmn.mcc[2]);
5894          DU_LOG("\t\tPLMN : mnc[0] %d\n", rrmPolicyMemberList->plmn.mnc[0]);
5895          DU_LOG("\t\tPLMN : mnc[1] %d\n", rrmPolicyMemberList->plmn.mnc[1]);
5896          DU_LOG("\t\tPLMN : mnc[2] %d\n", rrmPolicyMemberList->plmn.mnc[2]);
5897          DU_LOG("\t\tSST %d\n",rrmPolicyMemberList->snssai.sst);
5898          DU_LOG("\t\tSD %d %d %d\n",rrmPolicyMemberList->snssai.sd[0],rrmPolicyMemberList->snssai.sd[1],rrmPolicyMemberList->snssai.sd[2]);
5899       }
5900    }
5901 }
5902
5903 /**********************************************************************
5904   End of file
5905  **********************************************************************/
5906