ed8a5fd17aad4b26018bfdee3e98ca73241ed63a
[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    uint8_t csiFreqDomainAlloc=0;
1690    memset(csiRsCfg, 0, sizeof(CsiRsCfg));
1691    cur = cur -> xmlChildrenNode;
1692    while(cur != NULL)
1693    {
1694       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_FREQ")) && (cur->ns == ns))
1695       {
1696          csiFreqDomainAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1697          DU_ALLOC(csiRsCfg->csiFreqDomainAlloc, sizeof(uint8_t));
1698          if(!csiRsCfg->csiFreqDomainAlloc)
1699          {
1700             DU_LOG("\nERROR  --> DU APP : %s: Memory allocation failed at line %d", __func__, __LINE__);
1701             return RFAILED;
1702          }
1703          memcpy(csiRsCfg->csiFreqDomainAlloc, &csiFreqDomainAlloc,  sizeof(uint8_t));
1704       }
1705
1706       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_PORTS")) && (cur->ns == ns))
1707       {
1708          csiRsCfg->csiNrofPorts = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1709       }
1710
1711       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_OFDM_PORT")) && (cur->ns == ns))
1712       {
1713          csiRsCfg->csirsfirstOFDMSymbolInTimeDomain = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1714       }
1715
1716       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_OFDM_PORT_2")) && (cur->ns == ns))
1717       {
1718          csiRsCfg->csirsfirstOFDMSymbolInTimeDomain2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1719       }
1720
1721       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_DM_TYPE")) && (cur->ns == ns))
1722       {
1723          csiRsCfg->csirscdmType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1724       }
1725
1726       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_DENSITY")) && (cur->ns == ns))
1727       {
1728          csiRsCfg->csirsdensity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1729       }
1730
1731       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_DENSITY_DOT_5")) && (cur->ns == ns))
1732       {
1733          csiRsCfg->csirsdensitydot5 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1734       }
1735
1736       if ((!xmlStrcmp(cur->name, (const xmlChar *)"POWER_CONTROL_OFFSET")) && (cur->ns == ns))
1737       {
1738          csiRsCfg->powerControlOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1739       }
1740
1741       if ((!xmlStrcmp(cur->name, (const xmlChar *)"POWER_CONTROL_OFFSET_SS")) && (cur->ns == ns))
1742       {
1743          csiRsCfg->powerControlOffsetSS = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1744       }
1745
1746       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PERIODICITY_OFFSET")) && (cur->ns == ns))
1747       {
1748          csiRsCfg->periodicityAndOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1749       }
1750
1751       cur = cur -> next;
1752    }
1753    return ROK;
1754 }
1755
1756 /*******************************************************************
1757  *
1758  * @brief Fill SSB Configuration
1759  *
1760  * @details
1761  *
1762  *    Function : parseSsbCfg
1763  *
1764  *    Functionality: Fill SSB Configuration
1765  *
1766  * @params[in] XML document pointer
1767  *             XML namespace
1768  *             Current node in XML
1769  *             Pointer to structure to be filled
1770  * @return ROK     - success
1771  *         RFAILED - failure
1772  *
1773  * ****************************************************************/
1774 uint8_t parseSsbCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SsbCfg *ssbCfg)
1775 {
1776    xmlNodePtr child;
1777    uint8_t ssbMaskIdx = 0;
1778
1779    memset(ssbCfg, 0, sizeof( SsbCfg));
1780    cur = cur -> xmlChildrenNode;
1781    while(cur != NULL)
1782    {
1783 #ifdef O1_ENABLE
1784       ssbCfg->scsCmn = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
1785       ssbCfg->ssbPeriod = convertSSBPeriodicityToEnum(cellParams.ssbPeriodicity);
1786       ssbCfg->ssbScOffset = cellParams.ssbOffset;
1787 #else
1788       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_CMN")) && (cur->ns == ns))
1789       {
1790          ssbCfg->scsCmn = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1791       }
1792
1793       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PERIOD")) && (cur->ns == ns))
1794       {
1795          ssbCfg->ssbPeriod = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1796       }
1797
1798       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_SC_OFFSET")) && (cur->ns == ns))
1799       {
1800          ssbCfg->ssbScOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1801       }
1802 #endif
1803
1804       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_OFFSET_PT_A")) && (cur->ns == ns))
1805       {
1806          ssbCfg->ssbOffsetPointA = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1807       }
1808
1809       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PBSC_PWR")) && (cur->ns == ns))
1810       {
1811          ssbCfg->ssbPbchPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1812       }
1813
1814       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_MASK_LIST")) && (cur->ns == ns))
1815       {
1816          child = cur -> xmlChildrenNode;
1817          while(child != NULL)
1818          {
1819             if ((!xmlStrcmp(child->name, (const xmlChar *)"SSB_MASK")) && (child->ns == ns))
1820             {
1821                ssbCfg->ssbMask[ssbMaskIdx] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
1822                ssbMaskIdx++;
1823             }
1824             child = child -> next;
1825          }
1826       }
1827
1828       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_ID")) && (cur->ns == ns))
1829       {
1830          ssbCfg->beamId[0] = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1831       }
1832
1833       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BETA_PSS")) && (cur->ns == ns))
1834       {
1835          ssbCfg->betaPss = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1836       }
1837
1838       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BCH_PAYLOAD_FLAG")) && (cur->ns == ns))
1839       {
1840          ssbCfg->bchPayloadFlag = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1841       }
1842
1843       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DMRS_TYPE_A_POS")) && (cur->ns == ns))
1844       {
1845          ssbCfg->dmrsTypeAPos = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1846       }
1847
1848       cur = cur -> next;
1849    }
1850
1851    if(BuildMibPdu() != ROK)
1852    {
1853       DU_LOG("\nERROR  -->  Failed to build MIB PDU");
1854       memset(&ssbCfg->mibPdu, 0, 3*sizeof(uint8_t));
1855    }
1856    else
1857    {
1858       memcpy(&ssbCfg->mibPdu, encBuf, encBufSize);
1859    }
1860
1861    return ROK;
1862 }
1863
1864 /*******************************************************************
1865  *
1866  * @brief Fill Carrier Configuration
1867  *
1868  * @details
1869  *
1870  *    Function : parseCarrierCfg
1871  *
1872  *    Functionality: Fill Carrier Configuration
1873  *
1874  * @params[in] XML document pointer
1875  *             XML namespace
1876  *             Current node in XML
1877  *             Pointer to structure to be filled
1878  * @return ROK     - success
1879  *         RFAILED - failure
1880  *
1881  * ****************************************************************/
1882 uint8_t parseCarrierCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CarrierCfg *carrierCfg)
1883 {
1884    memset(carrierCfg, 0, sizeof(CarrierCfg));
1885    cur = cur -> xmlChildrenNode;
1886    while(cur != NULL)
1887    {
1888 #ifdef O1_ENABLE
1889       carrierCfg->dlBw = cellParams.bSChannelBwDL;
1890       carrierCfg->arfcnDL = cellParams.arfcnDL;
1891       carrierCfg->ulBw = cellParams.bSChannelBwUL;
1892       carrierCfg->arfcnUL = cellParams.arfcnUL;
1893 #else
1894       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DL_BW")) && (cur->ns == ns))
1895       {
1896          carrierCfg->dlBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1897       }
1898
1899       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_DL_ARFCN")) && (cur->ns == ns))
1900       {
1901          carrierCfg->arfcnDL = convertArfcnToFreqKhz(atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)));
1902       }
1903
1904       if ((!xmlStrcmp(cur->name, (const xmlChar *)"UL_BW")) && (cur->ns == ns))
1905       {
1906          carrierCfg->ulBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1907       }
1908
1909       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_UL_ARFCN")) && (cur->ns == ns))
1910       {
1911          carrierCfg->arfcnUL = convertArfcnToFreqKhz(atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)));
1912       }
1913 #endif
1914
1915       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TX_ANT")) && (cur->ns == ns))
1916       {
1917          carrierCfg->numTxAnt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1918       }
1919
1920       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RX_ANT")) && (cur->ns == ns))
1921       {
1922          carrierCfg->numRxAnt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
1923       }
1924
1925       cur = cur -> next;
1926    }
1927    return ROK;
1928 }
1929
1930 /*******************************************************************
1931  *
1932  * @brief Fill PLMN Information List
1933  *
1934  * @details
1935  *
1936  *    Function : parsePlmnInfo
1937  *
1938  *    Functionality: Fill PLMN Information List
1939  *
1940  * @params[in] XML document pointer
1941  *             XML namespace
1942  *             Current node in XML
1943  *             Pointer to structure to be filled
1944  * @return ROK     - success
1945  *         RFAILED - failure
1946  *
1947  * ****************************************************************/
1948 uint8_t parsePlmnInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PlmnInfoList *plmnInfoList)
1949 {
1950
1951    memset(plmnInfoList, 0, sizeof(PlmnInfoList));
1952    cur = cur -> xmlChildrenNode;
1953    while(cur != NULL)
1954    {
1955       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns))
1956       {
1957          if(parsePlmn(doc, ns, cur,&plmnInfoList->plmn) != ROK)
1958          {
1959             return RFAILED;
1960          }
1961       }
1962
1963       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_SLICE_SUPP_LST")) && (cur->ns == ns))
1964       {
1965          if(parseSupportedSliceList(doc, ns, cur,&plmnInfoList -> suppSliceList) != ROK)
1966          {
1967             return RFAILED;
1968          }
1969       }
1970
1971       cur = cur -> next;
1972    }
1973    return ROK;
1974 }
1975
1976 /*******************************************************************
1977  *
1978  * @brief Fill PUCCH Configuration Common
1979  *
1980  * @details
1981  *
1982  *    Function : parsePucchConfigCommon
1983  *
1984  *    Functionality: Fill PUCCH Configuration Common
1985  *
1986  * @params[in] XML document pointer
1987  *             XML namespace
1988  *             Current node in XML
1989  *             Pointer to structure to be filled
1990  * @return ROK     - success
1991  *         RFAILED - failure
1992  *
1993  * ****************************************************************/
1994 uint8_t parsePucchConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PucchConfigCommon *pucchCfgCmn)
1995 {
1996    memset(pucchCfgCmn, 0, sizeof(PucchConfigCommon));
1997    cur = cur -> xmlChildrenNode;
1998    while(cur != NULL)
1999    {
2000       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_RSRC_COMMON")) && (cur->ns == ns))
2001       {
2002          pucchCfgCmn->pucchResourceCommon = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2003       }
2004
2005       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_NEITHER_HOPPING")) && (cur->ns == ns))
2006       {
2007          pucchCfgCmn->pucchGroupHopping = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2008       }
2009
2010       cur = cur -> next;
2011    }
2012    return ROK;
2013 }
2014
2015 /*******************************************************************
2016  *
2017  * @brief Fill PUSCH Common Time Allocation
2018  *
2019  * @details
2020  *
2021  *    Function :  parsePuschTimeDomRsrcAlloc
2022  *
2023  *    Functionality: Fill PUSCH Common Time Allocation
2024  *
2025  * @params[in] XML document pointer
2026  *             XML namespace
2027  *             Current node in XML
2028  *             Pointer to structure to be filled
2029  * @return ROK     - success
2030  *         RFAILED - failure
2031  *
2032  * ****************************************************************/
2033 uint8_t parsePuschTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschTimeDomRsrcAlloc *puschTimeDomRsrsAlloc)
2034 {
2035    memset(puschTimeDomRsrsAlloc, 0, sizeof(PuschTimeDomRsrcAlloc));
2036    cur = cur -> xmlChildrenNode;
2037    while(cur != NULL)
2038    {
2039       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_K2_CFG")) && (cur->ns == ns))
2040       {
2041          puschTimeDomRsrsAlloc->k2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2042       }
2043
2044       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_MAPPING_TYPE")) && (cur->ns == ns))
2045       {
2046          puschTimeDomRsrsAlloc->mappingType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2047       }
2048
2049       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_START_SYMBOL")) && (cur->ns == ns))
2050       {
2051          puschTimeDomRsrsAlloc->startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2052       }
2053
2054       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_LENGTH_SYMBOL")) && (cur->ns == ns))
2055       {
2056          puschTimeDomRsrsAlloc->symbolLength= atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2057       }
2058
2059       cur = cur -> next;
2060    }
2061
2062    puschTimeDomRsrsAlloc -> startSymbolAndLength = \
2063       calcSliv(puschTimeDomRsrsAlloc->startSymbol, puschTimeDomRsrsAlloc->symbolLength);
2064    return ROK;
2065 }
2066
2067 /*******************************************************************
2068  *
2069  * @brief Fill PUSCH Configuration Common 
2070  *
2071  * @details
2072  *
2073  *    Function : parsePuschConfigCommon
2074  *
2075  *    Functionality: Fill PUSCH Configuration Common
2076  *
2077  * @params[in] XML document pointer
2078  *             XML namespace
2079  *             Current node in XML
2080  *             Pointer to structure to be filled
2081  * @return ROK     - success
2082  *         RFAILED - failure
2083  *
2084  * ****************************************************************/
2085 uint8_t parsePuschConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschConfigCommon *puschCfgCmn)
2086 {
2087    uint8_t idx = 0;
2088    xmlNodePtr child = NULLP;
2089
2090    memset(puschCfgCmn, 0, sizeof(PuschConfigCommon));
2091    cur = cur -> xmlChildrenNode;
2092    while(cur != NULL)
2093    {
2094       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRC_ALLOC")) && (cur->ns == ns))
2095       {
2096          puschCfgCmn->numTimeDomRsrcAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2097       }
2098
2099       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_COMM_TIME_ALLOC_LIST")) && (cur->ns == ns))
2100       {
2101          child = cur->xmlChildrenNode;
2102          while(child != NULL)
2103          {
2104             if ((!xmlStrcmp(child->name, (const xmlChar *)"PUSCH_COMM_TIME_ALLOC")) && (child->ns == ns))
2105             {
2106                if(parsePuschTimeDomRsrcAlloc(doc, ns, child, &puschCfgCmn->timeDomRsrcAllocList[idx]) != ROK)
2107                {
2108                   return RFAILED;
2109                }
2110                idx++;
2111             }
2112             child = child -> next;
2113          }
2114       }
2115       cur = cur -> next;
2116    }
2117    return ROK;
2118 }
2119
2120 /*******************************************************************
2121  *
2122  * @brief Fill BWP Configuration
2123  *
2124  * @details
2125  *
2126  *    Function : parseBwp
2127  *
2128  *    Functionality: Fill BWP Configuration
2129  *
2130  * @params[in] XML document pointer
2131  *             XML namespace
2132  *             Current node in XML
2133  *             Pointer to structure to be filled
2134  * @return ROK     - success
2135  *         RFAILED - failure
2136  *
2137  * ****************************************************************/
2138 uint8_t parseBwp(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpParams *bwp)
2139 {
2140    memset(bwp, 0, sizeof(BwpParams));
2141    cur = cur -> xmlChildrenNode;
2142    while(cur != NULL)
2143    {
2144       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FIRST_PRB")) && (cur->ns == ns))
2145       {
2146          bwp->firstPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2147       }
2148
2149       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_PRB")) && (cur->ns == ns))
2150       {
2151          bwp->numPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2152       }
2153
2154       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns))
2155       {
2156          bwp->scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2157       }
2158
2159       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NORMAL_CYCLIC_PREFIX")) && (cur->ns == ns))
2160       {
2161          bwp->cyclicPrefix = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2162       }
2163
2164       cur = cur -> next;
2165    }
2166    return ROK;
2167 }
2168
2169 /*******************************************************************
2170  *
2171  * @brief Fill UL BWP Configuration
2172  *
2173  * @details
2174  *
2175  *    Function : parseBwpULConfig 
2176  *
2177  *    Functionality: Fill UL BWP Configuration
2178  *
2179  * @params[in] XML document pointer
2180  *             XML namespace
2181  *             Current node in XML
2182  *             Pointer to structure to be filled
2183  * @return ROK     - success
2184  *         RFAILED - failure
2185  *
2186  * ****************************************************************/
2187 uint8_t parseBwpULConfig(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpUlConfig *bwpUlCfg)
2188 {
2189    memset(bwpUlCfg, 0, sizeof(BwpUlConfig));
2190    cur = cur -> xmlChildrenNode;
2191    while(cur != NULL)
2192    {
2193       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_PARAMS")) && (cur->ns == ns))
2194       {
2195          if(parseBwp(doc, ns, cur, &bwpUlCfg->bwp) != ROK)
2196          {
2197             return RFAILED;
2198          }
2199       }
2200
2201       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_CFG_COMMON")) && (cur->ns == ns))
2202       {
2203          if(parsePucchConfigCommon(doc, ns, cur, &bwpUlCfg->pucchCommon) != ROK)
2204          {
2205             return RFAILED;
2206          }
2207       }
2208
2209       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_CFG_COMMON")) && (cur->ns == ns))
2210       {
2211          if(parsePuschConfigCommon(doc, ns, cur, &bwpUlCfg->puschCommon) != ROK)
2212          {
2213             return RFAILED;
2214          }
2215       }
2216       cur = cur -> next;
2217    }
2218    return ROK;
2219 }
2220
2221 /*******************************************************************
2222  *
2223  * @brief Fill Page Configuration
2224  *
2225  * @details
2226  *
2227  *    Function : parsePageCfg
2228  *
2229  *    Functionality: Fill Page Configuration
2230  *
2231  * @params[in] XML document pointer
2232  *             XML namespace
2233  *             Current node in XML
2234  *             Pointer to structure to be filled
2235  * @return ROK     - success
2236  *         RFAILED - failure
2237  *
2238  * ****************************************************************/
2239 uint8_t parsePageCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SchPageCfg *pageCfg)
2240 {
2241    char *poPresent;
2242
2243    memset(pageCfg, 0, sizeof(SchPageCfg));
2244    cur = cur -> xmlChildrenNode;
2245    while(cur != NULL)
2246    {
2247       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_PO")) && (cur->ns == ns))
2248       {
2249          pageCfg->numPO = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2250       }
2251
2252       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PO_PRESENT")) && (cur->ns == ns))
2253       {
2254          poPresent = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
2255          if(!strcmp(poPresent, "TRUE"))
2256          {
2257             pageCfg->poPresent = true;
2258          }
2259          else
2260          {
2261             pageCfg->poPresent = false;
2262          }
2263       }
2264
2265       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PAGING_OCC")) && (cur->ns == ns))
2266       {
2267          pageCfg->pagingOcc[0] = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2268       }
2269
2270       cur = cur -> next;
2271    }
2272    return ROK;
2273 }
2274
2275 /*******************************************************************
2276  *
2277  * @brief Fill SIB1 PDCCH Configuration
2278  *
2279  * @details
2280  *
2281  *    Function : parsePdcchCfgSib1
2282  *
2283  *    Functionality: Fill SIB1 PDCCH Configuration
2284  *
2285  * @params[in] XML document pointer
2286  *             XML namespace
2287  *             Current node in XML
2288  *             Pointer to structure to be filled
2289  * @return ROK     - success
2290  *         RFAILED - failure
2291  *
2292  * ****************************************************************/
2293 uint8_t parsePdcchCfgSib1(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdcchConfigSib1 *pdcchConfigSib1)
2294 {
2295    memset(pdcchConfigSib1, 0, sizeof(PdcchConfigSib1));
2296    cur = cur -> xmlChildrenNode;
2297    while(cur != NULL)
2298    {
2299       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_ZERO_INDEX")) && (cur->ns == ns))
2300       {
2301          pdcchConfigSib1->coresetZeroIndex = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2302       }
2303
2304       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCH_SPACE_ZERO_INDEX")) && (cur->ns == ns))
2305       {
2306          pdcchConfigSib1->searchSpaceZeroIndex = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2307       }
2308
2309       cur = cur -> next;
2310    }
2311    return ROK;
2312 }
2313
2314 /*******************************************************************
2315  *
2316  * @brief Fill SIB1 Cell Configuration
2317  *
2318  * @details
2319  *
2320  *    Function : parseSib1CellCfg 
2321  *
2322  *    Functionality: Fill SIB1 Cell Configuration
2323  *
2324  * @params[in] XML document pointer
2325  *             XML namespace
2326  *             Current node in XML
2327  *             Pointer to structure to be filled
2328  * @return ROK     - success
2329  *         RFAILED - failure
2330  *
2331  * ****************************************************************/
2332 uint8_t parseSib1CellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, Sib1CellCfg *sib1CellCfg)
2333 {
2334    memset(sib1CellCfg, 0, sizeof( Sib1CellCfg));
2335    cur = cur -> xmlChildrenNode;
2336    while(cur != NULL)
2337    {
2338       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCH_PAGE_CFG")) && (cur->ns == ns))
2339       {
2340          if(parsePageCfg(doc, ns, cur, &sib1CellCfg->pagingCfg) != ROK)
2341          {
2342             return RFAILED;
2343          }
2344       }
2345
2346       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CONFIG_SIB1")) && (cur->ns == ns))
2347       {
2348          if(parsePdcchCfgSib1(doc, ns, cur, &sib1CellCfg->pdcchCfgSib1) != ROK)
2349          {
2350             return RFAILED;
2351          }
2352       }
2353
2354       cur = cur -> next;
2355    }
2356
2357    sib1CellCfg->sib1PduLen = duCfgParam.srvdCellLst[0].duSysInfo.sib1Len;
2358    if(sib1CellCfg->sib1PduLen > 0)
2359    {
2360       DU_ALLOC_SHRABL_BUF(sib1CellCfg->sib1Pdu, sib1CellCfg->sib1PduLen);
2361       if(!sib1CellCfg->sib1Pdu)
2362       {
2363          DU_LOG("\nERROR  --> DU APP : %s: Memory allocation failed at line %d", __func__, __LINE__);
2364          return RFAILED;
2365       }
2366       memcpy(sib1CellCfg->sib1Pdu, duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg, sib1CellCfg->sib1PduLen);
2367    }
2368    return ROK;
2369 }
2370
2371 /*******************************************************************
2372  *
2373  * @brief Fill Aggregation Level Candidates Information
2374  *
2375  * @details
2376  *
2377  *    Function : parseCandidateInfo 
2378  *
2379  *    Functionality: Fill Aggregation Level Candidates Information
2380  *
2381  * @params[in] XML document pointer
2382  *             XML namespace
2383  *             Current node in XML
2384  *             Pointer to structure to be filled
2385  * @return ROK     - success
2386  *         RFAILED - failure
2387  *
2388  * ****************************************************************/
2389 uint8_t parseCandidateInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CandidatesInfo *candInfo)
2390 {
2391    memset(candInfo, 0, sizeof(CandidatesInfo));
2392    cur = cur -> xmlChildrenNode;
2393    while(cur != NULL)
2394    {
2395       if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL1")) && (cur->ns == ns))
2396       {
2397          candInfo->aggLevel1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2398       }
2399
2400       if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL2")) && (cur->ns == ns))
2401       {
2402          candInfo->aggLevel2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2403       }
2404
2405       if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL4")) && (cur->ns == ns))
2406       {
2407          candInfo->aggLevel4 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2408       }
2409
2410       if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL8")) && (cur->ns == ns))
2411       {
2412          candInfo->aggLevel8 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2413       }
2414
2415       if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGG_LEVEL16")) && (cur->ns == ns))
2416       {
2417          candInfo->aggLevel16 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2418       }
2419
2420       cur = cur -> next;
2421    }
2422    return ROK;
2423 }
2424
2425 /*******************************************************************
2426  *
2427  * @brief Fill Search Space Connfiguration
2428  *
2429  * @details
2430  *
2431  *    Function : parseSearchSpaceCfg
2432  *
2433  *    Functionality: Fill Search Space Configuration
2434  *
2435  * @params[in] XML document pointer
2436  *             XML namespace
2437  *             Current node in XML
2438  *             Pointer to structure to be filled
2439  * @return ROK     - success
2440  *         RFAILED - failure
2441  *
2442  * ****************************************************************/
2443 uint8_t parseSearchSpaceCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SearchSpaceCfg *searchSpaceCfg)
2444 {
2445    memset(searchSpaceCfg, 0, sizeof(SearchSpaceCfg));
2446    cur = cur -> xmlChildrenNode;
2447    while(cur != NULL)
2448    {
2449       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCHSPACE_1_INDEX")) && (cur->ns == ns))
2450       {
2451          searchSpaceCfg->searchSpaceId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2452       }
2453
2454       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_0_INDEX")) && (cur->ns == ns))
2455       {
2456          searchSpaceCfg->coresetId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2457       }
2458
2459       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SS_MONITORING_SLOT_SL1")) && (cur->ns == ns))
2460       {
2461          searchSpaceCfg->monitoringSlot = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2462       }
2463
2464       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DURATION")) && (cur->ns == ns))
2465       {
2466          searchSpaceCfg->duration = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2467       }
2468
2469       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SS_MONITORING_SYMBOL")) && (cur->ns == ns))
2470       {
2471          searchSpaceCfg->monitoringSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2472       }
2473
2474       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CANDIDATE_INFO")) && (cur->ns == ns))
2475       {
2476          if(parseCandidateInfo(doc, ns, cur, &searchSpaceCfg->candidate) != ROK)
2477          {
2478             return RFAILED;
2479          }
2480       }
2481
2482       cur = cur -> next;
2483    }
2484    return ROK;
2485 }
2486
2487 /*******************************************************************
2488  *
2489  * @brief Fill PDCCH Configuration Common
2490  *
2491  * @details
2492  *
2493  *    Function : parsePdcchCfgCommon
2494  *
2495  *    Functionality: Fill PDCCH Configuration Common
2496  *
2497  * @params[in] XML document pointer
2498  *             XML namespace
2499  *             Current node in XML
2500  *             Pointer to structure to be filled
2501  * @return ROK     - success
2502  *         RFAILED - failure
2503  *
2504  * ****************************************************************/
2505 uint8_t parsePdcchCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdcchConfigCommon *pdcchCfgCm)
2506 {
2507    memset(pdcchCfgCm, 0, sizeof(PdcchConfigCommon));
2508    cur = cur -> xmlChildrenNode;
2509    while(cur != NULL)
2510    {
2511       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCH_SPACE_CFG")) && (cur->ns == ns))
2512       {
2513          if(parseSearchSpaceCfg(doc, ns, cur, &pdcchCfgCm->commonSearchSpace) != ROK)
2514          {
2515             return RFAILED;
2516          }
2517       }
2518
2519       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RA_SEARCH_SPACE_INDEX")) && (cur->ns == ns))
2520       {
2521          pdcchCfgCm->raSearchSpaceId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2522       }
2523
2524       cur = cur -> next;
2525    }
2526
2527    return ROK;
2528 }
2529
2530 /*******************************************************************
2531  *
2532  * @brief Fill PDSCH Common Time Domain Resource Allocation
2533  *
2534  * @details
2535  *
2536  *    Function : parsePdschCmnTimeDomRsrcAlloc
2537  *
2538  *    Functionality: Fill PDSCH Common Time Domain Resource Allocation
2539  *
2540  * @params[in] XML document pointer
2541  *             XML namespace
2542  *             Current node in XML
2543  *             Pointer to structure to be filled
2544  * @return ROK     - success
2545  *         RFAILED - failure
2546  *
2547  * ****************************************************************/
2548 uint8_t parsePdschCmnTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,\
2549       PdschCfgCommTimeDomRsrcAlloc *pdschTimeDomRsrcAlloc)
2550 {
2551    memset(pdschTimeDomRsrcAlloc, 0, sizeof(PdschCfgCommTimeDomRsrcAlloc));
2552    cur = cur -> xmlChildrenNode;
2553    while(cur != NULL)
2554    {
2555       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_K0_CFG")) && (cur->ns == ns))
2556       {
2557          pdschTimeDomRsrcAlloc->k0 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2558       }
2559       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_MAPPING_TYPE")) && (cur->ns == ns))
2560       {
2561          pdschTimeDomRsrcAlloc->mappingType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2562       }
2563       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_START_SYMBOL")) && (cur->ns == ns))
2564       {
2565          pdschTimeDomRsrcAlloc->startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2566       }
2567       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_LENGTH_SYMBOL")) && (cur->ns == ns))
2568       {
2569          pdschTimeDomRsrcAlloc->lengthSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2570       }
2571
2572       cur = cur -> next;
2573    }
2574    return ROK;
2575 }
2576
2577 /*******************************************************************
2578  *
2579  * @brief Fill PDSCH Configuration Common
2580  *
2581  * @details
2582  *
2583  *    Function : parsePdschConfigCommon
2584  *
2585  *    Functionality: Fill PDSCH Configuration Common
2586  *
2587  * @params[in] XML document pointer
2588  *             XML namespace
2589  *             Current node in XML
2590  *             Pointer to structure to be filled
2591  * @return ROK     - success
2592  *         RFAILED - failure
2593  *
2594  * ****************************************************************/
2595 uint8_t parsePdschConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PdschConfigCommon *pdschCfgCmn)
2596 {
2597    uint8_t idx = 0;
2598    xmlNodePtr child = NULLP;
2599
2600    memset(pdschCfgCmn, 0, sizeof(PdschConfigCommon));
2601    cur = cur -> xmlChildrenNode;
2602    while(cur != NULL)
2603    {
2604       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRC_ALLOC")) && (cur->ns == ns))
2605       {
2606          pdschCfgCmn->numTimeDomAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2607       }
2608
2609       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_COMM_TIME_ALLOC_LIST")) && (cur->ns == ns))
2610       {
2611          child = cur->xmlChildrenNode;
2612          while(child != NULL)  
2613          {
2614             if ((!xmlStrcmp(child->name, (const xmlChar *)"PDSCH_COMM_TIME_ALLOC")) && (child->ns == ns))
2615             {   
2616                if(parsePdschCmnTimeDomRsrcAlloc(doc, ns, child, &pdschCfgCmn->timeDomRsrcAllocList[idx]) != ROK)
2617                {
2618                   return RFAILED;
2619                }
2620                idx++;
2621             }
2622             child = child -> next;
2623          }
2624       }
2625       cur = cur -> next;
2626    }
2627    return ROK;
2628 }
2629
2630 /*******************************************************************
2631  *
2632  * @brief Fill DL BWP Configuration
2633  *
2634  * @details
2635  *
2636  *    Function : parseBwpDLConfig
2637  *
2638  *    Functionality: Fill DL BWP Configuration
2639  *
2640  * @params[in] XML document pointer
2641  *             XML namespace
2642  *             Current node in XML
2643  *             Pointer to structure to be filled
2644  * @return ROK     - success
2645  *         RFAILED - failure
2646  *
2647  * ****************************************************************/
2648 uint8_t parseBwpDLConfig(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,BwpDlConfig *bwpDlCfg)
2649 {
2650    memset(bwpDlCfg, 0, sizeof(BwpDlConfig));
2651    cur = cur -> xmlChildrenNode;
2652    while(cur != NULL)
2653    {
2654       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_PARAMS")) && (cur->ns == ns))
2655       {
2656          if(parseBwp(doc, ns, cur, &bwpDlCfg->bwp) != ROK)
2657          {
2658             return RFAILED;
2659          }
2660       }
2661
2662       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CFG_COMMON")) && (cur->ns == ns))
2663       {
2664          if(parsePdcchCfgCommon(doc, ns, cur, &bwpDlCfg->pdcchCommon) != ROK)
2665          {
2666             return RFAILED;
2667          }
2668       }
2669
2670       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_CFG_COMMON")) && (cur->ns == ns))
2671       {
2672          if(parsePdschConfigCommon(doc, ns, cur, &bwpDlCfg->pdschCommon) != ROK)
2673          {
2674             return RFAILED;
2675          }
2676       }
2677
2678       cur = cur -> next;
2679    }
2680    return ROK;
2681 }
2682
2683 /*******************************************************************
2684  *
2685  * @brief Fill Cell Configuration
2686  *
2687  * @details
2688  *
2689  *    Function : parseCellCfg
2690  *
2691  *    Functionality: Fill Cell Configuration
2692  *
2693  * @params[in] XML document pointer
2694  *             XML namespace
2695  *             Current node in XML
2696  *             Pointer to structure to be filled
2697  * @return ROK     - success
2698  *         RFAILED - failure
2699  *
2700  * ****************************************************************/
2701 uint8_t parseCellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,CellCfg *cellCfg)
2702 {
2703    memset(cellCfg, 0, sizeof(CellCfg));
2704    cur = cur -> xmlChildrenNode;
2705    while(cur != NULL)
2706    {
2707 #ifdef O1_ENABLE   
2708       cellCfg->opState = cellParams.operationalState;
2709       cellCfg->adminState = cellParams.administrativeState;
2710       cellCfg->cellState = cellParams.cellState;
2711       cellCfg->phyCellId = cellParams.nRPCI;
2712       cellCfg->tac = cellParams.nRTAC;
2713       cellCfg->ssbFreq = cellParams.ssbFrequency;
2714 #else
2715       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_OP_STATE")) && (cur->ns == ns))
2716       {
2717          cellCfg->opState = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2718       }
2719
2720       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_ADMIN_STATE")) && (cur->ns == ns))
2721       {
2722          cellCfg->adminState = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2723       }
2724
2725       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_CELL_STATE")) && (cur->ns == ns))
2726       {
2727          cellCfg->cellState = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2728       }
2729
2730       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_PCI")) && (cur->ns == ns))
2731       {
2732          cellCfg->phyCellId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2733       }
2734
2735       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns))
2736       {
2737          cellCfg->tac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2738       }
2739
2740       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_FREQUENCY")) && (cur->ns == ns))
2741       {
2742          cellCfg->ssbFreq = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2743       }
2744 #endif
2745
2746       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN_INFO")) && (cur->ns == ns))
2747       {
2748          if(parsePlmnInfo(doc, ns, cur, &cellCfg->plmnInfoList[0]) != ROK)
2749          {
2750             return RFAILED;
2751          }
2752       }
2753
2754       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns))
2755       {
2756          cellCfg->subCarrSpacing  = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2757       }
2758
2759       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DUPLEX_MODE")) && (cur->ns == ns))
2760       {
2761          cellCfg->dupType  = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2762       }
2763
2764       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB1_CELL_CFG")) && (cur->ns == ns))
2765       {
2766          if(parseSib1CellCfg(doc, ns, cur, &cellCfg->sib1Cfg) != ROK)
2767          {
2768             return RFAILED;
2769          }
2770       }
2771
2772       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_DL_CFG")) && (cur->ns == ns))
2773       {
2774          if(parseBwpDLConfig(doc, ns, cur, &cellCfg->initialDlBwp) != ROK)
2775          {
2776             return RFAILED;
2777          }
2778       }
2779
2780       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BWP_UL_CFG")) && (cur->ns == ns))
2781       {
2782          if(parseBwpULConfig(doc, ns, cur, &cellCfg->initialUlBwp) != ROK)
2783          {
2784             return RFAILED;
2785          }
2786       }
2787       cur = cur -> next;
2788    }
2789    return ROK;
2790 }
2791
2792 #ifdef NR_TDD
2793 /*******************************************************************
2794  *
2795  * @brief Fill TDD slot configuration
2796  *
2797  * @details
2798  *
2799  *    Function : parseTddCfg
2800  *
2801  *    Functionality: Fill TDD slot configuration
2802  *
2803  * @params[in] XML document pointer
2804  *             XML namespace
2805  *             Current node in XML
2806  *             Pointer to structure to be filled
2807  * @return ROK     - success
2808  *         RFAILED - failure
2809  *
2810  * ****************************************************************/
2811 uint8_t parseTddCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TDDCfg *tddCfg)
2812 {
2813    memset(tddCfg, 0, sizeof(TDDCfg));
2814    cur = cur -> xmlChildrenNode;
2815    while(cur != NULL)
2816    {
2817       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TDD_PERIODICITY")) && (cur->ns == ns))
2818       {
2819          tddCfg->tddPeriod = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2820       }
2821
2822       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SLOTS")) && (cur->ns == ns))
2823       {
2824          tddCfg->nrOfDlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2825       }
2826
2827       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SYMBOLS")) && (cur->ns == ns))
2828       {
2829          tddCfg->nrOfDlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2830       }
2831
2832       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SLOTS")) && (cur->ns == ns))
2833       {
2834          tddCfg->nrOfUlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2835       }
2836
2837       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SYMBOLS")) && (cur->ns == ns))
2838       {
2839          tddCfg->nrOfUlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2840       }
2841
2842       cur = cur -> next;
2843    }
2844    return ROK;
2845 }
2846 #endif
2847
2848 /*******************************************************************
2849  *
2850  * @brief Fill MAC Cell Configuration
2851  *
2852  * @details
2853  *
2854  *    Function : parseMacCellCfg
2855  *
2856  *    Functionality: Fill MAC Cell Configuration
2857  *
2858  * @params[in] XML document pointer
2859  *             XML namespace
2860  *             Current node in XML
2861  *             Pointer to structure to be filled
2862  * @return ROK     - success
2863  *         RFAILED - failure
2864  *
2865  * ****************************************************************/
2866 uint8_t parseMacCellCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,MacCellCfg *macCellCfg)
2867 {
2868    memset(macCellCfg, 0, sizeof(MacCellCfg));
2869    cur = cur -> xmlChildrenNode;
2870    while(cur != NULL)
2871    {
2872 #ifdef O1_ENABLE
2873       macCellCfg->cellId = cellParams.cellLocalId;
2874 #else
2875       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_ID")) && (cur->ns == ns))
2876       {
2877          macCellCfg->cellId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2878       }
2879 #endif
2880
2881       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CARRIER_CFG")) && (cur->ns == ns))
2882       {
2883          if(parseCarrierCfg(doc, ns, cur, &macCellCfg->carrCfg) != ROK)
2884          {
2885             return RFAILED;
2886          }
2887       }
2888
2889       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_CFG")) && (cur->ns == ns))
2890       {
2891          if(parseCellCfg(doc, ns, cur, &macCellCfg->cellCfg) != ROK)
2892          {
2893             return RFAILED;
2894          }
2895       }
2896
2897       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_CFG")) && (cur->ns == ns))
2898       {
2899          if(parseSsbCfg(doc, ns, cur, &macCellCfg->ssbCfg) != ROK)
2900          {
2901             return RFAILED;
2902          }
2903       }
2904
2905       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CSIRS_CFG")) && (cur->ns == ns))
2906       {
2907          if(parseCsiRsCfg(doc, ns, cur, &macCellCfg->csiRsCfg) != ROK)
2908          {
2909             return RFAILED;
2910          }
2911       }
2912
2913       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_CFG")) && (cur->ns == ns))
2914       {
2915          if(parsePrachCfg(doc, ns, cur, &macCellCfg->prachCfg) != ROK)
2916          {
2917             return RFAILED;
2918          }
2919       }
2920
2921 #ifdef NR_TDD
2922       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TDD_CFG")) && (cur->ns == ns))
2923       {
2924          if(parseTddCfg(doc, ns, cur, &macCellCfg->tddCfg) != ROK)
2925          {
2926             return RFAILED;
2927          }
2928       }
2929 #endif 
2930
2931       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRE_CODE_CFG")) && (cur->ns == ns))
2932       {
2933          if(parsePrecodingConfig(doc, ns, cur, &macCellCfg->precodingConf) != ROK)
2934          {
2935             return RFAILED;
2936          }
2937       }
2938
2939       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEAM_FORM_CFG")) && (cur->ns == ns))
2940       {
2941          if(parseBeamformingConfig(doc, ns, cur, &macCellCfg->beamCfg) != ROK)
2942          {
2943             return RFAILED;
2944          }
2945       }
2946
2947       cur = cur -> next;
2948    }
2949    return ROK;
2950 }
2951
2952 /*******************************************************************
2953  *
2954  * @brief Fill PUSCH Configuration Common Time Domain 
2955  *    Resource Allocation
2956  *
2957  * @details
2958  *
2959  *    Function : parsePuschCmnTimeDomRsrcAlloc
2960  *
2961  *    Functionality: Fill PUSCH Configuration Common Time Domain
2962  *       Resource Allocation
2963  *
2964  * @params[in] XML document pointer
2965  *             XML namespace
2966  *             Current node in XML
2967  *             Pointer to structure to be filled
2968  * @return ROK     - success
2969  *         RFAILED - failure
2970  *
2971  * ****************************************************************/
2972 uint8_t parsePuschCmnTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschCfgCmnTimeDomAlloc *puschCmnTimeDomAlloc)
2973 {
2974    uint16_t startSymbol;
2975    uint16_t lenSymbol;
2976
2977    memset(puschCmnTimeDomAlloc, 0, sizeof(PuschCfgCmnTimeDomAlloc));
2978    cur = cur -> xmlChildrenNode;
2979    while(cur != NULL)
2980    {
2981       if ((!xmlStrcmp(cur->name, (const xmlChar *)"K2")) && (cur->ns == ns))
2982       {
2983          puschCmnTimeDomAlloc->k2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2984       }
2985       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAP_TYPE")) && (cur->ns == ns))
2986       {
2987          puschCmnTimeDomAlloc->mapType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2988       }
2989       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_START_SYMBOL")) && (cur->ns == ns))
2990       {
2991          startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2992       }
2993       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_LENGTH_SYMBOL")) && (cur->ns == ns))
2994       {
2995          lenSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
2996       }
2997       cur = cur -> next;
2998    }
2999    puschCmnTimeDomAlloc->sliv = calcSliv(startSymbol, lenSymbol);
3000    return ROK;
3001 }
3002
3003 /*******************************************************************
3004  *
3005  * @brief Fill PUSCH Configuration Common
3006  *
3007  * @details
3008  *
3009  *    Function : parsePuschCfgCommon
3010  *
3011  *    Functionality: Fill PUSCH Configuration Common
3012  *
3013  * @params[in] XML document pointer
3014  *             XML namespace
3015  *             Current node in XML
3016  *             Pointer to structure to be filled
3017  * @return ROK     - success
3018  *         RFAILED - failure
3019  *
3020  * ****************************************************************/
3021 uint8_t parsePuschCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PuschCfgCommon *puschCfgCmn)
3022 {
3023    uint8_t rsrcIdx = 0;
3024    xmlNodePtr child = NULLP;
3025
3026    memset(puschCfgCmn, 0, sizeof(PuschCfgCommon));
3027    cur = cur -> xmlChildrenNode;
3028    while(cur != NULL)
3029    {
3030       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_CFG_PRESENT")) && (cur->ns == ns))
3031       {
3032          puschCfgCmn->puschCfgPresent = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3033       }
3034
3035       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_MSG3_DELTA_PREAMBLE")) && (cur->ns == ns))
3036       {
3037          puschCfgCmn->msg3DeltaPreamble = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3038       }
3039
3040       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_P0_NOMINAL_WITH_GRANT")) && (cur->ns == ns))
3041       {
3042          puschCfgCmn->p0NominalWithGrant = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3043       }
3044
3045       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRC_ALLOC")) && (cur->ns == ns))
3046       {
3047          puschCfgCmn->numTimeDomRsrcAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3048       }
3049
3050       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_TIME_DOM_RSRC_ALLOC_LIST")) && (cur->ns == ns))
3051       {
3052          child = cur->xmlChildrenNode;
3053          while (child != NULL)
3054          {
3055             if ((!xmlStrcmp(child->name, (const xmlChar *)"PUSCH_TIME_DOM_RSRC_ALLOC")) && (child->ns == ns))
3056             {
3057                if(parsePuschCmnTimeDomRsrcAlloc(doc, ns, child, &puschCfgCmn->timeDomAllocList[rsrcIdx]) != ROK)
3058                {
3059                   return RFAILED;
3060                }
3061                rsrcIdx++;
3062             }
3063             child = child->next;
3064          }
3065       }
3066       cur = cur -> next;
3067    }
3068    return ROK;
3069 }
3070
3071 /*******************************************************************
3072  *
3073  * @brief Fill PUCCH Configuration Common 
3074  *
3075  * @details
3076  *
3077  *    Function : parsePucchCfgCommon
3078  *
3079  *    Functionality: Fill PUCCH Configuration Common
3080  *
3081  * @params[in] XML document pointer
3082  *             XML namespace
3083  *             Current node in XML
3084  *             Pointer to structure to be filled
3085  * @return ROK     - success
3086  *         RFAILED - failure
3087  *
3088  * ****************************************************************/
3089 uint8_t parsePucchCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PucchCfgCommon *pucchCfgCmn)
3090 {
3091    memset(pucchCfgCmn, 0, sizeof(PucchCfgCommon));
3092    cur = cur -> xmlChildrenNode;
3093    while(cur != NULL)
3094    {
3095       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns))
3096       {
3097          pucchCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3098       }
3099
3100       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_RSRC_COMMON")) && (cur->ns == ns))
3101       {
3102          pucchCfgCmn->rsrcComm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3103       }
3104
3105       if ((!xmlStrcmp(cur->name, (const xmlChar *)"GRP_HOP")) && (cur->ns == ns))
3106       {
3107          pucchCfgCmn->grpHop = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3108       }
3109
3110       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_P0_NOMINAL")) && (cur->ns == ns))
3111       {
3112          pucchCfgCmn->p0Nominal = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3113       }
3114
3115       cur = cur -> next;
3116    }
3117    return ROK;
3118 }
3119
3120 /*******************************************************************
3121  *
3122  * @brief Fill RACH Configuration Common
3123  *
3124  * @details
3125  *
3126  *    Function : parseRachCfgCommon
3127  *
3128  *    Functionality: Fill RACH Configuration Common
3129  *
3130  * @params[in] XML document pointer
3131  *             XML namespace
3132  *             Current node in XML
3133  *             Pointer to structure to be filled
3134  * @return ROK     - success
3135  *         RFAILED - failure
3136  *
3137  * ****************************************************************/
3138 uint8_t parseRachCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RachCfgCommon *rachCfgCmn)
3139 {
3140    long   maxNumRb;
3141    long   prachMaxPrb;
3142
3143    memset(rachCfgCmn, 0, sizeof(RachCfgCommon));
3144    cur = cur -> xmlChildrenNode;
3145    while(cur != NULL)
3146    {
3147       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns))
3148       {
3149          rachCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3150       }
3151
3152       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_CONFIG_IDX")) && (cur->ns == ns))
3153       {
3154          rachCfgCmn->prachCfgIdx = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3155       }
3156
3157       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MSG_1_FDM")) && (cur->ns == ns))
3158       {
3159          rachCfgCmn->msg1Fdm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3160       }
3161
3162       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_RB")) && (cur->ns == ns))
3163       {
3164          maxNumRb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3165       }
3166       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_MAX_PRB")) && (cur->ns == ns))
3167       {
3168          prachMaxPrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3169       }
3170
3171       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ZERO_CORRELATION_ZONE_CFG")) && (cur->ns == ns))
3172       {
3173          rachCfgCmn->zeroCorrZoneCfg = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3174       }
3175
3176       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_PREAMBLE_RCVD_TGT_PWR")) && (cur->ns == ns))
3177       {
3178          rachCfgCmn->preambleRcvdTgtPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3179       }
3180
3181       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PREAMBLE_TRANS_MAX")) && (cur->ns == ns))
3182       {
3183          rachCfgCmn->preambleTransMax = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3184       }
3185
3186       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PWR_RAMPING_STEP")) && (cur->ns == ns))
3187       {
3188          rachCfgCmn->pwrRampingStep = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3189       }
3190
3191       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RA_RSP_WINDOW")) && (cur->ns == ns))
3192       {
3193          rachCfgCmn->raRspWindow = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3194       }
3195
3196       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RA_PREAMBLE")) && (cur->ns == ns))
3197       {
3198          rachCfgCmn->numRaPreamble = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3199       }
3200
3201       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_SSB_PER_RACH_OCC")) && (cur->ns == ns))
3202       {
3203          rachCfgCmn->numSsbPerRachOcc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3204       }
3205
3206       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CB_PREAMBLE_PER_SSB")) && (cur->ns == ns))
3207       {
3208          rachCfgCmn->numCbPreamblePerSsb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3209       }
3210
3211       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONT_RES_TIMER")) && (cur->ns == ns))
3212       {
3213          rachCfgCmn->contResTimer = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3214       }
3215
3216       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RSRP_THRESHOLD_SSB")) && (cur->ns == ns))
3217       {
3218          rachCfgCmn->rsrpThreshSsb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3219       }
3220
3221       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROOT_SEQ_IDX_PRESENT")) && (cur->ns == ns))
3222       {
3223          rachCfgCmn->rootSeqIdxPresent = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3224       }
3225
3226       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ROOT_SEQ_IDX")) && (cur->ns == ns))
3227       {
3228          rachCfgCmn->rootSeqIdx = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3229       }
3230
3231       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_SUBCARRIER_SPACING")) && (cur->ns == ns))
3232       {
3233          rachCfgCmn->msg1Scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3234       }
3235
3236       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRACH_RESTRICTED_SET_CFG")) && (cur->ns== ns))
3237       {
3238          rachCfgCmn->restrictedSetCfg = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3239       }
3240
3241       cur = cur -> next;
3242    }
3243
3244    rachCfgCmn->msg1FreqStart = ((maxNumRb) - (prachMaxPrb));
3245    return ROK;
3246 }
3247
3248 /*******************************************************************
3249  *
3250  * @brief Fill SCS Specific Carrier
3251  *
3252  * @details
3253  *
3254  *    Function : parseScsSpecCarrier
3255  *
3256  *    Functionality: Fill SCS Specific Carrier
3257  *
3258  * @params[in] XML document pointer
3259  *             XML namespace
3260  *             Current node in XML
3261  *             Pointer to structure to be filled
3262  * @return ROK     - success
3263  *         RFAILED - failure
3264  *
3265  * ****************************************************************/
3266 uint8_t parseScsSpecCarrier(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, ScsSpecCarrier *scsSpecCrr)
3267 {
3268    memset(scsSpecCrr, 0, sizeof(ScsSpecCarrier));
3269
3270 #ifdef O1_ENABLE
3271    scsSpecCrr->scsOffset = cellParams.ssbOffset;
3272    scsSpecCrr->scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
3273    scsSpecCrr->scsBw = cellParams.bSChannelBwUL;
3274 #else
3275    cur = cur -> xmlChildrenNode;
3276    while(cur != NULL)
3277    {
3278       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_SUBCARRIER_OFFSET")) && (cur->ns == ns))
3279       {
3280          scsSpecCrr->scsOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3281       }
3282
3283       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns))
3284       {
3285          scsSpecCrr->scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3286       }
3287
3288       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_BW")) && (cur->ns == ns))
3289       {
3290          scsSpecCrr->scsBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3291       }
3292       cur = cur -> next;
3293    }
3294 #endif   
3295    return ROK;
3296 }
3297
3298 /*******************************************************************
3299  *
3300  * @brief Fill UL Config Common 
3301  *
3302  * @details
3303  *
3304  *    Function : parseUlCfgCommon
3305  *
3306  *    Functionality: Fill UL Config Common
3307  *
3308  * @params[in] XML document pointer
3309  *             XML namespace
3310  *             Current node in XML
3311  *             Pointer to structure to be filled
3312  * @return ROK     - success
3313  *         RFAILED - failure
3314  *
3315  * ****************************************************************/
3316 uint8_t parseUlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,UlCfgCommon *ulCfgCmn)
3317 {
3318    memset(ulCfgCmn, 0, sizeof(UlCfgCommon));
3319    cur = cur -> xmlChildrenNode;
3320    while(cur != NULL)
3321    {
3322       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_FREQ_BAND")) && (cur->ns == ns))
3323       {
3324          ulCfgCmn->freqBandInd = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3325       }
3326
3327       if ((!xmlStrcmp(cur->name, (const xmlChar *)"UL_P_MAX")) && (cur->ns == ns))
3328       {
3329          ulCfgCmn->pMax = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3330       }
3331
3332       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FREQ_LOC_BW")) && (cur->ns == ns))
3333       {
3334          ulCfgCmn->locAndBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3335       }
3336
3337       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIME_ALLIGN_TIMER_COMM")) && (cur->ns == ns))
3338       {
3339          ulCfgCmn->timeAlignTimerComm = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3340       }
3341
3342       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_SPEC_CARRIER")) && (cur->ns == ns))
3343       {
3344          if(parseScsSpecCarrier(doc, ns, cur, &ulCfgCmn->ulScsCarrier) != ROK)
3345          {
3346             return RFAILED;
3347          }
3348       }
3349
3350       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RACH_CFG_COMMON")) && (cur->ns == ns))
3351       {
3352          if(parseRachCfgCommon(doc, ns, cur, &ulCfgCmn->rachCfg) != ROK)
3353          {
3354             return RFAILED;
3355          }
3356       }
3357
3358       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUSCH_CFG_COMMON")) && (cur->ns == ns))
3359       {
3360          if(parsePuschCfgCommon(doc, ns, cur, &ulCfgCmn->puschCfg) != ROK)
3361          {
3362             return RFAILED;
3363          }
3364       }
3365       
3366       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PUCCH_CFG_COMMON")) && (cur->ns == ns))
3367       {
3368          if(parsePucchCfgCommon(doc, ns, cur, &ulCfgCmn->pucchCfg) != ROK)
3369          {
3370             return RFAILED;
3371          }
3372       }
3373
3374       cur = cur -> next;
3375    }
3376    return ROK;
3377 }
3378
3379 /*******************************************************************
3380  *
3381  * @brief Fill TDD UL DL Configuration Common
3382  *
3383  * @details
3384  *
3385  *    Function : parseTddUlDlCfgCommon
3386  *
3387  *    Functionality: Fill TDD UL DL Configuration Common
3388  *
3389  * @params[in] XML document pointer
3390  *             XML namespace
3391  *             Current node in XML
3392  *             Pointer to structure to be filled
3393  * @return ROK     - success
3394  *         RFAILED - failure
3395  *
3396  * ****************************************************************/
3397 uint8_t parseTddUlDlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TddUlDlCfgCommon *tddUlDlCfgCmn)
3398 {
3399    memset(tddUlDlCfgCmn, 0, sizeof(TddUlDlCfgCommon));
3400    cur = cur -> xmlChildrenNode;
3401    while(cur != NULL)
3402    {
3403       if ((!xmlStrcmp(cur->name, (const xmlChar *)"REF_SCS")) && (cur->ns == ns))
3404       {
3405          tddUlDlCfgCmn->refScs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3406       }
3407
3408       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TX_PRD")) && (cur->ns == ns))
3409       {
3410          tddUlDlCfgCmn->txPrd = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3411       }
3412
3413       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SLOTS")) && (cur->ns == ns))
3414       {
3415          tddUlDlCfgCmn->numDlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3416       }
3417
3418       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_DL_SYMBOLS")) && (cur->ns == ns))
3419       {
3420          tddUlDlCfgCmn->numDlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3421       }
3422
3423       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SLOTS")) && (cur->ns == ns))
3424       {
3425          tddUlDlCfgCmn->numUlSlots = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3426       }
3427
3428       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_UL_SYMBOLS")) && (cur->ns == ns))
3429       {
3430          tddUlDlCfgCmn->numUlSymbols = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3431       }
3432
3433       cur = cur -> next;
3434    }
3435    return ROK;
3436 }
3437
3438 /*******************************************************************
3439  *
3440  * @brief Fill PCCH Configuration 
3441  *
3442  * @details
3443  *
3444  *    Function : parsePcchCfg
3445  *
3446  *    Functionality: Fill PCCH Configuration
3447  *
3448  * @params[in] XML document pointer
3449  *             XML namespace
3450  *             Current node in XML
3451  *             Pointer to structure to be filled
3452  * @return ROK     - success
3453  *         RFAILED - failure
3454  *
3455  * ****************************************************************/
3456 uint8_t parsePcchCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PcchCfg *pcchCfg)
3457 {
3458    xmlNodePtr child = NULLP;
3459    uint8_t  idx = 0;
3460
3461    memset(pcchCfg, 0, sizeof(PcchCfg));
3462    cur = cur -> xmlChildrenNode;
3463    while(cur != NULL)
3464    {
3465       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DEFAULT_PAGING_CYCLE")) && (cur->ns == ns))
3466       {
3467          pcchCfg->dfltPagingCycle = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3468       }
3469
3470       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAND_PAGING_FRAME_OFFSET")) && (cur->ns == ns))
3471       {
3472          pcchCfg->nAndPagingFrmOffsetType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3473       }
3474
3475       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PAGE_FRAME_OFFSET")) && (cur->ns == ns))
3476       {
3477          pcchCfg->pageFrameOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3478       }
3479
3480       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NS")) && (cur->ns == ns))
3481       {
3482          pcchCfg->ns = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3483       }
3484
3485       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FIRST_PDCCH_MONITORING_TYPE")) && (cur->ns == ns))
3486       {
3487          pcchCfg->firstPDCCHMontioringType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3488       }
3489
3490       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FIRST_PDCCH_LIST")) && (cur->ns == ns))
3491       {
3492          child = cur->xmlChildrenNode;
3493          while (child != NULL)
3494          {
3495             if ((!xmlStrcmp(child->name, (const xmlChar *)"FIRST_PDCCH_MONITORING_INFO")) && (child->ns == ns))
3496             {
3497                pcchCfg->firstPDCCHMontioringInfo[idx] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
3498                idx++;
3499             }
3500             child = child->next;
3501          }
3502       }
3503       cur = cur -> next;
3504    }
3505    return ROK;
3506 }
3507
3508 /*******************************************************************
3509  *
3510  * @brief Fill PDSCH Time Domain Resource Allocation
3511  *
3512  * @details
3513  *
3514  *    Function : parsePdschTimeDomRsrcAlloc
3515  *
3516  *    Functionality: Fill PDSCH Time Domain Resource Allocation
3517  *
3518  * @params[in] XML document pointer
3519  *             XML namespace
3520  *             Current node in XML
3521  *             Pointer to structure to be filled
3522  * @return ROK     - success
3523  *         RFAILED - failure
3524  *
3525  * ****************************************************************/
3526 uint8_t parsePdschTimeDomRsrcAlloc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdschTimeDomainRsrcAlloc *pdschTimeDomRsrcAlloc)
3527 {
3528    uint16_t startSymbol;
3529    uint16_t lenSymbol;
3530
3531    memset(pdschTimeDomRsrcAlloc, 0, sizeof(PdschTimeDomainRsrcAlloc));
3532    cur = cur -> xmlChildrenNode;
3533    while(cur != NULL)
3534    {
3535       if ((!xmlStrcmp(cur->name, (const xmlChar *)"K0")) && (cur->ns == ns))
3536       {
3537          pdschTimeDomRsrcAlloc->k0 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3538       }
3539
3540       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAP_TYPE")) && (cur->ns == ns))
3541       {
3542          pdschTimeDomRsrcAlloc->mapType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3543       }
3544
3545       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_START_SYMBOL")) && (cur->ns == ns))
3546       {
3547          startSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3548       }
3549
3550       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_LENGTH_SYMBOL")) && (cur->ns == ns))
3551       {
3552          lenSymbol = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3553       }
3554
3555       cur = cur -> next;
3556    }
3557    pdschTimeDomRsrcAlloc->sliv = calcSliv(startSymbol, lenSymbol);
3558    return ROK;
3559 }
3560
3561 /*******************************************************************
3562  *
3563  * @brief Fill PDSCH Configuration Common
3564  *
3565  * @details
3566  *
3567  *    Function : parsePdschCfgCommon
3568  *
3569  *    Functionality: Fill PDSCH Configuration Common
3570  *
3571  * @params[in] XML document pointer
3572  *             XML namespace
3573  *             Current node in XML
3574  *             Pointer to structure to be filled
3575  * @return ROK     - success
3576  *         RFAILED - failure
3577  *
3578  * ****************************************************************/
3579 uint8_t parsePdschCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,PdschCfgCommon *pdschCfgCmn)
3580 {
3581    uint8_t     idx = 0;
3582    xmlNodePtr  child = NULLP; 
3583
3584    memset(pdschCfgCmn, 0, sizeof(PdschCfgCommon));
3585    cur = cur -> xmlChildrenNode;
3586    while(cur != NULL)
3587    {
3588       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns))
3589       {
3590          pdschCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3591       }
3592
3593       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_TIME_DOM_RSRS_ALLOC")) && (cur->ns == ns))
3594       {
3595          pdschCfgCmn->numTimeDomRsrcAlloc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3596       }
3597
3598       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_TIME_DOM_RSRC_ALLOC_LIST")) && (cur->ns == ns))
3599       {
3600          child = cur->xmlChildrenNode;
3601          while (child != NULL)
3602          {
3603             if ((!xmlStrcmp(child->name, (const xmlChar *)"PDSCH_TIME_DOM_RSRC_ALLOC")) && (child->ns == ns))
3604             {
3605                if(parsePdschTimeDomRsrcAlloc(doc, ns, child, &pdschCfgCmn->timeDomAlloc[idx]) != ROK)
3606                {
3607                   return RFAILED;
3608                }
3609                idx++;
3610             }
3611             child = child->next;
3612          }
3613       }
3614       cur = cur -> next;
3615    }
3616    return ROK;
3617 }
3618
3619 /*******************************************************************
3620  *
3621  * @brief Fill BCCH Configuration
3622  *
3623  * @details
3624  *
3625  *    Function : parseBcchCfg
3626  *
3627  *    Functionality: Fill BCCH Configuration
3628  *
3629  * @params[in] XML document pointer
3630  *             XML namespace
3631  *             Current node in XML
3632  *             Pointer to structure to be filled
3633  * @return ROK     - success
3634  *         RFAILED - failure
3635  *
3636  * ****************************************************************/
3637 uint8_t parseBcchCfg(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, BcchCfg *bcchCfg)
3638 {
3639    memset(bcchCfg, 0, sizeof(BcchCfg));
3640    cur = cur -> xmlChildrenNode;
3641    while(cur != NULL)
3642    {
3643       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MOB_PRD_COEFF")) && (cur->ns == ns))
3644       {
3645          bcchCfg->modPrdCoeff = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3646       }
3647       cur = cur -> next;
3648    }
3649    return ROK;
3650 }
3651
3652 /*******************************************************************
3653  *
3654  * @brief Fill PDCCH Configuration Common
3655  *
3656  * @details
3657  *
3658  *    Function : parsePdcchConfigCommon
3659  *
3660  *    Functionality: Fill PDCCH Configuration Common
3661  *
3662  * @params[in] XML document pointer
3663  *             XML namespace
3664  *             Current node in XML
3665  *             Pointer to structure to be filled
3666  * @return ROK     - success
3667  *         RFAILED - failure
3668  *
3669  * ****************************************************************/
3670 uint8_t parsePdcchConfigCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, PdcchCfgCommon *pdccgCfgCmn)
3671 {
3672    uint8_t idx = 0;
3673    xmlNodePtr child = NULLP;
3674
3675    memset(pdccgCfgCmn, 0, sizeof( PdcchCfgCommon));
3676    cur = cur -> xmlChildrenNode;
3677    while(cur != NULL)
3678    {
3679       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRESENT")) && (cur->ns == ns))
3680       {
3681          pdccgCfgCmn->present = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3682       }
3683
3684       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CORESET_0_INDEX")) && (cur->ns == ns))
3685       {
3686          pdccgCfgCmn->ctrlRsrcSetZero = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3687       }
3688
3689       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCHSPACE_0_INDEX")) && (cur->ns == ns))
3690       {
3691          pdccgCfgCmn->searchSpcZero = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3692       }
3693
3694       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID")) && (cur->ns == ns))
3695       {
3696          pdccgCfgCmn->searchSpcId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3697       }
3698
3699       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CTRL_RSRC_SET_ID")) && (cur->ns == ns))
3700       {
3701          pdccgCfgCmn->ctrlRsrcSetId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3702       }
3703
3704       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MONITOR_SLOT_PERIOD_OFFSET_PRESENT")) && (cur->ns == ns))
3705       {
3706          pdccgCfgCmn->monitorSlotPrdAndOffPresent = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3707       }
3708
3709       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MONITOR_LIST")) && (cur->ns == ns))
3710       {
3711          child = cur->xmlChildrenNode;
3712          while (child)
3713          {
3714             if ((!xmlStrcmp(child->name, (const xmlChar *)"MONITOR_SYMBOL_IN_SLOT")) && (child->ns == ns))
3715             {
3716                pdccgCfgCmn->monitorSymbolsInSlot[idx] = atoi((char *)xmlNodeListGetString(doc, child->xmlChildrenNode, 1));
3717                idx++;
3718             }
3719             child = child->next;
3720          }
3721       }
3722
3723       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_CANDIDATE_AGG_LVL_1")) && (cur->ns == ns))
3724       {
3725          pdccgCfgCmn->numCandAggLvl1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3726       }
3727
3728       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_CANDIDATE_AGG_LVL_2")) && (cur->ns == ns))
3729       {
3730          pdccgCfgCmn->numCandAggLvl2 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3731       }
3732
3733       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_CANDIDATE_AGG_LVL_4")) && (cur->ns == ns))
3734       {
3735          pdccgCfgCmn->numCandAggLvl4 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3736       }
3737
3738       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_CANDIDATE_AGG_LVL_8")) && (cur->ns == ns))
3739       {
3740          pdccgCfgCmn->numCandAggLvl8 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3741       }
3742
3743       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_CANDIDATE_AGG_LVL_16")) && (cur->ns == ns))
3744       {
3745          pdccgCfgCmn->numCandAggLvl16 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3746       }
3747
3748       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEARCH_SPACE_TYPE")) && (cur->ns == ns))
3749       {
3750          pdccgCfgCmn->searchSpcType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3751       }
3752
3753       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_DCI_FORMAT")) && (cur->ns == ns))
3754       {
3755          pdccgCfgCmn->commSrchSpcDciFrmt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3756       }
3757
3758       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID_SIB1")) && (cur->ns == ns))
3759       {
3760          pdccgCfgCmn->searchSpcSib1 = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3761       }
3762
3763       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID_PAGING")) && (cur->ns == ns))
3764       {
3765          pdccgCfgCmn->pagingSearchSpc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3766       }
3767
3768       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_SEARCH_SPACE_ID_RA")) && (cur->ns == ns))
3769       {
3770          pdccgCfgCmn->raSearchSpc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3771       }
3772
3773       cur = cur -> next;
3774    }
3775    return ROK;
3776 }
3777
3778 /*******************************************************************
3779  *
3780  * @brief Fill DL Configuration Common
3781  *
3782  * @details
3783  *
3784  *    Function : parseDlCfgCommon
3785  *
3786  *    Functionality: Fill DL Configuration Common
3787  *
3788  * @params[in] XML document pointer
3789  *             XML namespace
3790  *             Current node in XML
3791  *             Pointer to structure to be filled
3792  * @return ROK     - success
3793  *         RFAILED - failure
3794  *
3795  * ****************************************************************/
3796 uint8_t parseDlCfgCommon(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,DlCfgCommon *dlCfgCmn)
3797 {
3798    memset(dlCfgCmn, 0, sizeof(DlCfgCommon));
3799    cur = cur -> xmlChildrenNode;
3800    while(cur != NULL)
3801    {
3802       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_FREQ_BAND")) && (cur->ns == ns))
3803       {
3804          dlCfgCmn->freqBandInd = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3805       }
3806
3807       if ((!xmlStrcmp(cur->name, (const xmlChar *)"OFFSET_TO_POINT_A")) && (cur->ns == ns))
3808       {
3809          dlCfgCmn->offsetToPointA = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3810       }
3811
3812       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FREQ_LOC_BW")) && (cur->ns == ns))
3813       {
3814          dlCfgCmn->locAndBw = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3815       }
3816
3817       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCS_SPEC_CARRIER")) && (cur->ns == ns))
3818       {
3819          if(parseScsSpecCarrier(doc, ns, cur, &dlCfgCmn->dlScsCarrier) != ROK)
3820          {
3821             return RFAILED;
3822          }
3823       }
3824
3825       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDCCH_CFG_COMMON")) && (cur->ns == ns))
3826       {
3827          if(parsePdcchConfigCommon(doc, ns, cur, &dlCfgCmn->pdcchCfg) != ROK)
3828          {
3829             return RFAILED;
3830          }
3831       }
3832
3833       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PDSCH_CFG_COMMON")) && (cur->ns == ns))
3834       {
3835          if(parsePdschCfgCommon(doc, ns, cur, &dlCfgCmn->pdschCfg) != ROK)
3836          {
3837             return RFAILED;
3838          }
3839       }
3840
3841       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BCCH_CFG")) && (cur->ns == ns))
3842       {
3843          if(parseBcchCfg(doc, ns, cur, &dlCfgCmn->bcchCfg) != ROK)
3844          {
3845             return RFAILED;
3846          }
3847       }
3848
3849       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PCCH_CFG")) && (cur->ns == ns))
3850       {
3851          if(parsePcchCfg(doc, ns, cur, &dlCfgCmn->pcchCfg) != ROK)
3852          {
3853             return RFAILED;
3854          }
3855       }
3856       cur = cur -> next;
3857    }
3858    return ROK;
3859 }
3860 /*******************************************************************
3861  *
3862  * @brief Fill Serving Cell Config Common SIB
3863  *
3864  * @details
3865  *
3866  *    Function : parseSrvCellCfgCmnSib
3867  *
3868  *    Functionality: Fill Serving Cell Config Common SIB
3869  *
3870  * @params[in] XML document pointer
3871  *             XML namespace
3872  *             Current node in XML
3873  *             Pointer to structure to be filled
3874  * @return ROK     - success
3875  *         RFAILED - failure
3876  *
3877  * ****************************************************************/
3878 uint8_t parseSrvCellCfgCmnSib(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SrvCellCfgCommSib *srvCellCfgCmnSib)
3879 {
3880    memset(srvCellCfgCmnSib, 0, sizeof(SrvCellCfgCommSib));
3881    cur = cur -> xmlChildrenNode;
3882    while(cur != NULL)
3883    {
3884 #ifdef O1_ENABLE
3885       srvCellCfgCmnSib->scs = convertScsValToScsEnum(cellParams.ssbSubCarrierSpacing);
3886 #else
3887       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NR_SCS")) && (cur->ns == ns))
3888       {
3889          srvCellCfgCmnSib->scs = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3890       }
3891 #endif
3892       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_POS_INBURST")) && (cur->ns == ns))
3893       {
3894          srvCellCfgCmnSib->ssbPosInBurst = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3895       }
3896
3897       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PERIODICITY")) && (cur->ns == ns))
3898       {
3899          srvCellCfgCmnSib->ssbPrdServingCell = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3900       }
3901
3902       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SSB_PBCH_PWR")) && (cur->ns == ns))
3903       {
3904          srvCellCfgCmnSib->ssPbchBlockPwr = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3905       }
3906
3907       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DL_CFG_COMMON")) && (cur->ns == ns))
3908       {
3909          if(parseDlCfgCommon(doc, ns, cur, &srvCellCfgCmnSib->dlCfg) != ROK)
3910          {
3911             return RFAILED;
3912          }
3913       }
3914
3915       if ((!xmlStrcmp(cur->name, (const xmlChar *)"UL_CFG_COMMON")) && (cur->ns == ns))
3916       {
3917          if(parseUlCfgCommon(doc, ns, cur, &srvCellCfgCmnSib->ulCfg) != ROK)
3918          {
3919             return RFAILED;
3920          }
3921       }
3922
3923       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TDD_UL_DL_CFG_COMMON")) && (cur->ns == ns))
3924       {
3925          if(parseTddUlDlCfgCommon(doc, ns, cur, &srvCellCfgCmnSib->tddCfg) != ROK)
3926          {
3927             return RFAILED;
3928          }
3929       }
3930
3931       cur = cur -> next;
3932    }
3933    return ROK;
3934 }
3935
3936 /*******************************************************************
3937  *
3938  * @brief Fill SI Scheduling Information 
3939  *
3940  * @details
3941  *
3942  *    Function : parseSiSchedInfo
3943  *
3944  *    Functionality: Fill SI Scheduling Information
3945  *
3946  * @params[in] XML document pointer
3947  *             XML namespace
3948  *             Current node in XML
3949  *             Pointer to structure to be filled
3950  * @return ROK     - success
3951  *         RFAILED - failure
3952  *
3953  * ****************************************************************/
3954 uint8_t parseSiSchedInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,SiSchedInfo *siSchedInfo)
3955 {
3956    memset(siSchedInfo, 0, sizeof(SiSchedInfo));
3957    cur = cur -> xmlChildrenNode;
3958    while(cur != NULL)
3959    {
3960       if ((!xmlStrcmp(cur->name, (const xmlChar *)"WIN_LEN")) && (cur->ns == ns))
3961       {
3962          siSchedInfo->winLen = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3963       }
3964
3965       if ((!xmlStrcmp(cur->name, (const xmlChar *)"BROADCAST_STATUS")) && (cur->ns == ns))
3966       {
3967          siSchedInfo->broadcastSta = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3968       }
3969
3970       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PERIODICITY")) && (cur->ns == ns))
3971       {
3972          siSchedInfo->preiodicity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3973       }
3974
3975       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB_TYPE")) && (cur->ns == ns))
3976       {
3977          siSchedInfo->sibType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3978       }
3979
3980       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB1_VALUE_TAG")) && (cur->ns == ns))
3981       {
3982          siSchedInfo->sibValTag = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
3983       }
3984
3985       cur = cur -> next;
3986    }
3987    return ROK;
3988 }
3989
3990 /*******************************************************************
3991  *
3992  * @brief Fill SIB1 Parameters
3993  *
3994  * @details
3995  *
3996  *    Function : parseSib1Params
3997  *
3998  *    Functionality: Fill SIB1 Parameters
3999  *
4000  * @params[in] XML document pointer
4001  *             XML namespace
4002  *             Current node in XML
4003  *             Pointer to structure to be filled
4004  * @return ROK     - success
4005  *         RFAILED - failure
4006  *
4007  * ****************************************************************/
4008 uint8_t parseSib1Params(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,Sib1Params *sib1Params)
4009 {
4010    memset(sib1Params, 0, sizeof(Sib1Params));
4011    cur = cur -> xmlChildrenNode;
4012    while(cur != NULL)
4013    {
4014 #ifdef O1_ENABLE
4015    sib1Params-> tac = cellParams.nRTAC;
4016    sib1Params->cellIdentity = CELL_IDENTITY *  cellParams.cellLocalId;
4017    DU_LOG("\nDEBUG --> DU_APP: parseSib1Params(): OAM CellLocalId=%d", sib1Params->cellIdentity);
4018 #else
4019       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TAC")) && (cur->ns == ns))
4020       {
4021          sib1Params-> tac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4022       }
4023
4024       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_IDENTITY")) && (cur->ns == ns))
4025       {
4026          sib1Params->cellIdentity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4027       }
4028 #endif
4029
4030       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns))
4031       {
4032          if(parsePlmn(doc, ns, cur, &sib1Params->plmn) != ROK)
4033          {
4034             return RFAILED;
4035          }
4036       }
4037
4038       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RANAC")) && (cur->ns == ns))
4039       {
4040          sib1Params->ranac = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4041       }
4042
4043       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CELL_RESVD_OPUSE")) && (cur->ns == ns))
4044       {
4045          sib1Params->cellResvdForOpUse = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4046       }
4047
4048       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONN_EST_FAIL_CNT")) && (cur->ns == ns))
4049       {
4050          sib1Params->connEstFailCnt = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4051       }
4052
4053       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONN_EST_FAIL_OFF_VALID")) && (cur->ns == ns))
4054       {
4055          sib1Params->connEstFailOffValidity = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4056       }
4057
4058       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CONN_EST_FAIL_OFFSET")) && (cur->ns == ns))
4059       {
4060          sib1Params->connEstFailOffset = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4061       }
4062
4063       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SI_SHED_INFO")) && (cur->ns == ns))
4064       {
4065          if(parseSiSchedInfo(doc, ns, cur, &sib1Params->siSchedInfo) != ROK)
4066          {
4067             return RFAILED;
4068          }
4069       }
4070
4071       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SRV_CELL_CFG_COM_SIB")) && (cur->ns == ns))
4072       {
4073          if(parseSrvCellCfgCmnSib(doc, ns, cur, &sib1Params->srvCellCfgCommSib) != ROK)
4074          {
4075             return RFAILED;
4076          }
4077       }
4078
4079       cur = cur -> next;
4080    }
4081    return ROK;
4082 }
4083
4084 #ifndef O1_ENABLE
4085 /*******************************************************************
4086  *
4087  * @brief Fill RRM Policy List
4088  *
4089  * @details
4090  *
4091  *    Function : parseRrmPolicyList
4092  *
4093  *    Functionality: Fill RRM Policy List
4094  *
4095  * @params[in] XML document pointer
4096  *             XML namespace
4097  *             Current node in XML
4098  *             Pointer to structure to be filled
4099  * @return ROK     - success
4100  *         RFAILED - failure
4101  *
4102  * ****************************************************************/
4103 uint8_t parseRrmPolicyList(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,RrmPolicyMemberList *rrmPolicyMemberList)
4104 {
4105    memset(rrmPolicyMemberList, 0, sizeof(RrmPolicyMemberList));
4106    cur = cur->xmlChildrenNode;
4107    while(cur != NULL)
4108    {
4109       if ((!xmlStrcmp(cur->name, (const xmlChar *)"PLMN")) && (cur->ns == ns))
4110       {
4111          if(parsePlmn(doc, ns, cur, &rrmPolicyMemberList->plmn) != ROK)
4112          {
4113             return RFAILED;
4114          }
4115       }
4116
4117       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SNSSAI")) && (cur->ns == ns))
4118       {
4119          if(parseSnssai(doc, ns, cur, &rrmPolicyMemberList->snssai) != ROK)
4120          {
4121             return RFAILED;
4122          }
4123       }
4124
4125       cur = cur -> next;
4126    }
4127    return ROK;
4128 }
4129
4130 /*******************************************************************
4131  *
4132  * @brief Fill RRM Policy Ratio
4133  *
4134  * @details
4135  *
4136  *    Function : parseRrmPolicyRatio
4137  *
4138  *    Functionality: Fill RRM Policy Ratio
4139  *
4140  * @params[in] XML document pointer
4141  *             XML namespace
4142  *             Current node in XML
4143  *             Pointer to structure to be filled
4144  * @return ROK     - success
4145  *         RFAILED - failure
4146  *
4147  * ****************************************************************/
4148 uint8_t parseRrmPolicyRatio(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RrmPolicyRatio *rrmPolicyRatio)
4149 {
4150    memset(rrmPolicyRatio, 0, sizeof(RrmPolicyRatio));
4151    cur = cur -> xmlChildrenNode;
4152    while(cur != NULL)
4153    {
4154       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_RATIO")) && (cur->ns == ns))
4155       {
4156          rrmPolicyRatio->maxRatio = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4157       }
4158
4159       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MIN_RATIO")) && (cur->ns == ns))
4160       {
4161          rrmPolicyRatio->minRatio = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4162       }
4163
4164       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DEDICATED_RATIO")) && (cur->ns == ns))
4165       {
4166          rrmPolicyRatio->dedicatedRatio = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4167       }
4168
4169       cur = cur -> next;
4170    }
4171    return ROK;
4172 }
4173
4174 /*******************************************************************
4175  *
4176  * @brief Fill MAC Slice RRM Policy
4177  *
4178  * @details
4179  *
4180  *    Function : parseMacSliceRrmPolicy
4181  *
4182  *    Functionality: Fill MAC Slice RRM Policy
4183  *
4184  * @params[in] XML document pointer
4185  *             XML namespace
4186  *             Current node in XML
4187  *             Pointer to structure to be filled
4188  * @return ROK     - success
4189  *         RFAILED - failure
4190  *
4191  * ****************************************************************/
4192 uint8_t parseMacSliceRrmPolicy(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, MacSliceRrmPolicy *rrmPolicy)
4193 {
4194    uint8_t memIdx = 0;
4195
4196    memset(rrmPolicy, 0, sizeof(MacSliceRrmPolicy));
4197    cur = cur -> xmlChildrenNode;
4198    while(cur != NULL)
4199    {
4200       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RESOURCE_TYPE")) && (cur->ns == ns))
4201       {
4202          rrmPolicy->resourceType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4203       }
4204
4205       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RRM_POLICY_MEMBER")) && (cur->ns == ns))
4206       {
4207          rrmPolicy->numOfRrmPolicyMem = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4208       }
4209
4210       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RRM_POLICY_MEMBER_LIST")) && (cur->ns == ns))
4211       {
4212          DU_ALLOC_SHRABL_BUF(rrmPolicy->rRMPolicyMemberList,\
4213                rrmPolicy->numOfRrmPolicyMem * sizeof(RrmPolicyMemberList*));
4214
4215          if(!rrmPolicy->rRMPolicyMemberList)
4216          {
4217             DU_LOG("\nERROR  --> DU APP : %s: Memory allocation failed at line %d", __func__, __LINE__);
4218             return RFAILED;
4219          }
4220
4221          for(memIdx = 0; memIdx < rrmPolicy->numOfRrmPolicyMem; memIdx++)
4222          {
4223             DU_ALLOC_SHRABL_BUF(rrmPolicy->rRMPolicyMemberList[memIdx], sizeof(RrmPolicyMemberList));
4224             if (rrmPolicy->rRMPolicyMemberList[memIdx] == NULLP)
4225             {
4226                DU_LOG("\nERROR  --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
4227                return RFAILED;
4228             }
4229
4230             if(parseRrmPolicyList(doc, ns, cur, rrmPolicy->rRMPolicyMemberList[memIdx]) != ROK)
4231             {
4232                return RFAILED;
4233             }
4234          }
4235       }
4236
4237       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RRM_POLICY_RATIO")) && (cur->ns == ns))
4238       {
4239          if(parseRrmPolicyRatio(doc, ns, cur, &rrmPolicy->policyRatio) != ROK)
4240          {
4241             return RFAILED;
4242          }
4243       }
4244
4245       cur = cur -> next;
4246    }
4247    return ROK;
4248 }
4249
4250 /*******************************************************************
4251  *
4252  * @brief Fill MAC Slice Configuration
4253  *
4254  * @details
4255  *
4256  *    Function : parseMacSliceCfgReq
4257  *
4258  *    Functionality: Fill MAC Slice Configuration
4259  *
4260  * @params[in] XML document pointer
4261  *             XML namespace
4262  *             Current node in XML
4263  *             Pointer to structure to be filled
4264  * @return ROK     - success
4265  *         RFAILED - failure
4266  *
4267  * ****************************************************************/
4268 uint8_t parseMacSliceCfgReq(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,MacSliceCfgReq *macSliceCfgReq)
4269 {
4270    uint8_t policyIdx = 0;
4271    memset(macSliceCfgReq, 0, sizeof(MacSliceCfgReq));
4272    cur = cur -> xmlChildrenNode;
4273    while(cur != NULL)
4274    {
4275       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_RRM_POLICY")) && (cur->ns == ns))
4276       {
4277          macSliceCfgReq->numOfRrmPolicy = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4278       }
4279
4280       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_SLICE_RRM_POLICY")) && (cur->ns == ns))
4281       {
4282          DU_ALLOC_SHRABL_BUF(macSliceCfgReq->listOfRrmPolicy,  macSliceCfgReq->numOfRrmPolicy * sizeof(MacSliceRrmPolicy*));
4283          if(!macSliceCfgReq->listOfRrmPolicy)
4284          {
4285             DU_LOG("\nERROR  --> DU APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
4286             return RFAILED;
4287          }
4288
4289          for(policyIdx = 0; policyIdx < macSliceCfgReq->numOfRrmPolicy; policyIdx++)
4290          {
4291             DU_ALLOC_SHRABL_BUF(macSliceCfgReq->listOfRrmPolicy[policyIdx], sizeof(MacSliceRrmPolicy));
4292             if (macSliceCfgReq->listOfRrmPolicy[policyIdx] == NULLP)
4293             {
4294                DU_LOG("\nERROR  --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
4295             }
4296             
4297             if(parseMacSliceRrmPolicy(doc, ns, cur, macSliceCfgReq->listOfRrmPolicy[policyIdx]) != ROK)
4298             {
4299                return RFAILED;
4300             }
4301          }
4302       }
4303       cur = cur -> next;
4304    }
4305    return ROK;
4306 }
4307 #endif
4308
4309 #ifdef THREAD_AFFINITY
4310 /*******************************************************************
4311  *
4312  * @brief Set thread affinity to the core configured via XML file
4313  *
4314  * @details
4315  *
4316  *    Function : parseThreadAffinity
4317  *
4318  *    Functionality: Set thread affinity to the core configured 
4319  *       via XML file
4320  *
4321  * @params[in] XML document pointer
4322  *             XML namespace
4323  *             Current node in XML
4324  *             Thread information
4325  * @return ROK     - success
4326  *         RFAILED - failure
4327  *
4328  * ****************************************************************/
4329 uint8_t parseThreadAffinity(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, ThreadInfo *threads)
4330 {
4331    cur = cur -> xmlChildrenNode;
4332    while(cur != NULL)
4333    {
4334       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_APP_CORE")) && (cur->ns == ns))
4335       {
4336          threads->duAppCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4337 #ifdef INTEL_THREAD_AFFINITY
4338          ODU_SET_THREAD_AFFINITY(&threads->duAppSTskId, SS_AFFINITY_MODE_EXCL, threads->duAppCoreId, 0);
4339 #endif
4340       }
4341
4342       if ((!xmlStrcmp(cur->name, (const xmlChar *)"EGTP_CORE")) && (cur->ns == ns))
4343       {
4344          threads->egtpCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4345 #ifdef INTEL_THREAD_AFFINITY
4346          ODU_SET_THREAD_AFFINITY(&threads->egtpSTskId, SS_AFFINITY_MODE_EXCL, threads->egtpCoreId, 0);
4347 #endif
4348       }
4349
4350       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RLC_MAC_CORE")) && (cur->ns == ns))
4351       {
4352          threads->rlcMacCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4353 #ifdef INTEL_THREAD_AFFINITY
4354          ODU_SET_THREAD_AFFINITY(&threads->rlcMacSTskId, SS_AFFINITY_MODE_EXCL, threads->rlcMacCoreId, 0);
4355 #endif
4356       }
4357
4358       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RLC_UL_CORE")) && (cur->ns == ns))
4359       {
4360          threads->rlcUlCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4361 #ifdef INTEL_THREAD_AFFINITY
4362          ODU_SET_THREAD_AFFINITY(&threads->rlcUlSTskId, SS_AFFINITY_MODE_EXCL, threads->rlcUlCoreId, 0);
4363 #endif
4364       }
4365
4366       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCH_CORE")) && (cur->ns == ns))
4367       {
4368          threads->schCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4369 #ifdef INTEL_THREAD_AFFINITY
4370          ODU_SET_THREAD_AFFINITY(&threads->schSTskId, SS_AFFINITY_MODE_EXCL, threads->schCoreId, 0);
4371 #endif
4372       }
4373
4374       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCTP_CORE")) && (cur->ns == ns))
4375       {
4376          threads->sctpCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4377 #ifdef INTEL_THREAD_AFFINITY
4378          ODU_SET_THREAD_AFFINITY(&threads->sctpSTskId, SS_AFFINITY_MODE_EXCL, threads->sctpCoreId, 0);
4379 #endif
4380       }
4381
4382       if ((!xmlStrcmp(cur->name, (const xmlChar *)"LOWER_MAC_CORE")) && (cur->ns == ns))
4383       {
4384          threads->lwrMacCoreId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4385 #ifdef INTEL_THREAD_AFFINITY
4386          ODU_SET_THREAD_AFFINITY(&threads->lwrMacSTskId, SS_AFFINITY_MODE_EXCL, threads->lwrMacCoreId, 0);
4387 #endif
4388       }
4389
4390       cur = cur -> next;
4391    }
4392    return ROK;
4393 }
4394 #endif
4395
4396 /*******************************************************************
4397  *
4398  * @brief Fill tmrTqCp
4399  *
4400  * @details
4401  *
4402  *    Function : parseTmrTqCp
4403  *
4404  *    Functionality: Fill tmrTqCp
4405  *
4406  * @params[in] XML document pointer
4407  *             XML namespace
4408  *             Current node in XML
4409  *             Pointer to structure to be filled
4410  * @return ROK     - success
4411  *         RFAILED - failure
4412  *
4413  * ****************************************************************/
4414 uint8_t parseTmrTqCp(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, CmTqCp *tmrTqCp)
4415 {
4416    memset(tmrTqCp, 0, sizeof(CmTqCp));
4417    cur = cur ->xmlChildrenNode;
4418    while(cur != NULL)
4419    {
4420       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIMER_LEN")) && (cur->ns == ns))
4421       {
4422          tmrTqCp->tmrLen = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4423       }
4424       cur = cur -> next;
4425    }
4426    return ROK;
4427 }
4428
4429 /*******************************************************************
4430  *
4431  * @brief Fill DU timer Parameters
4432  *
4433  * @details
4434  *
4435  *    Function : parseDuTimerParams
4436  *
4437  *    Functionality: Fill DU timer Parmeters
4438  *
4439  * @params[in] XML document pointer
4440  *             XML namespace
4441  *             Current node in XML
4442  *             Pointer to structure to be filled
4443  * @return ROK     - success
4444  *         RFAILED - failure
4445  *
4446  * ****************************************************************/
4447 uint8_t parseDuTimerParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, DuTimers  *duTimers)
4448 {
4449    memset(duTimers, 0, sizeof(DuTimers));
4450    
4451    cur = cur->xmlChildrenNode;
4452    while (cur != NULL)
4453    {
4454       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIMER_TQ_CP")) && (cur->ns == ns))
4455       {
4456          if(parseTmrTqCp(doc, ns, cur, &duTimers->tmrTqCp) != ROK)
4457          {
4458             return RFAILED;
4459          }
4460          else
4461          {
4462             /* Initialzie the timer queue */   
4463             memset(&(duTimers->tmrTq), 0, sizeof(CmTqType) * duTimers->tmrTqCp.tmrLen);
4464          }
4465       }
4466
4467       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIMER_RESOLUTION")) && (cur->ns == ns))
4468       {
4469          duTimers->tmrRes = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4470       }
4471       cur = cur -> next;
4472    }
4473    return ROK;
4474 }
4475
4476 /*******************************************************************
4477  *
4478  * @brief Fill TNL assoc 
4479  *
4480  * @details
4481  *
4482  *    Function : parseTnlAssoc
4483  *
4484  *    Functionality: Fill TNL assoc
4485  *
4486  * @params[in] XML document pointer
4487  *             XML namespace
4488  *             Current node in XML
4489  *             Pointer to structure to be filled
4490  * @return ROK     - success
4491  *         RFAILED - failure
4492  *
4493  * ****************************************************************/
4494 uint8_t parseTnlAssoc(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, TNLAssociation *tnlAssoc)
4495 {
4496    char *duIpV4Addr;
4497    char *ricIpV4Addr;
4498    CmInetIpAddr duIp;
4499    CmInetIpAddr ricIp;
4500
4501    memset(tnlAssoc, 0, sizeof(TNLAssociation));
4502    cur = cur ->xmlChildrenNode;
4503    while(cur != NULL)
4504    {
4505       if ((!xmlStrcmp(cur->name, (const xmlChar *)"LOCAL_IP")) && (cur->ns == ns))
4506       {
4507          duIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
4508          cmInetAddr(duIpV4Addr, &(duIp));
4509          tnlAssoc->localIpAddress.ipV4Pres = true;
4510          tnlAssoc->localIpAddress.ipV4Addr = duIp;
4511       }
4512
4513       if ((!xmlStrcmp(cur->name, (const xmlChar *)"LOCAL_PORT")) && (cur->ns == ns))
4514       {
4515          tnlAssoc->localPort = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4516       }
4517
4518       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DESTINATION_IP")) && (cur->ns == ns))
4519       {
4520          ricIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
4521          cmInetAddr(ricIpV4Addr, &(ricIp));
4522          tnlAssoc->destIpAddress.ipV4Pres = true;
4523          tnlAssoc->destIpAddress.ipV4Addr = ricIp;
4524       }
4525
4526       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DESTINATION_PORT")) && (cur->ns == ns))
4527       {
4528          tnlAssoc->destPort = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4529       }
4530
4531       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ASSOC_USAGE")) && (cur->ns == ns))
4532       {
4533          tnlAssoc->usage = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4534       }
4535       cur = cur -> next;
4536    }
4537    return ROK;
4538 }
4539
4540 /*******************************************************************
4541  *
4542  * @brief Fill ric style parmeters
4543  *
4544  * @details
4545  *
4546  *    Function : parseRicStyle
4547  *
4548  *    Functionality: Fill ric style parmeters
4549  *
4550  * @params[in] XML document pointer
4551  *             XML namespace
4552  *             Current node in XML
4553  *             Pointer to structure to be filled
4554  * @return ROK     - success
4555  *         RFAILED - failure
4556  *
4557  * ****************************************************************/
4558 uint8_t parseRicStyle(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RicStyle  *ricStyle)
4559 {
4560    char *tempName;
4561    memset(ricStyle, 0, sizeof(RicStyle));
4562
4563    cur = cur->xmlChildrenNode;
4564    while (cur != NULL)
4565    {
4566       if ((!xmlStrcmp(cur->name, (const xmlChar *)"STYLE_TYPE")) && (cur->ns == ns))
4567       {
4568          ricStyle->styleType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4569       }
4570
4571       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME")) && (cur->ns == ns))
4572       {
4573          tempName =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
4574          strcpy((char*)ricStyle->name, tempName);
4575       }
4576
4577       if ((!xmlStrcmp(cur->name, (const xmlChar *)"FORMAT_TYPE")) && (cur->ns == ns))
4578       {
4579          ricStyle->formatType = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4580       }
4581       cur = cur -> next;
4582    }
4583    return ROK;
4584 }
4585
4586 /*******************************************************************
4587  *
4588  * @brief Fill measurement info parameters
4589  *
4590  * @details
4591  *
4592  *    Function : parseMeasurementInfo
4593  *
4594  *    Functionality: Fill measurement info parmeters
4595  *
4596  * @params[in] XML document pointer
4597  *             XML namespace
4598  *             Current node in XML
4599  *             Pointer to structure to be filled
4600  * @return ROK     - success
4601  *         RFAILED - failure
4602  *
4603  * ****************************************************************/
4604 uint8_t parseMeasurementInfo(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, CmLListCp  *measurementInfoList)
4605 {
4606    CmLList *node;
4607    char *tempName;
4608    MeasurementInfoForAction *measurementInfoForAction;
4609
4610    DU_ALLOC(measurementInfoForAction, sizeof(MeasurementInfoForAction));
4611    if(!measurementInfoForAction)
4612    {
4613       return RFAILED;
4614    }
4615
4616    cur = cur->xmlChildrenNode;
4617    while (cur != NULL)
4618    {
4619       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ID")) && (cur->ns == ns))
4620       {
4621          measurementInfoForAction->measurementTypeId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4622       }
4623
4624       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME")) && (cur->ns == ns))
4625       {
4626          tempName =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
4627          strcpy((char*)measurementInfoForAction->measurementTypeName, tempName);
4628       }
4629
4630       cur = cur -> next;
4631    }
4632
4633    DU_ALLOC(node, sizeof(CmLList));
4634    if(node)
4635    {
4636       node->node = (PTR) measurementInfoForAction;
4637       cmLListAdd2Tail(measurementInfoList, node);
4638    }
4639    else
4640    {
4641       DU_FREE(measurementInfoForAction, sizeof(MeasurementInfoForAction));
4642       return RFAILED;
4643    }
4644
4645    return ROK;
4646 }
4647
4648 /*******************************************************************
4649  *
4650  * @brief Fill report style parameters
4651  *
4652  * @details
4653  *
4654  *    Function : parseReportStyle
4655  *
4656  *    Functionality: Fill report style parmeters
4657  *
4658  * @params[in] XML document pointer
4659  *             XML namespace
4660  *             Current node in XML
4661  *             Pointer to structure to be filled
4662  * @return ROK     - success
4663  *         RFAILED - failure
4664  *
4665  * ****************************************************************/
4666 uint8_t parseReportStyle(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RicReportStyle  *ricReportStyle)
4667 {
4668    xmlNodePtr child = NULLP;
4669    memset(ricReportStyle, 0, sizeof(RicReportStyle));
4670
4671    cur = cur->xmlChildrenNode;
4672    while (cur != NULL)
4673    {
4674       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RIC_STYLE")) && (cur->ns == ns))
4675       {
4676          if(parseRicStyle(doc, ns, cur, &ricReportStyle->reportStyle) != ROK)
4677          {
4678             return RFAILED;
4679          }
4680       }
4681
4682       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MEASUREMENT_INFO_LIST")) && (cur->ns == ns))
4683       {
4684          child = cur->xmlChildrenNode;
4685          while(child != NULL)
4686          {
4687             if ((!xmlStrcmp(child->name, (const xmlChar *)"MEASUREMENT_INFO")) && (child->ns == ns))
4688             {
4689                if(parseMeasurementInfo(doc, ns, child, &ricReportStyle->measurementInfoList) != ROK)
4690                {
4691                   return RFAILED;
4692                }
4693             }
4694             child = child -> next;
4695          }
4696       }
4697
4698       cur = cur -> next;
4699    }
4700    return ROK;
4701 }
4702
4703 /*******************************************************************
4704  *
4705  * @brief Fill RAN function name parameters
4706  *
4707  * @details
4708  *
4709  *    Function : parseRanFuncName
4710  *
4711  *    Functionality: Fill RAN function name parmeters
4712  *
4713  * @params[in] XML document pointer
4714  *             XML namespace
4715  *             Current node in XML
4716  *             Pointer to structure to be filled
4717  * @return ROK     - success
4718  *         RFAILED - failure
4719  *
4720  * ****************************************************************/
4721 uint8_t parseRanFuncName(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RanFunctionName  *ranFunctionName)
4722 {
4723    char *tempShortName;
4724    char *tempServiceModelOid;
4725    char *tempDiscription;
4726
4727    memset(ranFunctionName, 0, sizeof(RanFunctionName));
4728
4729    cur = cur->xmlChildrenNode;
4730    while (cur != NULL)
4731    {
4732       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SHORT_NAME")) && (cur->ns == ns))
4733       {
4734          tempShortName =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
4735          strcpy((char*)ranFunctionName->shortName, tempShortName);
4736       }
4737
4738       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SEVICE_MODEL_OID")) && (cur->ns == ns))
4739       {
4740          tempServiceModelOid =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
4741          strcpy((char*)ranFunctionName->serviceModelOID, tempServiceModelOid);
4742       }
4743
4744       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DESCRIPTION")) && (cur->ns == ns))
4745       {
4746          tempDiscription =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
4747          strcpy((char*)ranFunctionName->description, tempDiscription);
4748       }
4749       cur = cur -> next;
4750    }
4751    return ROK;
4752 }
4753
4754 /*******************************************************************
4755  *
4756  * @brief Fill RAN function parameters
4757  *
4758  * @details
4759  *
4760  *    Function : parseRanFunctionParams
4761  *
4762  *    Functionality: Fill RAN function parmeters
4763  *
4764  * @params[in] XML document pointer
4765  *             XML namespace
4766  *             Current node in XML
4767  *             Pointer to structure to be filled
4768  * @return ROK     - success
4769  *         RFAILED - failure
4770  *
4771  * ****************************************************************/
4772 uint8_t parseRanFunctionParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, RanFunction  *ranFunction)
4773 {
4774    xmlNodePtr child = NULLP;
4775    uint8_t eventTriggerStyleIdx=0, reportStyleIdx=0;
4776
4777    memset(ranFunction, 0, sizeof(RanFunction));
4778
4779    cur = cur->xmlChildrenNode;
4780
4781    while (cur != NULL)
4782    {
4783       if ((!xmlStrcmp(cur->name, (const xmlChar *)"ID")) && (cur->ns == ns))
4784       {
4785          ranFunction->id = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4786       }
4787
4788       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RAN_FUNCTION_NAME")) && (cur->ns == ns))
4789       {
4790          if(parseRanFuncName(doc, ns, cur, &ranFunction->name) != ROK)
4791          {
4792             return RFAILED;
4793          }
4794       }
4795
4796       if ((!xmlStrcmp(cur->name, (const xmlChar *)"REVISION_COUNTER")) && (cur->ns == ns))
4797       {
4798          ranFunction->revisionCounter = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4799       }
4800
4801       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_EVENT_TRIGGER_STYLE_SUPPORTED")) && (cur->ns == ns))
4802       {
4803          ranFunction->numOfEventTriggerStyleSupported = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4804       }
4805
4806
4807       if ((!xmlStrcmp(cur->name, (const xmlChar *)"EVENT_TRIGGERED_STYLE_LIST")) && (cur->ns == ns))
4808       {
4809          child = cur->xmlChildrenNode;
4810          while(child != NULL)
4811          {
4812             if ((!xmlStrcmp(child->name, (const xmlChar *)"EVENT_TRIGGERED_STYLE")) && (child->ns == ns))
4813             {
4814                if(parseRicStyle(doc, ns, child,&ranFunction->eventTriggerStyleList[eventTriggerStyleIdx]) != ROK)
4815                {
4816                   return RFAILED;
4817                }
4818                eventTriggerStyleIdx++;
4819
4820             }
4821             child = child -> next;
4822          }
4823
4824       }
4825
4826       child = NULLP;
4827       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_REPORT_STYLE_SUPPORTED")) && (cur->ns == ns))
4828       {
4829          ranFunction->numOfReportStyleSupported = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4830       }
4831
4832       if ((!xmlStrcmp(cur->name, (const xmlChar *)"REPORT_STYLE_SUPPORTED_LIST")) && (cur->ns == ns))
4833       {
4834          child = cur->xmlChildrenNode;
4835          while(child != NULL)
4836          {
4837             if ((!xmlStrcmp(child->name, (const xmlChar *)"REPORT_STYLE")) && (child->ns == ns))
4838             {
4839                if(parseReportStyle(doc, ns, child,&ranFunction->reportStyleList[reportStyleIdx]) != ROK)
4840                {
4841                   return RFAILED;
4842                }
4843                reportStyleIdx++;
4844
4845             }
4846             child = child -> next;
4847          }
4848
4849       }
4850
4851       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RIC_INDICATION_HEADER_FORMAT")) && (cur->ns == ns))
4852       {
4853          ranFunction->ricIndicationHeaderFormat = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4854       }
4855
4856       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RIC_INDICATION_MESSAGE_FORMAT")) && (cur->ns == ns))
4857       {
4858          ranFunction->ricIndicationMessageFormat = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4859       }
4860       cur = cur -> next;
4861    }
4862    return ROK;
4863 }
4864
4865 /*******************************************************************
4866  *
4867  * @brief Fill E2 config Parameters
4868  *
4869  * @details
4870  *
4871  *    Function : parseE2ConfigParams
4872  *
4873  *    Functionality: Fill E2 config Parmeters
4874  *
4875  * @params[in] XML document pointer
4876  *             XML namespace
4877  *             Current node in XML
4878  *             Pointer to structure to be filled
4879  * @return ROK     - success
4880  *         RFAILED - failure
4881  *
4882  * ****************************************************************/
4883 uint8_t parseE2ConfigParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, E2apDb *e2apDb)
4884 {
4885    uint8_t tnlIdx=0,ranFuncIdx=0;
4886    xmlNodePtr child = NULLP;
4887
4888    memset(e2apDb, 0, sizeof(E2apDb));
4889    cur = cur->xmlChildrenNode;
4890    while (cur != NULL)
4891    {
4892       if ((!xmlStrcmp(cur->name, (const xmlChar *)"E2_NODE_ID")) && (cur->ns == ns))
4893       {
4894          e2apDb->e2NodeId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4895       }
4896
4897       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_TNL_ASSOC")) && (cur->ns == ns))
4898       {
4899          e2apDb->numOfTNLAssoc = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4900       }
4901
4902       if ((!xmlStrcmp(cur->name, (const xmlChar *)"TNL_ASSOC_LIST")) && (cur->ns == ns))
4903       {
4904          child = cur->xmlChildrenNode;
4905          while(child != NULL)
4906          {
4907             if ((!xmlStrcmp(child->name, (const xmlChar *)"TNL_ASSOC")) && (child->ns == ns))
4908             {
4909                if(parseTnlAssoc(doc, ns, child,&e2apDb->tnlAssoc[tnlIdx]) != ROK)
4910                {
4911                   return RFAILED;
4912                }
4913                tnlIdx++;
4914
4915             }
4916             child = child -> next;
4917          }
4918       }
4919
4920       if ((!xmlStrcmp(cur->name, (const xmlChar *)"NUM_OF_RAN_FUNCTION")) && (cur->ns == ns))
4921       {
4922          e2apDb->numOfRanFunction = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4923       }
4924
4925       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RAN_FUNCTION_LIST")) && (cur->ns == ns))
4926       {
4927          child = cur->xmlChildrenNode;
4928          while(child != NULL)
4929          {
4930             if ((!xmlStrcmp(child->name, (const xmlChar *)"RAN_FUNCTION")) && (child->ns == ns))
4931             {
4932                if(parseRanFunctionParams(doc, ns, child,&e2apDb->ranFunction[ranFuncIdx]) != ROK)
4933                {
4934                   return RFAILED;
4935                }
4936                cmLListInit(&e2apDb->ranFunction[ranFuncIdx].subscriptionList);
4937                ranFuncIdx++;
4938
4939             }
4940             child = child -> next;
4941          }
4942       }
4943
4944       cur = cur -> next;
4945    }
4946    return ROK;
4947 }
4948
4949 /*******************************************************************
4950  *
4951  * @brief Fill Global config Parameters
4952  *
4953  * @details
4954  *
4955  *    Function : parseGlobalConfigParams
4956  *
4957  *    Functionality: Fill Global config Parmeters
4958  *
4959  * @params[in] XML document pointer
4960  *             XML namespace
4961  *             Current node in XML
4962  *             Pointer to structure to be filled
4963  * @return ROK     - success
4964  *         RFAILED - failure
4965  *
4966  * ****************************************************************/
4967 uint8_t parseGlobalConfigParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur)
4968 {
4969
4970    memset(&gConfigInfo, 0, sizeof(GConfiguration));
4971    cur = cur->xmlChildrenNode;
4972    while (cur != NULL)
4973    {
4974
4975      if ((!xmlStrcmp(cur->name, (const xmlChar *)"RADIO_FRAME_DURATION")) && (cur->ns == ns))
4976      {
4977         gConfigInfo.gRadioFrameDuration = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4978      }
4979
4980      if ((!xmlStrcmp(cur->name, (const xmlChar *)"ODU_UE_THROUGHPUT_PRINT_TIME_INTERVAL")) && (cur->ns == ns))
4981      {
4982         gConfigInfo.gUeThrptTimeIntervl = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4983      }
4984
4985      if ((!xmlStrcmp(cur->name, (const xmlChar *)"ODU_SNSSAI_THROUGHPUT_PRINT_TIME_INTERVAL")) && (cur->ns == ns))
4986      {
4987         gConfigInfo.gSnssaiThrptTimeIntervl = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4988      }
4989
4990      if ((!xmlStrcmp(cur->name, (const xmlChar *)"PHY_DELTA_DL")) && (cur->ns == ns))
4991      {
4992         gConfigInfo.gPhyDeltaDl = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4993      }
4994
4995      if ((!xmlStrcmp(cur->name, (const xmlChar *)"PHY_DELTA_UL")) && (cur->ns == ns))
4996      {
4997         gConfigInfo.gPhyDeltaUl = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
4998      }
4999       cur = cur -> next;
5000    }
5001    return ROK;
5002 }
5003
5004 /*******************************************************************
5005  *
5006  * @brief Free the memory allocate for slice supported list 
5007  *
5008  * @details
5009  *
5010  *    Function : parseDuCfgParams
5011  *
5012  *    Functionality: Free the memory allocate for slice supported list 
5013  *
5014  * @return void
5015  *
5016  * ****************************************************************/
5017 void freeSliceSuppLst(SupportedSliceList *sliceSuppLst) 
5018 {
5019    uint8_t sliceIdx=0;
5020
5021    if(sliceSuppLst->numSupportedSlices&&sliceSuppLst->snssai)
5022    {
5023       for(sliceIdx=0;sliceIdx<sliceSuppLst->numSupportedSlices;sliceIdx++)
5024       {
5025          if(sliceSuppLst->snssai)
5026          {
5027             if(sliceSuppLst->snssai[sliceIdx])
5028             {
5029                DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, sliceSuppLst->snssai[sliceIdx], sizeof(Snssai));
5030             }
5031             DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, \
5032             sliceSuppLst->snssai, (sliceSuppLst->numSupportedSlices) * sizeof(Snssai*));
5033          }
5034       }
5035    }
5036 }
5037
5038 /*******************************************************************
5039  *
5040  * @brief Free the memory allocate in parseDuCfgParams 
5041  *
5042  * @details
5043  *
5044  *    Function : parseDuCfgParams
5045  *
5046  *    Functionality: Free the memory allocate in parseDuCfgParams
5047  *
5048  * @return void
5049  *
5050  * ****************************************************************/
5051 void freeDuCfgParams()
5052 {
5053    uint8_t ranFuncIdx=0,reportStyleIdx=0;
5054    uint8_t policyIdx = 0,memIdx=0;
5055    MacSliceRrmPolicy *rrmPolicy =NULLP;
5056    MacSliceCfgReq *macSliceCfgReq=NULLP;
5057    F1DuSysInfo *sysInfo;
5058    CsiRsCfg *csiRsCfg;
5059    RanFunction  *ranFunction;
5060    RicReportStyle  *ricReportStyle;
5061    CmLListCp  *measurementInfoList;
5062    CmLList *measInfoNode = NULLP;
5063
5064    if(duCfgParam.duName)
5065    {
5066       DU_FREE(duCfgParam.duName, strlen(duCfgParam.duName));
5067    }
5068    
5069    freeSliceSuppLst(&duCfgParam.macCellCfg.cellCfg.plmnInfoList[0].suppSliceList);
5070    csiRsCfg=&duCfgParam.macCellCfg.csiRsCfg;
5071    if(csiRsCfg->csiFreqDomainAlloc)
5072    {
5073       DU_FREE(csiRsCfg->csiFreqDomainAlloc, sizeof(uint8_t));
5074    }
5075    if(duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1Pdu)
5076    {
5077       DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, \
5078       duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1Pdu, duCfgParam.macCellCfg.cellCfg.sib1Cfg.sib1PduLen);
5079    }
5080
5081    if(duCb.e2apDb.numOfRanFunction)
5082    {
5083       for(ranFuncIdx=0;ranFuncIdx<duCb.e2apDb.numOfRanFunction;ranFuncIdx++)
5084       {
5085          ranFunction=&duCb.e2apDb.ranFunction[ranFuncIdx];
5086          for(reportStyleIdx=0;reportStyleIdx<ranFunction->numOfReportStyleSupported;reportStyleIdx++)
5087          {
5088             ricReportStyle=&ranFunction->reportStyleList[reportStyleIdx];
5089             measurementInfoList=&ricReportStyle->measurementInfoList;
5090             CM_LLIST_FIRST_NODE(measurementInfoList, measInfoNode);
5091             while(measInfoNode)
5092             {
5093                MeasurementInfoForAction *measurementInfoForAction;
5094                measurementInfoForAction= (MeasurementInfoForAction*)measInfoNode->node;
5095                cmLListDelFrm(measurementInfoList, measInfoNode);
5096                DU_FREE(measurementInfoForAction, sizeof(MeasurementInfoForAction));
5097                DU_FREE(measInfoNode, sizeof(CmLList));
5098                CM_LLIST_FIRST_NODE(measurementInfoList, measInfoNode);
5099             }
5100          }
5101       }
5102    }
5103    
5104    freeSliceSuppLst(&duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.srvdPlmn[0].taiSliceSuppLst);
5105    sysInfo=&duCfgParam.srvdCellLst[0].duSysInfo;
5106    if(sysInfo->mibMsg)
5107    {
5108       DU_FREE(sysInfo->mibMsg, sysInfo->mibLen);
5109    }
5110    if(sysInfo->sib1Msg)
5111    {
5112       DU_FREE(sysInfo->sib1Msg, sysInfo->sib1Len);
5113    }
5114
5115    macSliceCfgReq=&duCfgParam.tempSliceCfg;
5116    if(macSliceCfgReq->listOfRrmPolicy)
5117    {
5118       for(policyIdx = 0; policyIdx < macSliceCfgReq->numOfRrmPolicy; policyIdx++)
5119       {
5120          if (macSliceCfgReq->listOfRrmPolicy[policyIdx])
5121          {
5122             rrmPolicy=macSliceCfgReq->listOfRrmPolicy[policyIdx];
5123             if(rrmPolicy->rRMPolicyMemberList)
5124             {
5125                for(memIdx = 0; memIdx < rrmPolicy->numOfRrmPolicyMem; memIdx++)
5126                {
5127                   if (rrmPolicy->rRMPolicyMemberList[memIdx])
5128                   {
5129                      DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,\
5130                            rrmPolicy->rRMPolicyMemberList[memIdx], sizeof(RrmPolicyMemberList));
5131                   }
5132                }
5133                DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL,rrmPolicy->rRMPolicyMemberList,\
5134                      rrmPolicy->numOfRrmPolicyMem * sizeof(RrmPolicyMemberList*));
5135             }
5136
5137             DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, \
5138                   macSliceCfgReq->listOfRrmPolicy[policyIdx], sizeof(MacSliceRrmPolicy));
5139          }
5140       }
5141       DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, \
5142             macSliceCfgReq->listOfRrmPolicy,  macSliceCfgReq->numOfRrmPolicy * sizeof(MacSliceRrmPolicy*));
5143    }
5144 }
5145
5146
5147 /*******************************************************************
5148  *
5149  * @brief Fill DU Config Parmeters 
5150  *
5151  * @details
5152  *
5153  *    Function : parseDuCfgParams
5154  *
5155  *    Functionality:
5156  *
5157  * @params[in] XML document pointer
5158  *             XML namespace
5159  *             Current node in XML
5160  * @return ROK     - success
5161  *         RFAILED - failure
5162  *
5163  * ****************************************************************/
5164 uint8_t parseDuCfgParams(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur)
5165 {
5166    uint8_t ret=ROK;
5167    char *tempDuName = "";
5168    char *duIpV4Addr;
5169    char *cuIpV4Addr;
5170    char *ricIpV4Addr;
5171    CmInetIpAddr duIp;
5172    CmInetIpAddr cuIp;
5173    CmInetIpAddr ricIp;
5174
5175    cur = cur->xmlChildrenNode;
5176    while(cur != NULL)
5177    {
5178       if ((!xmlStrcmp(cur->name, (const xmlChar *)"THREAD_AFFINITY")) && (cur->ns == ns))
5179       {
5180 #ifdef THREAD_AFFINITY      
5181          if(parseThreadAffinity(doc, ns, cur, &duCfgParam.threadInfo) != ROK)
5182          {
5183             ret = RFAILED;
5184             break;
5185          }
5186 #endif         
5187       }
5188
5189       if ((!xmlStrcmp(cur->name, (const xmlChar *)"GNB_ID")) && (cur->ns == ns))
5190       {
5191          duCb.gnbId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5192       }
5193
5194       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_ID")) && (cur->ns == ns))
5195       {
5196          duCfgParam.duId = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5197       }
5198
5199       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_NAME")) && (cur->ns == ns))
5200       {
5201          tempDuName =(char*) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5202          DU_ALLOC(duCfgParam.duName, strlen(tempDuName));
5203          if(!duCfgParam.duName)
5204          {
5205             DU_LOG("\nERROR --> DU_APP: %s: Memory allocation failed at line %d", __func__, __LINE__);
5206             ret = RFAILED;
5207             break;
5208          }
5209          strcpy((char*)duCfgParam.duName, tempDuName);
5210       }
5211
5212       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_NUM_DRB")) && (cur->ns == ns))
5213       {
5214          duCfgParam.maxNumDrb = atoi((char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1));
5215       }
5216
5217 #ifdef O1_ENABLE
5218       if( getStartupConfig(&g_cfg) != ROK )
5219       {
5220          RETVALUE(RFAILED);
5221       }
5222       cmInetAddr((S8*)g_cfg.DU_IPV4_Addr, &duIp);
5223       cmInetAddr((S8*)g_cfg.CU_IPV4_Addr, &cuIp);
5224       cmInetAddr((S8*)g_cfg.RIC_IPV4_Addr, &ricIp);
5225
5226 #else
5227       if ((!xmlStrcmp(cur->name, (const xmlChar *)"DU_IP_V4_ADDR")) && (cur->ns == ns))
5228       {
5229          duIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5230          cmInetAddr(duIpV4Addr, &(duIp));
5231       }
5232
5233       if ((!xmlStrcmp(cur->name, (const xmlChar *)"CU_IP_V4_ADDR")) && (cur->ns == ns))
5234       {
5235          cuIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5236          cmInetAddr(cuIpV4Addr, &(cuIp));
5237       }
5238
5239       if ((!xmlStrcmp(cur->name, (const xmlChar *)"RIC_IP_V4_ADDR")) && (cur->ns == ns))
5240       {
5241          ricIpV4Addr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
5242          cmInetAddr(ricIpV4Addr, &(ricIp));
5243       }
5244 #endif
5245
5246       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SCTP")) && (cur->ns == ns))
5247       {
5248          if(parseSctpParams(doc, ns, cur, &duCfgParam.sctpParams) != ROK)
5249          {
5250             ret = RFAILED;
5251             break;
5252          }
5253          duCfgParam.sctpParams.duIpAddr.ipV4Pres = true;
5254          duCfgParam.sctpParams.duIpAddr.ipV4Addr = duIp;
5255          duCfgParam.sctpParams.cuIpAddr.ipV4Pres = true;
5256          duCfgParam.sctpParams.cuIpAddr.ipV4Addr = cuIp;
5257          duCfgParam.sctpParams.ricIpAddr.ipV4Pres = true;
5258          duCfgParam.sctpParams.ricIpAddr.ipV4Addr = ricIp;
5259       }
5260
5261       if ((!xmlStrcmp(cur->name, (const xmlChar *)"EGTP")) && (cur->ns == ns))
5262       {
5263          if(parseEgtpParams(doc, ns, cur, &duCfgParam.egtpParams) != ROK)
5264          {
5265             ret = RFAILED;
5266             break;
5267          }
5268          duCfgParam.egtpParams.localIp.ipV4Addr = duIp;
5269          duCfgParam.egtpParams.localIp.ipV4Pres = true;
5270          duCfgParam.egtpParams.destIp.ipV4Pres = true;
5271          duCfgParam.egtpParams.destIp.ipV4Addr = cuIp;
5272          duCfgParam.egtpParams.maxTunnelId = duCfgParam.maxNumDrb * MAX_NUM_UE; 
5273       }
5274
5275       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MIB_PARAMS")) && (cur->ns == ns))
5276       {
5277          if(parseMibParams(doc, ns, cur, &duCfgParam.mibParams) != ROK)
5278          {
5279             ret = RFAILED;
5280             break;
5281          }
5282       }
5283
5284       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SIB1_PARAMS")) && (cur->ns == ns))
5285       {
5286          if(parseSib1Params(doc, ns, cur, &duCfgParam.sib1Params) != ROK)
5287          {
5288             ret = RFAILED;
5289             break;
5290          }
5291       }
5292
5293       if ((!xmlStrcmp(cur->name, (const xmlChar *)"F1_DU_SRVD_CELL_INFO")) && (cur->ns == ns))
5294       {
5295          if(parseF1DuServedCellInfo(doc, ns, cur, &duCfgParam.srvdCellLst[0]) != ROK)
5296          {
5297             ret = RFAILED;
5298             break;
5299          }
5300       }
5301
5302       if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAC_CELL_CFG")) && (cur->ns == ns))
5303       {
5304          if(parseMacCellCfg(doc, ns, cur, &duCfgParam.macCellCfg) != ROK)
5305          {
5306             ret = RFAILED;
5307             break;
5308          }
5309       }
5310
5311 #ifndef O1_ENABLE
5312       if ((!xmlStrcmp(cur->name, (const xmlChar *)"SLICE_CFG")) && (cur->ns == ns))
5313       {
5314          if(parseMacSliceCfgReq(doc, ns, cur, &duCfgParam.tempSliceCfg) != ROK)
5315          {
5316             ret = RFAILED;
5317             break;
5318          }
5319       }
5320 #endif      
5321
5322       if((!xmlStrcmp(cur->name, (const xmlChar *)"DU_TIMER_INFO")) && (cur->ns == ns))
5323       {
5324          if(parseDuTimerParams(doc, ns, cur, &duCb.duTimersInfo) != ROK)
5325          {
5326             ret = RFAILED;
5327             break;
5328          }
5329       }
5330
5331       if((!xmlStrcmp(cur->name, (const xmlChar *)"E2AP_CFG")) && (cur->ns == ns))
5332       {
5333          if(parseE2ConfigParams(doc, ns, cur, &duCb.e2apDb) != ROK)
5334          {
5335             ret = RFAILED;
5336             break;
5337          }
5338          else
5339          {
5340             cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.e2SetupTimer), 1);
5341             cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.ricServiceUpdateTimer.timer), 1);
5342             cmInitTimers(&(duCb.e2apDb.e2TimersInfo.e2Timers.e2NodeConfigUpdate.timer), 1);
5343          }
5344       }
5345       
5346       if((!xmlStrcmp(cur->name, (const xmlChar *)"GLOBAL_CFG")) && (cur->ns == ns))
5347       {
5348          if(parseGlobalConfigParams(doc, ns, cur) != ROK)
5349          {
5350             ret = RFAILED;
5351             break;
5352          }
5353       }
5354
5355       cur = cur -> next;
5356    }
5357
5358    if(ret != ROK)
5359    {
5360       freeDuCfgParams();
5361    }
5362    return ret;
5363 }
5364
5365 /*******************************************************************
5366  *
5367  * @brief Reads config and posts message to du_app on completion
5368  *
5369  * @details
5370  *
5371  *    Function : duReadCfg
5372  *
5373  *    Functionality:
5374  *      - Reads configuration from xml file and stores in DB
5375  *      - Post to du_app for further processing
5376  *
5377  * @params[in] void
5378  * @return ROK     - success
5379  *         RFAILED - failure
5380  *
5381  * ****************************************************************/
5382 uint8_t duReadCfg()
5383 {
5384    const char *filename = "../build/config/odu_config.xml";
5385    xmlDocPtr doc = NULLP;
5386    xmlNodePtr cur = NULLP;
5387    xmlNsPtr ns = NULLP;
5388    Pst pst;
5389    Buffer *mBuf;
5390
5391    /* Parse, store and print DU configurations from XML file */
5392    doc = xmlParseFile(filename);
5393    if(doc == NULL)
5394    {
5395       DU_LOG("\nERROR  --> DU_APP: Failed to parse the XML file");
5396       return RFAILED;
5397    }
5398
5399    cur = xmlDocGetRootElement(doc);
5400    ns = xmlSearchNsByHref(doc, cur, (const xmlChar *)"urn:o-ran:odu:configuration");
5401    if(ns == NULL)
5402    {
5403       DU_LOG("\nERROR  --> DU_APP: XML Namespace not found.\n");
5404       xmlFreeDoc(doc);
5405       xmlCleanupParser();
5406       return RFAILED;
5407    }
5408
5409    parseDuCfgParams(doc, ns, cur);
5410    printDuConfig();
5411
5412    xmlFreeDoc(doc);
5413    xmlCleanupParser();
5414
5415    /* Fill pst structure */
5416    memset(&(pst), 0, sizeof(Pst));
5417    pst.srcEnt = (Ent)ENTDUAPP;
5418    pst.srcInst = (Inst)DU_INST;
5419    pst.srcProcId = DU_PROC;
5420    pst.dstEnt = pst.srcEnt;
5421    pst.dstInst = pst.srcInst;
5422    pst.dstProcId = pst.srcProcId;
5423    pst.event = EVTCFG;
5424    pst.selector = ODU_SELECTOR_TC;
5425    pst.pool= DU_POOL;
5426
5427
5428    /* Timer Registration request to system services */
5429    if (ODU_REG_TMR_MT(pst.srcEnt, pst.srcInst, duCb.duTimersInfo.tmrRes, duActvTmr) != ROK)
5430    {
5431       DU_LOG("\nERROR  -->  DU_APP : Failed to register timer");
5432       return RFAILED;
5433    }   
5434               
5435    if(ODU_GET_MSG_BUF(DFLT_REGION, DU_POOL, &mBuf) != ROK)
5436    {
5437       DU_LOG("\nERROR  -->  DU_APP : Memory allocation failed in duReadCfg");
5438       return RFAILED;
5439    }
5440
5441    if (ODU_POST_TASK(&pst, mBuf) != ROK)
5442    {
5443       DU_LOG("\nERROR  -->  DU_APP : ODU_POST_TASK failed in duReadCfg");
5444       return RFAILED;
5445    }
5446
5447    return ROK;
5448 }
5449
5450 /*******************************************************************
5451  *
5452  * @brief Prints all DU Configuration
5453  *
5454  * @details
5455  *
5456  *    Function : printDuConfig
5457  *
5458  *    Functionality:
5459  *      - Prints all DU configurations
5460  *
5461  * @params[in] void
5462  * @return void
5463  *
5464  * ****************************************************************/
5465 void printDuConfig()
5466 {
5467    
5468    uint16_t ranFuncIdx;
5469    uint8_t reportStyleIdx =0, eventStyleIdx=0, tnlIdx=0;
5470    uint8_t sliceIdx = 0, pfIdx = 0, rsrcIdx = 0, ssbMaskIdx = 0, fdmIdx = 0;
5471    uint8_t monitoringSymbIdx = 0, poIdx = 0, policyIdx = 0, memIdx = 0;
5472    __attribute__((unused)) SctpParams *sctp;
5473    __attribute__((unused)) F1EgtpParams *egtp;
5474    __attribute__((unused)) MibParams *mib;
5475    __attribute__((unused)) F1RrcVersion *f1RrcVersion;
5476    F1DuCellInfo *f1DuCellInfo;
5477    F1CellInfo *f1CellInfo;
5478    __attribute__((unused)) F1DuSysInfo *duSysInfo;
5479    __attribute__((unused)) F1BrdcstPlmnInfo *brdcstPlmnInfo;
5480    NrModeInfo *nrModeInfo; 
5481    __attribute__((unused)) F1NrFddInfo *f1NrFddInfo;
5482    F1SrvdPlmn *srvdPlmn;
5483    SupportedSliceList *sliceSuppLst;
5484    MacCellCfg *macCellCfg;
5485    __attribute__((unused)) CarrierCfg *carrierCfg;
5486    CellCfg *cellCfg;
5487    PlmnInfoList *plmnInfoList;
5488    Sib1CellCfg *sib1Cfg;
5489    SchPageCfg *pageCfg;
5490    __attribute__((unused)) PdcchConfigSib1 *pdcchConfigSib1;
5491    BwpDlConfig *bwpDlCfg;
5492    __attribute__((unused)) BwpParams *bwp;
5493    PdcchConfigCommon *pdcchCfgCmn;
5494    SearchSpaceCfg *searchSpaceCfg;
5495    __attribute__((unused)) CandidatesInfo *candidateInfo;
5496    PdschConfigCommon *pdschCfgCmn;
5497    __attribute__((unused)) PdschCfgCommTimeDomRsrcAlloc *pdschCmnTimeDomRsrcAlloc;
5498    BwpUlConfig *bwpUlCfg;
5499    __attribute__((unused)) PucchConfigCommon *pucchCfgCmn;
5500    PuschConfigCommon *puschCfgCmn;
5501    __attribute__((unused)) PuschTimeDomRsrcAlloc *puschTimeDomRsrcAlloc;
5502    __attribute__((unused)) SsbCfg *ssbCfg;
5503    __attribute__((unused)) CsiRsCfg *csiRsCfg;
5504    PrachCfg *prachCfg;
5505    __attribute__((unused)) PrachFdmInfo *prachFdmInfo;
5506    __attribute__((unused)) PrecodingConf *precodCfg;
5507    __attribute__((unused)) BeamformingConf *beamFormingCfg;
5508    Sib1Params *sib1Params;
5509    __attribute__((unused)) SiSchedInfo *siSchedInfo;
5510    SrvCellCfgCommSib *srvCellCfgCmnSib;
5511    DlCfgCommon *dlCfgCmn;
5512    PdcchCfgCommon *pdcchCfgCommon;
5513    PdschCfgCommon *pdschCfgCommon;
5514    __attribute__((unused)) PdschTimeDomainRsrcAlloc *pdschTimeDomRsrcAlloc;
5515    __attribute__((unused)) BcchCfg *bcchCfg;
5516    __attribute__((unused)) PcchCfg *pcchCfg;
5517    UlCfgCommon *ulCfgCmn;
5518    RachCfgCommon *rachCfgCmn;
5519    PuschCfgCommon *puschCfgCommon;
5520    __attribute__((unused)) PuschCfgCmnTimeDomAlloc *puschCmnTimeDomRsrsAlloc;
5521    PucchCfgCommon *pucchCfgCommon;
5522    __attribute__((unused)) TddUlDlCfgCommon *tddUlDlCfgCmn;
5523    MacSliceCfgReq *macSliceCfg;
5524    MacSliceRrmPolicy *rrmPolicy;
5525    __attribute__((unused)) RrmPolicyRatio *rrmPolicyRatio;
5526    __attribute__((unused)) RrmPolicyMemberList *rrmPolicyMemberList;
5527    CmLList *node;
5528    E2apDb *e2apDb;
5529    RanFunction *ranFunc;
5530    CmLListCp *measurementInfoList;
5531    MeasurementInfoForAction *measurementInfoForAction;
5532 #ifdef NR_TDD
5533    F1NrTddInfo *f1NrTddInfo;
5534    TDDCfg *tddCfg;
5535 #endif
5536
5537    DU_LOG("\n ** DU CONFIGURATION ** \n");
5538    DU_LOG("DU ID %d\n", duCfgParam.duId);
5539    DU_LOG("DU Name %s\n", duCfgParam.duName);
5540
5541    DU_LOG("\n ** Thread Affinity ** \n");
5542    DU_LOG("DU APP CORE ID %d\n", duCfgParam.threadInfo.duAppCoreId);
5543    DU_LOG("EGTP CORE ID %d\n", duCfgParam.threadInfo.egtpCoreId);
5544    DU_LOG("SCTP CORE ID %d\n", duCfgParam.threadInfo.sctpCoreId);
5545    DU_LOG("RLC-UL CORE ID %d\n", duCfgParam.threadInfo.rlcUlCoreId);
5546    DU_LOG("RLC-DL and MAC CORE ID %d\n", duCfgParam.threadInfo.rlcMacCoreId);
5547    DU_LOG("SCH CORE ID %d\n", duCfgParam.threadInfo.schCoreId);
5548    DU_LOG("Lower MAC CORE ID %d\n", duCfgParam.threadInfo.lwrMacCoreId);
5549
5550    DU_LOG("MAX NUM DRB %d\n", duCfgParam.maxNumDrb);
5551
5552    sctp = &duCfgParam.sctpParams;
5553    DU_LOG("\n ** SCTP PARAMETER ** \n");
5554    DU_LOG("DU IPv4 Address present %u\n", sctp->duIpAddr.ipV4Pres);
5555    DU_LOG("DU IP Address %u\n", sctp->duIpAddr.ipV4Addr);
5556    DU_LOG("CU IPv4 Address present %u\n", sctp->cuIpAddr.ipV4Pres);
5557    DU_LOG("CU IP Address %u\n", sctp->cuIpAddr.ipV4Addr);
5558    DU_LOG("RIC IPv4 Address present %u\n", sctp->ricIpAddr.ipV4Pres);
5559    DU_LOG("RIC IP Address %u\n", sctp->ricIpAddr.ipV4Addr);
5560    DU_LOG("SCTP Port at DU for F1 Interface %d\n", sctp->duPort[F1_INTERFACE]);
5561    DU_LOG("SCTP Port at CU for F1 Interface %d\n", sctp->cuPort);
5562    DU_LOG("SCTP Port at DU for E2 Interface %d\n", sctp->duPort[E2_INTERFACE]);
5563    DU_LOG("SCTP Port at RIC for E2 Interface %d\n", sctp->ricPort);
5564
5565    egtp = &duCfgParam.egtpParams;
5566    DU_LOG("\n ** EGTP PARAMETER ** \n");
5567    DU_LOG("DU IP Address %d\n", egtp->localIp.ipV4Addr);
5568    DU_LOG("CU IP Address %d\n", egtp->destIp.ipV4Addr);
5569    DU_LOG("EGTP Port at DU %d\n", egtp->localPort);
5570    DU_LOG("EGTP Port at CU %d\n", egtp->destPort);
5571    DU_LOG("Minimum Tunnel ID %d\n", egtp->minTunnelId);
5572    DU_LOG("Maximum Tunnel ID %d\n",egtp->maxTunnelId);
5573
5574    mib = &duCfgParam.mibParams;
5575    DU_LOG("\n ** MIB PARAMETER ** \n");
5576    DU_LOG("System Frame Number %d\n", mib->sysFrmNum);
5577    DU_LOG("Subcarrier Spacing Common %ld\n", mib->subCarrierSpacingCommon);
5578    DU_LOG("SSB Subcarrier Offset %ld\n", mib->ssb_SubcarrierOffset);
5579    DU_LOG("DMRS Type-A Position %ld\n", mib->dmrs_TypeA_Position);
5580    DU_LOG("Control Resource Set Zero %ld\n", mib->controlResourceSetZero);
5581    DU_LOG("Search Space Zero %ld\n", mib->searchSpaceZero);
5582    DU_LOG("Cell Barred %ld\n", mib->cellBarred);
5583    DU_LOG("Intra Frequency Reselection %ld\n", mib->intraFreqReselection);
5584    
5585    duSysInfo = &duCfgParam.srvdCellLst[0].duSysInfo;
5586    DU_LOG("\n ** DU System Information ** \n");
5587    DU_LOG("MIB length %d\n", duSysInfo->mibLen);
5588    DU_LOG("MIB message  %s\n", duSysInfo->mibMsg);
5589    DU_LOG("SIB1 length  %d\n", duSysInfo->sib1Len);
5590    DU_LOG("SIB1 message  %s\n", duSysInfo->sib1Msg);
5591    
5592    f1DuCellInfo = &duCfgParam.srvdCellLst[0].duCellInfo;
5593    DU_LOG("\n ** DU Cell Information ** \n");
5594
5595    f1CellInfo = &f1DuCellInfo->cellInfo;
5596    DU_LOG("NR PCI %d\n", f1CellInfo->nrPci);
5597    DU_LOG("DU TAC %d\n", f1DuCellInfo->tac);   
5598    DU_LOG("EPS TAC %d\n", f1DuCellInfo->epsTac);
5599    DU_LOG("Measurement Time Configuration Duration %d\n", f1DuCellInfo->measTimeCfgDuration);
5600    DU_LOG("Cell Direction %d\n", f1DuCellInfo->cellDir);
5601    DU_LOG("Cell Type %d\n", f1DuCellInfo->cellType);
5602
5603    DU_LOG("\n ** Cell  Info : NR CGI ** \n");
5604    DU_LOG("Cell Id %d\n",f1CellInfo->nrCgi.cellId);
5605    DU_LOG("PLMN : mcc[0] %d\n", f1CellInfo->nrCgi.plmn.mcc[0]);
5606    DU_LOG("PLMN : mcc[1] %d\n", f1CellInfo->nrCgi.plmn.mcc[1]);
5607    DU_LOG("PLMN : mcc[2] %d\n", f1CellInfo->nrCgi.plmn.mcc[2]);
5608    DU_LOG("PLMN : mnc[0] %d\n", f1CellInfo->nrCgi.plmn.mnc[0]);
5609    DU_LOG("PLMN : mnc[1] %d\n", f1CellInfo->nrCgi.plmn.mnc[1]);
5610    DU_LOG("PLMN : mnc[2] %d\n", f1CellInfo->nrCgi.plmn.mnc[2]);
5611
5612    srvdPlmn = &f1CellInfo->srvdPlmn[0];
5613    DU_LOG("\n ** Cell  Info : Served PLMN ** \n");
5614    DU_LOG("PLMN : mcc[0] %d\n", srvdPlmn->plmn.mcc[0]);
5615    DU_LOG("PLMN : mcc[1] %d\n", srvdPlmn->plmn.mcc[1]);
5616    DU_LOG("PLMN : mcc[2] %d\n", srvdPlmn->plmn.mcc[2]);
5617    DU_LOG("PLMN : mnc[0] %d\n", srvdPlmn->plmn.mnc[0]);
5618    DU_LOG("PLMN : mnc[1] %d\n", srvdPlmn->plmn.mnc[1]);
5619    DU_LOG("PLMN : mnc[2] %d\n", srvdPlmn->plmn.mnc[2]);
5620    DU_LOG("EXT_PLMN : mcc[0] %d\n", srvdPlmn->extPlmn.mcc[0]);
5621    DU_LOG("EXT_PLMN : mcc[1] %d\n", srvdPlmn->extPlmn.mcc[1]);
5622    DU_LOG("EXT_PLMN : mcc[2] %d\n", srvdPlmn->extPlmn.mcc[2]);
5623    DU_LOG("EXT_PLMN : mnc[0] %d\n", srvdPlmn->extPlmn.mnc[0]);
5624    DU_LOG("EXT_PLMN : mnc[1] %d\n", srvdPlmn->extPlmn.mnc[1]);
5625    DU_LOG("EXT_PLMN : mnc[2] %d\n", srvdPlmn->extPlmn.mnc[2]);
5626
5627    sliceSuppLst = &srvdPlmn->taiSliceSuppLst;
5628    DU_LOG("\n ** Cell  Info : Served PLMN : Supported Slice List ** \n");
5629    DU_LOG("Number of Slices supported %d\n", sliceSuppLst->numSupportedSlices);
5630    for (sliceIdx = 0; sliceIdx < sliceSuppLst->numSupportedSlices; sliceIdx++)
5631    {
5632       DU_LOG("Slice\n");
5633       DU_LOG("\tSST %d\n", (*sliceSuppLst->snssai[sliceIdx]).sst);
5634       DU_LOG("\tSD %d %d %d\n", (*sliceSuppLst->snssai[sliceIdx]).sd[0], (*sliceSuppLst->snssai[sliceIdx]).sd[1], \
5635          (*sliceSuppLst->snssai[sliceIdx]).sd[2]);
5636    }
5637    
5638    brdcstPlmnInfo = &f1DuCellInfo->brdcstPlmnInfo[0];
5639    DU_LOG("\n ** DU Cell Information : Broadcast PLMN Info ** \n");
5640    DU_LOG("TAC %d\n", brdcstPlmnInfo->tac);
5641    DU_LOG("NR Cell Id %d\n", brdcstPlmnInfo->nrCellId);
5642    DU_LOG("RANAC %d\n", brdcstPlmnInfo->ranac);
5643
5644    DU_LOG("PLMN : mcc[0] %d\n", brdcstPlmnInfo->plmn[0].mcc[0]);
5645    DU_LOG("PLMN : mcc[1] %d\n", brdcstPlmnInfo->plmn[0].mcc[1]);
5646    DU_LOG("PLMN : mcc[2] %d\n", brdcstPlmnInfo->plmn[0].mcc[2]);
5647    DU_LOG("PLMN : mnc[0] %d\n", brdcstPlmnInfo->plmn[0].mnc[0]);
5648    DU_LOG("PLMN : mnc[1] %d\n", brdcstPlmnInfo->plmn[0].mnc[1]);
5649    DU_LOG("PLMN : mnc[2] %d\n", brdcstPlmnInfo->plmn[0].mnc[2]);
5650     
5651    DU_LOG("EXT_PLMN : mcc[0] %d\n", brdcstPlmnInfo->extPlmn[0].mcc[0]);
5652    DU_LOG("EXT_PLMN : mcc[1] %d\n", brdcstPlmnInfo->extPlmn[0].mcc[1]);
5653    DU_LOG("EXT_PLMN : mcc[2] %d\n", brdcstPlmnInfo->extPlmn[0].mcc[2]);
5654    DU_LOG("EXT_PLMN : mnc[0] %d\n", brdcstPlmnInfo->extPlmn[0].mnc[0]);
5655    DU_LOG("EXT_PLMN : mnc[1] %d\n", brdcstPlmnInfo->extPlmn[0].mnc[1]);
5656    DU_LOG("EXT_PLMN : mnc[2] %d\n", brdcstPlmnInfo->extPlmn[0].mnc[2]);
5657
5658    nrModeInfo = &f1DuCellInfo->f1Mode;
5659    f1NrFddInfo = &nrModeInfo->mode.fdd;
5660    DU_LOG("\n ** DU Cell Information : NR Mode Info ** \n");
5661 #ifndef NR_TDD   
5662    DU_LOG("\n ** NR Mode Info : FDD ** \n");
5663    DU_LOG("\n ** NR Mode Info : FDD : UL NR Frequency ** \n");
5664    DU_LOG("NR ARFCN %d\n", f1NrFddInfo->ulNrFreqInfo.nrArfcn);
5665    DU_LOG("SUL : ARFCN %d\n",f1NrFddInfo->ulNrFreqInfo.sulInfo.sulArfcn);
5666    DU_LOG("SUL : Transmission BW Subcarrier Spacing %d\n", f1NrFddInfo->ulNrFreqInfo.sulInfo.sulTxBw.nrScs);
5667    DU_LOG("SUL : Number of RBs in Transmission BW %d\n", f1NrFddInfo->ulNrFreqInfo.sulInfo.sulTxBw.nrb);
5668    DU_LOG("NR Frequency Band %d\n", f1NrFddInfo->ulNrFreqInfo.freqBand[0].nrFreqBand);
5669    DU_LOG("SUL Band %d\n", f1NrFddInfo->ulNrFreqInfo.freqBand[0].sulBand[0]);
5670
5671    DU_LOG("\n ** NR Mode Info : FDD : DL NR Frequency ** \n");
5672    DU_LOG("NR ARFCN %d\n", f1NrFddInfo->dlNrFreqInfo.nrArfcn);
5673    DU_LOG("SUL : ARFCN %d\n",f1NrFddInfo->dlNrFreqInfo.sulInfo.sulArfcn);
5674    DU_LOG("SUL : Transmission BW Subcarrier Sapcing %d\n", f1NrFddInfo->dlNrFreqInfo.sulInfo.sulTxBw.nrScs);
5675    DU_LOG("SUL : Number of RBs in Transmission BW %d\n", f1NrFddInfo->dlNrFreqInfo.sulInfo.sulTxBw.nrb);
5676    DU_LOG("NR Frequency Band %d\n", f1NrFddInfo->dlNrFreqInfo.freqBand[0].nrFreqBand);
5677    DU_LOG("SUL Band %d\n", f1NrFddInfo->dlNrFreqInfo.freqBand[0].sulBand[0]);
5678
5679    DU_LOG("\n ** NR Mode Info : FDD : UL Transmission Bandwidth ** \n");
5680    DU_LOG("Subscarrier spacing %d\n", f1NrFddInfo->ulTxBw.nrScs);
5681    DU_LOG("Number of RBs %d\n", f1NrFddInfo->ulTxBw.nrb);
5682   
5683    DU_LOG("\n ** NR Mode Info : FDD : DL Transmission Bandwidth ** \n");
5684    DU_LOG("Subcarrier Spacing %d\n", f1NrFddInfo->dlTxBw.nrScs);
5685    DU_LOG("Number of RBs %d\n", f1NrFddInfo->dlTxBw.nrb);
5686
5687 #else
5688
5689    f1NrTddInfo = &nrModeInfo ->mode.tdd; 
5690
5691    DU_LOG("\n ** NR Mode Info : TDD : NR Frequency ** \n");
5692    DU_LOG("NR ARFCN %d\n", f1NrTddInfo->nrFreqInfo.nrArfcn);
5693    DU_LOG("SUL : ARFCN %d\n",f1NrTddInfo->nrFreqInfo.sulInfo.sulArfcn);
5694    DU_LOG("SUL : Transmission BW Subscarrier Spacing %d\n", f1NrTddInfo->nrFreqInfo.sulInfo.sulTxBw.nrScs);
5695    DU_LOG("SUL : Number of RBs in Transmission BW %d\n", f1NrTddInfo->nrFreqInfo.sulInfo.sulTxBw.nrb);
5696    DU_LOG("NR Frequency Band %d\n", f1NrTddInfo->nrFreqInfo.freqBand[0].nrFreqBand);
5697    DU_LOG("SUL Band %d\n", f1NrTddInfo->nrFreqInfo.freqBand[0].sulBand[0]);
5698
5699    DU_LOG("\n ** NR Mode Info : TDD : NR Transmission Bandwidth ** \n");
5700    DU_LOG("Subcarrier Spacing %d\n", f1NrTddInfo->nrTxBw.nrScs);
5701    DU_LOG("Number of RBs %d\n", f1NrTddInfo->nrTxBw.nrb);
5702 #endif
5703
5704    macCellCfg = &duCfgParam.macCellCfg;
5705    DU_LOG("\n ** MAC CELL CONFIGURATION ** \n");
5706    DU_LOG("Cell Id %d\n", macCellCfg->cellId);
5707
5708    DU_LOG("\n ** MAC Cell Configuration : Carrier Configuration ** \n");
5709    carrierCfg = &macCellCfg ->carrCfg;
5710    DU_LOG("DL Bandwidth %d\n", carrierCfg->dlBw);
5711    DU_LOG("DL ARFCN %d\n", carrierCfg->arfcnDL);
5712    DU_LOG("UL Bandwidth %d\n", carrierCfg->ulBw);
5713    DU_LOG("UL ARFCN %d\n", carrierCfg->arfcnUL);
5714    DU_LOG("Number of Transmission Antenna %d\n", carrierCfg->numTxAnt);
5715    DU_LOG("Number of Received Antenna %d\n", carrierCfg->numRxAnt);
5716
5717    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration ** \n");
5718    cellCfg = &macCellCfg ->cellCfg;
5719    DU_LOG("Operational State %d\n", cellCfg->opState);
5720    DU_LOG("Administration State %d\n", cellCfg->adminState);
5721    DU_LOG("Cell Current State %d\n", cellCfg->cellState);
5722    DU_LOG("NR PCI %d\n", cellCfg->phyCellId);
5723    DU_LOG("TAC: %d\n", cellCfg->tac);
5724    DU_LOG("SSB Freqeuncy %d\n", cellCfg->ssbFreq);
5725    DU_LOG("Subcarrier Spacing: %d\n", cellCfg->subCarrSpacing);
5726    DU_LOG("Duplex Mode %d\n", cellCfg->dupType);
5727
5728    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : PLMN Info List ** \n");
5729    plmnInfoList = &cellCfg ->plmnInfoList[0];
5730    DU_LOG("PLMN : mcc[0] %d\n", plmnInfoList->plmn.mcc[0]);
5731    DU_LOG("PLMN : mcc[1] %d\n", plmnInfoList->plmn.mcc[1]);
5732    DU_LOG("PLMN : mcc[2] %d\n", plmnInfoList->plmn.mcc[2]);
5733    DU_LOG("PLMN : mnc[0] %d\n", plmnInfoList->plmn.mnc[0]);
5734    DU_LOG("PLMN : mnc[1] %d\n", plmnInfoList->plmn.mnc[1]);
5735    DU_LOG("PLMN : mnc[2] %d\n", plmnInfoList->plmn.mnc[2]);
5736
5737    DU_LOG("Number of Slice supported %d\n", plmnInfoList->suppSliceList.numSupportedSlices);
5738    for(sliceIdx = 0; sliceIdx < plmnInfoList->suppSliceList.numSupportedSlices; sliceIdx++)
5739    {
5740       DU_LOG("Slice\n");
5741       DU_LOG("\nSST %d\n", (*plmnInfoList->suppSliceList.snssai[sliceIdx]).sst);
5742       DU_LOG("\nSD %d %d %d\n", (*plmnInfoList->suppSliceList.snssai[sliceIdx]).sd[0], \
5743          (*plmnInfoList->suppSliceList.snssai[sliceIdx]).sd[1],(*plmnInfoList->suppSliceList.snssai[sliceIdx]).sd[2]);
5744    }
5745    
5746    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : SIB1 ** \n");
5747    sib1Cfg = &cellCfg->sib1Cfg;
5748    DU_LOG("SIB1 PDU Length %d\n", sib1Cfg->sib1PduLen);
5749    DU_LOG("SIB1 PDU %s\n", sib1Cfg->sib1Pdu);
5750
5751    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : SIB1 : Paging Configuration ** \n");
5752    pageCfg = &sib1Cfg->pagingCfg;
5753
5754    DU_LOG("Number of Paging Occassion %d\n", pageCfg->numPO);
5755    if (pageCfg->poPresent == true)
5756       DU_LOG("FirstPDCCH-Monitoring Paging Occassion present : TRUE\n");
5757    else 
5758       DU_LOG("FirstPDCCH-Monitoring Paging Occassion present : FALSE\n");
5759
5760    for(pfIdx = 0; pfIdx < MAX_PO_PER_PF; pfIdx++)
5761    {
5762       DU_LOG("Paging Occassion at Paging Frame [%d] : %d\n", pfIdx, pageCfg->pagingOcc[pfIdx]);
5763    }
5764
5765    pdcchConfigSib1 = &sib1Cfg->pdcchCfgSib1;
5766    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : SIB1 : PDCCH ** \n");
5767    DU_LOG("Coreset Zero Index %d\n", pdcchConfigSib1->coresetZeroIndex);
5768    DU_LOG("Search Space Zero Index %d\n", pdcchConfigSib1->searchSpaceZeroIndex);
5769
5770    bwpDlCfg = &cellCfg->initialDlBwp;
5771    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : DL BWP Configuration ** \n");
5772
5773    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : DL BWP : BWP ** \n");
5774    bwp = &bwpDlCfg->bwp;
5775    DU_LOG("First PRB %d\n", bwp->firstPrb);
5776    DU_LOG("Number of PRBs %d\n", bwp->numPrb);
5777    DU_LOG("Subcarrier Spacing %d\n", bwp->scs);
5778    DU_LOG("Cyclic Perfix %d\n", bwp->cyclicPrefix);
5779
5780    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : DL BWP : PDCCH Config Common ** \n");
5781    pdcchCfgCmn = &bwpDlCfg->pdcchCommon;
5782    DU_LOG("RA Search Space ID %d\n", pdcchCfgCmn->raSearchSpaceId);
5783
5784    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : DL BWP : PDCCH Config Common : Search Space ** \n");
5785    searchSpaceCfg = &pdcchCfgCmn->commonSearchSpace;
5786    DU_LOG("Search Space ID %d\n", searchSpaceCfg->searchSpaceId);
5787    DU_LOG("Coreset ID %d\n", searchSpaceCfg->coresetId);
5788    DU_LOG("Monitoring Slot %d\n", searchSpaceCfg->monitoringSlot);
5789    DU_LOG("Duration %d\n", searchSpaceCfg->duration);
5790    DU_LOG("Monitoring Symbol %x\n", searchSpaceCfg->monitoringSymbol);
5791
5792    candidateInfo = &searchSpaceCfg->candidate;
5793    DU_LOG("Number of Candidates in Aggregation Level_1 %d\n", candidateInfo->aggLevel1);
5794    DU_LOG("Number of Candidates in Aggregation Level_2 %d\n", candidateInfo->aggLevel2);
5795    DU_LOG("Number of Candidates in Aggregation Level_4 %d\n", candidateInfo->aggLevel4);
5796    DU_LOG("Number of Candidates in Aggregation Level_8 %d\n", candidateInfo->aggLevel8);
5797    DU_LOG("Number of Candidates in Aggregation Level_16 %d\n", candidateInfo->aggLevel16);
5798
5799    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : DL BWP : PDSCH Config Common ** \n");
5800    pdschCfgCmn = &bwpDlCfg->pdschCommon;
5801    DU_LOG("Number of Time Domain Resource Allocation %d\n", pdschCfgCmn->numTimeDomAlloc);
5802   
5803    for (rsrcIdx = 0; rsrcIdx <  pdschCfgCmn->numTimeDomAlloc; rsrcIdx++)
5804    {
5805       DU_LOG("Time Domain Resource Allocation Idx %d\n", rsrcIdx);
5806       pdschCmnTimeDomRsrcAlloc = &pdschCfgCmn->timeDomRsrcAllocList[rsrcIdx];
5807       DU_LOG("\tK0 %d\n", pdschCmnTimeDomRsrcAlloc->k0);
5808       DU_LOG("\tPDSCH Mapping Type %d\n", pdschCmnTimeDomRsrcAlloc->mappingType);
5809       DU_LOG("\tPDSCH Start Symbol %d\n", pdschCmnTimeDomRsrcAlloc->startSymbol);
5810       DU_LOG("\tPDSCH Symbol Length %d\n", pdschCmnTimeDomRsrcAlloc->lengthSymbol);
5811    }
5812
5813    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : UL BWP Configuration ** \n");
5814    bwpUlCfg = &cellCfg->initialUlBwp;
5815
5816    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : UL BWP : BWP ** \n");
5817    DU_LOG("First PRB %d\n", bwpUlCfg->bwp.firstPrb);
5818    DU_LOG("Number of PRBs %d\n", bwpUlCfg->bwp.numPrb);
5819    DU_LOG("Subcarrier Spacing %d\n", bwpUlCfg->bwp.scs);
5820    DU_LOG("Cyclic Prefix %d\n", bwpUlCfg->bwp.cyclicPrefix);
5821    
5822    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : UL BWP : PUCCH Config Common ** \n");
5823    pucchCfgCmn = &bwpUlCfg->pucchCommon;
5824    DU_LOG("PUCCH Resource Common %d\n", pucchCfgCmn->pucchResourceCommon);
5825    DU_LOG("Group Hopping %d\n", pucchCfgCmn->pucchGroupHopping);
5826
5827    DU_LOG("\n ** MAC Cell Configuration : Cell Configuration : UL BWP : PUSCH Config Common ** \n");
5828    puschCfgCmn = &bwpUlCfg ->puschCommon;
5829    DU_LOG("Number of Time Domain Resource Allocation %d\n", puschCfgCmn->numTimeDomRsrcAlloc);
5830    for (rsrcIdx = 0; rsrcIdx <  puschCfgCmn->numTimeDomRsrcAlloc; rsrcIdx++)
5831    {
5832       DU_LOG("Time Domain Resource Allocation Idx %d\n", rsrcIdx);
5833       puschTimeDomRsrcAlloc = &puschCfgCmn->timeDomRsrcAllocList[rsrcIdx];
5834       DU_LOG("\tK2 %d\n", puschTimeDomRsrcAlloc->k2);
5835       DU_LOG("\tPUSCH Mapping Type %d\n", puschTimeDomRsrcAlloc->mappingType);
5836       DU_LOG("\tPUSCH Start Symbol %d\n", puschTimeDomRsrcAlloc->startSymbol);
5837       DU_LOG("\tPUSCH Symbol Length %d\n", puschTimeDomRsrcAlloc->symbolLength);
5838       DU_LOG("\tPUSCH Start Symbol And Length %d\n", puschTimeDomRsrcAlloc->startSymbolAndLength);
5839    }
5840
5841    DU_LOG("\n ** MAC Cell Configuration : SSB Configuration** \n");
5842    ssbCfg = &macCellCfg ->ssbCfg;
5843    DU_LOG("SSB PDCH Power %d\n", ssbCfg->ssbPbchPwr);
5844    DU_LOG("Subcarrier Spacing Common %d\n", ssbCfg->scsCmn);
5845    DU_LOG("SSB Offset from Point A %d\n", ssbCfg->ssbOffsetPointA);
5846    DU_LOG("SSB Periodicity in msec %d\n", ssbCfg->ssbPeriod);
5847    DU_LOG("SSB Subcarrier Offset %d\n", ssbCfg->ssbScOffset);
5848    for (ssbMaskIdx = 0; ssbMaskIdx < SSB_MASK_SIZE; ssbMaskIdx++)
5849    {
5850       DU_LOG("SSB Mask[%d] :%d\n", ssbMaskIdx, ssbCfg->ssbMask[ssbMaskIdx]);
5851    }
5852    DU_LOG("Beam ID %d\n", ssbCfg->beamId[0]);
5853    DU_LOG("BETA PSS %d\n", ssbCfg->betaPss);
5854    DU_LOG("BCH Payloag Flag %d\n", ssbCfg->bchPayloadFlag);
5855    DU_LOG("MIB PDU %d %d %d \n", ssbCfg->mibPdu[0], ssbCfg->mibPdu[1], ssbCfg->mibPdu[2]);
5856    DU_LOG("DMRS Type-A Position %d\n", ssbCfg->dmrsTypeAPos);
5857
5858    DU_LOG("\n ** MAC Cell Configuration : CSI RS Configuration ** \n");
5859    csiRsCfg = &macCellCfg->csiRsCfg;
5860    DU_LOG("Frequency Domain Allocation %s\n", csiRsCfg->csiFreqDomainAlloc);
5861    DU_LOG("Number of Ports %d\n", csiRsCfg->csiNrofPorts);
5862    DU_LOG("First OFDM Symbol in Time Domain %d\n", csiRsCfg->csirsfirstOFDMSymbolInTimeDomain);
5863    DU_LOG("First OFDM Symbol in Timer Domain 2 %d\n", csiRsCfg->csirsfirstOFDMSymbolInTimeDomain2);
5864    DU_LOG("CDM Type %d\n", csiRsCfg->csirscdmType);
5865    DU_LOG("Density %d\n", csiRsCfg->csirsdensity);
5866    DU_LOG("Density dot 5:%d\n", csiRsCfg->csirsdensitydot5);
5867    DU_LOG("Power Control Offset %d\n", csiRsCfg->powerControlOffset);
5868    DU_LOG("Power Control Offset Search Space %d\n", csiRsCfg->powerControlOffsetSS);
5869    DU_LOG("Periodicity And Offset %d\n", csiRsCfg->periodicityAndOffset);
5870
5871    DU_LOG("\n ** MAC Cell Configuration : PRACH Configuration ** \n");
5872    prachCfg = &macCellCfg->prachCfg;
5873    DU_LOG("PRACH Sequence Length %d\n", prachCfg->prachSeqLen);
5874    DU_LOG("Subcarrier Spacing %d\n", prachCfg->prachSubcSpacing);
5875    DU_LOG("Number of PRACH FDM %d\n", prachCfg->msg1Fdm);
5876    DU_LOG("PRACH Configuration Index %d\n", prachCfg->prachCfgIdx);
5877    DU_LOG("PRACH Restricted Set Configuration %d\n", prachCfg->prachRstSetCfg);
5878    DU_LOG("Number of SSB per RACH occassion %d\n", prachCfg->ssbPerRach);
5879    DU_LOG("Number of RA preambles %d\n", prachCfg->totalNumRaPreamble);
5880    DU_LOG("Number of Contention Based Preamble per SSB %d\n", prachCfg->numCbPreamblePerSsb);
5881    DU_LOG("PRACH Frequeny Start Offset %d\n", prachCfg->msg1FreqStart);
5882    DU_LOG("RA Contention Resolution Timer %d\n", prachCfg->raContResTmr);
5883    DU_LOG("RSRP Threshold %d\n", prachCfg->rsrpThreshSsb);
5884    DU_LOG("RA Response Window %d\n", prachCfg->raRspWindow); 
5885    for(fdmIdx = 0; fdmIdx < prachCfg->msg1Fdm; fdmIdx++)
5886    {
5887       prachFdmInfo = &prachCfg->fdm[fdmIdx];
5888       DU_LOG("FDM[%d]\n", fdmIdx);
5889       DU_LOG("\tRoot Sequence Index %d\n", prachFdmInfo->rootSeqIdx);
5890       DU_LOG("\tNumber of Root Sequence %d\n", prachFdmInfo->numRootSeq);
5891       DU_LOG("\tK1 %d\n", prachFdmInfo->k1);
5892       DU_LOG("\tZero Correlation Zone Configuration %d\n", prachFdmInfo->zeroCorrZoneCfg);   
5893    }
5894
5895 #ifdef NR_TDD
5896    DU_LOG("\n ** MAC Cell Configuration : TDD Configuration ** \n");
5897    tddCfg = &macCellCfg->tddCfg;
5898    DU_LOG("TDD Slot Periodicity %d\n", tddCfg->tddPeriod);
5899    DU_LOG("Number of DL Slots %d\n", tddCfg->nrOfDlSlots);
5900    DU_LOG("Number of DL Symbols %d\n", tddCfg->nrOfDlSymbols);
5901    DU_LOG("Number of UL Slots %d\n", tddCfg->nrOfUlSlots);
5902    DU_LOG("Number of UL Symbols %d\n", tddCfg->nrOfUlSymbols);
5903 #endif
5904
5905    DU_LOG("\n ** MAC Cell Configuration : Precoding Configuration ** \n");
5906    precodCfg = &macCellCfg->precodingConf;
5907    DU_LOG("Number of Layers %d\n", precodCfg->numLayers);
5908    DU_LOG("Number of Antenna Ports %d\n", precodCfg->numAntPorts);
5909
5910    DU_LOG("\n ** MAC Cell Config : BEAM FORMING  CFG ** \n");
5911    beamFormingCfg = &macCellCfg ->beamCfg;
5912    DU_LOG("Number of Beams %d\n", beamFormingCfg->numOfBeams);
5913    DU_LOG("Number of Tx RUs %d\n", beamFormingCfg->numTxRUs);
5914    DU_LOG("Beam Index %d\n", beamFormingCfg->beamIdx);
5915    DU_LOG("Beam Type %d\n", beamFormingCfg->beamType);
5916    DU_LOG("Beam Azimuth %d\n", beamFormingCfg->beamAzimuth);
5917    DU_LOG("Beam Tilt %d\n", beamFormingCfg->beamTilt);
5918    DU_LOG("Beam Horizontal Width %d\n", beamFormingCfg->beamHorizWidth);
5919    DU_LOG("Beam Vertical Width %d\n", beamFormingCfg->beamVertWidth);
5920    DU_LOG("Coverage Shape %d\n", beamFormingCfg->coverageShape);
5921    DU_LOG("Digitak Tilt %d\n",beamFormingCfg ->digitalTilt);
5922    DU_LOG("Digital Azimuth %d\n", beamFormingCfg->digitalAzimuth);
5923
5924    DU_LOG("\n ** SIB1 Configuration ** \n");
5925    sib1Params = &duCfgParam.sib1Params;
5926    DU_LOG("TAC %d\n", sib1Params->tac);
5927    DU_LOG("RANAC %ld\n", sib1Params->ranac);
5928    DU_LOG("Cell ID %d\n", sib1Params->cellIdentity);
5929    DU_LOG("Cell Reserved for Operational Use %ld\n", sib1Params->cellResvdForOpUse);
5930    DU_LOG("Connection Establishment Failure Count %ld\n", sib1Params->connEstFailCnt);
5931    DU_LOG("Connection Establishment Failure Offset Valid %ld\n", sib1Params->connEstFailOffValidity);
5932    DU_LOG("Connection Establishment Failure Offset %ld\n", sib1Params->connEstFailOffset);
5933    DU_LOG("PLMN : mcc[0] %d\n", sib1Params->plmn.mcc[0]);
5934    DU_LOG("PLMN : mcc[1] %d\n", sib1Params->plmn.mcc[1]);
5935    DU_LOG("PLMN : mcc[2] %d\n", sib1Params->plmn.mcc[2]);
5936    DU_LOG("PLMN : mnc[0] %d\n", sib1Params->plmn.mnc[0]);
5937    DU_LOG("PLMN : mnc[1] %d\n", sib1Params->plmn.mnc[1]);
5938    DU_LOG("PLMN : mnc[2] %d\n", sib1Params->plmn.mnc[2]);
5939
5940    DU_LOG("\n ** SIB1 : SI Scheduling Info ** \n");
5941    siSchedInfo = &sib1Params ->siSchedInfo;
5942    DU_LOG("Windown Length %ld\n", siSchedInfo->winLen);
5943    DU_LOG("Broadcast Status %ld\n", siSchedInfo->broadcastSta);
5944    DU_LOG("Periodicity %ld\n", siSchedInfo->preiodicity);
5945    DU_LOG("SIB Type %ld\n", siSchedInfo->sibType);
5946    DU_LOG("SIB Value Tag %ld\n", siSchedInfo->sibValTag);
5947
5948    DU_LOG("\n ** SIB1 : Serving Cell Configuration Common SIB ** \n");
5949    srvCellCfgCmnSib = &sib1Params->srvCellCfgCommSib;
5950    DU_LOG("Subcarrier Spacing %ld\n", srvCellCfgCmnSib->scs);
5951    DU_LOG("SSB Position in Burst %d\n", srvCellCfgCmnSib->ssbPosInBurst);
5952    DU_LOG("SSB Periodicity %ld\n", srvCellCfgCmnSib->ssbPrdServingCell);
5953    DU_LOG("SS PBCH Power %ld\n", srvCellCfgCmnSib->ssPbchBlockPwr);
5954
5955    DU_LOG("\n ** SIB1 : Serving Cell Config Common SIB : DL Config Common ** \n");
5956    dlCfgCmn = &srvCellCfgCmnSib->dlCfg;
5957    DU_LOG("Frequency Band Indicator %ld\n", dlCfgCmn->freqBandInd);
5958    DU_LOG("Offset to Point A %ld\n", dlCfgCmn->offsetToPointA);
5959    DU_LOG("Frequency Location And Bandwidth %ld\n", dlCfgCmn->locAndBw);
5960    DU_LOG("Offset to Point A considering Subcarrier Spacing %ld\n", dlCfgCmn->dlScsCarrier.scsOffset);
5961    DU_LOG("Subcarrier Spacing %ld\n", dlCfgCmn->dlScsCarrier.scs);
5962    DU_LOG("Bandwidth considering Subcarrier Spacing %ld\n", dlCfgCmn->dlScsCarrier.scsBw);
5963
5964    DU_LOG("\n ** SIB1 : Serving Cell Config Common SIB : DL Config Common : PDCCH Config Common ** \n");
5965    pdcchCfgCommon = &dlCfgCmn->pdcchCfg;
5966    if(pdcchCfgCommon->present)
5967    {
5968       DU_LOG("Control Resource Set Zero Index %ld\n", pdcchCfgCommon->ctrlRsrcSetZero);
5969       DU_LOG("Search Space Zero Index %ld\n", pdcchCfgCommon->searchSpcZero);
5970       DU_LOG("Search Space ID %ld\n", pdcchCfgCommon->searchSpcId);
5971       DU_LOG("Control Resource Set ID %ld\n", pdcchCfgCommon->ctrlRsrcSetId);
5972       DU_LOG("Monitoring Slot Periodicity and Offset Present %d\n", pdcchCfgCommon->monitorSlotPrdAndOffPresent);
5973       DU_LOG("Monitoring Slot Periodicity and Offset %ld\n", pdcchCfgCommon->monitorSlotPrdAndOff);
5974       for (monitoringSymbIdx = 0; monitoringSymbIdx < 2; monitoringSymbIdx++)
5975       {
5976          DU_LOG("Monitoring Symbols in Slot [%d] %d\n",monitoringSymbIdx,  pdcchCfgCommon->monitorSymbolsInSlot[monitoringSymbIdx]);
5977       }
5978       DU_LOG("Number of Candidates for Aggregation Level_1 %ld\n", pdcchCfgCommon->numCandAggLvl1);
5979       DU_LOG("Number of Candidates for Aggregation Level_2 %ld\n", pdcchCfgCommon->numCandAggLvl2);
5980       DU_LOG("Number of Candidates for Aggregation Level_4 %ld\n", pdcchCfgCommon->numCandAggLvl4);
5981       DU_LOG("Number of Candidates for Aggregation Level_8 %ld\n", pdcchCfgCommon->numCandAggLvl8);
5982       DU_LOG("Number of Candidates for Aggregation Level_16 %ld\n", pdcchCfgCommon->numCandAggLvl16);
5983       DU_LOG("Seach Space Type %d\n", pdcchCfgCommon->searchSpcType);
5984       DU_LOG("Common Search Space DCI Format %d\n", pdcchCfgCommon->commSrchSpcDciFrmt);
5985       DU_LOG("SIB1 Search Space ID %ld\n", pdcchCfgCommon->searchSpcSib1);
5986       DU_LOG("Paging Search Space ID %ld\n", pdcchCfgCommon->pagingSearchSpc);
5987       DU_LOG("RA Search Space ID %ld\n", pdcchCfgCommon->raSearchSpc);
5988    }
5989    else
5990    {
5991       DU_LOG("PDCCH Config Common not Present");
5992    }
5993
5994    DU_LOG("\n ** SIB1 : Serving Cell Config Common : DL Config Common : PDSCH Config Common ** \n");
5995    pdschCfgCommon = &dlCfgCmn->pdschCfg;
5996    DU_LOG("PDSCH Config Common Present %d\n", pdschCfgCommon->present);
5997    if(pdschCfgCommon->present)
5998    {
5999       DU_LOG("Number of Time Domain Resource Allocation %d\n", pdschCfgCommon->numTimeDomRsrcAlloc);
6000       for (rsrcIdx = 0; rsrcIdx < pdschCfgCommon->numTimeDomRsrcAlloc; rsrcIdx++)
6001       {
6002          pdschTimeDomRsrcAlloc = &pdschCfgCommon->timeDomAlloc[rsrcIdx];
6003          DU_LOG("PDSCH Timer Domain Resource Allocation [%d]", rsrcIdx);
6004          DU_LOG("K0 %ld\n", pdschTimeDomRsrcAlloc->k0);
6005          DU_LOG("MappingType %ld\n", pdschTimeDomRsrcAlloc->mapType);
6006          DU_LOG("SLIV %d\n", pdschTimeDomRsrcAlloc->sliv);
6007       }
6008    }
6009    else
6010    {
6011       DU_LOG("PDSCH Config Common not Present");
6012    }
6013
6014    DU_LOG("\n ** SIB1 : Serving Cell Config Common : DL Config Common : BCCH Config Common ** \n");
6015    bcchCfg = &dlCfgCmn->bcchCfg;
6016    DU_LOG("Modification Period Coefficient %ld\n", bcchCfg->modPrdCoeff);
6017
6018    DU_LOG("\n ** SIB1 : Serving Cell Config Common : DL Config Common : PCCH Config Common ** \n");
6019    pcchCfg = &dlCfgCmn->pcchCfg;
6020    DU_LOG("Default Paging Cycle %d\n", pcchCfg->dfltPagingCycle);
6021    DU_LOG("Number of PF in Paging Cycle %d\n", pcchCfg->nAndPagingFrmOffsetType);
6022    DU_LOG("PF Offset %d\n", pcchCfg->pageFrameOffset);
6023    DU_LOG("NS - Number of P0 in PF %d\n", pcchCfg->ns);
6024    DU_LOG("First PDCCH Monitoring Occassion of each P0 Type %d\n", pcchCfg->firstPDCCHMontioringType);
6025    for (poIdx = 0; poIdx < MAX_PO_PER_PF; poIdx++)
6026    {
6027       DU_LOG("First PDCCH Monitoring Occassion in P0 [%d] %d\n", poIdx, pcchCfg->firstPDCCHMontioringInfo[poIdx]);
6028    }
6029
6030    DU_LOG("\n ** SIB1 : Serving Cell Config Common : UL Config Common ** \n");
6031    ulCfgCmn = &srvCellCfgCmnSib->ulCfg;
6032    DU_LOG("Frequency Band Indicator %ld\n", ulCfgCmn->freqBandInd);
6033    DU_LOG("Maximum Transmission Power %ld\n", ulCfgCmn->pMax);
6034    DU_LOG("Frequency Location and Bandwidth %ld\n", ulCfgCmn->locAndBw);
6035    DU_LOG("Time Alignment Timer %ld\n", ulCfgCmn->timeAlignTimerComm);
6036    DU_LOG("Offset to Point A considering Subcarrier Spacing %ld\n", ulCfgCmn->ulScsCarrier.scsOffset);
6037    DU_LOG("Subcarrier Spacing %ld\n", ulCfgCmn->ulScsCarrier.scs);
6038    DU_LOG("Carrier BW considering Subcarrier Spacing %ld\n", ulCfgCmn->ulScsCarrier.scsBw);
6039
6040    DU_LOG("\n ** SIB1 : Serving Cell Config Common : UL Config Common : RACH Config Common ** \n");
6041    rachCfgCmn = &ulCfgCmn ->rachCfg;
6042    if(rachCfgCmn->present)
6043    {
6044       DU_LOG("PRACH Configuration Index %ld\n", rachCfgCmn->prachCfgIdx);
6045       DU_LOG("Number of PRACH FDM %ld\n", rachCfgCmn->msg1Fdm);
6046       DU_LOG("PRACH Frequeny Start Offset %ld\n", rachCfgCmn->msg1FreqStart);
6047       DU_LOG("Zero Correaltion Zone Configuration %ld\n", rachCfgCmn->zeroCorrZoneCfg);
6048       DU_LOG("Target Power Level of Received Preamble %ld\n", rachCfgCmn->preambleRcvdTgtPwr);
6049       DU_LOG("Maximum number of Preamble Transmission %ld\n", rachCfgCmn->preambleTransMax);
6050       DU_LOG("Power Ramping Step %ld\n", rachCfgCmn->pwrRampingStep);
6051       DU_LOG("RA Response Window %ld\n", rachCfgCmn->raRspWindow);
6052       DU_LOG("Total Number of RA Preambles %ld\n", rachCfgCmn->numRaPreamble);
6053       DU_LOG("Number of SSB per RACH Occassion %ld\n", rachCfgCmn->numSsbPerRachOcc);
6054       DU_LOG("Number of Contention Based Preamble per SSB %ld\n", rachCfgCmn->numCbPreamblePerSsb);
6055       DU_LOG("Contention Resolution Timer %ld\n", rachCfgCmn->contResTimer);
6056       DU_LOG("RSRP Threshold %ld\n", rachCfgCmn->rsrpThreshSsb);
6057       DU_LOG("Root Sequence Index Present %d\n", rachCfgCmn->rootSeqIdxPresent);
6058       DU_LOG("Root Sequence Index %ld\n", rachCfgCmn->rootSeqIdx);
6059       DU_LOG("Subcarrier Spacing %ld\n", rachCfgCmn->msg1Scs);
6060       DU_LOG("Restricted Set Configuration %ld\n", rachCfgCmn->restrictedSetCfg);
6061    }
6062    else
6063    {
6064       DU_LOG("RACH Config Common not present\n");
6065    }
6066
6067    DU_LOG("\n ** SIB1 : Serving Cell Config Common : UL Config Common : PUSCH Config Common ** \n");
6068    puschCfgCommon = &ulCfgCmn ->puschCfg;
6069    if(puschCfgCommon->puschCfgPresent)
6070    {
6071       DU_LOG("MSG3 Delta from RACH Preamble %ld\n", puschCfgCommon->msg3DeltaPreamble);
6072       DU_LOG("P0 Nominal With Grant %ld\n", puschCfgCommon->p0NominalWithGrant);
6073       DU_LOG("Number of Time Domain Resource Allocation %d\n", puschCfgCommon->numTimeDomRsrcAlloc);
6074       for(rsrcIdx = 0; rsrcIdx < puschCfgCommon->numTimeDomRsrcAlloc; rsrcIdx++)
6075       {
6076          puschCmnTimeDomRsrsAlloc = &puschCfgCommon ->timeDomAllocList[rsrcIdx];
6077          DU_LOG("Time Domain Resource Alloc [%d]", rsrcIdx);
6078          DU_LOG("\tK2 %ld\n", puschCmnTimeDomRsrsAlloc->k2);
6079          DU_LOG("\tMapping Type %ld\n", puschCmnTimeDomRsrsAlloc->mapType);
6080          DU_LOG("\tSLIV %d\n", puschCmnTimeDomRsrsAlloc->sliv);
6081       }
6082    }
6083    else
6084    {
6085       DU_LOG("PUSCH Config Common not present\n");
6086    }
6087    
6088    DU_LOG("\n ** SIB1 : Serving Cell Config Common : UL Config Common : PUCCH Config Common **\n");
6089    pucchCfgCommon = &ulCfgCmn->pucchCfg;
6090    if(pucchCfgCommon->present)
6091    {
6092       DU_LOG("Resource Common %ld\n", pucchCfgCommon->rsrcComm);
6093       DU_LOG("Group Hopping %ld\n", pucchCfgCommon->grpHop);
6094       DU_LOG("P0 Nominal %ld\n", pucchCfgCommon->p0Nominal);
6095    }
6096    else
6097    {
6098       DU_LOG("PUCCH Config Common not present\n");
6099    }
6100  
6101    DU_LOG("\n ** SIB1 : Serving Cell Config Common : TDD UL DL Config Common ** \n");
6102    tddUlDlCfgCmn = &srvCellCfgCmnSib->tddCfg;
6103    DU_LOG("Reference Subcarrier Spacing %ld\n", tddUlDlCfgCmn->refScs);
6104    DU_LOG("Transmission Periodicity %ld\n", tddUlDlCfgCmn->txPrd);
6105    DU_LOG("Number of DL Slots %ld\n", tddUlDlCfgCmn->numDlSlots);
6106    DU_LOG("Number of DL Symbols %ld\n", tddUlDlCfgCmn->numDlSymbols);
6107    DU_LOG("Number of UL Slots %ld\n", tddUlDlCfgCmn->numUlSlots);
6108    DU_LOG("Number of UL Symbols %ld\n", tddUlDlCfgCmn->numUlSymbols);
6109
6110    DU_LOG("\n ** MAC SLICE CONFIG REQUEST ** \n");
6111    macSliceCfg = &duCfgParam.tempSliceCfg;
6112    DU_LOG("Number of RRM Policy %d\n",macSliceCfg->numOfRrmPolicy);
6113
6114    for(policyIdx = 0; policyIdx < macSliceCfg->numOfRrmPolicy; policyIdx++)
6115    {
6116       rrmPolicy = macSliceCfg->listOfRrmPolicy[policyIdx];
6117       DU_LOG("RRM Policy [%d]\n", policyIdx);
6118       DU_LOG("\tResource Type %d\n", rrmPolicy->resourceType);
6119
6120       rrmPolicyRatio = &rrmPolicy ->policyRatio;
6121       DU_LOG("\tPolicy Maximum Ratio %d\n", rrmPolicyRatio->maxRatio);
6122       DU_LOG("\tPolicy Minimum Ratio %d\n", rrmPolicyRatio->minRatio);
6123       DU_LOG("\tPolicy Deidcated Ration %d\n", rrmPolicyRatio->dedicatedRatio);
6124       DU_LOG("\tNumber of RRM Policy Member %d\n", rrmPolicy->numOfRrmPolicyMem);   
6125       
6126       for(memIdx = 0; memIdx < rrmPolicy->numOfRrmPolicyMem; memIdx++)
6127       {
6128          rrmPolicyMemberList = rrmPolicy->rRMPolicyMemberList[memIdx];
6129          DU_LOG("\tRRM Policy Member [%d]\n", memIdx);
6130          DU_LOG("\t\tPLMN : mcc[0] %d\n", rrmPolicyMemberList->plmn.mcc[0]);
6131          DU_LOG("\t\tPLMN : mcc[1] %d\n", rrmPolicyMemberList->plmn.mcc[1]);
6132          DU_LOG("\t\tPLMN : mcc[2] %d\n", rrmPolicyMemberList->plmn.mcc[2]);
6133          DU_LOG("\t\tPLMN : mnc[0] %d\n", rrmPolicyMemberList->plmn.mnc[0]);
6134          DU_LOG("\t\tPLMN : mnc[1] %d\n", rrmPolicyMemberList->plmn.mnc[1]);
6135          DU_LOG("\t\tPLMN : mnc[2] %d\n", rrmPolicyMemberList->plmn.mnc[2]);
6136          DU_LOG("\t\tSST %d\n",rrmPolicyMemberList->snssai.sst);
6137          DU_LOG("\t\tSD %d %d %d\n",rrmPolicyMemberList->snssai.sd[0],rrmPolicyMemberList->snssai.sd[1],rrmPolicyMemberList->snssai.sd[2]);
6138       }
6139    }
6140    
6141    DU_LOG("\n ** E2 configuration ** \n");
6142    e2apDb = &duCb.e2apDb;
6143    DU_LOG("E2 node id %lu\n", e2apDb->e2NodeId);
6144    DU_LOG("Number of RAN function %d\n", e2apDb->numOfRanFunction);
6145    for(ranFuncIdx=0; ranFuncIdx<e2apDb->numOfRanFunction; ranFuncIdx++)
6146    {
6147       ranFunc = &e2apDb->ranFunction[ranFuncIdx];
6148       DU_LOG("RAN function id %d\n", ranFunc->id);
6149       DU_LOG("Short Name %s\n", ranFunc->name.shortName);
6150       DU_LOG("Service Model OID %s\n", ranFunc->name.serviceModelOID);
6151       DU_LOG("Description %s\n", ranFunc->name.description);
6152       
6153       DU_LOG("RevisionCounter %d\n",ranFunc->revisionCounter);
6154       DU_LOG("NUM of Event Trigger Style Supported %d\n",ranFunc->numOfEventTriggerStyleSupported);
6155       for(eventStyleIdx=0;eventStyleIdx<ranFunc->numOfEventTriggerStyleSupported; eventStyleIdx++)
6156       {
6157          DU_LOG("Style Type %d\n",ranFunc->eventTriggerStyleList[eventStyleIdx].styleType);
6158          DU_LOG("Name %s\n",ranFunc->eventTriggerStyleList[eventStyleIdx].name);
6159          DU_LOG("Format type %d\n",ranFunc->eventTriggerStyleList[eventStyleIdx].formatType);
6160       }
6161
6162       DU_LOG("Num of Report Style Supported %d\n",ranFunc->numOfReportStyleSupported);
6163       for(reportStyleIdx=0;reportStyleIdx<ranFunc->numOfReportStyleSupported; reportStyleIdx++)
6164       {
6165          DU_LOG("Style Type %d\n",ranFunc->reportStyleList[reportStyleIdx].reportStyle.styleType);
6166          DU_LOG("Name %s\n",ranFunc->reportStyleList[reportStyleIdx].reportStyle.name);
6167          DU_LOG("Format type %d\n",ranFunc->reportStyleList[reportStyleIdx].reportStyle.formatType);
6168          measurementInfoList = &ranFunc->reportStyleList[reportStyleIdx].measurementInfoList;
6169          if(measurementInfoList->count)
6170          {
6171             CM_LLIST_FIRST_NODE(measurementInfoList, node);
6172             while(node)
6173             {
6174                measurementInfoForAction = (MeasurementInfoForAction*) node->node;
6175                if(measurementInfoForAction)
6176                {
6177                   DU_LOG("Measurement Type Name %s\n",measurementInfoForAction->measurementTypeName);
6178                   DU_LOG("Measurement Type Id %d\n",measurementInfoForAction->measurementTypeId);
6179                }
6180                node = node->next;
6181             }
6182          }
6183       }
6184       DU_LOG("Ric Indication header format %d\n",ranFunc->ricIndicationHeaderFormat);
6185       DU_LOG("Ric indication message format %d\n",ranFunc->ricIndicationMessageFormat);
6186
6187    }
6188    DU_LOG("Number of TNL association %d\n", e2apDb->numOfTNLAssoc);
6189    for(tnlIdx=0;tnlIdx<e2apDb->numOfTNLAssoc;tnlIdx++)
6190    {
6191       DU_LOG("Local IPv4 Address present %u\n", e2apDb->tnlAssoc[tnlIdx].localIpAddress.ipV4Pres);
6192       DU_LOG("local IP Address %u\n", e2apDb->tnlAssoc[tnlIdx].localIpAddress.ipV4Addr);
6193       DU_LOG("Destination IPv4 Address present %u\n", e2apDb->tnlAssoc[tnlIdx].destIpAddress.ipV4Pres);
6194       DU_LOG("Destination IP Address %u\n", e2apDb->tnlAssoc[tnlIdx].destIpAddress.ipV4Addr);
6195       DU_LOG("Local port %d\n", e2apDb->tnlAssoc[tnlIdx].localPort);
6196       DU_LOG("Destination port %d\n", e2apDb->tnlAssoc[tnlIdx].destPort);
6197       DU_LOG("Tnl usage %d\n", e2apDb->tnlAssoc[tnlIdx].usage);
6198    }
6199 }
6200
6201 /**********************************************************************
6202   End of file
6203  **********************************************************************/
6204