Merge "[Epic-ID: ODUHIGH-516][Task-ID: ODUHIGH-531] RIC Subscription Modification...
[o-du/l2.git] / src / du_app / du_f1ap_msg_hdl.c
index b639f07..c263e52 100644 (file)
@@ -1756,17 +1756,14 @@ uint8_t BuildAndSendF1SetupReq()
             printf("%x",encBuf[ieIdx]);
          }
 #endif
+         
 
-         duCb.f1SetupReqAndRspMsg.f1MsgReqBufSize = encBufSize;
-         DU_ALLOC(duCb.f1SetupReqAndRspMsg.f1MsgReqBuf, encBufSize);
-         if(duCb.f1SetupReqAndRspMsg.f1MsgReqBuf == NULLP)
-         {
-            DU_LOG("\nERROR  -->  F1AP : Memory allocation failed to store the encoding of f1setup req");
-            return RFAILED;
-         }
-         memcpy(duCb.f1SetupReqAndRspMsg.f1MsgReqBuf, &encBuf, duCb.f1SetupReqAndRspMsg.f1MsgReqBufSize);
       }
-
+      if(addOrModifyE2NodeComponent(F1, E2_NODE_COMPONENT_ADD, true, encBufSize, encBuf) !=ROK)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Failed to add the e2 node in the list");
+         break;
+      }
       /* Sending msg */
       if(sendF1APMsg() != ROK)
       {
@@ -2765,6 +2762,11 @@ uint8_t BuildAndSendDUConfigUpdate(ServCellAction servCellAction)
          }
 #endif
       }
+      if(addOrModifyE2NodeComponent(F1, E2_NODE_COMPONENT_UPDATE, true, encBufSize, encBuf)!=ROK)
+      {
+         DU_LOG("\nERROR  -->  F1AP : Failed to update the e2 node in the list");
+         break;
+      }
       /* Sending msg */
       if(sendF1APMsg() != ROK)
       {
@@ -15549,15 +15551,12 @@ uint8_t procF1SetupRsp(F1AP_PDU_t *f1apMsg, MsgLen recvBufLen, char *recvBuf)
    
    duProcF1SetupRsp();
    freeAperDecodeF1SetupRsp(f1SetRspMsg);
-
-   duCb.f1SetupReqAndRspMsg.f1MsgRspBufSize = recvBufLen;
-   DU_ALLOC(duCb.f1SetupReqAndRspMsg.f1MsgRspBuf, duCb.f1SetupReqAndRspMsg.f1MsgRspBufSize);
-   if(duCb.f1SetupReqAndRspMsg.f1MsgReqBuf == NULLP)
+   
+   if(addOrModifyE2NodeComponent(F1, E2_NODE_COMPONENT_ADD, false, recvBufLen, recvBuf) !=ROK)
    {
-      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed to store the buf of F1setup response");
+      DU_LOG("\nERROR  -->  F1AP : Failed to add the e2 node in the list");
       return RFAILED;
    }
-   memcpy(duCb.f1SetupReqAndRspMsg.f1MsgRspBuf, recvBuf, recvBufLen);
 
    if(BuildAndSendE2SetupReq() != ROK)
    {
@@ -15735,11 +15734,12 @@ uint8_t duProcGnbDuCfgUpdAckMsg(uint8_t transId)
 *
 *    Functionality: added free part for the memory allocated by aper_decoder
 *
-* @params[in] F1AP_PDU_t *f1apMsg 
+* @params[in] F1AP_PDU_t *f1apMsg,  MsgLen recvBufLen, char *recvBuf 
 * @return void 
 *
 * ****************************************************************/
-uint8_t procF1GNBDUCfgUpdAck(F1AP_PDU_t *f1apMsg)
+
+uint8_t procF1GNBDUCfgUpdAck(F1AP_PDU_t *f1apMsg, MsgLen recvBufLen, char *recvBuf)
 {
    uint8_t ieIdx=0,transId=0;
    GNBDUConfigurationUpdateAcknowledge_t *gnbDuAck = NULLP;
@@ -15781,6 +15781,12 @@ uint8_t procF1GNBDUCfgUpdAck(F1AP_PDU_t *f1apMsg)
    }
 #endif
 
+   if(addOrModifyE2NodeComponent(F1, E2_NODE_COMPONENT_UPDATE, false, recvBufLen, recvBuf) !=ROK)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Failed to update the e2 node in the list");
+      return RFAILED;
+   }
+
    freeAperDecodeGnbDuAck(gnbDuAck);
    return ROK;
 }
@@ -17964,7 +17970,7 @@ void F1APMsgHdlr(Buffer *mBuf)
 
                case SuccessfulOutcome__value_PR_GNBDUConfigurationUpdateAcknowledge:
                   {
-                     procF1GNBDUCfgUpdAck(f1apMsg);
+                     procF1GNBDUCfgUpdAck(f1apMsg, recvBufLen, recvBuf);
                      break;
                   }