+/*******************************************************************
+ *
+ * @brief Pack and send DL user data from DUAPP to RLC
+ *
+ * @details
+ *
+ * Function : packRlcDlUserDataToRlc
+ *
+ * Functionality:
+ * Pack and send DL User Data from DUAPP to RLC
+ *
+ * @params[in] Post structure
+ * DL user data
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t packRlcDlUserDataToRlc(Pst *pst, RlcDlUserDataInfo *dlUserData)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ /* pack the address of the structure */
+ CMCHKPK(oduPackPointer,(PTR)dlUserData, dlUserData->dlMsg);
+ return ODU_POST_TASK(pst,dlUserData->dlMsg);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> RLC DL: Only LWLC supported for packRlcUlUserDataToDu");
+ }
+ return RFAILED;
+}
+
+/*******************************************************************
+ *
+ * @brief Unpack DL user data received at RLC from DUAPP
+ *
+ * @details
+ *
+ * Function : unpackRlcDlUserDataToRlc
+ *
+ * Functionality:
+ * Unpack DL user data received at RLC from DUAPP
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t unpackRlcDlUserDataToRlc(DuRlcDlUserDataToRlcFunc func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ RlcDlUserDataInfo *dlUserData;
+ /* unpack the address of the structure */
+ CMCHKUNPK(oduUnpackPointer, (PTR *)&dlUserData, mBuf);
+ return (*func)(pst, dlUserData);
+ }
+ else
+ {
+ /* Nothing to do for other selectors */
+ DU_LOG("\nERROR --> RLC DL: Only LWLC supported for UL User data transfer ");
+ ODU_PUT_MSG_BUF(mBuf);
+ }
+
+ return RFAILED;
+}
+
+/*******************************************************************
+*
+* @brief Packs and Sends UE Delete Request from DUAPP to RLC
+*
+* @details
+*
+* Function : packDuRlcUeDeleteReq
+*
+* Functionality:
+* Packs and Sends UE Delete Request from DUAPP to RLC
+*
+*
+* @params[in] Post structure pointer
+* RlcUeDelete pointer
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t packDuRlcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete)
+{
+ Buffer *mBuf = NULLP;
+
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nERROR --> RLC : Memory allocation failed at packDuRlcUeDeleteReq");
+ return RFAILED;
+ }
+ /* pack the address of the structure */
+ CMCHKPK(oduPackPointer,(PTR)ueDelete, mBuf);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> RLC: Only LWLC supported for packDuRlcUeDeleteReq");
+ return RFAILED;
+ }
+
+ return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+* @brief Unpacks UE Delete Request received from DU APP
+*
+* @details
+*
+* Function : unpackRlcUeDeleteReq
+*
+* Functionality:
+* Unpacks UE Delete Request received from DU APP
+*
+* @params[in] Pointer to Handler
+* Post structure pointer
+* Message Buffer
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t unpackRlcUeDeleteReq(DuRlcUeDeleteReq func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ RlcUeDelete *ueDelete;
+ /* unpack the address of the structure */
+ CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDelete, mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
+ return (*func)(pst, ueDelete);
+ }
+ else
+ {
+ /* Nothing to do for other selectors */
+ DU_LOG("\nERROR --> RLC: Only LWLC supported for UE Delete Request ");
+ ODU_PUT_MSG_BUF(mBuf);
+ }
+ return RFAILED;
+}
+
+/*******************************************************************
+*
+* @brief Packs and Sends UE Del Response from RLC to DUAPP
+*
+* @details
+*
+* Function : packRlcDuUeDeleteRsp
+*
+* Functionality:
+* Packs and Sends UE Del Response from RLC to DUAPP
+*
+*
+* @params[in] Post structure pointer
+* RlcUeDeleteRsp *ueDelRsp
+*
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t packRlcDuUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *ueDelRsp)
+{
+ Buffer *mBuf = NULLP;
+
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nERROR --> RLC : Memory allocation failed at packRlcDuUeDeleteRsp");
+ return RFAILED;
+ }
+ /* pack the address of the structure */
+ CMCHKPK(oduPackPointer,(PTR)ueDelRsp, mBuf);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> RLC: Only LWLC supported for packRlcDuUeDeleteRsp");
+ return RFAILED;
+ }
+
+ return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+*
+* @brief Unpacks UE Del Response received from DU APP
+*
+* @details
+*
+* Function : unpackRlcUeDeleteRsp
+*
+* Functionality:
+* Unpacks UE Del Response received from DU APP
+*
+* @params[in] Pointer to Handler
+* Post structure pointer
+* Message Buffer
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t unpackRlcUeDeleteRsp(RlcDuUeDeleteRsp func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ RlcUeDeleteRsp *ueDeleteRsp = NULLP;
+ /* unpack the address of the structure */
+ CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDeleteRsp, mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
+ return (*func)(pst, ueDeleteRsp);
+ }
+ else
+ {
+ /* Nothing to do for other selectors */
+ DU_LOG("\nERROR --> RLC: Only LWLC supported for UE Del Response ");
+ ODU_PUT_MSG_BUF(mBuf);
+ }
+
+ return RFAILED;
+}
+
+/*******************************************************************
+*
+* @brief Packs and Sends Slice PM from RLC to DUAPP
+*
+* @details
+*
+* Function : packRlcDuSlicePm
+*
+* Functionality:
+* Packs and Sends Slice Performance Metrics from RLC to DUAPP
+*
+*
+* @params[in] Post structure pointer
+* SlicePmList *sliceStats
+*
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t packRlcDuSlicePm(Pst *pst, SlicePmList *sliceStats)
+{
+ Buffer *mBuf = NULLP;
+
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nERROR --> RLC : Memory allocation failed at packRlcDuSlicePm");
+ return RFAILED;
+ }
+ /* pack the address of the structure */
+ CMCHKPK(oduPackPointer,(PTR)sliceStats, mBuf);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> RLC: Only LWLC supported for packRlcDuSlicePm");
+ return RFAILED;
+ }
+
+ return ODU_POST_TASK(pst,mBuf);
+}
+
+/*******************************************************************
+*
+* @brief Unpacks Slice PM received from RLC
+*
+* @details
+*
+* Function : unpackRlcSlicePm
+*
+* Functionality:
+* Unpacks Slice Performance Metrics received from RLC
+*
+* @params[in] Pointer to Handler
+* Post structure pointer
+* Message Buffer
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t unpackRlcSlicePm(RlcSlicePmToDuFunc func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == ODU_SELECTOR_LWLC)
+ {
+ SlicePmList *sliceStats = NULLP;
+ /* unpack the address of the structure */
+ CMCHKUNPK(oduUnpackPointer, (PTR *)&sliceStats, mBuf);
+ ODU_PUT_MSG_BUF(mBuf);
+ return (*func)(pst, sliceStats);
+ }
+ else
+ {
+ /* Nothing to do for other selectors */
+ DU_LOG("\nERROR --> RLC: Only LWLC supported for Slice Metrics ");
+ ODU_PUT_MSG_BUF(mBuf);
+ }
+
+ return RFAILED;
+}