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