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