Bug correction by Lionel GAUTHIER:
the PDCP prototype was wrong, now GTPv1-U goes through PDCP and RLC git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5353 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -42,17 +42,16 @@ Address : EURECOM,
|
|||||||
/* When gtpv1u is compiled for eNB use MACRO from UTILS/log.h,
|
/* When gtpv1u is compiled for eNB use MACRO from UTILS/log.h,
|
||||||
* otherwise use standard fprintf as logger.
|
* otherwise use standard fprintf as logger.
|
||||||
*/
|
*/
|
||||||
//#if defined(ENB_MODE)
|
#if defined(ENB_MODE)
|
||||||
#if 0
|
# define GTPU_DEBUG(x, args...) LOG_I(GTPU, x, ##args)
|
||||||
# define GTPU_DEBUG(x, args...) LOG_I(GTPU, x, ##args)
|
# define GTPU_INFO(x, args...) LOG_I(GTPU, x, ##args)
|
||||||
# define GTPU_INFO(x, args...) LOG_I(GTPU, x, ##args)
|
# define GTPU_WARNING(x, args...) LOG_W(GTPU, x, ##args)
|
||||||
# define GTPU_WARN(x, args...) LOG_W(GTPU, x, ##args)
|
# define GTPU_ERROR(x, args...) LOG_E(GTPU, x, ##args)
|
||||||
# define GTPU_ERROR(x, args...) LOG_E(GTPU, x, ##args)
|
|
||||||
#else
|
#else
|
||||||
# define GTPU_DEBUG(x, args...) fprintf(stdout, "[GTPU][D]"x, ##args)
|
# define GTPU_DEBUG(x, args...) fprintf(stdout, "[GTPU][D]"x, ##args)
|
||||||
# define GTPU_INFO(x, args...) fprintf(stdout, "[GTPU][I]"x, ##args)
|
# define GTPU_INFO(x, args...) fprintf(stdout, "[GTPU][I]"x, ##args)
|
||||||
# define GTPU_WARN(x, args...) fprintf(stdout, "[GTPU][W]"x, ##args)
|
# define GTPU_WARNING(x, args...) fprintf(stdout, "[GTPU][W]"x, ##args)
|
||||||
# define GTPU_ERROR(x, args...) fprintf(stderr, "[GTPU][E]"x, ##args)
|
# define GTPU_ERROR(x, args...) fprintf(stderr, "[GTPU][E]"x, ##args)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint32_t gtpv1u_new_teid(void);
|
uint32_t gtpv1u_new_teid(void);
|
||||||
|
|||||||
@@ -59,16 +59,17 @@ Address : EURECOM,
|
|||||||
|
|
||||||
extern boolean_t
|
extern boolean_t
|
||||||
pdcp_data_req(
|
pdcp_data_req(
|
||||||
module_id_t enb_idP,
|
const module_id_t enb_mod_idP,
|
||||||
module_id_t UE_id,
|
const module_id_t ue_mod_idP,
|
||||||
frame_t frame,
|
const frame_t frameP,
|
||||||
eNB_flag_t eNB_flag,
|
const eNB_flag_t enb_flagP,
|
||||||
rb_id_t rb_id,
|
const srb_flag_t srb_flagP,
|
||||||
mui_t muiP,
|
const rb_id_t rb_idP,
|
||||||
confirm_t confirmP,
|
const mui_t muiP,
|
||||||
sdu_size_t sdu_buffer_size,
|
const confirm_t confirmP,
|
||||||
unsigned char* sdu_buffer,
|
const sdu_size_t sdu_buffer_sizeP,
|
||||||
pdcp_transmission_mode_t mode);
|
unsigned char *const sdu_buffer_pP,
|
||||||
|
const pdcp_transmission_mode_t modeP);
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -248,14 +249,17 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req(
|
|||||||
gtpv1u_teid_data_p->ue_id,
|
gtpv1u_teid_data_p->ue_id,
|
||||||
gtpv1u_teid_data_p->eps_bearer_id);
|
gtpv1u_teid_data_p->eps_bearer_id);
|
||||||
|
|
||||||
|
#warning "LG eps bearer mapping to DRB id to do (offset -4)"
|
||||||
|
|
||||||
result = pdcp_data_req(
|
result = pdcp_data_req(
|
||||||
gtpv1u_teid_data_p->enb_id,
|
gtpv1u_teid_data_p->enb_id,
|
||||||
gtpv1u_teid_data_p->ue_id,
|
gtpv1u_teid_data_p->ue_id,
|
||||||
0, // frame TO DO
|
0, // frame TO DO
|
||||||
ENB_FLAG_YES,
|
ENB_FLAG_YES,
|
||||||
gtpv1u_teid_data_p->eps_bearer_id,
|
SRB_FLAG_NO,
|
||||||
|
(gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4,
|
||||||
0, // mui
|
0, // mui
|
||||||
0, // confirm
|
FALSE, // confirm
|
||||||
buffer_len,
|
buffer_len,
|
||||||
buffer,
|
buffer,
|
||||||
PDCP_TRANSMISSION_MODE_DATA);
|
PDCP_TRANSMISSION_MODE_DATA);
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
#include "NwGtpv1uIe.h"
|
#include "NwGtpv1uIe.h"
|
||||||
#include "NwGtpv1uLog.h"
|
#include "NwGtpv1uLog.h"
|
||||||
|
|
||||||
|
#include "gtpv1u.h"
|
||||||
#include "UTIL/LOG/log.h"
|
#include "UTIL/LOG/log.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@@ -204,7 +205,7 @@ nwGtpv1uCreateAndSendMsg( NwGtpv1uStackT *thiz, NwU32T peerIp, NwU16T peerPort,
|
|||||||
|
|
||||||
*((NwU32T *) msgHdr) = htonl(pMsg->teid);
|
*((NwU32T *) msgHdr) = htonl(pMsg->teid);
|
||||||
msgHdr += 4;
|
msgHdr += 4;
|
||||||
NW_LOG(thiz, NW_LOG_LEVEL_ERRO, "nwGtpv1uCreateAndSendMsg to teid %u\n", pMsg->teid);
|
GTPU_ERROR("nwGtpv1uCreateAndSendMsg to teid %u\n", pMsg->teid);
|
||||||
|
|
||||||
if(pMsg->seqNumFlag || pMsg->extHdrFlag || pMsg->npduNumFlag) {
|
if(pMsg->seqNumFlag || pMsg->extHdrFlag || pMsg->npduNumFlag) {
|
||||||
*((NwU16T *) msgHdr) = (pMsg->seqNumFlag ? htons(pMsg->seqNum) : 0x0000);
|
*((NwU16T *) msgHdr) = (pMsg->seqNumFlag ? htons(pMsg->seqNum) : 0x0000);
|
||||||
@@ -276,7 +277,7 @@ nwGtpv1uPeerRspTimeout(void *arg)
|
|||||||
NwGtpv1uTrxnT *thiz;
|
NwGtpv1uTrxnT *thiz;
|
||||||
NwGtpv1uTimeoutInfoT *timeoutInfo = arg;
|
NwGtpv1uTimeoutInfoT *timeoutInfo = arg;
|
||||||
|
|
||||||
LOG_W(GTPU, "Retransmission timer expired\n");
|
GTPU_WARNING( "Retransmission timer expired\n");
|
||||||
|
|
||||||
thiz = ((NwGtpv1uTrxnT *)timeoutInfo->timeoutArg);
|
thiz = ((NwGtpv1uTrxnT *)timeoutInfo->timeoutArg);
|
||||||
rc = thiz->pStack->udp.udpDataReqCallback(thiz->pStack->udp.hUdp,
|
rc = thiz->pStack->udp.udpDataReqCallback(thiz->pStack->udp.hUdp,
|
||||||
@@ -291,7 +292,7 @@ nwGtpv1uPeerRspTimeout(void *arg)
|
|||||||
thiz->maxRetries--;
|
thiz->maxRetries--;
|
||||||
} else {
|
} else {
|
||||||
/* Inform session layer about path fialure */
|
/* Inform session layer about path fialure */
|
||||||
printf("Max retries over!\n");
|
GTPU_WARNING("Max retries over!\n");
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -332,8 +333,7 @@ NwGtpv1uCreateTunnelEndPoint( NW_IN NwGtpv1uStackT *thiz,
|
|||||||
pTunnelEndPoint);
|
pTunnelEndPoint);
|
||||||
|
|
||||||
if(pCollision) {
|
if(pCollision) {
|
||||||
LOG_E(GTPU,
|
GTPU_ERROR("Tunnel end-point cannot be created for teid 0x%x. "
|
||||||
"Tunnel end-point cannot be created for teid 0x%x. "
|
|
||||||
"Tunnel already exists", teid);
|
"Tunnel already exists", teid);
|
||||||
rc = nwGtpTunnelEndPointDestroy(thiz, pTunnelEndPoint);
|
rc = nwGtpTunnelEndPointDestroy(thiz, pTunnelEndPoint);
|
||||||
NW_ASSERT(rc == NW_GTPV1U_OK);
|
NW_ASSERT(rc == NW_GTPV1U_OK);
|
||||||
@@ -345,8 +345,7 @@ NwGtpv1uCreateTunnelEndPoint( NW_IN NwGtpv1uStackT *thiz,
|
|||||||
pTunnelEndPoint = RB_FIND(NwGtpv1uTunnelEndPointIdentifierMap,
|
pTunnelEndPoint = RB_FIND(NwGtpv1uTunnelEndPointIdentifierMap,
|
||||||
&(thiz->teidMap), pTunnelEndPoint);
|
&(thiz->teidMap), pTunnelEndPoint);
|
||||||
NW_ASSERT(pTunnelEndPoint);
|
NW_ASSERT(pTunnelEndPoint);
|
||||||
LOG_D(GTPU,
|
GTPU_DEBUG("Tunnel end-point 0x%x creation successful for teid 0x%x %u(dec)",
|
||||||
"Tunnel end-point 0x%x creation successful for teid 0x%x %u(dec)",
|
|
||||||
(unsigned int)pTunnelEndPoint, teid, teid);
|
(unsigned int)pTunnelEndPoint, teid, teid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,7 +387,7 @@ nwGtpv1uDestroyTunnelEndPoint( NwGtpv1uStackT *thiz,
|
|||||||
(NwGtpv1uTunnelEndPointT *)
|
(NwGtpv1uTunnelEndPointT *)
|
||||||
pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle);
|
pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle);
|
||||||
} else {
|
} else {
|
||||||
LOG_W(GTPU, "Non-existent Tunnel end-point handle '%x'",
|
GTPU_WARNING("Non-existent Tunnel end-point handle '%x'",
|
||||||
pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle);
|
pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -502,14 +501,12 @@ nwGtpv1uProcessGpdu( NwGtpv1uStackT *thiz,
|
|||||||
|
|
||||||
if(NW_GTPV1U_OK == rc) {
|
if(NW_GTPV1U_OK == rc) {
|
||||||
NwGtpv1uMsgT *pMsg = (NwGtpv1uMsgT *) hMsg;
|
NwGtpv1uMsgT *pMsg = (NwGtpv1uMsgT *) hMsg;
|
||||||
LOG_D(GTPU,
|
GTPU_DEBUG("Received T-PDU over tunnel end-point '%x' of size %u from "NW_IPV4_ADDR,
|
||||||
"Received T-PDU over tunnel end-point '%x' of size %u from "NW_IPV4_ADDR,
|
|
||||||
ntohl(msgHdr->teid), pMsg->msgLen, NW_IPV4_ADDR_FORMAT((peerIp)));
|
ntohl(msgHdr->teid), pMsg->msgLen, NW_IPV4_ADDR_FORMAT((peerIp)));
|
||||||
rc = nwGtpSessionSendMsgApiToUlpEntity(pTunnelEndPoint, pMsg);
|
rc = nwGtpSessionSendMsgApiToUlpEntity(pTunnelEndPoint, pMsg);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG_E(GTPU,
|
GTPU_ERROR("Received T-PDU over non-existent tunnel end-point '%x' from "NW_IPV4_ADDR,
|
||||||
"Received T-PDU over non-existent tunnel end-point '%x' from "NW_IPV4_ADDR,
|
|
||||||
ntohl(msgHdr->teid), NW_IPV4_ADDR_FORMAT((peerIp)));
|
ntohl(msgHdr->teid), NW_IPV4_ADDR_FORMAT((peerIp)));
|
||||||
}
|
}
|
||||||
NW_LEAVE(thiz);
|
NW_LEAVE(thiz);
|
||||||
@@ -559,14 +556,16 @@ nwGtpv1uHandleEchoReq(NW_IN NwGtpv1uStackT *thiz,
|
|||||||
*/
|
*/
|
||||||
rc = nwGtpv1uMsgAddIeTV1(hMsg, NW_GTPV1U_IE_RECOVERY, 0x00);
|
rc = nwGtpv1uMsgAddIeTV1(hMsg, NW_GTPV1U_IE_RECOVERY, 0x00);
|
||||||
|
|
||||||
LOG_I(GTPU,
|
GTPU_INFO("Sending NW_GTP_ECHO_RSP message to %x:%x with seq %u",
|
||||||
"Sending NW_GTP_ECHO_RSP message to %x:%x with seq %u", peerIp, peerPort,
|
peerIp,
|
||||||
seqNum);
|
peerPort,
|
||||||
|
seqNum);
|
||||||
|
|
||||||
rc = nwGtpv1uCreateAndSendMsg(thiz,
|
rc = nwGtpv1uCreateAndSendMsg(
|
||||||
peerIp,
|
thiz,
|
||||||
peerPort,
|
peerIp,
|
||||||
(NwGtpv1uMsgT *) hMsg);
|
peerPort,
|
||||||
|
(NwGtpv1uMsgT *) hMsg);
|
||||||
|
|
||||||
rc = nwGtpv1uMsgDelete((NwGtpv1uStackHandleT)thiz, hMsg);
|
rc = nwGtpv1uMsgDelete((NwGtpv1uStackHandleT)thiz, hMsg);
|
||||||
NW_ASSERT(NW_GTPV1U_OK == rc);
|
NW_ASSERT(NW_GTPV1U_OK == rc);
|
||||||
@@ -754,12 +753,12 @@ nwGtpv1uProcessUdpReq( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle,
|
|||||||
|
|
||||||
switch(msgType) {
|
switch(msgType) {
|
||||||
case NW_GTP_ECHO_REQ:
|
case NW_GTP_ECHO_REQ:
|
||||||
LOG_D(GTPU, "NW_GTP_ECHO_REQ");
|
GTPU_DEBUG("NW_GTP_ECHO_REQ");
|
||||||
ret = nwGtpv1uHandleEchoReq( thiz, udpData, udpDataLen, peerPort, peerIp);
|
ret = nwGtpv1uHandleEchoReq( thiz, udpData, udpDataLen, peerPort, peerIp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NW_GTP_ERROR_INDICATION:
|
case NW_GTP_ERROR_INDICATION:
|
||||||
LOG_D(GTPU, "NW_GTP_ERROR_INDICATION");
|
GTPU_DEBUG("NW_GTP_ERROR_INDICATION");
|
||||||
ret = nwGtpv1uSendUlpMessageIndication( thiz,
|
ret = nwGtpv1uSendUlpMessageIndication( thiz,
|
||||||
0,
|
0,
|
||||||
NW_GTPV1U_ULP_API_RECV_MSG,
|
NW_GTPV1U_ULP_API_RECV_MSG,
|
||||||
@@ -773,12 +772,12 @@ nwGtpv1uProcessUdpReq( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NW_GTP_ECHO_RSP:
|
case NW_GTP_ECHO_RSP:
|
||||||
LOG_D(GTPU, "NW_GTP_ECHO_RSP");
|
GTPU_DEBUG("NW_GTP_ECHO_RSP");
|
||||||
ret = NW_GTPV1U_OK;
|
ret = NW_GTPV1U_OK;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NW_GTP_GPDU:
|
case NW_GTP_GPDU:
|
||||||
LOG_D(GTPU, "NW_GTP_GPDU");
|
GTPU_DEBUG("NW_GTP_GPDU");
|
||||||
ret = nwGtpv1uProcessGpdu(thiz, udpData, udpDataLen, peerIp);
|
ret = nwGtpv1uProcessGpdu(thiz, udpData, udpDataLen, peerIp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -811,7 +810,7 @@ nwGtpv1uProcessUlpReq( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle,
|
|||||||
|
|
||||||
switch(pUlpReq->apiType) {
|
switch(pUlpReq->apiType) {
|
||||||
case NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT: {
|
case NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT: {
|
||||||
LOG_D(GTPU, "Received NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT from ulp");
|
GTPU_DEBUG("Received NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT from ulp");
|
||||||
rc = NwGtpv1uCreateTunnelEndPoint(thiz,
|
rc = NwGtpv1uCreateTunnelEndPoint(thiz,
|
||||||
pUlpReq->apiInfo.createTunnelEndPointInfo.teid,
|
pUlpReq->apiInfo.createTunnelEndPointInfo.teid,
|
||||||
pUlpReq->apiInfo.createTunnelEndPointInfo.hUlpSession,
|
pUlpReq->apiInfo.createTunnelEndPointInfo.hUlpSession,
|
||||||
@@ -820,25 +819,25 @@ nwGtpv1uProcessUlpReq( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT: {
|
case NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT: {
|
||||||
LOG_D(GTPU, "Received destroy session req from ulp");
|
GTPU_DEBUG("Received destroy session req from ulp");
|
||||||
rc = nwGtpv1uDestroyTunnelEndPoint(thiz, pUlpReq);
|
rc = nwGtpv1uDestroyTunnelEndPoint(thiz, pUlpReq);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NW_GTPV1U_ULP_API_INITIAL_REQ: {
|
case NW_GTPV1U_ULP_API_INITIAL_REQ: {
|
||||||
LOG_D(GTPU, "Received initial req from ulp");
|
GTPU_DEBUG("Received initial req from ulp");
|
||||||
rc = nwGtpv1uInitialReq(thiz, pUlpReq);
|
rc = nwGtpv1uInitialReq(thiz, pUlpReq);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NW_GTPV1U_ULP_API_SEND_TPDU: {
|
case NW_GTPV1U_ULP_API_SEND_TPDU: {
|
||||||
LOG_D(GTPU, "Received send tpdu req from ulp");
|
GTPU_DEBUG("Received send tpdu req from ulp");
|
||||||
rc = nwGtpv1uSendto(thiz, pUlpReq);
|
rc = nwGtpv1uSendto(thiz, pUlpReq);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_D(GTPU, "Unsupported API received from ulp");
|
GTPU_DEBUG("Unsupported API received from ulp");
|
||||||
rc = NW_GTPV1U_FAILURE;
|
rc = NW_GTPV1U_FAILURE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -865,8 +864,7 @@ nwGtpv1uProcessTimeout(void *timeoutInfo)
|
|||||||
NW_ASSERT(thiz != NULL);
|
NW_ASSERT(thiz != NULL);
|
||||||
|
|
||||||
NW_ENTER(thiz);
|
NW_ENTER(thiz);
|
||||||
LOG_D(GTPU,
|
GTPU_DEBUG("Received timeout event from ULP with timeoutInfo %x!",
|
||||||
"Received timeout event from ULP with timeoutInfo %x!",
|
|
||||||
(unsigned int)timeoutInfo);
|
(unsigned int)timeoutInfo);
|
||||||
|
|
||||||
rc = (((NwGtpv1uTimeoutInfoT *) timeoutInfo)->timeoutCallbackFunc) (timeoutInfo);
|
rc = (((NwGtpv1uTimeoutInfoT *) timeoutInfo)->timeoutCallbackFunc) (timeoutInfo);
|
||||||
|
|||||||
Reference in New Issue
Block a user