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