1 /******************************************************************************
3 * Copyright (c) 2020 ICT/CAS.
5 * Licensed under the O-RAN Software License, Version 1.0 (the "Software License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * https://www.o-ran.org/software
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 *******************************************************************************/
24 #include "cuupCommon.h"
25 #include "plat_syslog.h"
27 #define DL_PDU_SESSION_INFORMATION 0 /* NGU DL PDU type */
28 #define UL_PDU_SESSION_INFORMATION 1 /* NGU UL PDU type */
30 #define NGU_FREE(p) if(NULL != p)\
36 #define nguLog(iLog_Level, content, arg...) \
37 VOS_SysLog(gNguModuleId, iLog_Level, __FILE__, __LINE__, __func__, content, ##arg);
39 #define nguNullCheck(p) \
43 nguLog(LOG_ERR, "[NGU] NULL pointer\n");\
48 #define nguGetInstance(ueIdx,pduSessId,p) \
50 if((NULL == gNguUeInfo[ueIdx])\
51 || (NULL == gNguUeInfo[ueIdx]->nguInstance[pduSessId]))\
56 p = gNguUeInfo[ueIdx]->nguInstance[pduSessId];\
60 #define nguDlDataCheck(p) if(NULL == p)\
62 nguLog(LOG_ERR,"[NGU] input is NULL!\n");\
64 }else if(NULL==p->pMsgBuff)\
66 nguLog(LOG_ERR,"[NGU] p->pMsgBuff in input is NULL!\n");\
70 #define nguExPduCheck(p) if(NULL == p)\
72 nguLog(LOG_ERR,"[NGU] ex pdu is null\n");\
74 }else if( (GTP_EXT_PDUSESSION_CONTAINER!=p->exHdrType) || (NULL==p->pPdu) || (p->len<=0))\
76 nguLog(LOG_ERR,"[NGU] ex pdu is wrong\n");\
80 #define nguDlDataFree(p) \
84 if(NULL != p->pExPduInfo)\
86 if(NULL != p->pExPduInfo->pPdu)\
88 NGU_FREE(p->pExPduInfo->pPdu);\
89 p->pExPduInfo->pPdu = NULL;\
91 NGU_FREE(p->pExPduInfo);\
92 p->pExPduInfo = NULL;\
114 CuupBearerStatus_e ueStatus;
115 NguInstance_t *nguInstance[CUUP_MAX_SESSION_NUM];
119 typedef struct dlPduSessInfo
121 UINT8 exHdrLen; /* gtp extension head length:2 */
122 UINT8 spare1 :4; /* spare: 0 */
123 UINT8 pduType :4; /* pdu type:0 */
124 UINT8 qfi :6; /* qfi */
130 UINT8 nextExHdrType;/* next extension head type:0 */
133 typedef struct ulPduSessInfo
135 UINT8 exHdrLen; /* gtp extension head length:1 */
136 UINT8 spare1 :4; /* spare: 0 */
137 UINT8 pduType :4; /* pdu type:1 */
138 UINT8 qfi :6; /* qfi */
140 UINT8 nextExHdrType;/* next extension head type:0 */