code changes in Gnb-DU config update for CLA [Issue Id - ODUHIGH-335] 63/6263/5
authorlal.harshita <Harshita.Lal@radisys.com>
Wed, 9 Jun 2021 06:25:49 +0000 (11:55 +0530)
committerlal.harshita <Harshita.Lal@radisys.com>
Mon, 14 Jun 2021 04:36:10 +0000 (10:06 +0530)
Change-Id: I657775cf29ce32b3dd894f1995a1754afeeab7f7
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
13 files changed:
src/cu_stub/cu_f1ap_msg_hdl.c
src/cu_stub/cu_f1ap_msg_hdl.h
src/du_app/du_cell_mgr.c
src/du_app/du_cell_mgr.h
src/du_app/du_cfg.h
src/du_app/du_f1ap_msg_hdl.c
src/du_app/du_mgr.h
src/du_app/du_mgr_msg_router.c
src/du_app/du_msg_hdl.c
src/du_app/du_ue_mgr.c
src/du_app/du_ue_mgr.h
src/du_app/du_utils.c
src/du_app/du_utils.h

index 9c40c0e..b3b6886 100644 (file)
 #define RES_ALLOC_TYPE       1          /* Resource allocation type */
 #define FIVE_QI_VALUE 9  /*spec 23.501, Table 5.7.4-1*/
 /*******************************************************************
 #define RES_ALLOC_TYPE       1          /* Resource allocation type */
 #define FIVE_QI_VALUE 9  /*spec 23.501, Table 5.7.4-1*/
 /*******************************************************************
-*
-* @brief Sends F1 msg over SCTP
-*
-* @details
-*
-*    Function : SendF1APMsg
-*
-*    Functionality: Sends F1 msg over SCTP
-*
-* @params[in] Region region
-*             Pool pool
-* @return ROK     - success
-*         RFAILED - failure
-*
-* ****************************************************************/
+ *
+ * @brief Sends F1 msg over SCTP
+ *
+ * @details
+ *
+ *    Function : SendF1APMsg
+ *
+ *    Functionality: Sends F1 msg over SCTP
+ *
+ * @params[in] Region region
+ *             Pool pool
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
 S16 SendF1APMsg(Region region, Pool pool)
 {
    Buffer *mBuf = NULLP;
 S16 SendF1APMsg(Region region, Pool pool)
 {
    Buffer *mBuf = NULLP;
@@ -196,20 +196,20 @@ S16 SendF1APMsg(Region region, Pool pool)
    {
       if(ODU_ADD_POST_MSG_MULT((Data *)encBuf, encBufSize, mBuf) == ROK)
       {
    {
       if(ODU_ADD_POST_MSG_MULT((Data *)encBuf, encBufSize, mBuf) == ROK)
       {
-        ODU_PRINT_MSG(mBuf, 0,0);
+         ODU_PRINT_MSG(mBuf, 0,0);
 
 
-        if(sctpSend(mBuf) != ROK)
-        {
-           DU_LOG("\nERROR  -->  F1AP : SCTP Send failed");
-           ODU_PUT_MSG_BUF(mBuf);
-           return RFAILED;
-        }
+         if(sctpSend(mBuf) != ROK)
+         {
+            DU_LOG("\nERROR  -->  F1AP : SCTP Send failed");
+            ODU_PUT_MSG_BUF(mBuf);
+            return RFAILED;
+         }
       }
       else
       {
       }
       else
       {
-        DU_LOG("\nERROR  -->  F1AP : ODU_ADD_POST_MSG_MULT failed");
-        ODU_PUT_MSG_BUF(mBuf);
-        return RFAILED;
+         DU_LOG("\nERROR  -->  F1AP : ODU_ADD_POST_MSG_MULT failed");
+         ODU_PUT_MSG_BUF(mBuf);
+         return RFAILED;
       }
       ODU_PUT_MSG_BUF(mBuf);
    }
       }
       ODU_PUT_MSG_BUF(mBuf);
    }
@@ -297,7 +297,7 @@ S16 BuildAndSendF1SetupRsp()
    f1apMsg->choice.successfulOutcome->procedureCode = ProcedureCode_id_F1Setup;
    f1apMsg->choice.successfulOutcome->criticality = Criticality_reject;
    f1apMsg->choice.successfulOutcome->value.present = \
    f1apMsg->choice.successfulOutcome->procedureCode = ProcedureCode_id_F1Setup;
    f1apMsg->choice.successfulOutcome->criticality = Criticality_reject;
    f1apMsg->choice.successfulOutcome->value.present = \
-                                                     SuccessfulOutcome__value_PR_F1SetupResponse;
+                                                      SuccessfulOutcome__value_PR_F1SetupResponse;
    f1SetupRsp = &f1apMsg->choice.successfulOutcome->value.choice.F1SetupResponse;
 
    elementCnt = 4;
    f1SetupRsp = &f1apMsg->choice.successfulOutcome->value.choice.F1SetupResponse;
 
    elementCnt = 4;
@@ -305,7 +305,7 @@ S16 BuildAndSendF1SetupRsp()
    f1SetupRsp->protocolIEs.list.size = elementCnt*sizeof(F1SetupResponseIEs_t *);
 
    CU_ALLOC(f1SetupRsp->protocolIEs.list.array, \
    f1SetupRsp->protocolIEs.list.size = elementCnt*sizeof(F1SetupResponseIEs_t *);
 
    CU_ALLOC(f1SetupRsp->protocolIEs.list.array, \
-        elementCnt * sizeof(F1SetupResponseIEs_t *));
+         elementCnt * sizeof(F1SetupResponseIEs_t *));
    if(f1SetupRsp->protocolIEs.list.array == NULLP)
    {
       DU_LOG("\nERROR  -->  F1AP : Memory allocation for F1ResponseIEs failed");
    if(f1SetupRsp->protocolIEs.list.array == NULLP)
    {
       DU_LOG("\nERROR  -->  F1AP : Memory allocation for F1ResponseIEs failed");
@@ -317,15 +317,15 @@ S16 BuildAndSendF1SetupRsp()
    for(idx=0; idx<elementCnt; idx++)
    {
       CU_ALLOC(f1SetupRsp->protocolIEs.list.array[idx], \
    for(idx=0; idx<elementCnt; idx++)
    {
       CU_ALLOC(f1SetupRsp->protocolIEs.list.array[idx], \
-           sizeof(F1SetupResponseIEs_t)); 
+            sizeof(F1SetupResponseIEs_t)); 
       if(f1SetupRsp->protocolIEs.list.array[idx] == NULLP)
       {  
       if(f1SetupRsp->protocolIEs.list.array[idx] == NULLP)
       {  
-        CU_FREE(f1SetupRsp->protocolIEs.list.array,\
-              elementCnt * sizeof(F1SetupResponseIEs_t *));
-        CU_FREE(f1apMsg->choice.successfulOutcome, \
-              sizeof(SuccessfulOutcome_t));
-        CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
-        return RFAILED;
+         CU_FREE(f1SetupRsp->protocolIEs.list.array,\
+               elementCnt * sizeof(F1SetupResponseIEs_t *));
+         CU_FREE(f1apMsg->choice.successfulOutcome, \
+               sizeof(SuccessfulOutcome_t));
+         CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
+         return RFAILED;
       }    
    }
 
       }    
    }
 
@@ -334,16 +334,16 @@ S16 BuildAndSendF1SetupRsp()
    f1SetupRsp->protocolIEs.list.array[idx]->id = ProtocolIE_ID_id_TransactionID;
    f1SetupRsp->protocolIEs.list.array[idx]->criticality = Criticality_reject;
    f1SetupRsp->protocolIEs.list.array[idx]->value.present = \
    f1SetupRsp->protocolIEs.list.array[idx]->id = ProtocolIE_ID_id_TransactionID;
    f1SetupRsp->protocolIEs.list.array[idx]->criticality = Criticality_reject;
    f1SetupRsp->protocolIEs.list.array[idx]->value.present = \
-                                                           F1SetupResponseIEs__value_PR_TransactionID;
+                                                            F1SetupResponseIEs__value_PR_TransactionID;
    f1SetupRsp->protocolIEs.list.array[idx]->value.choice.TransactionID =\
    f1SetupRsp->protocolIEs.list.array[idx]->value.choice.TransactionID =\
-                                                                       TRANS_ID;
+                                                                        TRANS_ID;
 
    /*CU Name*/
    idx++;
    f1SetupRsp->protocolIEs.list.array[idx]->id = ProtocolIE_ID_id_gNB_CU_Name;
    f1SetupRsp->protocolIEs.list.array[idx]->criticality = Criticality_ignore;
    f1SetupRsp->protocolIEs.list.array[idx]->value.present = \
 
    /*CU Name*/
    idx++;
    f1SetupRsp->protocolIEs.list.array[idx]->id = ProtocolIE_ID_id_gNB_CU_Name;
    f1SetupRsp->protocolIEs.list.array[idx]->criticality = Criticality_ignore;
    f1SetupRsp->protocolIEs.list.array[idx]->value.present = \
-                                                           F1SetupResponseIEs__value_PR_GNB_CU_Name;
+                                                            F1SetupResponseIEs__value_PR_GNB_CU_Name;
    cuName = &f1SetupRsp->protocolIEs.list.array[idx]->value.choice.GNB_CU_Name;
    cuName->size = sizeof(cuCfgParams.cuName);
 
    cuName = &f1SetupRsp->protocolIEs.list.array[idx]->value.choice.GNB_CU_Name;
    cuName->size = sizeof(cuCfgParams.cuName);
 
@@ -352,13 +352,13 @@ S16 BuildAndSendF1SetupRsp()
    {
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
    {
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
-        CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx],\
-              sizeof(F1SetupResponseIEs_t));
+         CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx],\
+               sizeof(F1SetupResponseIEs_t));
       }
       CU_FREE(f1SetupRsp->protocolIEs.list.array,\
       }
       CU_FREE(f1SetupRsp->protocolIEs.list.array,\
-           elementCnt * sizeof(F1SetupResponseIEs_t *));
+            elementCnt * sizeof(F1SetupResponseIEs_t *));
       CU_FREE(f1apMsg->choice.successfulOutcome,\
       CU_FREE(f1apMsg->choice.successfulOutcome,\
-           sizeof(SuccessfulOutcome_t));
+            sizeof(SuccessfulOutcome_t));
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
    }
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
    }
@@ -367,28 +367,28 @@ S16 BuildAndSendF1SetupRsp()
    /*Cells to be activated list*/
    idx++;
    f1SetupRsp->protocolIEs.list.array[idx]->id = \
    /*Cells to be activated list*/
    idx++;
    f1SetupRsp->protocolIEs.list.array[idx]->id = \
-                                                ProtocolIE_ID_id_Cells_to_be_Activated_List ;
+                                                 ProtocolIE_ID_id_Cells_to_be_Activated_List ;
    f1SetupRsp->protocolIEs.list.array[idx]->criticality = Criticality_reject;
    f1SetupRsp->protocolIEs.list.array[idx]->value.present = \
    f1SetupRsp->protocolIEs.list.array[idx]->criticality = Criticality_reject;
    f1SetupRsp->protocolIEs.list.array[idx]->value.present = \
-                                                           F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List;
+                                                            F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List;
    cellToActivate = &f1SetupRsp->protocolIEs.list.array[idx]->value.choice.\
    cellToActivate = &f1SetupRsp->protocolIEs.list.array[idx]->value.choice.\
-                   Cells_to_be_Activated_List;
+                    Cells_to_be_Activated_List;
    cellCnt=1;
    cellToActivate->list.count = cellCnt;
    cellToActivate->list.size = \
    cellCnt=1;
    cellToActivate->list.count = cellCnt;
    cellToActivate->list.size = \
-                              cellCnt*sizeof(struct Cells_to_be_Activated_List_ItemIEs  *);
+                               cellCnt*sizeof(struct Cells_to_be_Activated_List_ItemIEs  *);
    CU_ALLOC(cellToActivate->list.array,\
    CU_ALLOC(cellToActivate->list.array,\
-        sizeof(struct Cells_to_be_Activated_List_ItemIEs  *));
+         sizeof(struct Cells_to_be_Activated_List_ItemIEs  *));
    if(cellToActivate->list.array == NULLP)
    {
       CU_FREE(cuName->buf, sizeof(cuName->size));
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
    if(cellToActivate->list.array == NULLP)
    {
       CU_FREE(cuName->buf, sizeof(cuName->size));
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
-        CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx],\
-              sizeof(F1SetupResponseIEs_t));
+         CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx],\
+               sizeof(F1SetupResponseIEs_t));
       }
       CU_FREE(f1SetupRsp->protocolIEs.list.array,\
       }
       CU_FREE(f1SetupRsp->protocolIEs.list.array,\
-           elementCnt * sizeof(F1SetupResponseIEs_t *));
+            elementCnt * sizeof(F1SetupResponseIEs_t *));
       CU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
       CU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
@@ -398,88 +398,88 @@ S16 BuildAndSendF1SetupRsp()
       CU_ALLOC(cellToActivate->list.array[ieIdx],sizeof(struct Cells_to_be_Activated_List_ItemIEs ));
       if(cellToActivate->list.array[ieIdx] == NULLP)
       {
       CU_ALLOC(cellToActivate->list.array[ieIdx],sizeof(struct Cells_to_be_Activated_List_ItemIEs ));
       if(cellToActivate->list.array[ieIdx] == NULLP)
       {
-        CU_FREE(cellToActivate->list.array,\
-              sizeof(struct Cells_to_be_Activated_List_ItemIEs  *));
-        CU_FREE(cuName->buf, sizeof(cuName->size));
-        for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
-        {
-           CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx], \
-                 sizeof(F1SetupResponseIEs_t));
-        }
-        CU_FREE(f1SetupRsp->protocolIEs.list.array, \
-              elementCnt * sizeof(F1SetupResponseIEs_t *));
-        CU_FREE(f1apMsg->choice.successfulOutcome, \
-              sizeof(SuccessfulOutcome_t));
-        CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
-        return RFAILED;
+         CU_FREE(cellToActivate->list.array,\
+               sizeof(struct Cells_to_be_Activated_List_ItemIEs  *));
+         CU_FREE(cuName->buf, sizeof(cuName->size));
+         for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
+         {
+            CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx], \
+                  sizeof(F1SetupResponseIEs_t));
+         }
+         CU_FREE(f1SetupRsp->protocolIEs.list.array, \
+               elementCnt * sizeof(F1SetupResponseIEs_t *));
+         CU_FREE(f1apMsg->choice.successfulOutcome, \
+               sizeof(SuccessfulOutcome_t));
+         CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
+         return RFAILED;
       }
    }
    cellToActivate->list.array[0]->id = \
       }
    }
    cellToActivate->list.array[0]->id = \
-                                      ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
+                                       ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
    cellToActivate->list.array[0]->criticality = Criticality_ignore;
    cellToActivate->list.array[0]->value.present = \
    cellToActivate->list.array[0]->criticality = Criticality_ignore;
    cellToActivate->list.array[0]->value.present = \
-                                                 Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
+                                                  Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
    cellToActivate->list.array[0]->value.choice.Cells_to_be_Activated_List_Item.\
       nRCGI.pLMN_Identity.size = 3*sizeof(uint8_t);
    CU_ALLOC(cellToActivate->list.array[0]->\
    cellToActivate->list.array[0]->value.choice.Cells_to_be_Activated_List_Item.\
       nRCGI.pLMN_Identity.size = 3*sizeof(uint8_t);
    CU_ALLOC(cellToActivate->list.array[0]->\
-        value.choice.Cells_to_be_Activated_List_Item.nRCGI.pLMN_Identity.buf,\
-        3*sizeof(uint8_t));
+         value.choice.Cells_to_be_Activated_List_Item.nRCGI.pLMN_Identity.buf,\
+         3*sizeof(uint8_t));
    if(cellToActivate->list.array[0]->value.choice.\
    if(cellToActivate->list.array[0]->value.choice.\
-        Cells_to_be_Activated_List_Item.nRCGI.pLMN_Identity.buf == NULLP)
+         Cells_to_be_Activated_List_Item.nRCGI.pLMN_Identity.buf == NULLP)
    {
 
       for(ieIdx=0; ieIdx<cellCnt; ieIdx++)
       {
    {
 
       for(ieIdx=0; ieIdx<cellCnt; ieIdx++)
       {
-        CU_FREE(cellToActivate->list.array[ieIdx],\
-              sizeof(struct Cells_to_be_Activated_List_ItemIEs ));
+         CU_FREE(cellToActivate->list.array[ieIdx],\
+               sizeof(struct Cells_to_be_Activated_List_ItemIEs ));
       }
 
       CU_FREE(cellToActivate->list.array,\
       }
 
       CU_FREE(cellToActivate->list.array,\
-           sizeof(struct Cells_to_be_Activated_List_ItemIEs  *));
+            sizeof(struct Cells_to_be_Activated_List_ItemIEs  *));
       CU_FREE(cuName->buf, sizeof(cuName->size));
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
       CU_FREE(cuName->buf, sizeof(cuName->size));
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
-        CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx], \
-              sizeof(F1SetupResponseIEs_t));
+         CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx], \
+               sizeof(F1SetupResponseIEs_t));
       }
       CU_FREE(f1SetupRsp->protocolIEs.list.array, \
       }
       CU_FREE(f1SetupRsp->protocolIEs.list.array, \
-           elementCnt * sizeof(F1SetupResponseIEs_t *));
+            elementCnt * sizeof(F1SetupResponseIEs_t *));
       CU_FREE(f1apMsg->choice.successfulOutcome, \
       CU_FREE(f1apMsg->choice.successfulOutcome, \
-           sizeof(SuccessfulOutcome_t));
+            sizeof(SuccessfulOutcome_t));
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
    }
    buildPlmnId(cuCfgParams.plmn , cellToActivate->list.array[0]->value.choice.\
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
    }
    buildPlmnId(cuCfgParams.plmn , cellToActivate->list.array[0]->value.choice.\
-        Cells_to_be_Activated_List_Item.nRCGI.pLMN_Identity.buf);
+         Cells_to_be_Activated_List_Item.nRCGI.pLMN_Identity.buf);
    cellToActivate->list.array[0]->value.choice.Cells_to_be_Activated_List_Item.\
       nRCGI.nRCellIdentity.size = 5;
    CU_ALLOC(cellToActivate->list.array[0]->value.choice.\
    cellToActivate->list.array[0]->value.choice.Cells_to_be_Activated_List_Item.\
       nRCGI.nRCellIdentity.size = 5;
    CU_ALLOC(cellToActivate->list.array[0]->value.choice.\
-        Cells_to_be_Activated_List_Item.nRCGI.nRCellIdentity.buf,\
-        5*sizeof(uint8_t));
+         Cells_to_be_Activated_List_Item.nRCGI.nRCellIdentity.buf,\
+         5*sizeof(uint8_t));
    if(cellToActivate->list.array[0]->value.choice.\
    if(cellToActivate->list.array[0]->value.choice.\
-        Cells_to_be_Activated_List_Item.nRCGI.nRCellIdentity.buf == NULLP)
+         Cells_to_be_Activated_List_Item.nRCGI.nRCellIdentity.buf == NULLP)
    {
       CU_FREE(cellToActivate->list.array[0]->\
    {
       CU_FREE(cellToActivate->list.array[0]->\
-           value.choice.Cells_to_be_Activated_List_Item.nRCGI.pLMN_Identity.buf,\
-           3*sizeof(uint8_t));
+            value.choice.Cells_to_be_Activated_List_Item.nRCGI.pLMN_Identity.buf,\
+            3*sizeof(uint8_t));
       for(ieIdx=0; ieIdx<cellCnt; ieIdx++)
       {
       for(ieIdx=0; ieIdx<cellCnt; ieIdx++)
       {
-        CU_FREE(cellToActivate->list.array[ieIdx],\
-              sizeof(struct Cells_to_be_Activated_List_ItemIEs ));
+         CU_FREE(cellToActivate->list.array[ieIdx],\
+               sizeof(struct Cells_to_be_Activated_List_ItemIEs ));
       }
 
       CU_FREE(cellToActivate->list.array,\
       }
 
       CU_FREE(cellToActivate->list.array,\
-           sizeof(struct Cells_to_be_Activated_List_ItemIEs  *));
+            sizeof(struct Cells_to_be_Activated_List_ItemIEs  *));
       CU_FREE(cuName->buf, sizeof(cuName->size));
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
       CU_FREE(cuName->buf, sizeof(cuName->size));
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
-        CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx], \
-              sizeof(F1SetupResponseIEs_t));
+         CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx], \
+               sizeof(F1SetupResponseIEs_t));
       }
       CU_FREE(f1SetupRsp->protocolIEs.list.array, \
       }
       CU_FREE(f1SetupRsp->protocolIEs.list.array, \
-           elementCnt * sizeof(F1SetupResponseIEs_t *));
+            elementCnt * sizeof(F1SetupResponseIEs_t *));
       CU_FREE(f1apMsg->choice.successfulOutcome, \
       CU_FREE(f1apMsg->choice.successfulOutcome, \
-           sizeof(SuccessfulOutcome_t));
+            sizeof(SuccessfulOutcome_t));
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
    }
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
    }
@@ -487,10 +487,10 @@ S16 BuildAndSendF1SetupRsp()
    /* RRC Version */
    idx++;
    f1SetupRsp->protocolIEs.list.array[idx]->id = \
    /* RRC Version */
    idx++;
    f1SetupRsp->protocolIEs.list.array[idx]->id = \
-                                                ProtocolIE_ID_id_GNB_CU_RRC_Version;
+                                                 ProtocolIE_ID_id_GNB_CU_RRC_Version;
    f1SetupRsp->protocolIEs.list.array[idx]->criticality = Criticality_reject;
    f1SetupRsp->protocolIEs.list.array[idx]->value.present = \
    f1SetupRsp->protocolIEs.list.array[idx]->criticality = Criticality_reject;
    f1SetupRsp->protocolIEs.list.array[idx]->value.present = \
-                                                           F1SetupResponseIEs__value_PR_RRC_Version;
+                                                            F1SetupResponseIEs__value_PR_RRC_Version;
    rrcVer = &f1SetupRsp->protocolIEs.list.array[idx]->value.choice.RRC_Version;
    rrcVer->latest_RRC_Version.size = RRC_SIZE; 
 
    rrcVer = &f1SetupRsp->protocolIEs.list.array[idx]->value.choice.RRC_Version;
    rrcVer->latest_RRC_Version.size = RRC_SIZE; 
 
@@ -500,11 +500,11 @@ S16 BuildAndSendF1SetupRsp()
       CU_FREE(cuName->buf, sizeof(cuName->size));
       for(ieIdx=0; ieIdx<elementCnt; idx++)
       {
       CU_FREE(cuName->buf, sizeof(cuName->size));
       for(ieIdx=0; ieIdx<elementCnt; idx++)
       {
-        CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx], \
-              sizeof(F1SetupResponseIEs_t));
+         CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx], \
+               sizeof(F1SetupResponseIEs_t));
       } 
       CU_FREE(f1SetupRsp->protocolIEs.list.array,\
       } 
       CU_FREE(f1SetupRsp->protocolIEs.list.array,\
-           elementCnt * sizeof(F1SetupResponseIEs_t *));
+            elementCnt * sizeof(F1SetupResponseIEs_t *));
       CU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
       CU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
@@ -520,11 +520,11 @@ S16 BuildAndSendF1SetupRsp()
       CU_FREE(cuName->buf, sizeof(cuName->size));
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
       CU_FREE(cuName->buf, sizeof(cuName->size));
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
-        CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx], \
-              sizeof(F1SetupResponseIEs_t));
+         CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx], \
+               sizeof(F1SetupResponseIEs_t));
       } 
       CU_FREE(f1SetupRsp->protocolIEs.list.array,\
       } 
       CU_FREE(f1SetupRsp->protocolIEs.list.array,\
-           elementCnt * sizeof(F1SetupResponseIEs_t *));
+            elementCnt * sizeof(F1SetupResponseIEs_t *));
       CU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
       CU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
@@ -532,73 +532,73 @@ S16 BuildAndSendF1SetupRsp()
    rrcVer->iE_Extensions->list.count = 1;
    rrcVer->iE_Extensions->list.size = sizeof(struct RRC_Version_ExtIEs *);
    CU_ALLOC(rrcVer->iE_Extensions->list.array,\
    rrcVer->iE_Extensions->list.count = 1;
    rrcVer->iE_Extensions->list.size = sizeof(struct RRC_Version_ExtIEs *);
    CU_ALLOC(rrcVer->iE_Extensions->list.array,\
-        sizeof(struct RRC_Version_ExtIEs *));
+         sizeof(struct RRC_Version_ExtIEs *));
    if(rrcVer->iE_Extensions->list.array == NULLP)
    {
       CU_FREE(rrcVer->iE_Extensions,\
    if(rrcVer->iE_Extensions->list.array == NULLP)
    {
       CU_FREE(rrcVer->iE_Extensions,\
-           sizeof(ProtocolExtensionContainer_4624P81_t));
+            sizeof(ProtocolExtensionContainer_4624P81_t));
       CU_FREE(rrcVer->latest_RRC_Version.buf, sizeof(uint8_t));
       CU_FREE(cuName->buf, sizeof(cuName->size));
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
       CU_FREE(rrcVer->latest_RRC_Version.buf, sizeof(uint8_t));
       CU_FREE(cuName->buf, sizeof(cuName->size));
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
-        CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx], \
-              sizeof(F1SetupResponseIEs_t));
+         CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx], \
+               sizeof(F1SetupResponseIEs_t));
       } 
       CU_FREE(f1SetupRsp->protocolIEs.list.array,\
       } 
       CU_FREE(f1SetupRsp->protocolIEs.list.array,\
-           elementCnt * sizeof(F1SetupResponseIEs_t *));
+            elementCnt * sizeof(F1SetupResponseIEs_t *));
       CU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
    }
    CU_ALLOC(rrcVer->iE_Extensions->list.array[0],\
       CU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
    }
    CU_ALLOC(rrcVer->iE_Extensions->list.array[0],\
-        sizeof(struct RRC_Version_ExtIEs));
+         sizeof(struct RRC_Version_ExtIEs));
    if(rrcVer->iE_Extensions->list.array[0] == NULLP)
    {
       CU_FREE(rrcVer->iE_Extensions->list.array,\
    if(rrcVer->iE_Extensions->list.array[0] == NULLP)
    {
       CU_FREE(rrcVer->iE_Extensions->list.array,\
-           sizeof(struct RRC_Version_ExtIEs *));
+            sizeof(struct RRC_Version_ExtIEs *));
       CU_FREE(rrcVer->iE_Extensions,\
       CU_FREE(rrcVer->iE_Extensions,\
-           sizeof(ProtocolExtensionContainer_4624P81_t));
+            sizeof(ProtocolExtensionContainer_4624P81_t));
       CU_FREE(rrcVer->latest_RRC_Version.buf, sizeof(uint8_t));
       CU_FREE(cuName->buf, sizeof(cuName->size));
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
       CU_FREE(rrcVer->latest_RRC_Version.buf, sizeof(uint8_t));
       CU_FREE(cuName->buf, sizeof(cuName->size));
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
-        CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx], \
-              sizeof(F1SetupResponseIEs_t));
+         CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx], \
+               sizeof(F1SetupResponseIEs_t));
       } 
       CU_FREE(f1SetupRsp->protocolIEs.list.array,\
       } 
       CU_FREE(f1SetupRsp->protocolIEs.list.array,\
-           elementCnt * sizeof(F1SetupResponseIEs_t *));
+            elementCnt * sizeof(F1SetupResponseIEs_t *));
       CU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
    }
    rrcVer->iE_Extensions->list.array[0]->id = \
       CU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
    }
    rrcVer->iE_Extensions->list.array[0]->id = \
-                                             ProtocolIE_ID_id_latest_RRC_Version_Enhanced;
+                                              ProtocolIE_ID_id_latest_RRC_Version_Enhanced;
    rrcVer->iE_Extensions->list.array[0]->criticality = Criticality_reject;
    rrcVer->iE_Extensions->list.array[0]->extensionValue.present = \
    rrcVer->iE_Extensions->list.array[0]->criticality = Criticality_reject;
    rrcVer->iE_Extensions->list.array[0]->extensionValue.present = \
-                                                                 RRC_Version_ExtIEs__extensionValue_PR_Latest_RRC_Version_Enhanced;
+                                                                  RRC_Version_ExtIEs__extensionValue_PR_Latest_RRC_Version_Enhanced;
    rrcVer->iE_Extensions->list.array[0]->extensionValue.choice.\
       Latest_RRC_Version_Enhanced.size = 3*sizeof(uint8_t);
    CU_ALLOC(rrcVer->iE_Extensions->list.\
    rrcVer->iE_Extensions->list.array[0]->extensionValue.choice.\
       Latest_RRC_Version_Enhanced.size = 3*sizeof(uint8_t);
    CU_ALLOC(rrcVer->iE_Extensions->list.\
-        array[0]->extensionValue.choice.Latest_RRC_Version_Enhanced.buf,\
-        3*sizeof(uint8_t));
+         array[0]->extensionValue.choice.Latest_RRC_Version_Enhanced.buf,\
+         3*sizeof(uint8_t));
    if(rrcVer->iE_Extensions->list.\
    if(rrcVer->iE_Extensions->list.\
-        array[0]->extensionValue.choice.Latest_RRC_Version_Enhanced.buf == NULLP)
+         array[0]->extensionValue.choice.Latest_RRC_Version_Enhanced.buf == NULLP)
    {
       CU_FREE(rrcVer->iE_Extensions->list.array[0],\
    {
       CU_FREE(rrcVer->iE_Extensions->list.array[0],\
-           sizeof(struct RRC_Version_ExtIEs));
+            sizeof(struct RRC_Version_ExtIEs));
       CU_FREE(rrcVer->iE_Extensions->list.array,\
       CU_FREE(rrcVer->iE_Extensions->list.array,\
-           sizeof(struct RRC_Version_ExtIEs *));
+            sizeof(struct RRC_Version_ExtIEs *));
       CU_FREE(rrcVer->iE_Extensions,\
       CU_FREE(rrcVer->iE_Extensions,\
-           sizeof(ProtocolExtensionContainer_4624P81_t));
+            sizeof(ProtocolExtensionContainer_4624P81_t));
       CU_FREE(rrcVer->latest_RRC_Version.buf, sizeof(uint8_t));
       CU_FREE(cuName->buf, sizeof(cuName->size));
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
       CU_FREE(rrcVer->latest_RRC_Version.buf, sizeof(uint8_t));
       CU_FREE(cuName->buf, sizeof(cuName->size));
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
-        CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx], \
-              sizeof(F1SetupResponseIEs_t));
+         CU_FREE(f1SetupRsp->protocolIEs.list.array[ieIdx], \
+               sizeof(F1SetupResponseIEs_t));
       } 
       CU_FREE(f1SetupRsp->protocolIEs.list.array,\
       } 
       CU_FREE(f1SetupRsp->protocolIEs.list.array,\
-           elementCnt * sizeof(F1SetupResponseIEs_t *));
+            elementCnt * sizeof(F1SetupResponseIEs_t *));
       CU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
       CU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
       CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
       return RFAILED;
@@ -632,7 +632,7 @@ S16 BuildAndSendF1SetupRsp()
    if(encRetVal.encoded == ENCODE_FAIL)
    {
       DU_LOG("\nERROR  -->  F1AP : Could not encode F1SetupResponse structure (at %s)\n",\
    if(encRetVal.encoded == ENCODE_FAIL)
    {
       DU_LOG("\nERROR  -->  F1AP : Could not encode F1SetupResponse structure (at %s)\n",\
-           encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+            encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
       return RFAILED;   
    } 
    else 
       return RFAILED;   
    } 
    else 
@@ -640,7 +640,7 @@ S16 BuildAndSendF1SetupRsp()
       DU_LOG("\nDEBUG  -->  F1AP : Created APER encoded buffer for F1SetupResponse\n");
       for(int i=0; i< encBufSize; i++)
       {
       DU_LOG("\nDEBUG  -->  F1AP : Created APER encoded buffer for F1SetupResponse\n");
       for(int i=0; i< encBufSize; i++)
       {
-        DU_LOG("%x",encBuf[i]);
+         DU_LOG("%x",encBuf[i]);
       } 
    }
 
       } 
    }
 
@@ -665,8 +665,7 @@ S16 BuildAndSendF1SetupRsp()
  *    Functionality: Constructs the DU Update Acknowledge message and sends
  *                   it to the DU through SCTP.
  *
  *    Functionality: Constructs the DU Update Acknowledge message and sends
  *                   it to the DU through SCTP.
  *
- * @params[in] void **buf,Buffer to which encoded pattern is written into
- * @params[in] int *size,size of buffer
+ * @params[in] 
  *
  * @return ROK     - success
  *         RFAILED - failure
  *
  * @return ROK     - success
  *         RFAILED - failure
@@ -725,10 +724,10 @@ S16 BuildAndSendDUUpdateAck()
       CU_ALLOC(gNBDuCfgAck->protocolIEs.list.array[idx], sizeof(GNBDUConfigurationUpdateAcknowledgeIEs_t));
       if(gNBDuCfgAck->protocolIEs.list.array[idx] == NULLP)
       {
       CU_ALLOC(gNBDuCfgAck->protocolIEs.list.array[idx], sizeof(GNBDUConfigurationUpdateAcknowledgeIEs_t));
       if(gNBDuCfgAck->protocolIEs.list.array[idx] == NULLP)
       {
-        CU_FREE(gNBDuCfgAck->protocolIEs.list.array, elementCnt * sizeof(GNBDUConfigurationUpdateAcknowledgeIEs_t *));
-        CU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
-        CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
-        return RFAILED;
+         CU_FREE(gNBDuCfgAck->protocolIEs.list.array, elementCnt * sizeof(GNBDUConfigurationUpdateAcknowledgeIEs_t *));
+         CU_FREE(f1apMsg->choice.successfulOutcome, sizeof(SuccessfulOutcome_t));
+         CU_FREE(f1apMsg, sizeof(F1AP_PDU_t));
+         return RFAILED;
       }
    }
 
       }
    }
 
@@ -736,7 +735,8 @@ S16 BuildAndSendDUUpdateAck()
    idx = 0;
    gNBDuCfgAck->protocolIEs.list.array[idx]->id = ProtocolIE_ID_id_TransactionID ;
    gNBDuCfgAck->protocolIEs.list.array[idx]->criticality = Criticality_reject;
    idx = 0;
    gNBDuCfgAck->protocolIEs.list.array[idx]->id = ProtocolIE_ID_id_TransactionID ;
    gNBDuCfgAck->protocolIEs.list.array[idx]->criticality = Criticality_reject;
-   gNBDuCfgAck->protocolIEs.list.array[idx]->value.present = GNBDUConfigurationUpdateAcknowledgeIEs__value_PR_TransactionID;
+   gNBDuCfgAck->protocolIEs.list.array[idx]->value.present =\
+   GNBDUConfigurationUpdateAcknowledgeIEs__value_PR_TransactionID;
    gNBDuCfgAck->protocolIEs.list.array[idx]->value.choice.TransactionID = TRANS_ID;
 
    xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
    gNBDuCfgAck->protocolIEs.list.array[idx]->value.choice.TransactionID = TRANS_ID;
 
    xer_fprint(stdout, &asn_DEF_F1AP_PDU, f1apMsg);
@@ -758,7 +758,8 @@ S16 BuildAndSendDUUpdateAck()
    /* Checking encode results */
    if(enRetVal.encoded == ENCODE_FAIL) 
    {
    /* Checking encode results */
    if(enRetVal.encoded == ENCODE_FAIL) 
    {
-      DU_LOG("\nERROR  -->  F1AP : Could not encode DUConfigUpdateAcknowledge structure (at %s)",enRetVal.failed_type ? enRetVal.failed_type->name : "unknown");
+      DU_LOG("\nERROR  -->  F1AP : Could not encode DUConfigUpdateAcknowledge structure (at %s)",\
+      enRetVal.failed_type ? enRetVal.failed_type->name : "unknown");
       return RFAILED; 
    } 
    else 
       return RFAILED; 
    } 
    else 
@@ -766,7 +767,7 @@ S16 BuildAndSendDUUpdateAck()
       DU_LOG("\nDEBUG  -->  F1AP : Created APER encoded buffer for DuConfigUpdateAcknowledge\n");  
       for(int i=0; i< encBufSize; i++)
       {
       DU_LOG("\nDEBUG  -->  F1AP : Created APER encoded buffer for DuConfigUpdateAcknowledge\n");  
       for(int i=0; i< encBufSize; i++)
       {
-        DU_LOG("%x",encBuf[i]);
+         DU_LOG("%x",encBuf[i]);
       } 
    }
 
       } 
    }
 
@@ -7598,6 +7599,65 @@ uint8_t procUeContextReleaseReq(F1AP_PDU_t *f1apMsg)
    }
    return ROK;
 }
    }
    return ROK;
 }
+/*******************************************************************
+*
+* @brief processing of Gnb-DU config update 
+*
+* @details
+*
+*    Function : procGnbDuUpdate 
+*
+*    Functionality:
+*         - processing of Gnb-DU config update 
+*
+* @params[in] F1AP_PDU_t *f1apMsg
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t procGnbDuUpdate(F1AP_PDU_t *f1apMsg)
+{
+   bool cellToBeDelete = false;
+   uint8_t ieIdx = 0;
+   GNBDUConfigurationUpdate_t *duCfgUpdate = NULLP;
+
+   duCfgUpdate = &f1apMsg->choice.initiatingMessage->value.choice.GNBDUConfigurationUpdate;
+
+   for(ieIdx=0; ieIdx < duCfgUpdate->protocolIEs.list.count; ieIdx++)
+   {
+      switch(duCfgUpdate->protocolIEs.list.array[ieIdx]->id)
+      {
+         case ProtocolIE_ID_id_TransactionID:
+            break;
+         case ProtocolIE_ID_id_Served_Cells_To_Modify_List:
+            break;
+         case ProtocolIE_ID_id_Served_Cells_To_Delete_List:
+            {
+               cellToBeDelete = true;
+               break;
+            }
+         case ProtocolIE_ID_id_gNB_DU_ID:
+            break;
+      }
+   }
+   if(BuildAndSendDUUpdateAck() != ROK)
+   {
+      DU_LOG("ERROR  -->  F1AP : Failed to build and send DUUpdateAck");  
+      return RFAILED;
+   }
+
+   if(cellToBeDelete == false)
+   {
+      DU_LOG("\nINFO  -->  F1AP : Sending F1 reset request");
+      if(BuildAndSendF1ResetReq() != ROK)
+      {
+         DU_LOG("ERROR  -->  F1AP : Failed to build and send F1 reset request");
+         return RFAILED;
+      }
+   }
+
+   return ROK;
+}
 /*******************************************************************
  *
  * @brief Handles received F1AP message and sends back response  
 /*******************************************************************
  *
  * @brief Handles received F1AP message and sends back response  
@@ -7687,9 +7747,7 @@ void F1APMsgHdlr(Buffer *mBuf)
                case InitiatingMessage__value_PR_GNBDUConfigurationUpdate:
                   {
                      DU_LOG("\nINFO  -->  F1AP : GNB-DU config update received");
                case InitiatingMessage__value_PR_GNBDUConfigurationUpdate:
                   {
                      DU_LOG("\nINFO  -->  F1AP : GNB-DU config update received");
-                     BuildAndSendDUUpdateAck();
-                     DU_LOG("\nINFO  -->  F1AP : Sending F1 reset request");
-                     BuildAndSendF1ResetReq();
+                     procGnbDuUpdate(f1apMsg);
                      break;
                   }
                case InitiatingMessage__value_PR_InitialULRRCMessageTransfer:
                      break;
                   }
                case InitiatingMessage__value_PR_InitialULRRCMessageTransfer:
index 002113e..042780e 100644 (file)
@@ -77,6 +77,7 @@ F1apMsgDb f1apMsgDb;
 void F1APMsgHdlr(Buffer *mBuf);
 uint8_t BuildAndSendUeContextModificationReq();
 uint8_t BuildAndSendUeContextReleaseCommand(uint8_t cuUeF1apId, uint8_t duUeF1apId);
 void F1APMsgHdlr(Buffer *mBuf);
 uint8_t BuildAndSendUeContextModificationReq();
 uint8_t BuildAndSendUeContextReleaseCommand(uint8_t cuUeF1apId, uint8_t duUeF1apId);
+uint8_t BuildAndSendF1ResetReq();
 /**********************************************************************
          End of file
 **********************************************************************/
 /**********************************************************************
          End of file
 **********************************************************************/
index f1d4486..167dbcd 100644 (file)
@@ -113,25 +113,6 @@ void duProcF1SetupRsp()
    duCb.f1Status = TRUE; //Set F1 status as true
 }
 
    duCb.f1Status = TRUE; //Set F1 status as true
 }
 
-/*******************************************************************
- *
- * @brief Handles GNB DU Cfg Update Ack received in F1AP
- *
- * @details
- *
- *    Function : duProcGnbDuCfgUpdAckMsg
- *
- *    Functionality:
- *      - Handles GNB DU Cfg Update Ack received in F1AP
- *
- * @params[in] Pointer to F1GnbDuCfgUpdAck
- * @return void
- *  
- ******************************************************************/
-void duProcGnbDuCfgUpdAckMsg()
-{
-   DU_LOG("\nINFO   -->  DU APP: GNB-DU config update Ack received ");
-}
 /*******************************************************************
 *
 * @brief Returns cellCb based on cell ID
 /*******************************************************************
 *
 * @brief Returns cellCb based on cell ID
index 37128df..5926637 100644 (file)
@@ -22,7 +22,6 @@
 
 uint8_t duBuildAndSendMacCellCfg(uint16_t cellId);
 uint8_t duProcCellsToBeActivated(uint8_t *plmnStr, uint16_t nci, uint16_t nRPci);
 
 uint8_t duBuildAndSendMacCellCfg(uint16_t cellId);
 uint8_t duProcCellsToBeActivated(uint8_t *plmnStr, uint16_t nci, uint16_t nRPci);
-void duProcGnbDuCfgUpdAckMsg();
 void duProcF1SetupRsp();
 uint8_t duGetCellCb(uint16_t cellId, DuCellCb **cellCb);
 #endif
 void duProcF1SetupRsp();
 uint8_t duGetCellCb(uint16_t cellId, DuCellCb **cellCb);
 #endif
index a08ed64..ffe5978 100644 (file)
@@ -298,6 +298,12 @@ typedef enum
    GNBCU 
 }F1Entity;
 
    GNBCU 
 }F1Entity;
 
+typedef enum
+{
+   SERV_CELL_TO_MODIFY,
+   SERV_CELL_TO_DELETE
+}ServCellAction;
+
 typedef enum
 {
    UNSPECIFIED,
 typedef enum
 {
    UNSPECIFIED,
index b9c1c89..31b432b 100644 (file)
@@ -22,6 +22,7 @@
 #include "legtp.h"
 #include "lkw.x"
 #include "lrg.x"
 #include "legtp.h"
 #include "lkw.x"
 #include "lrg.x"
+#include "F1AP-PDU.h"
 #include "du_app_mac_inf.h"
 #include "du_cfg.h"
 #include "du_app_rlc_inf.h"
 #include "du_app_mac_inf.h"
 #include "du_cfg.h"
 #include "du_app_rlc_inf.h"
@@ -91,7 +92,6 @@
 #include "SchedulingRequestResourceConfig.h"
 #include<ProtocolIE-Field.h>
 #include "ProtocolExtensionField.h"
 #include "SchedulingRequestResourceConfig.h"
 #include<ProtocolIE-Field.h>
 #include "ProtocolExtensionField.h"
-#include "F1AP-PDU.h"
 #include "odu_common_codec.h"
 #include "du_mgr.h"
 #include "du_cell_mgr.h"
 #include "odu_common_codec.h"
 #include "du_mgr.h"
 #include "du_cell_mgr.h"
@@ -108,6 +108,7 @@ extern StartupConfig g_cfg;
 #endif
 
 DuCfgParams duCfgParam;
 #endif
 
 DuCfgParams duCfgParam;
+
 /************************************************************************
  *
  * @brief Converts enum values into actual value of Poll retransmit timer
 /************************************************************************
  *
  * @brief Converts enum values into actual value of Poll retransmit timer
@@ -597,6 +598,109 @@ int16_t getStatProhTmr(uint8_t statProhTmrCfg)
    return statProhTmr; 
 }
 
    return statProhTmr; 
 }
 
+/*******************************************************************
+*
+* @brief Adding F1AP pdu to reserved pdu list
+*
+* @details
+*
+*    Function : addToReservedF1apPduList 
+*
+*    Functionality: Adding F1AP pdu to reserved pdu list.
+*     These pdu are awaiting aknowledgment from CU
+*
+* @params[in] uint8_t transId, F1AP_PDU_t *f1apMsg
+*
+* @return ROK - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+
+void addToReservedF1apPduList(uint8_t transId, F1AP_PDU_t *f1apPdu)
+{
+   CmLList         *node = NULLP;
+   ReservedF1apPduInfo *pduInfo = NULLP;
+   DU_ALLOC(pduInfo, sizeof(ReservedF1apPduInfo));
+   if(pduInfo)
+   {
+      DU_ALLOC(node, sizeof(CmLList));
+      if(node)
+      {
+         pduInfo->transId = transId;
+         pduInfo->f1apMsg = (void*) f1apPdu;
+
+         node->node = (PTR)pduInfo;
+         cmLListAdd2Tail(&duCb.reservedF1apPduList, node);
+      }
+   }
+}
+
+/*******************************************************************
+*
+* @brief searching for F1AP pdu from ReservedF1apPduList 
+*
+* @details
+*
+*    Function : searchFromReservedF1apPduList 
+*
+*    Functionality: searching for F1AP pdu information
+*
+* @params[in] uint8_t transId
+*
+* @return pointer to F1AP_PDU_t
+*
+* ****************************************************************/
+
+CmLList *searchFromReservedF1apPduList(uint8_t transId)
+{
+   CmLList         *node;
+   ReservedF1apPduInfo *f1apPdu;
+   if(duCb.reservedF1apPduList.count)
+   {
+      CM_LLIST_FIRST_NODE(&duCb.reservedF1apPduList, node);
+      while(node)
+      {
+         f1apPdu = (ReservedF1apPduInfo*)node->node;
+         if(f1apPdu->transId == transId)
+         {
+            return node;
+         }
+         node = node->next;
+      }
+   }
+   return NULL;
+}
+
+/*******************************************************************
+*
+* @brief deleting F1AP pdu information from ReservedF1apPduList
+*
+* @details
+*
+*    Function : deleteFromReservedF1apPduList 
+*
+*    Functionality: deleting pdu information from ReservedF1apPduList
+*
+* @params[in] CmLList *node 
+*
+* @return void 
+*
+* ****************************************************************/
+
+void deleteFromReservedF1apPduList(CmLList *node)
+{
+   ReservedF1apPduInfo *f1apPdu;
+
+   if(node != NULL)
+   {
+      f1apPdu = (ReservedF1apPduInfo *)node->node;
+      cmLListDelFrm(&duCb.reservedF1apPduList, node);
+      DU_FREE(f1apPdu, sizeof(ReservedF1apPduInfo));
+      DU_FREE(node, sizeof(CmLList));
+      node = NULL;
+   }
+}
+
 /*******************************************************************
  *
  * @brief Builds Uplink Info for NR 
 /*******************************************************************
  *
  * @brief Builds Uplink Info for NR 
@@ -1708,6 +1812,203 @@ uint8_t BuildAndSendF1SetupReq()
    return ret;
 }/* End of BuildAndSendF1SetupReq */
 
    return ret;
 }/* End of BuildAndSendF1SetupReq */
 
+/*******************************************************************
+ *
+ * @brief Deallocating memory allocated for Served_Cells_To_Modify_Item_t
+ *
+ * @details
+ *
+ *    Function : freeCellsToModifyItem 
+ *
+ *    Functionality: Deallocating memory of variables allocated in
+ *                    BuildAndSendDUConfigUpdate function
+ *
+ * @params[in]  Served_Cells_To_Modify_Item_t *modifyItem
+ *
+ * @return ROK     - void
+ *
+ * ****************************************************************/
+
+void freeCellsToModifyItem(Served_Cells_To_Modify_Item_t *modifyItem)
+{
+   uint8_t arrIdx=0,i=0;
+   if(modifyItem->oldNRCGI.pLMN_Identity.buf != NULLP)
+   {
+      if(modifyItem->oldNRCGI.nRCellIdentity.buf != NULLP)
+      {
+         if(modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.buf != NULLP)
+         {
+            if(modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf
+                  != NULLP)
+            {
+               if(modifyItem->served_Cell_Information.servedPLMNs.list.array\
+                     != NULLP)
+               {
+                  if(!modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx])
+                  {
+                     if(modifyItem->served_Cell_Information.servedPLMNs.list.\
+                           array[arrIdx]->pLMN_Identity.buf != NULLP)
+                     {
+                        if(modifyItem->served_Cell_Information.servedPLMNs.list.\
+                              array[arrIdx]->iE_Extensions!= NULLP)
+                        {
+                           if(modifyItem->served_Cell_Information.servedPLMNs.list.\
+                                 array[arrIdx]->iE_Extensions->list.array != NULLP)
+                           {
+                              if(modifyItem->served_Cell_Information.servedPLMNs.list.\
+                                    array[arrIdx]->iE_Extensions->list.array[arrIdx])
+                              {
+                                 if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+                                       iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+                                       list.array !=NULLP)
+                                 {
+                                    if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+                                          iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+                                          list.array[arrIdx]!=NULLP)
+                                    {
+                                       if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+                                             iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+                                             list.array[arrIdx]->sNSSAI.sST.buf!=NULLP)
+                                       {
+                                          if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+                                                iE_Extensions->list.array[arrIdx]->extensionValue.choice.\
+                                                SliceSupportList.\
+                                                list.array[arrIdx]->sNSSAI.sD != NULLP)
+                                          {
+                                             if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+                                                   iE_Extensions->list.array[arrIdx]->extensionValue.\
+                                                   choice.SliceSupportList.\
+                                                   list.array[arrIdx]->sNSSAI.sD->buf!=NULLP)
+                                             {
+                                                if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD
+                                                      !=NULLP)
+                                                {
+                                                   if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
+                                                         fDD->uL_NRFreqInfo.freqBandListNr.list.array!=NULLP)
+                                                   {
+                                                      if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
+                                                            fDD->uL_NRFreqInfo.freqBandListNr.list.array[arrIdx]!=NULLP)
+                                                      {
+                                                         if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
+                                                               fDD->dL_NRFreqInfo.freqBandListNr.list.array !=NULLP)
+                                                         {
+                                                            if(modifyItem->served_Cell_Information.nR_Mode_Info.\
+                                                                  choice.fDD->dL_NRFreqInfo.freqBandListNr.list.\
+                                                                  array[arrIdx]!= NULLP)
+                                                            {
+                                                               if(modifyItem->served_Cell_Information.\
+                                                                     measurementTimingConfiguration.buf !=NULLP)
+                                                               {
+                                                                  DU_FREE(modifyItem->served_Cell_Information.\
+                                                                        measurementTimingConfiguration.\
+                                                                        buf,modifyItem->served_Cell_Information.\
+                                                                        measurementTimingConfiguration.size);
+                                                               }
+                                                               DU_FREE(modifyItem->served_Cell_Information.\
+                                                                     nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
+                                                                     freqBandListNr.\
+                                                                     list.array[arrIdx],sizeof(FreqBandNrItem_t));
+                                                            }
+                                                            DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info\
+                                                                  .choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array,\
+                                                                  modifyItem->served_Cell_Information.nR_Mode_Info.\
+                                                                  choice.fDD->dL_NRFreqInfo.freqBandListNr.list.size);
+                                                         }
+                                                         DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.\
+                                                               choice.fDD->uL_NRFreqInfo.freqBandListNr.list.\
+                                                               array[arrIdx],sizeof(FreqBandNrItem_t));
+                                                      }
+                                                      DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.\
+                                                            choice.\
+                                                            fDD->uL_NRFreqInfo.freqBandListNr.list.\
+                                                            array,modifyItem->served_Cell_Information.nR_Mode_Info.\
+                                                            choice.fDD->uL_NRFreqInfo.freqBandListNr.list.size);
+                                                   }
+                                                   DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
+                                                         fDD,sizeof(FDD_Info_t));
+                                                }
+                                                DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
+                                                      array[arrIdx]->iE_Extensions->list.array[arrIdx]->extensionValue.\
+                                                      choice.SliceSupportList.\
+                                                      list.array[arrIdx]->sNSSAI.sD->buf,modifyItem->\
+                                                      served_Cell_Information.\
+                                                      servedPLMNs.list.array[arrIdx]->iE_Extensions->list.\
+                                                      array[arrIdx]->\
+                                                      extensionValue.choice.SliceSupportList.list.array[arrIdx]->\
+                                                      sNSSAI.sD->size);
+
+                                             }
+                                             DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
+                                                   array[arrIdx]->\
+                                                   iE_Extensions->list.array[arrIdx]->extensionValue.choice.\
+                                                   SliceSupportList.\
+                                                   list.array[arrIdx]->sNSSAI.sD,sizeof(OCTET_STRING_t));
+                                          }
+                                          DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+                                                iE_Extensions->list.array[arrIdx]->extensionValue.choice.\
+                                                SliceSupportList.\
+                                                list.array[arrIdx]->sNSSAI.sST.buf,modifyItem->served_Cell_Information.\
+                                                servedPLMNs.\
+                                                list.array[arrIdx]->iE_Extensions->list.array[arrIdx]->\
+                                                extensionValue.choice.\
+                                                SliceSupportList.list.array[arrIdx]->sNSSAI.sST.size);
+                                       }
+                                       DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+                                             iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+                                             list.array[arrIdx],sizeof(SliceSupportItem_t));
+                                    }
+                                    DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+                                          iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+                                          list.array,\
+                                          modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+                                          iE_Extensions->list.array[arrIdx]->extensionValue.choice.\
+                                          SliceSupportList.list.size);
+                                 }
+                              }
+                              for(i=0;i<modifyItem->served_Cell_Information.servedPLMNs.list.\
+                                    array[arrIdx]->iE_Extensions->list.count;i++)
+                              {
+                                 DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
+                                       array[arrIdx]->iE_Extensions->list.array[i],\
+                                       sizeof(ServedPLMNs_ItemExtIEs_t ));
+                              }
+                              DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
+                                    array[arrIdx]->iE_Extensions->list.array,modifyItem->served_Cell_Information.\
+                                    servedPLMNs.list.array[arrIdx]->iE_Extensions->list.size);
+                           }
+                           DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
+                                 array[arrIdx]->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t));
+                        }
+                        DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
+                              array[arrIdx]->pLMN_Identity.buf,
+                              modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->pLMN_Identity.size);
+                     }
+                  }
+                  for(i=0;i<modifyItem->served_Cell_Information.servedPLMNs.list.count;i++)
+                  {
+                     if(modifyItem->served_Cell_Information.servedPLMNs.list.array[i]
+                           != NULLP)
+                     {
+                        DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[i],\
+                              sizeof(ServedPLMNs_Item_t));
+                     }
+                  }
+                  DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array,\
+                        modifyItem->served_Cell_Information.servedPLMNs.list.size);
+               }
+               DU_FREE(modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf,\
+                     modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.size);
+            }
+            DU_FREE(modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.buf,\
+                  modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.size);
+         }
+         DU_FREE(modifyItem->oldNRCGI.nRCellIdentity.buf,\
+               modifyItem->oldNRCGI.nRCellIdentity.size);
+      }
+      DU_FREE(modifyItem->oldNRCGI.pLMN_Identity.buf,\
+            modifyItem->oldNRCGI.pLMN_Identity.size);  
+   }
+}
 /*******************************************************************
  *
  * @brief Deallocating memory of BuildAndSendDUConfigUpdate
 /*******************************************************************
  *
  * @brief Deallocating memory of BuildAndSendDUConfigUpdate
@@ -1726,231 +2027,87 @@ uint8_t BuildAndSendF1SetupReq()
  * ****************************************************************/
 void FreeDUConfigUpdate(F1AP_PDU_t *f1apDuCfg)
 {
  * ****************************************************************/
 void FreeDUConfigUpdate(F1AP_PDU_t *f1apDuCfg)
 {
-   uint8_t  i;
-   uint8_t  idx;
+   uint8_t  ieIdx=0, cellModifyIdx=0, cellDeleteIdx=0;
    GNBDUConfigurationUpdate_t *duCfgUpdate = NULLP;
    GNBDUConfigurationUpdate_t *duCfgUpdate = NULLP;
-   Served_Cells_To_Modify_List_t  *cellsToModify;
-   Served_Cells_To_Modify_Item_t *modifyItem;
-   idx=0;
-   i=1;
+   Served_Cells_To_Modify_List_t  *cellsToModify=NULLP;
+   Served_Cells_To_Delete_List_t  *cellsToDelete=NULLP;
+   Served_Cells_To_Delete_Item_t  *deleteItem = NULLP;
+   Served_Cells_To_Delete_ItemIEs_t *deleteItemIe = NULLP;
+
    if(f1apDuCfg != NULLP)
    {
       if(f1apDuCfg->choice.initiatingMessage != NULLP)
       {
    if(f1apDuCfg != NULLP)
    {
       if(f1apDuCfg->choice.initiatingMessage != NULLP)
       {
-        duCfgUpdate = &f1apDuCfg->choice.initiatingMessage->\
-                      value.choice.GNBDUConfigurationUpdate;
-        if(duCfgUpdate->protocolIEs.list.array != NULLP)
-        {
-           if(duCfgUpdate->protocolIEs.list.array[i] != NULLP)
-           {
-              cellsToModify = &duCfgUpdate->protocolIEs.list.array[i]->\
-                              value.choice.Served_Cells_To_Modify_List;
-              if(cellsToModify->list.array != NULLP)
-              {
-                 if(cellsToModify->list.array[idx] != NULLP)
-                 {
-                    modifyItem=&cellsToModify->list.array[idx]->value.choice.\
-                               Served_Cells_To_Modify_Item;
-                    if(modifyItem->oldNRCGI.pLMN_Identity.buf != NULLP)
-                    {
-                       if(modifyItem->oldNRCGI.nRCellIdentity.buf != NULLP)
-                       {
-                          if(modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.buf != NULLP)
-                          {
-                             if(modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf
-                                   != NULLP)
-                             { 
-                                if(modifyItem->served_Cell_Information.servedPLMNs.list.array\
-                                      != NULLP)
-                                {
-                                   if(!modifyItem->served_Cell_Information.servedPLMNs.list.array[idx])
-                                   {
-                                      if(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                            array[idx]->pLMN_Identity.buf != NULLP)
-                                      {
-                                         if(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                               array[idx]->iE_Extensions!= NULLP)
-                                         {
-                                            if(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                  array[idx]->iE_Extensions->list.array != NULLP)
-                                            {
-                                               if(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                     array[idx]->iE_Extensions->list.array[idx])
-                                               {
-                                                  if(modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                        iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                        list.array !=NULLP)
-                                                  {
-                                                     if(modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                           iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                           list.array[idx]!=NULLP)
-                                                     {   
-                                                        if(modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                              iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                              list.array[idx]->sNSSAI.sST.buf!=NULLP)
-                                                        {
-                                                           if(modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                                 iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                                 list.array[idx]->sNSSAI.sD != NULLP)
-                                                           { 
-                                                              if(modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                                    iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                                    list.array[idx]->sNSSAI.sD->buf!=NULLP)
-                                                              {
-                                                                 if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD
-                                                                       !=NULLP)
-                                                                 {
-                                                                    if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
-                                                                          fDD->uL_NRFreqInfo.freqBandListNr.list.array!=NULLP)
-                                                                    {
-                                                                       if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
-                                                                             fDD->uL_NRFreqInfo.freqBandListNr.list.array[idx]!=NULLP)
-                                                                       {
-                                                                          if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
-                                                                                fDD->dL_NRFreqInfo.freqBandListNr.list.array !=NULLP)
-                                                                          {
-                                                                             if(modifyItem->served_Cell_Information.nR_Mode_Info.\
-                                                                                   choice.fDD->dL_NRFreqInfo.freqBandListNr.list.\
-                                                                                   array[idx]!= NULLP)
-                                                                             {
-                                                                                if(modifyItem->served_Cell_Information.\
-                                                                                      measurementTimingConfiguration.buf !=NULLP)
-                                                                                {
-                                                                                   idx=2;
-                                                                                   if(duCfgUpdate->protocolIEs.list.array[idx]->value.\
-                                                                                         choice.GNB_DU_ID.buf!=NULLP)
-                                                                                   {
-                                                                                      DU_FREE(duCfgUpdate->protocolIEs.list.\
-                                                                                            array[idx]->value.choice.GNB_DU_ID.buf,\
-                                                                                            duCfgUpdate->protocolIEs.list.array[idx]->\
-                                                                                            value.choice.GNB_DU_ID.size);
-                                                                                   }
-                                                                                   idx=0;
-                                                                                   DU_FREE(modifyItem->served_Cell_Information.\
-                                                                                         measurementTimingConfiguration.\
-                                                                                         buf,modifyItem->served_Cell_Information.\
-                                                                                         measurementTimingConfiguration.size);
-                                                                                }
-                                                                                DU_FREE(modifyItem->served_Cell_Information.\
-                                                                                      nR_Mode_Info.choice.fDD->dL_NRFreqInfo.freqBandListNr.\
-                                                                                      list.array[idx],sizeof(FreqBandNrItem_t));
-                                                                             }
-                                                                             DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info\
-                                                                                   .choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array,\
-                                                                                   modifyItem->served_Cell_Information.nR_Mode_Info.\
-                                                                                   choice.fDD->dL_NRFreqInfo.freqBandListNr.list.size);
-                                                                          }
-                                                                          DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.\
-                                                                                choice.fDD->uL_NRFreqInfo.freqBandListNr.list.\
-                                                                                array[idx],sizeof(FreqBandNrItem_t));
-                                                                       }
-                                                                       DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.\
-                                                                             choice.\
-                                                                             fDD->uL_NRFreqInfo.freqBandListNr.list.\
-                                                                             array,modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
-                                                                             fDD->uL_NRFreqInfo.freqBandListNr.list.size);
-                                                                    }
-                                                                    DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
-                                                                          fDD,sizeof(FDD_Info_t));
-                                                                 }
-                                                                 DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                                       array[idx]->iE_Extensions->list.array[idx]->extensionValue.choice.\
-                                                                       SliceSupportList.\
-                                                                       list.array[idx]->sNSSAI.sD->buf,modifyItem->served_Cell_Information.\
-                                                                       servedPLMNs.list.array[idx]->iE_Extensions->list.array[idx]->\
-                                                                       extensionValue.choice.SliceSupportList.list.array[idx]->\
-                                                                       sNSSAI.sD->size);
+         duCfgUpdate = &f1apDuCfg->choice.initiatingMessage->\
+                       value.choice.GNBDUConfigurationUpdate;
+         if(duCfgUpdate->protocolIEs.list.array != NULLP)
+         {
+            for(ieIdx=0; ieIdx<duCfgUpdate->protocolIEs.list.count; ieIdx++)
+            {
+               if(duCfgUpdate->protocolIEs.list.array[ieIdx] != NULLP)
+               {
+                  switch(duCfgUpdate->protocolIEs.list.array[ieIdx]->id)
+                  {
+                     case ProtocolIE_ID_id_Served_Cells_To_Modify_List:
+                        {
+                           cellsToModify = &duCfgUpdate->protocolIEs.list.array[ieIdx]->\
+                                           value.choice.Served_Cells_To_Modify_List;
+                           if(cellsToModify->list.array != NULLP)
+                           {
+                              for(cellModifyIdx=0; cellModifyIdx<cellsToModify->list.count ;cellModifyIdx++)
+                              {
+                                 if(cellsToModify->list.array[cellModifyIdx] != NULLP)
+                                 {
+                                    freeCellsToModifyItem(&cellsToModify->list.array[cellModifyIdx]->value.choice.\
+                                          Served_Cells_To_Modify_Item);
+                                    DU_FREE(cellsToModify->list.array[cellModifyIdx],\
+                                          sizeof(Served_Cells_To_Modify_ItemIEs_t));
+                                 }
+                              }
+                              DU_FREE(cellsToModify->list.array,cellsToModify->list.size);
+                           }
+                           break;
+                        }
+                     case ProtocolIE_ID_id_Served_Cells_To_Delete_List:
+                        {
+                           cellsToDelete = &duCfgUpdate->protocolIEs.list.array[ieIdx]->\
+                                           value.choice.Served_Cells_To_Delete_List;
+                           if(cellsToDelete->list.array != NULLP)
+                           {
+                              for(cellDeleteIdx=0; cellDeleteIdx<cellsToDelete->list.count ;cellDeleteIdx++)
+                              {
+                                 if(cellsToDelete->list.array[cellDeleteIdx] != NULLP)
+                                 {
+                                    deleteItemIe = ((Served_Cells_To_Delete_ItemIEs_t*)\
+                                          cellsToDelete->list.array[cellDeleteIdx]);
+                                    deleteItem=&deleteItemIe->value.choice.Served_Cells_To_Delete_Item;
+                                    DU_FREE(deleteItem->oldNRCGI.pLMN_Identity.buf,\
+                                          deleteItem->oldNRCGI.pLMN_Identity.size); 
+                                    DU_FREE(deleteItem->oldNRCGI.nRCellIdentity.buf,\
+                                          deleteItem->oldNRCGI.nRCellIdentity.size);
+                                    DU_FREE(cellsToDelete->list.array[cellDeleteIdx],\
+                                          sizeof(Served_Cells_To_Delete_ItemIEs_t));
+                                 }
+                              }
+                              DU_FREE(cellsToDelete->list.array,cellsToDelete->list.size);
+                           }
 
 
-                                                              }
-                                                              DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                                    array[idx]->\
-                                                                    iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                                    list.array[idx]->sNSSAI.sD,sizeof(OCTET_STRING_t));
-                                                           }
-                                                           DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                                 iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                                 list.array[idx]->sNSSAI.sST.buf,modifyItem->served_Cell_Information.\
-                                                                 servedPLMNs.\
-                                                                 list.array[idx]->iE_Extensions->list.array[idx]->extensionValue.choice.\
-                                                                 SliceSupportList.list.array[idx]->sNSSAI.sST.size);
-                                                        }
-                                                        DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                              iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                              list.array[idx],sizeof(SliceSupportItem_t));
-                                                     }
-                                                     DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                           iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.\
-                                                           list.array,\
-                                                           modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->\
-                                                           iE_Extensions->list.array[idx]->extensionValue.choice.SliceSupportList.list.size);
-                                                  }
-                                               }
-                                               for(i=0;i<modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                     array[idx]->iE_Extensions->list.count;i++)
-                                               {
-                                                  DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                        array[idx]->iE_Extensions->list.array[i],\
-                                                        sizeof(ServedPLMNs_ItemExtIEs_t ));
-                                               }
-                                               DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                     array[idx]->iE_Extensions->list.array,modifyItem->served_Cell_Information.servedPLMNs.
-                                                     list.array[idx]->iE_Extensions->list.size);
-                                            }
-                                            DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                  array[idx]->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t));
-                                         }
-                                         DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                               array[idx]->pLMN_Identity.buf,
-                                               modifyItem->served_Cell_Information.servedPLMNs.list.array[idx]->pLMN_Identity.size);
-                                      }
-                                   }
-                                   for(i=0;i<modifyItem->served_Cell_Information.servedPLMNs.list.count;i++)
-                                   {
-                                      if(modifyItem->served_Cell_Information.servedPLMNs.list.array[i]
-                                            != NULLP)
-                                      {
-                                         DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[i],\
-                                               sizeof(ServedPLMNs_Item_t));
-                                      }
-                                   }
-                                   DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array,\
-                                         modifyItem->served_Cell_Information.servedPLMNs.list.size);
-                                }
-                                DU_FREE(modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf,\
-                                      modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.size);          
-                             }
-                             DU_FREE(modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.buf,\
-                                   modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.size);
-                          }
-                          DU_FREE(modifyItem->oldNRCGI.nRCellIdentity.buf,\
-                                modifyItem->oldNRCGI.nRCellIdentity.size);
-                       }
-                       DU_FREE(modifyItem->oldNRCGI.pLMN_Identity.buf,\
-                             modifyItem->oldNRCGI.pLMN_Identity.size);
-                    }
-                 }
-                 for(i=0; i<cellsToModify->list.count ;i++)
-                 {
-                    if(cellsToModify->list.array[i] != NULLP)
-                    {
-                       DU_FREE(cellsToModify->list.array[i],\
-                             sizeof(Served_Cells_To_Modify_ItemIEs_t));
-                    } 
-                 }
-                 DU_FREE(cellsToModify->list.array,cellsToModify->list.size);
-              }
-           }
-           for(i=0;i<duCfgUpdate->protocolIEs.list.count;i++)
-           {
-              if(duCfgUpdate->protocolIEs.list.array[i] !=NULLP)
-              {
-                 DU_FREE(duCfgUpdate->protocolIEs.list.array[i],\
-                       sizeof(GNBDUConfigurationUpdateIEs_t));
-              }
-           }
-           DU_FREE(duCfgUpdate->protocolIEs.list.array,duCfgUpdate->protocolIEs.list.size);
-        }
-        DU_FREE(f1apDuCfg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
+                           break;
+                        }
+                     case GNBDUConfigurationUpdateIEs__value_PR_GNB_DU_ID:
+                        {
+                           DU_FREE(duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf,\
+                                 duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size);
+                           break;
+                        }
+                  }
+                  DU_FREE(duCfgUpdate->protocolIEs.list.array[ieIdx],\
+                        sizeof(GNBDUConfigurationUpdateIEs_t));
+               }
+            }
+            DU_FREE(duCfgUpdate->protocolIEs.list.array,duCfgUpdate->protocolIEs.list.size);
+         }
+         DU_FREE(f1apDuCfg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
       }
       DU_FREE(f1apDuCfg, (Size)sizeof(F1AP_PDU_t));
    }
       }
       DU_FREE(f1apDuCfg, (Size)sizeof(F1AP_PDU_t));
    }
@@ -2363,6 +2520,111 @@ uint8_t buildServCellToModList(Served_Cells_To_Modify_List_t *cellsToModify)
    else
       return ROK;
 }
    else
       return ROK;
 }
+/*******************************************************************
+ *
+ * @brief filling the DeleteItemList
+ *
+ * @details
+ *
+ *    Function : fillCellToDeleteItem 
+ *
+ *    Functionality: Filling the DeleteItemIe 
+ *
+ * @params[in] Pointer to Served_Cells_To_Delete_ItemIEs_t 
+ *
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ *****************************************************************/
+uint8_t fillCellToDeleteItem(struct Served_Cells_To_Delete_ItemIEs *deleteItemIe)
+{
+   uint8_t arrIdx;
+   Served_Cells_To_Delete_Item_t *deleteItem=NULLP;
+   
+   deleteItemIe->id = ProtocolIE_ID_id_Served_Cells_To_Delete_Item;
+   deleteItemIe->criticality = Criticality_reject;
+   deleteItemIe->value.present =\
+   Served_Cells_To_Delete_ItemIEs__value_PR_Served_Cells_To_Delete_Item;
+   deleteItem=&deleteItemIe->value.choice.Served_Cells_To_Delete_Item;
+
+   /*pLMN_Identity*/
+   deleteItem->oldNRCGI.pLMN_Identity.size = 3*sizeof(uint8_t);
+   DU_ALLOC(deleteItem->oldNRCGI.pLMN_Identity.buf,deleteItem->oldNRCGI.pLMN_Identity.size);
+   if(deleteItem->oldNRCGI.pLMN_Identity.buf == NULLP)
+   {
+      DU_LOG("ERROR  --> F1AP: fillCellToDeleteItem(): Failed to allocate the memory");
+      return RFAILED;
+   }
+   buildPlmnId(duCfgParam.srvdCellLst[0].duCellInfo.cellInfo.nrCgi.plmn,\
+         deleteItem->oldNRCGI.pLMN_Identity.buf);
+
+   /*nRCellIdentity*/
+   deleteItem->oldNRCGI.nRCellIdentity.size = 5*sizeof(uint8_t);
+   DU_ALLOC(deleteItem->oldNRCGI.nRCellIdentity.buf,\
+         deleteItem->oldNRCGI.nRCellIdentity.size);
+   if(deleteItem->oldNRCGI.nRCellIdentity.buf == NULLP)
+   {
+      DU_LOG("ERROR  --> F1AP: fillCellToDeleteItem(): Failed to allocate the memory");
+      return RFAILED;
+   }
+   for(arrIdx = 0; arrIdx < deleteItem->oldNRCGI.nRCellIdentity.size-1; arrIdx++)
+   {
+      deleteItem->oldNRCGI.nRCellIdentity.buf[arrIdx] = 0;
+   }
+   deleteItem->oldNRCGI.nRCellIdentity.buf[4] = 16;
+   deleteItem->oldNRCGI.nRCellIdentity.bits_unused = 4;
+   return ROK;
+} 
+/*******************************************************************
+ *
+ * @brief Builds ServCellToDeleteList
+ *
+ * @details
+ *
+ *    Function : buildServCellToDeleteList
+ *
+ *    Functionality: Builds the serv cell to delete List
+ *
+ * @params[in] Pointer to Served_Cells_To_Delete_List_t *
+ *
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ *****************************************************************/
+uint8_t buildServCellToDeleteList(Served_Cells_To_Delete_List_t *cellsToDelete)
+{
+   uint8_t ieListCnt, arrIdx;
+   
+   ieListCnt = 1;
+   cellsToDelete->list.count = ieListCnt;
+   cellsToDelete->list.size = ieListCnt*sizeof(Served_Cells_To_Delete_ItemIEs_t *);
+   
+   DU_ALLOC(cellsToDelete->list.array,cellsToDelete->list.size);
+   if(cellsToDelete->list.array == NULLP)
+   {
+      DU_LOG("\nERROR  --> F1AP : buildServCellToDeleteList(): Memory allocation failed");
+      return RFAILED;
+   }
+   
+   for(arrIdx=0; arrIdx< ieListCnt; arrIdx++)
+   {
+      DU_ALLOC(cellsToDelete->list.array[arrIdx],sizeof(Served_Cells_To_Delete_ItemIEs_t));
+      if(cellsToDelete->list.array[arrIdx] == NULLP)
+      {
+         DU_LOG("\nERROR  --> F1AP : buildServCellToDeleteList(): Memory allocation failed");
+         return RFAILED;
+      }
+   }
+   
+   arrIdx=0;
+   if(fillCellToDeleteItem((Served_Cells_To_Delete_ItemIEs_t*)cellsToDelete->list.array[arrIdx]) !=ROK)
+   {
+      DU_LOG("\nERROR  -->  F1AP: buildServCellToDeleteList(): failed to fill Served_Cells_To_Delete_ItemIEs");
+      return RFAILED;
+   }
+   return ROK;
+}
 
 /*******************************************************************
  *
 
 /*******************************************************************
  *
@@ -2382,12 +2644,14 @@ uint8_t buildServCellToModList(Served_Cells_To_Modify_List_t *cellsToModify)
  *         RFAILED - failure
  *
  * ****************************************************************/
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint8_t BuildAndSendDUConfigUpdate()
+uint8_t BuildAndSendDUConfigUpdate(ServCellAction servCellAction)
 {
 {
-   uint8_t ret, ieIdx, elementCnt;
+   uint8_t ret =0, ieIdx=0, elementCnt=0;
+   bool memAlloctionFailure = false;
    F1AP_PDU_t                 *f1apDuCfg = NULLP;
    GNBDUConfigurationUpdate_t *duCfgUpdate = NULLP;
    asn_enc_rval_t encRetVal;     /* Encoder return value */
    F1AP_PDU_t                 *f1apDuCfg = NULLP;
    GNBDUConfigurationUpdate_t *duCfgUpdate = NULLP;
    asn_enc_rval_t encRetVal;     /* Encoder return value */
+   
    memset(&encRetVal, 0, sizeof(asn_enc_rval_t));
    ret= RFAILED;
 
    memset(&encRetVal, 0, sizeof(asn_enc_rval_t));
    ret= RFAILED;
 
@@ -2398,78 +2662,106 @@ uint8_t BuildAndSendDUConfigUpdate()
       DU_ALLOC(f1apDuCfg, sizeof(F1AP_PDU_t));
       if(f1apDuCfg == NULLP)
       {
       DU_ALLOC(f1apDuCfg, sizeof(F1AP_PDU_t));
       if(f1apDuCfg == NULLP)
       {
-        DU_LOG("\nERROR  -->  F1AP : Memory allocation for F1AP-PDU failed");
-        break;
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendDUConfigUpdate(): Memory allocation for F1AP-PDU failed");
+         break;
       }
 
       f1apDuCfg->present = F1AP_PDU_PR_initiatingMessage;
       DU_ALLOC(f1apDuCfg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
       if(f1apDuCfg->choice.initiatingMessage == NULLP)
       {
       }
 
       f1apDuCfg->present = F1AP_PDU_PR_initiatingMessage;
       DU_ALLOC(f1apDuCfg->choice.initiatingMessage,sizeof(InitiatingMessage_t));
       if(f1apDuCfg->choice.initiatingMessage == NULLP)
       {
-        DU_LOG("\nERROR  -->  F1AP : Memory allocation for F1AP-PDU failed");
-        break;
+         DU_LOG("\nERROR  -->  F1AP : BuildAndSendDUConfigUpdate(): Memory allocation for F1AP-PDU failed");
+         break;
       }
 
       f1apDuCfg->choice.initiatingMessage->procedureCode = \
       }
 
       f1apDuCfg->choice.initiatingMessage->procedureCode = \
-                                                          ProcedureCode_id_gNBDUConfigurationUpdate;
+                                                           ProcedureCode_id_gNBDUConfigurationUpdate;
       f1apDuCfg->choice.initiatingMessage->criticality = Criticality_reject;
       f1apDuCfg->choice.initiatingMessage->value.present = \
       f1apDuCfg->choice.initiatingMessage->criticality = Criticality_reject;
       f1apDuCfg->choice.initiatingMessage->value.present = \
-                                                          InitiatingMessage__value_PR_GNBDUConfigurationUpdate;
+                                                           InitiatingMessage__value_PR_GNBDUConfigurationUpdate;
       duCfgUpdate = &f1apDuCfg->choice.initiatingMessage->value.\
       duCfgUpdate = &f1apDuCfg->choice.initiatingMessage->value.\
-                   choice.GNBDUConfigurationUpdate;
+                    choice.GNBDUConfigurationUpdate;
       elementCnt = 3;
       duCfgUpdate->protocolIEs.list.count = elementCnt;
       duCfgUpdate->protocolIEs.list.size = \
       elementCnt = 3;
       duCfgUpdate->protocolIEs.list.count = elementCnt;
       duCfgUpdate->protocolIEs.list.size = \
-                                          elementCnt * sizeof(GNBDUConfigurationUpdateIEs_t*);
+                                           elementCnt * sizeof(GNBDUConfigurationUpdateIEs_t*);
 
       /* Initialize the F1Setup members */
       DU_ALLOC(duCfgUpdate->protocolIEs.list.array,duCfgUpdate->protocolIEs.list.size);
       if(duCfgUpdate->protocolIEs.list.array == NULLP)
       {
 
       /* Initialize the F1Setup members */
       DU_ALLOC(duCfgUpdate->protocolIEs.list.array,duCfgUpdate->protocolIEs.list.size);
       if(duCfgUpdate->protocolIEs.list.array == NULLP)
       {
-        DU_LOG("ERROR  -->  F1AP : Memory allocation for F1RequestIEs failed");
-        break;
+         DU_LOG("ERROR  -->  F1AP : BuildAndSendDUConfigUpdate(): Memory allocation failed");
+         break;
       }
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
       }
       for(ieIdx=0; ieIdx<elementCnt; ieIdx++)
       {
-        DU_ALLOC(duCfgUpdate->protocolIEs.list.array[ieIdx],sizeof(GNBDUConfigurationUpdateIEs_t));
-        if(duCfgUpdate->protocolIEs.list.array[ieIdx] == NULLP)
-        {
-           break;
-        }
+         DU_ALLOC(duCfgUpdate->protocolIEs.list.array[ieIdx],sizeof(GNBDUConfigurationUpdateIEs_t));
+         if(duCfgUpdate->protocolIEs.list.array[ieIdx] == NULLP)
+         {
+            DU_LOG("ERROR  -->  F1AP : BuildAndSendDUConfigUpdate(): Memory allocation failed");
+            memAlloctionFailure = true;
+            break;
+         }
+      }
+      
+      if(memAlloctionFailure == true)
+      {
+         break;
       }
       }
-
       /*TransactionID*/
       ieIdx = 0;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->id=ProtocolIE_ID_id_TransactionID;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality= Criticality_reject;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \
       /*TransactionID*/
       ieIdx = 0;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->id=ProtocolIE_ID_id_TransactionID;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality= Criticality_reject;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \
-         GNBDUConfigurationUpdateIEs__value_PR_TransactionID;
+      GNBDUConfigurationUpdateIEs__value_PR_TransactionID;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.TransactionID = TRANS_ID;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.TransactionID = TRANS_ID;
-
-      /*Served Cell to Modify */
+      
       ieIdx++;
       ieIdx++;
-      duCfgUpdate->protocolIEs.list.array[ieIdx]->id = \
-                                                     ProtocolIE_ID_id_Served_Cells_To_Modify_List;
-      duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality =Criticality_reject;
-      duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \
-        GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Modify_List;
-      if(buildServCellToModList(&duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.\
-        Served_Cells_To_Modify_List))
-         break;
-
+      if(servCellAction == SERV_CELL_TO_MODIFY)
+      {
+         /*Served Cell to Modify */
+         duCfgUpdate->protocolIEs.list.array[ieIdx]->id = \
+         ProtocolIE_ID_id_Served_Cells_To_Modify_List;
+         duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality =Criticality_reject;
+         duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \
+         GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Modify_List;
+         if(buildServCellToModList(&duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.\
+                  Served_Cells_To_Modify_List))
+         {
+            DU_LOG("ERROR  --> DU APP : BuildAndSendDUConfigUpdate(): failed to build ServCellToModList");
+            break;
+         }
+      }
+      else
+      {
+         /*Served Cell to Delete */ 
+         duCfgUpdate->protocolIEs.list.array[ieIdx]->id = \
+         ProtocolIE_ID_id_Served_Cells_To_Delete_List;
+         duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality =Criticality_reject;
+         duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \
+         GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Delete_List;
+         if(buildServCellToDeleteList(&duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.\
+         Served_Cells_To_Delete_List)!=ROK)
+         {
+            DU_LOG("ERROR  --> DU APP : BuildAndSendDUConfigUpdate(): failed to build ServCellToDeleteList");
+            break;
+         }
+         
+      }
       // NOTE :GNB DU SYS INFO:MIB AND SIB1 INFORMATION TO BE BUILT AND FILLED HERE
       /*GNB DU ID */
       ieIdx++;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_ID;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \
       // NOTE :GNB DU SYS INFO:MIB AND SIB1 INFORMATION TO BE BUILT AND FILLED HERE
       /*GNB DU ID */
       ieIdx++;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->id = ProtocolIE_ID_id_gNB_DU_ID;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->criticality = Criticality_reject;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->value.present = \
-       GNBDUConfigurationUpdateIEs__value_PR_GNB_DU_ID;
+      GNBDUConfigurationUpdateIEs__value_PR_GNB_DU_ID;
       duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size = sizeof(uint8_t);
       DU_ALLOC(duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf,\
       duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size = sizeof(uint8_t);
       DU_ALLOC(duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf,\
-           duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size);
+            duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size);
       if(duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf == NULLP)
       {
       if(duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf == NULLP)
       {
-        break;
+         DU_LOG("ERROR  --> DU APP : BuildAndSendDUConfigUpdate(): Memory allocation failed for GNB_DU_ID");
+         break;
       }
       duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf[0] = duCfgParam.duId;
 
       }
       duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf[0] = duCfgParam.duId;
 
@@ -2483,30 +2775,30 @@ uint8_t BuildAndSendDUConfigUpdate()
       /* Checking encode results */
       if(encRetVal.encoded == ENCODE_FAIL)
       {
       /* Checking encode results */
       if(encRetVal.encoded == ENCODE_FAIL)
       {
-        DU_LOG("ERROR  -->  F1AP : Could not encode DUConfigUpdate structure (at %s)\n",\
-        encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
-        break;
+         DU_LOG("ERROR  -->  F1AP : Could not encode DUConfigUpdate structure (at %s)\n",\
+               encRetVal.failed_type ? encRetVal.failed_type->name : "unknown");
+         break;
       }
       else
       {
       }
       else
       {
-        DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for DUConfigUpdate\n");
-        for(ieIdx =0; ieIdx < encBufSize; ieIdx++)
-        {
-           printf("%x",encBuf[ieIdx]);
-        }
+         DU_LOG("\nDEBUG   -->  F1AP : Created APER encoded buffer for DUConfigUpdate\n");
+         for(ieIdx =0; ieIdx < encBufSize; ieIdx++)
+         {
+            printf("%x",encBuf[ieIdx]);
+         }
       }
       /* Sending msg */
       if(sendF1APMsg() != ROK)
       {
       }
       /* Sending msg */
       if(sendF1APMsg() != ROK)
       {
-        DU_LOG("\nERROR  -->  F1AP : Sending GNB-DU Config Update failed");
-        break;
+         DU_LOG("\nERROR  -->  F1AP : Sending GNB-DU Config Update failed");
+         break;
       }
 
       ret = ROK;
       break;
    }
       }
 
       ret = ROK;
       break;
    }
-   FreeDUConfigUpdate(f1apDuCfg);
-
+  
+   addToReservedF1apPduList(TRANS_ID,f1apDuCfg);
    return ret;
 }
 
    return ret;
 }
 
@@ -11484,6 +11776,99 @@ void freeAperDecodeGnbDuAck(GNBDUConfigurationUpdateAcknowledge_t *gnbDuAck)
       free(gnbDuAck->protocolIEs.list.array);
    }
 }
       free(gnbDuAck->protocolIEs.list.array);
    }
 }
+
+/*******************************************************************
+*
+* @brief Building  result of gnb-du config update ack output
+*
+* @details
+*
+*    Function : duProcGnbDuCfgUpdAckMsg 
+*
+*    Functionality: 
+*        Building output of gnb-du config update ack 
+*
+* @params[in] transId
+* @return void
+*
+* ****************************************************************/
+
+uint8_t duProcGnbDuCfgUpdAckMsg(uint8_t transId)
+{
+   uint8_t ueId =0 , ueIdx =0, ieIdx=0,arrIdx=0;
+   uint8_t cellId =0, cellIdx =0, crnti=0;
+   CmLList *f1apPduNode;
+   ReservedF1apPduInfo *f1apPduInfo;
+   F1AP_PDU_t *f1apMsgPdu = NULLP;
+   GNBDUConfigurationUpdate_t *gnbDuConfigUpdate = NULLP;
+   BIT_STRING_t *cellIdentity;
+   struct Served_Cells_To_Delete_ItemIEs *deleteItemIe;
+   Served_Cells_To_Delete_List_t *cellsToDelete;
+   Served_Cells_To_Delete_Item_t *deleteItem=NULLP;
+
+   DU_LOG("\nINFO   -->  DU APP: GNB-DU config update Ack received ");
+   f1apPduNode = searchFromReservedF1apPduList(transId);
+   f1apPduInfo = (ReservedF1apPduInfo *)f1apPduNode->node;
+   f1apMsgPdu = (F1AP_PDU_t *)f1apPduInfo->f1apMsg;
+
+   if(f1apMsgPdu)
+   {
+      if(f1apMsgPdu->choice.initiatingMessage)
+      {
+         gnbDuConfigUpdate = &f1apMsgPdu->choice.initiatingMessage->value.choice.GNBDUConfigurationUpdate;
+         for(ieIdx=0; ieIdx < gnbDuConfigUpdate->protocolIEs.list.count; ieIdx++)
+         {
+            switch(gnbDuConfigUpdate->protocolIEs.list.array[ieIdx]->id)
+            {
+               case ProtocolIE_ID_id_Served_Cells_To_Delete_List:
+               {
+                  cellsToDelete = &gnbDuConfigUpdate->protocolIEs.list.array[ieIdx]->value.choice.\
+                  Served_Cells_To_Delete_List;
+                  if(cellsToDelete->list.array)
+                  {
+                     if(cellsToDelete->list.array[arrIdx])
+                     {
+                        deleteItemIe = (Served_Cells_To_Delete_ItemIEs_t*)cellsToDelete->list.array[arrIdx];
+                        deleteItem=&deleteItemIe->value.choice.Served_Cells_To_Delete_Item;
+                        if(deleteItem->oldNRCGI.nRCellIdentity.buf)
+                        {
+                           cellIdentity = &deleteItem->oldNRCGI.nRCellIdentity;
+                           bitStringToInt(cellIdentity, &cellId);
+                        }
+                     }
+                  }
+
+                  GET_CELL_IDX(cellId, cellIdx);
+                  if(duCb.actvCellLst[cellIdx] != NULLP)
+                  {
+                     for(ueIdx = 0; ueIdx < duCb.numUe; ueIdx++)
+                     {
+                        crnti = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].crnti;
+                        GET_UE_IDX(crnti,ueId);
+                        BuildAndSendUeContextReleaseReq(cellId, ueId);
+                     }
+                  }
+                  else
+                  {
+                     DU_LOG("ERROR  --> DU_APP : duProcGnbDuCfgUpdAckMsg(): CellId [%d] not found", cellId);
+                     return RFAILED;
+                  }
+
+                  break;
+               }
+
+               default:
+                  break;
+            }
+         }
+      }
+   }
+   
+   FreeDUConfigUpdate(f1apMsgPdu);
+   deleteFromReservedF1apPduList(f1apPduNode);
+   return ROK;
+}
+
 /*******************************************************************
 *
 * @brief Processes GNB DU config update ack
 /*******************************************************************
 *
 * @brief Processes GNB DU config update ack
@@ -11500,28 +11885,40 @@ void freeAperDecodeGnbDuAck(GNBDUConfigurationUpdateAcknowledge_t *gnbDuAck)
 * ****************************************************************/
 uint8_t procF1GNBDUCfgUpdAck(F1AP_PDU_t *f1apMsg)
 {
 * ****************************************************************/
 uint8_t procF1GNBDUCfgUpdAck(F1AP_PDU_t *f1apMsg)
 {
-   uint8_t ieIdx;
+   uint8_t ieIdx=0,transId=0;
    GNBDUConfigurationUpdateAcknowledge_t *gnbDuAck = NULLP;
    GNBDUConfigurationUpdateAcknowledge_t *gnbDuAck = NULLP;
-   
+
    DU_LOG("\nINFO   -->  F1AP : GNB-DU config update acknowledgment");
    gnbDuAck = &f1apMsg->choice.successfulOutcome->value.choice.GNBDUConfigurationUpdateAcknowledge;
    DU_LOG("\nINFO   -->  F1AP : GNB-DU config update acknowledgment");
    gnbDuAck = &f1apMsg->choice.successfulOutcome->value.choice.GNBDUConfigurationUpdateAcknowledge;
-   
+
    for(ieIdx=0; ieIdx < gnbDuAck->protocolIEs.list.count; ieIdx++)
    {
       switch(gnbDuAck->protocolIEs.list.array[ieIdx]->id)
       {
          case ProtocolIE_ID_id_TransactionID:
    for(ieIdx=0; ieIdx < gnbDuAck->protocolIEs.list.count; ieIdx++)
    {
       switch(gnbDuAck->protocolIEs.list.array[ieIdx]->id)
       {
          case ProtocolIE_ID_id_TransactionID:
-           break;
+            {
+               transId = gnbDuAck->protocolIEs.list.array[ieIdx]->value.choice.TransactionID;
+               break;
+            }
          case ProtocolIE_ID_id_Cells_to_be_Activated_List:
          case ProtocolIE_ID_id_Cells_to_be_Activated_List:
-           break;
+            {
+               break;
+            }
          default :
          default :
-            DU_LOG("\nERROR  -->  F1AP: Invalid IE Received: %ld, at procF1GNBDUCfgUpdAck()", \
-           gnbDuAck->protocolIEs.list.array[ieIdx]->id);
-           break;
+            {
+               DU_LOG("\nERROR  -->  F1AP: procF1GNBDUCfgUpdAck(): Invalid IE Received: %ld", \
+                     gnbDuAck->protocolIEs.list.array[ieIdx]->id);
+               break;
+            }
       }
    }
       }
    }
-   duProcGnbDuCfgUpdAckMsg();
+   
+   duProcGnbDuCfgUpdAckMsg(transId);
+    
 #if 0
 #if 0
+   /* presently we are not supporting F1 Reset from DU to CU , we are only
+    * supporting F1 Reset from CU to DU */
+
    if(BuildAndSendF1ResetReq() != ROK)
    {
       return RFAILED;
    if(BuildAndSendF1ResetReq() != ROK)
    {
       return RFAILED;
index 0378748..39265d6 100644 (file)
@@ -189,6 +189,13 @@ typedef struct ueCcchCtxt
    uint16_t cellId;        /* Cell Id */
 }UeCcchCtxt;
 
    uint16_t cellId;        /* Cell Id */
 }UeCcchCtxt;
 
+/* This structure is added to store the information about the F1AP pdu and
+ * transId so that It can be used in future */
+typedef struct reservedF1apPduInfo
+{
+   uint8_t transId;               /* trans Id */
+   void *f1apMsg;              /* msg structure */
+}ReservedF1apPduInfo;
 
 /* DU APP DB */
 typedef struct duCb
 
 /* DU APP DB */
 typedef struct duCb
@@ -206,6 +213,7 @@ typedef struct duCb
    UeCcchCtxt     ueCcchCtxt[MAX_NUM_UE]; /* mapping of gnbDuUeF1apId to CRNTI required for CCCH processing*/
    uint8_t       numDrb;           /* current number of DRbs*/
    UpTnlCfg*     upTnlCfg[MAX_NUM_DRB]; /* tunnel info for every Drb */
    UeCcchCtxt     ueCcchCtxt[MAX_NUM_UE]; /* mapping of gnbDuUeF1apId to CRNTI required for CCCH processing*/
    uint8_t       numDrb;           /* current number of DRbs*/
    UpTnlCfg*     upTnlCfg[MAX_NUM_DRB]; /* tunnel info for every Drb */
+   CmLListCp     reservedF1apPduList; /*storing F1AP pdu infomation and transId */
 }DuCb;
 
 
 }DuCb;
 
 
index 45ec532..8f0391a 100644 (file)
@@ -96,7 +96,7 @@ uint8_t duActvInit(Ent entity, Inst inst, Region region, Reason reason)
    memset(duCb.ueCcchCtxt, 0, MAX_NUM_UE * sizeof(UeCcchCtxt));
    duCb.numCfgCells  = 0;
    duCb.numActvCells = 0;
    memset(duCb.ueCcchCtxt, 0, MAX_NUM_UE * sizeof(UeCcchCtxt));
    duCb.numCfgCells  = 0;
    duCb.numActvCells = 0;
-
+   cmLListInit(&duCb.reservedF1apPduList);
    ODU_SET_PROC_ID(DU_PROC);
 
    return ROK;
    ODU_SET_PROC_ID(DU_PROC);
 
    return ROK;
index d236c9a..d1731ad 100644 (file)
@@ -1476,13 +1476,13 @@ uint8_t  duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
    {
       if(macCellCfgCfm->cellId == duCb.actvCellLst[actvCellIdx]->cellId)
       {
    {
       if(macCellCfgCfm->cellId == duCb.actvCellLst[actvCellIdx]->cellId)
       {
-        duCb.actvCellLst[actvCellIdx]->duMacCellCfg = NULLP;
+         duCb.actvCellLst[actvCellIdx]->duMacCellCfg = NULLP;
       }
    }
    if(macCellCfgCfm->rsp == ROK)
    {
       /* Build and send GNB-DU config update */
       }
    }
    if(macCellCfgCfm->rsp == ROK)
    {
       /* Build and send GNB-DU config update */
-      ret = BuildAndSendDUConfigUpdate();
+      ret = BuildAndSendDUConfigUpdate(SERV_CELL_TO_MODIFY);
 
       /* Build and Send Cell Start Req to MAC */
       ret = duBuildAndSendMacCellStart();
 
       /* Build and Send Cell Start Req to MAC */
       ret = duBuildAndSendMacCellStart();
index 5b0a146..b6c333b 100644 (file)
@@ -2510,7 +2510,7 @@ uint8_t DuProcRlcDlRrcMsgRsp(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsg)
          }
          if(ueCb->f1UeDb->actionType == UE_CTXT_RELEASE)
          {
          }
          if(ueCb->f1UeDb->actionType == UE_CTXT_RELEASE)
          {
-            ret = duBuildAndSendUeDeleteReq(dlRrcMsg->cellId);
+            ret = duBuildAndSendUeDeleteReq(dlRrcMsg->cellId,dlRrcMsg->crnti);
             if(ret == RFAILED)
             {
                DU_LOG("\nERROR  -->  DU APP : Failed to process UE Context Release Request in DuProcRlcDlRrcMsgRsp()");
             if(ret == RFAILED)
             {
                DU_LOG("\nERROR  -->  DU APP : Failed to process UE Context Release Request in DuProcRlcDlRrcMsgRsp()");
@@ -3070,25 +3070,27 @@ uint8_t sendUeDeleteReqToRlc(uint16_t cellId, uint8_t ueId)
  *
  * ****************************************************************/
 
  *
  * ****************************************************************/
 
-uint8_t duBuildAndSendUeDeleteReq(uint16_t cellId)
+uint8_t duBuildAndSendUeDeleteReq(uint16_t cellId, uint16_t crnti)
 {
 {
-   uint8_t  ueIdx = 0, ueId =0;
-   uint16_t cellIdx = 0, crnti   = 0;
+   uint8_t  ueId =0;
+   uint16_t cellIdx = 0;
 
    DU_LOG("\nDEBUG  -->  DU_APP: Processing UE Delete Request ");
    GET_CELL_IDX(cellId, cellIdx);
 
    DU_LOG("\nDEBUG  -->  DU_APP: Processing UE Delete Request ");
    GET_CELL_IDX(cellId, cellIdx);
+   GET_UE_IDX(crnti, ueId);
 
    if(duCb.actvCellLst[cellIdx] != NULLP)
    {
 
    if(duCb.actvCellLst[cellIdx] != NULLP)
    {
-      for(ueIdx =0;ueIdx< duCb.actvCellLst[cellIdx]->numActvUes; ueIdx++)
+      if(crnti != duCb.actvCellLst[cellIdx]->ueCb[ueId - 1].crnti)
       {
       {
-         crnti = duCb.actvCellLst[cellIdx]->ueCb[ueIdx].crnti;
-         GET_UE_IDX(crnti,ueId);
-         if(sendUeDeleteReqToMac(cellId, ueId, crnti) == RFAILED)
-         {
-            DU_LOG("\nERROR  -->  DU APP : duBuildAndSendUeDeleteReq(): Failed to build UE  delete req for MAC ");
-            return RFAILED;
-         }
+         DU_LOG("\nERROR  -->  DU APP : duBuildAndSendUeDeleteReq(): CRNTI [%d] not found", crnti);
+         return RFAILED;
+      }
+
+      if(sendUeDeleteReqToMac(cellId, ueId, crnti) == RFAILED)
+      {
+         DU_LOG("\nERROR  -->  DU APP : duBuildAndSendUeDeleteReq(): Failed to build UE  delete req for MAC ");
+         return RFAILED;
       }
    }
    else
       }
    }
    else
@@ -3377,7 +3379,7 @@ uint8_t duSendCellDeletReq(uint16_t cellId)
 uint8_t duProcUeContextReleaseCommand(DuUeCb *duUeCb)
 {
    uint8_t ret =ROK, ueIdx=0;
 uint8_t duProcUeContextReleaseCommand(DuUeCb *duUeCb)
 {
    uint8_t ret =ROK, ueIdx=0;
-   uint16_t cellId=0;
+   uint16_t cellId=0,crnti =0;
    if(duUeCb == NULLP)
    {
       DU_LOG("\nERROR  -->  DU APP : duProcUeContextReleaseCommand() : duUeCb is null");
    if(duUeCb == NULLP)
    {
       DU_LOG("\nERROR  -->  DU APP : duProcUeContextReleaseCommand() : duUeCb is null");
@@ -3390,6 +3392,7 @@ uint8_t duProcUeContextReleaseCommand(DuUeCb *duUeCb)
    }
    
    cellId = duCb.actvCellLst[duUeCb->f1UeDb->cellIdx]->cellId;
    }
    
    cellId = duCb.actvCellLst[duUeCb->f1UeDb->cellIdx]->cellId;
+   crnti = duUeCb->crnti;
    /* Send DL RRC msg for RRC release */
    if(duUeCb->f1UeDb->dlRrcMsg)
    {
    /* Send DL RRC msg for RRC release */
    if(duUeCb->f1UeDb->dlRrcMsg)
    {
@@ -3408,7 +3411,7 @@ uint8_t duProcUeContextReleaseCommand(DuUeCb *duUeCb)
    }
    else
    {
    }
    else
    {
-      ret = duBuildAndSendUeDeleteReq(cellId);
+      ret = duBuildAndSendUeDeleteReq(cellId,crnti);
       if(ret == RFAILED)
       {
          DU_LOG("\nERROR  -->  DU APP : duProcUeContextReleaseCommand(): Failed to build and send Ue Delete request");
       if(ret == RFAILED)
       {
          DU_LOG("\nERROR  -->  DU APP : duProcUeContextReleaseCommand(): Failed to build and send Ue Delete request");
index 52c0574..5d2d597 100644 (file)
@@ -28,7 +28,7 @@ uint8_t duBuildAndSendUeCreateReqToMac(uint16_t cellId, uint8_t ueIdx,\
 uint8_t duBuildAndSendUeCreateReqToRlc(uint16_t cellId, uint8_t ueIdx, RlcUeCfg *duRlcUeCfg);
 uint8_t duCreateUeCb(UeCcchCtxt *ueCcchCtxt, uint32_t gnbCuUeF1apId);
 uint8_t duProcUlCcchInd(UlCcchIndInfo *ulCcchIndInfo);
 uint8_t duBuildAndSendUeCreateReqToRlc(uint16_t cellId, uint8_t ueIdx, RlcUeCfg *duRlcUeCfg);
 uint8_t duCreateUeCb(UeCcchCtxt *ueCcchCtxt, uint32_t gnbCuUeF1apId);
 uint8_t duProcUlCcchInd(UlCcchIndInfo *ulCcchIndInfo);
-uint8_t duBuildAndSendUeDeleteReq(uint16_t cellId);
+uint8_t duBuildAndSendUeDeleteReq(uint16_t cellId, uint16_t crnti);
 void deleteRlcUeCfg(RlcUeCfg *ueCfg);
 void freeF1UeDb(F1UeContextSetupDb *f1UeDb);
 uint8_t sendUeDeleteReqToMac(uint16_t cellId, uint8_t ueId, uint16_t crnti);
 void deleteRlcUeCfg(RlcUeCfg *ueCfg);
 void freeF1UeDb(F1UeContextSetupDb *f1UeDb);
 uint8_t sendUeDeleteReqToMac(uint16_t cellId, uint8_t ueId, uint16_t crnti);
index 95772fe..319ef94 100644 (file)
@@ -180,3 +180,8 @@ void fillStartSymbolAndLen(uint8_t numRsrcAlloc, PdschConfig *pdschCfg, PuschCfg
       }
    }
 }
       }
    }
 }
+
+/**********************************************************************
+End of file
+**********************************************************************/
+
index c755845..c3cf3e7 100644 (file)
 }
 
 
 }
 
 
-void fillStartSymbolAndLen(uint8_t numRsrcAlloc, PdschConfig *pdschCfg, PuschCfg *puschCfg)
-;
-
+void fillStartSymbolAndLen(uint8_t numRsrcAlloc, PdschConfig *pdschCfg, PuschCfg *puschCfg);
 /**********************************************************************
          End of file
 **********************************************************************/
 /**********************************************************************
          End of file
 **********************************************************************/