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