1 /******************************************************************************
2 ###############################################################################
3 # Copyright (c) [2017-2020] [ICT/CAS] #
4 # Licensed under the ORAN Software License v1.0 (License) #
5 ###############################################################################
6 ******************************************************************************/
12 #include "cuupCommon.h"
13 #include "plat_syslog.h"
15 #define DL_PDU_SESSION_INFORMATION 0 /* NGU DL PDU type */
16 #define UL_PDU_SESSION_INFORMATION 1 /* NGU UL PDU type */
18 #define NGU_FREE(p) if(NULL != p)\
24 #define nguLog(iLog_Level, content, arg...) \
25 VOS_SysLog(gNguModuleId, iLog_Level, __FILE__, __LINE__, __func__, content, ##arg);
27 #define nguNullCheck(p) \
31 nguLog(LOG_ERR, "[NGU] NULL pointer\n");\
36 #define nguGetInstance(ueIdx,pduSessId,p) \
38 if((NULL == gNguUeInfo[ueIdx])\
39 || (NULL == gNguUeInfo[ueIdx]->nguInstance[pduSessId]))\
44 p = gNguUeInfo[ueIdx]->nguInstance[pduSessId];\
48 #define nguDlDataCheck(p) if(NULL == p)\
50 nguLog(LOG_ERR,"[NGU] input is NULL!\n");\
52 }else if(NULL==p->pMsgBuff)\
54 nguLog(LOG_ERR,"[NGU] p->pMsgBuff in input is NULL!\n");\
58 #define nguExPduCheck(p) if(NULL == p)\
60 nguLog(LOG_ERR,"[NGU] ex pdu is null\n");\
62 }else if( (GTP_EXT_PDUSESSION_CONTAINER!=p->exHdrType) || (NULL==p->pPdu) || (p->len<=0))\
64 nguLog(LOG_ERR,"[NGU] ex pdu is wrong\n");\
68 #define nguDlDataFree(p) \
72 if(NULL != p->pExPduInfo)\
74 if(NULL != p->pExPduInfo->pPdu)\
76 NGU_FREE(p->pExPduInfo->pPdu);\
77 p->pExPduInfo->pPdu = NULL;\
79 NGU_FREE(p->pExPduInfo);\
80 p->pExPduInfo = NULL;\
102 CuupBearerStatus_e ueStatus;
103 NguInstance_t *nguInstance[CUUP_MAX_SESSION_NUM];
107 typedef struct dlPduSessInfo
109 UINT8 exHdrLen; /* gtp extension head length:2 */
110 UINT8 spare1 :4; /* spare: 0 */
111 UINT8 pduType :4; /* pdu type:0 */
112 UINT8 qfi :6; /* qfi */
118 UINT8 nextExHdrType;/* next extension head type:0 */
121 typedef struct ulPduSessInfo
123 UINT8 exHdrLen; /* gtp extension head length:1 */
124 UINT8 spare1 :4; /* spare: 0 */
125 UINT8 pduType :4; /* pdu type:1 */
126 UINT8 qfi :6; /* qfi */
128 UINT8 nextExHdrType;/* next extension head type:0 */