+ * ****************************************************************/
+DuPagUeList* handlePageInfoLL(uint8_t i_s, CmLListCp *pagInfoLL, ActionTypeLL action)
+{
+ CmLList *node = NULLP;
+ DuPagUeList *pagInfo = NULLP;
+ bool found = FALSE;
+
+ if(pagInfoLL == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP: PagInfo LL is empty");
+ return NULLP;
+ }
+ node = pagInfoLL->first;
+
+ while(node)
+ {
+ pagInfo = (DuPagUeList *)node->node;
+ if(pagInfo->i_s == i_s)
+ {
+ found = TRUE;
+ break;
+ }
+ node = node->next;
+ }
+
+ switch(action)
+ {
+ case SEARCH:
+ {
+ if(!found)
+ {
+ pagInfo = NULLP;
+ }
+ return pagInfo;
+ }
+
+ case CREATE:
+ {
+ if(node != NULLP)
+ return pagInfo;
+
+ /*Need to add a new node for this LC*/
+
+ /*List is empty; Initialize the LL ControlPointer*/
+ if(pagInfoLL->count == 0)
+ {
+ cmLListInit(pagInfoLL);
+ }
+
+ pagInfo = NULLP;
+ /*Allocate the List*/
+ DU_ALLOC(pagInfo, sizeof(DuPagUeList));
+ if(pagInfo)
+ {
+ pagInfo->i_s = i_s;
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : Allocation of List failed,i_s:%d",i_s);
+ return NULLP;
+ }
+
+ if(duAddNodeToLList(pagInfoLL, pagInfo, NULLP) == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : failed to Add Node,i_s:%d",i_s);
+ DU_FREE(pagInfo, sizeof(DuPagUeList));
+ return NULLP;
+ }
+ return pagInfo;
+ }
+ case DELETE:
+ {
+ if(!found || pagInfo == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP: i_s:%d not found; thus Deletion unsuccessful",i_s);
+ }
+ else
+ {
+ if(duDelNodeFromLList(pagInfoLL, node) == ROK)
+ DU_FREE(pagInfo, sizeof(DuPagUeList));
+
+ DU_LOG("\nDEBUG --> DU APP: i_s:%d Deleted successfully",i_s);
+ }
+ return NULLP;
+ }
+ default:
+ {
+ DU_LOG("\nERROR --> DU APP: Incorrect ActionType:%d on PageInfo List",action);
+ }
+ }
+ return NULLP;
+}
+
+/*******************************************************************
+ * @brief Handle the PageUe List
+ *
+ * @details
+ *
+ * Function : handlePageUeLL
+ *
+ * Functionality: Handling the (SEARCH,CREATE,DELETE) PageUeList
+ *
+ * @params[in] DuPagingMsg *pagingParam, CmLListCp *pageUeLL, ActionTypeLL
+ * action
+ *
+ * @return DuPagUeRecord
+ *
+ * ****************************************************************/
+DuPagUeRecord* handlePageUeLL(DuPagingMsg *pagingParam, CmLListCp *pageUeLL, ActionTypeLL action)
+{
+ CmLList *node = NULLP;
+ DuPagUeRecord *ueRecord = NULLP;
+ bool found = FALSE;
+
+ if(pageUeLL == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP: UE Page Record LL is empty");
+ return NULLP;
+ }
+ node = pageUeLL->first;
+
+ while(node)
+ {
+ ueRecord = (DuPagUeRecord *)node->node;
+ if(ueRecord && (ueRecord->pagUeId == pagingParam->pagUeId &&
+ ueRecord->sTmsi == pagingParam->sTmsi))
+ {
+ found = TRUE;
+ break;
+ }
+ node = node->next;
+ }
+
+ switch(action)
+ {
+ case SEARCH:
+ {
+ if(!found)
+ {
+ ueRecord = NULLP;
+ }
+ return ueRecord;
+ }
+
+ case CREATE:
+ {
+ if(node != NULLP)
+ return ueRecord;
+
+ /*Need to add a new node for this LC*/
+
+ /*List is empty; Initialize the LL ControlPointer*/
+ if(pageUeLL->count == 0)
+ {
+ cmLListInit(pageUeLL);
+ }
+
+ ueRecord = NULLP;
+ /*Allocate the List*/
+ DU_ALLOC(ueRecord, sizeof(DuPagUeRecord));
+ if(ueRecord)
+ {
+ ueRecord->pagUeId = pagingParam->pagUeId;
+ ueRecord->sTmsi = pagingParam->sTmsi;
+ ueRecord->pagPriority = pagingParam->pagPriority;
+ }
+ else
+ {
+ DU_LOG("\nERROR --> DU APP : Allocation of UE Record failed,ueId:%d",pagingParam->pagUeId);
+ return NULLP;
+ }
+
+ if(duAddNodeToLList(pageUeLL, ueRecord, NULLP) == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : failed to Add Ue Record Node,ueId:%d",pagingParam->pagUeId);
+ DU_FREE(ueRecord, sizeof(DuPagUeRecord));
+ return NULLP;
+ }
+ return ueRecord;
+ }
+ case DELETE:
+ {
+ if(!found || ueRecord == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP: UeId:%d not found; thus Deletion unsuccessful",pagingParam->pagUeId);
+ }
+ else
+ {
+ if(duDelNodeFromLList(pageUeLL, node) == ROK)
+ DU_FREE(ueRecord, sizeof(DuPagUeRecord));
+
+ DU_LOG("\nDEBUG --> DU APP: UeId:%d Deleted successfully",pagingParam->pagUeId);
+ }
+ return NULLP;
+ }
+ default:
+ {
+ DU_LOG("\nERROR --> DU APP: Incorrect ActionType:%d on UeRecord",action);
+ }
+ }
+ return NULLP;
+}
+
+/*******************************************************************
+ * @brief Keeping the record of Paging having a particular SFN and index associated