sync ENB source code (debug session on GTP)
git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5959 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -45,6 +45,8 @@
|
|||||||
#include "NwGtpv1uIe.h"
|
#include "NwGtpv1uIe.h"
|
||||||
#include "NwGtpv1uLog.h"
|
#include "NwGtpv1uLog.h"
|
||||||
|
|
||||||
|
#include "assertions.h"
|
||||||
|
|
||||||
#include "gtpv1u.h"
|
#include "gtpv1u.h"
|
||||||
#if defined(ENB_MODE)
|
#if defined(ENB_MODE)
|
||||||
#include "UTIL/LOG/log.h"
|
#include "UTIL/LOG/log.h"
|
||||||
@@ -58,6 +60,7 @@ extern "C" {
|
|||||||
* P R I V A T E F U N C T I O N S *
|
* P R I V A T E F U N C T I O N S *
|
||||||
*--------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#define NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE (12) /**< Size of GTPv1u EPC specific header */
|
||||||
#define NW_GTPV1U_EPC_MIN_HEADER_SIZE (8)
|
#define NW_GTPV1U_EPC_MIN_HEADER_SIZE (8)
|
||||||
|
|
||||||
|
|
||||||
@@ -479,20 +482,23 @@ nwGtpv1uSendto( NwGtpv1uStackT *thiz, NW_IN NwGtpv1uUlpApiT *pUlpReq)
|
|||||||
static NwGtpv1uRcT
|
static NwGtpv1uRcT
|
||||||
nwGtpv1uProcessGpdu( NwGtpv1uStackT *thiz,
|
nwGtpv1uProcessGpdu( NwGtpv1uStackT *thiz,
|
||||||
NW_IN NwU8T *gpdu,
|
NW_IN NwU8T *gpdu,
|
||||||
NW_IN NwU32T gdpuLen,
|
NW_IN NwU32T gpduLen,
|
||||||
NW_IN NwU32T peerIp)
|
NW_IN NwU32T peerIp)
|
||||||
|
|
||||||
{
|
{
|
||||||
NwGtpv1uRcT rc = NW_GTPV1U_FAILURE;
|
NwGtpv1uRcT rc = NW_GTPV1U_FAILURE;
|
||||||
NwGtpv1uMsgHeaderT *msgHdr;
|
NwGtpv1uMsgHeaderT *msgHdr = NULL;
|
||||||
NwGtpv1uTunnelEndPointT *pTunnelEndPoint;
|
NwGtpv1uTunnelEndPointT *pTunnelEndPoint = NULL;
|
||||||
NwGtpv1uTunnelEndPointT tunnelEndPointKey;
|
NwGtpv1uTunnelEndPointT tunnelEndPointKey;
|
||||||
|
NwU16T payload_len = 0;
|
||||||
|
NwU16T hdr_len = 0;
|
||||||
|
|
||||||
NW_ENTER(thiz);
|
NW_ENTER(thiz);
|
||||||
|
|
||||||
msgHdr = (NwGtpv1uMsgHeaderT *) gpdu;
|
msgHdr = (NwGtpv1uMsgHeaderT *) gpdu;
|
||||||
|
|
||||||
tunnelEndPointKey.teid = ntohl(msgHdr->teid);
|
tunnelEndPointKey.teid = ntohl(msgHdr->teid);
|
||||||
|
|
||||||
pTunnelEndPoint = RB_FIND(NwGtpv1uTunnelEndPointIdentifierMap,
|
pTunnelEndPoint = RB_FIND(NwGtpv1uTunnelEndPointIdentifierMap,
|
||||||
&(thiz->teidMap), &tunnelEndPointKey);
|
&(thiz->teidMap), &tunnelEndPointKey);
|
||||||
|
|
||||||
@@ -501,9 +507,19 @@ nwGtpv1uProcessGpdu( NwGtpv1uStackT *thiz,
|
|||||||
|
|
||||||
rc = nwGtpv1uMsgFromBufferNew( (NwGtpv1uStackHandleT)thiz,
|
rc = nwGtpv1uMsgFromBufferNew( (NwGtpv1uStackHandleT)thiz,
|
||||||
(NwU8T *)gpdu,
|
(NwU8T *)gpdu,
|
||||||
gdpuLen,
|
gpduLen,
|
||||||
&hMsg);
|
&hMsg);
|
||||||
|
|
||||||
|
payload_len = ntohs(msgHdr->msgLength);
|
||||||
|
hdr_len = NW_GTPV1U_EPC_MIN_HEADER_SIZE;
|
||||||
|
if (msgHdr->S || msgHdr->PN || msgHdr->E ) {
|
||||||
|
hdr_len = NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE;
|
||||||
|
payload_len = payload_len - (NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE - NW_GTPV1U_EPC_MIN_HEADER_SIZE);
|
||||||
|
}
|
||||||
|
AssertFatal(gpduLen == (payload_len + hdr_len),
|
||||||
|
"Mismatch gpduLen %d / hdr_len %d / payload_len %d",
|
||||||
|
gpduLen, hdr_len, payload_len);
|
||||||
|
|
||||||
if(NW_GTPV1U_OK == rc) {
|
if(NW_GTPV1U_OK == rc) {
|
||||||
NwGtpv1uMsgT *pMsg = (NwGtpv1uMsgT *) hMsg;
|
NwGtpv1uMsgT *pMsg = (NwGtpv1uMsgT *) hMsg;
|
||||||
GTPU_DEBUG("Received T-PDU over tunnel end-point '%x' of size %u from "NW_IPV4_ADDR"\n",
|
GTPU_DEBUG("Received T-PDU over tunnel end-point '%x' of size %u from "NW_IPV4_ADDR"\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user