Commit 0209011a authored by laurent's avatar laurent Committed by Sakthivel Velumani

restore compilation capability, gtp replacement of rnti by ueid

parent ce3b886f
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
#include "RRC/LTE/defs_NB_IoT.h" #include "RRC/LTE/defs_NB_IoT.h"
#include "RRC/LTE/rrc_defs.h" #include "RRC/LTE/rrc_defs.h"
#include "RRC/NR/nr_rrc_defs.h" #include "RRC/NR/nr_rrc_defs.h"
#include <openair3/ocp-gtpu/gtpv1u_eNB_task.h> #include <openair3/ocp-gtpu/gtp_itf.h>
typedef struct { typedef struct {
......
...@@ -257,8 +257,6 @@ typedef struct IttiMsgText_s { ...@@ -257,8 +257,6 @@ typedef struct IttiMsgText_s {
#include <openair3/MME_APP/mme_app.h> #include <openair3/MME_APP/mme_app.h>
//#include <proto.h> //#include <proto.h>
#include <openair3/ocp-gtpu/gtpv1u_eNB_task.h>
#include <openair3/ocp-gtpu/gtpv1u_gNB_task.h>
void *rrc_enb_process_itti_msg(void *); void *rrc_enb_process_itti_msg(void *);
#include <openair3/SCTP/sctp_eNB_task.h> #include <openair3/SCTP/sctp_eNB_task.h>
#include <openair3/NGAP/ngap_gNB.h> #include <openair3/NGAP/ngap_gNB.h>
......
...@@ -338,7 +338,7 @@ Also, incoming downlink sdu can comme from internal RRC: in this case, pdcp_run( ...@@ -338,7 +338,7 @@ Also, incoming downlink sdu can comme from internal RRC: in this case, pdcp_run(
At Rx side, pdcp_data_ind() is the entry point that receives the data from RLC. At Rx side, pdcp_data_ind() is the entry point that receives the data from RLC.
- Inside pdcp_data_ind(), the pdcp manager mutex protects the access to the PDU receiving function of PDCP (recv_pdu() callback corresponding to nr_pdcp_entity_drb_am_recv_pdu() for DRBs) - Inside pdcp_data_ind(), the pdcp manager mutex protects the access to the PDU receiving function of PDCP (recv_pdu() callback corresponding to nr_pdcp_entity_drb_am_recv_pdu() for DRBs)
- Then deliver_sdu_drb() function sends the received data to GTP thread through an ITTI message (GTPV1U_ENB_TUNNEL_DATA_REQ). - Then deliver_sdu_drb() function sends the received data to GTP thread through an ITTI message (GTPV1U_TUNNEL_DATA_REQ).
pdcp_config_set_security(): not yet developped pdcp_config_set_security(): not yet developped
......
...@@ -20,12 +20,10 @@ ...@@ -20,12 +20,10 @@
*/ */
MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_req_t, Gtpv1uTunnelDataReq) MESSAGE_DEF(GTPV1U_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_tunnel_data_req_t, Gtpv1uTunnelDataReq)
MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_data_forwarding_req_t,Gtpv1uDataForwardingReq) MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_data_forwarding_req_t,Gtpv1uDataForwardingReq)
MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_data_forwarding_ind_t,Gtpv1uDataForwardingInd) MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_data_forwarding_ind_t,Gtpv1uDataForwardingInd)
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_req_t, Gtpv1uEndMarkerReq) MESSAGE_DEF(GTPV1U_ENB_END_MARKER_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_req_t, Gtpv1uEndMarkerReq)
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_ind_t, Gtpv1uEndMarkerInd) MESSAGE_DEF(GTPV1U_ENB_END_MARKER_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_ind_t, Gtpv1uEndMarkerInd)
MESSAGE_DEF(GTPV1U_REQ, MESSAGE_PRIORITY_MED, Gtpv1uReq, gtpv1uReq) MESSAGE_DEF(GTPV1U_REQ, MESSAGE_PRIORITY_MED, Gtpv1uReq, gtpv1uReq)
MESSAGE_DEF(GTPV1U_GNB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_tunnel_data_req_t, NRGtpv1uTunnelDataReq)
MESSAGE_DEF(GTPV1U_DU_BUFFER_REPORT_REQ, MESSAGE_PRIORITY_MED, gtpv1u_DU_buffer_report_req_t, NRGtpv1uBufferReportReq) MESSAGE_DEF(GTPV1U_DU_BUFFER_REPORT_REQ, MESSAGE_PRIORITY_MED, gtpv1u_DU_buffer_report_req_t, NRGtpv1uBufferReportReq)
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#define NR_GTPV1U_MAX_BEARERS_PER_UE max_val_NR_DRB_Identity #define NR_GTPV1U_MAX_BEARERS_PER_UE max_val_NR_DRB_Identity
#define GTPV1U_ENB_TUNNEL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataInd #define GTPV1U_ENB_TUNNEL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataInd
#define GTPV1U_ENB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataReq #define GTPV1U_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataReq
#define GTPV1U_ENB_DATA_FORWARDING_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDataForwardingReq #define GTPV1U_ENB_DATA_FORWARDING_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDataForwardingReq
#define GTPV1U_ENB_DATA_FORWARDING_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDataForwardingInd #define GTPV1U_ENB_DATA_FORWARDING_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDataForwardingInd
#define GTPV1U_ENB_END_MARKER_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uEndMarkerReq #define GTPV1U_ENB_END_MARKER_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uEndMarkerReq
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
#define GTPV1U_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uReq #define GTPV1U_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uReq
#define GTPV1U_GNB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uTunnelDataReq
#define GTPV1U_DU_BUFFER_REPORT_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uBufferReportReq #define GTPV1U_DU_BUFFER_REPORT_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uBufferReportReq
#define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF #define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
...@@ -108,21 +106,14 @@ typedef struct gtpv1u_enb_delete_tunnel_resp_s { ...@@ -108,21 +106,14 @@ typedef struct gtpv1u_enb_delete_tunnel_resp_s {
teid_t enb_S1u_teid; ///< local S1U Tunnel Endpoint Identifier to be deleted teid_t enb_S1u_teid; ///< local S1U Tunnel Endpoint Identifier to be deleted
} gtpv1u_enb_delete_tunnel_resp_t; } gtpv1u_enb_delete_tunnel_resp_t;
typedef struct gtpv1u_enb_tunnel_data_ind_s {
rnti_t rnti;
uint8_t *buffer;
uint32_t length;
uint32_t offset; ///< start of message offset in buffer
teid_t enb_S1u_teid; ///< Tunnel Endpoint Identifier
} gtpv1u_enb_tunnel_data_ind_t;
typedef struct gtpv1u_enb_tunnel_data_req_s { typedef struct gtpv1u_tunnel_data_req_s {
uint8_t *buffer; uint8_t *buffer;
uint32_t length; uint32_t length;
uint32_t offset; ///< start of message offset in buffer uint32_t offset; ///< start of message offset in buffer
rnti_t rnti; ue_id_t ue_id;
rb_id_t rab_id; rb_id_t bearer_id;
} gtpv1u_enb_tunnel_data_req_t; } gtpv1u_tunnel_data_req_t;
typedef struct gtpv1u_enb_data_forwarding_req_s { typedef struct gtpv1u_enb_data_forwarding_req_s {
uint8_t *buffer; uint8_t *buffer;
...@@ -208,13 +199,7 @@ typedef struct gtpv1u_gnb_delete_tunnel_resp_s { ...@@ -208,13 +199,7 @@ typedef struct gtpv1u_gnb_delete_tunnel_resp_s {
uint8_t status; ///< Status of NGU endpoint deleteion (Failed = 0xFF or Success = 0x0) uint8_t status; ///< Status of NGU endpoint deleteion (Failed = 0xFF or Success = 0x0)
teid_t gnb_NGu_teid; ///< local NGU Tunnel Endpoint Identifier to be deleted teid_t gnb_NGu_teid; ///< local NGU Tunnel Endpoint Identifier to be deleted
} gtpv1u_gnb_delete_tunnel_resp_t; } gtpv1u_gnb_delete_tunnel_resp_t;
typedef struct gtpv1u_gnb_tunnel_data_req_s {
uint8_t *buffer;
uint32_t length;
uint32_t offset; ///< start of message offset in buffer
ue_id_t ue_id;
pdusessionid_t pdusession_id;
} gtpv1u_gnb_tunnel_data_req_t;
typedef struct gtpv1u_DU_buffer_report_req_s { typedef struct gtpv1u_DU_buffer_report_req_s {
uint32_t buffer_availability; uint32_t buffer_availability;
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
# include "intertask_interface.h" # include "intertask_interface.h"
# include "s1ap_eNB.h" # include "s1ap_eNB.h"
# include "sctp_eNB_task.h" # include "sctp_eNB_task.h"
# include "gtpv1u_eNB_task.h" # include "openair3/ocp-gtpu/gtp_itf.h"
# include "flexran_agent.h" # include "flexran_agent.h"
# include "x2ap_eNB.h" # include "x2ap_eNB.h"
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "intertask_interface.h" #include "intertask_interface.h"
#include "ngap_gNB.h" #include "ngap_gNB.h"
#include "sctp_eNB_task.h" #include "sctp_eNB_task.h"
#include "gtpv1u_eNB_task.h" #include "openair3/ocp-gtpu/gtp_itf.h"
#include "PHY/INIT/phy_init.h" #include "PHY/INIT/phy_init.h"
#include "f1ap_cu_task.h" #include "f1ap_cu_task.h"
#include "f1ap_du_task.h" #include "f1ap_du_task.h"
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
#include "openair3/S1AP/s1ap_eNB.h" #include "openair3/S1AP/s1ap_eNB.h"
#include <pthread.h> #include <pthread.h>
# include "gtpv1u_eNB_task.h" # include "openair3/ocp-gtpu/gtp_itf.h"
#include <openair3/ocp-gtpu/gtp_itf.h> #include <openair3/ocp-gtpu/gtp_itf.h>
#include "ENB_APP/enb_config.h" #include "ENB_APP/enb_config.h"
...@@ -210,20 +210,19 @@ rlc_op_status_t cu_send_to_du(const protocol_ctxt_t *const ctxt, ...@@ -210,20 +210,19 @@ rlc_op_status_t cu_send_to_du(const protocol_ctxt_t *const ctxt,
const rb_id_t rb_id, const mui_t mui, const rb_id_t rb_id, const mui_t mui,
confirm_t confirm, sdu_size_t size, mem_block_t *sdu, confirm_t confirm, sdu_size_t size, mem_block_t *sdu,
const uint32_t *const sourceID, const uint32_t *const destID) { const uint32_t *const sourceID, const uint32_t *const destID) {
uint8_t *gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U, MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0, GTPV1U_TUNNEL_DATA_REQ,
size + GTPU_HEADER_OVERHEAD_MAX); sizeof(gtpv1u_tunnel_data_req_t) +
AssertFatal(gtpu_buffer_p != NULL, "OUT OF MEMORY"); size + GTPU_HEADER_OVERHEAD_MAX );
memcpy(gtpu_buffer_p+GTPU_HEADER_OVERHEAD_MAX, AssertFatal(message_p != NULL, "OUT OF MEMORY");
gtpv1u_tunnel_data_req_t *req=&GTPV1U_TUNNEL_DATA_REQ(message_p);
req->buffer = (uint8_t*)(req+1);
memcpy(req->buffer + GTPU_HEADER_OVERHEAD_MAX,
sdu->data, sdu->data,
size ); size );
MessageDef *message_p = itti_alloc_new_message(TASK_PDCP_ENB, 0, GTPV1U_ENB_TUNNEL_DATA_REQ);
AssertFatal(message_p != NULL, "OUT OF MEMORY");
gtpv1u_enb_tunnel_data_req_t *req=&GTPV1U_ENB_TUNNEL_DATA_REQ(message_p);
req->buffer = gtpu_buffer_p;
req->length = size; req->length = size;
req->offset = GTPU_HEADER_OVERHEAD_MAX; req->offset = GTPU_HEADER_OVERHEAD_MAX;
req->rnti = ctxt->rnti; req->ue_id = ctxt->rnti;
req->rab_id = rb_id+4; req->bearer_id = rb_id+4;
LOG_D(PDCP, "%s() (drb %ld) sending message to gtp size %d\n", LOG_D(PDCP, "%s() (drb %ld) sending message to gtp size %d\n",
__func__, rb_id, size); __func__, rb_id, size);
extern instance_t CUuniqInstance; extern instance_t CUuniqInstance;
...@@ -643,7 +642,6 @@ pdcp_data_ind( ...@@ -643,7 +642,6 @@ pdcp_data_ind(
uint16_t pdcp_uid=0; uint16_t pdcp_uid=0;
MessageDef *message_p = NULL; MessageDef *message_p = NULL;
uint8_t *gtpu_buffer_p = NULL;
uint32_t rx_hfn_for_count; uint32_t rx_hfn_for_count;
int pdcp_sn_for_count; int pdcp_sn_for_count;
int security_ok; int security_ok;
...@@ -1050,22 +1048,23 @@ pdcp_data_ind( ...@@ -1050,22 +1048,23 @@ pdcp_data_ind(
if (LINK_ENB_PDCP_TO_GTPV1U) { if (LINK_ENB_PDCP_TO_GTPV1U) {
if ((true == ctxt_pP->enb_flag) && (false == srb_flagP)) { if ((true == ctxt_pP->enb_flag) && (false == srb_flagP)) {
LOG_D(PDCP, "Sending packet to GTP, Calling GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %ld len %u\n", LOG_D(PDCP, "Sending packet to GTP, Calling GTPV1U_TUNNEL_DATA_REQ ue %x rab %ld len %u\n",
ctxt_pP->rnti, ctxt_pP->rnti,
rb_id + 4, rb_id + 4,
sdu_buffer_sizeP - payload_offset ); sdu_buffer_sizeP - payload_offset );
//LOG_T(PDCP,"Sending to GTPV1U %d bytes\n", sdu_buffer_sizeP - payload_offset); message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0, GTPV1U_TUNNEL_DATA_REQ,
gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U, sizeof(gtpv1u_tunnel_data_req_t) +
sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX); sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX );
AssertFatal(gtpu_buffer_p != NULL, "OUT OF MEMORY");
memcpy(&gtpu_buffer_p[GTPU_HEADER_OVERHEAD_MAX], &sdu_buffer_pP->data[payload_offset], sdu_buffer_sizeP - payload_offset);
message_p = itti_alloc_new_message(TASK_PDCP_ENB, 0, GTPV1U_ENB_TUNNEL_DATA_REQ);
AssertFatal(message_p != NULL, "OUT OF MEMORY"); AssertFatal(message_p != NULL, "OUT OF MEMORY");
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer = gtpu_buffer_p; gtpv1u_tunnel_data_req_t *req=&GTPV1U_TUNNEL_DATA_REQ(message_p);
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).length = sdu_buffer_sizeP - payload_offset; req->buffer = (uint8_t*)(req+1);
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX; memcpy(req->buffer + GTPU_HEADER_OVERHEAD_MAX,
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rnti = ctxt_pP->rnti; &sdu_buffer_pP->data[payload_offset],
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rab_id = rb_id + 4; sdu_buffer_sizeP - payload_offset);
req->length = sdu_buffer_sizeP - payload_offset;
req->offset = GTPU_HEADER_OVERHEAD_MAX;
req->ue_id = ctxt_pP->rnti;
req->bearer_id = rb_id + 4;
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p); itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
packet_forwarded = true; packet_forwarded = true;
} }
......
...@@ -83,7 +83,7 @@ extern struct msghdr nas_msg_rx; ...@@ -83,7 +83,7 @@ extern struct msghdr nas_msg_rx;
# include "gtpv1u_eNB_task.h" # include "openair3/ocp-gtpu/gtp_itf.h"
extern int gtpv1u_new_data_req( uint8_t enb_module_idP, rnti_t ue_rntiP, uint8_t rab_idP, uint8_t *buffer_pP, uint32_t buf_lenP, uint32_t buf_offsetP); extern int gtpv1u_new_data_req( uint8_t enb_module_idP, rnti_t ue_rntiP, uint8_t rab_idP, uint8_t *buffer_pP, uint32_t buf_lenP, uint32_t buf_offsetP);
uint16_t ue_id_g; // Global variable to identify the ID for each UE. It is updated in main() of lte-uesoftmodem.c uint16_t ue_id_g; // Global variable to identify the ID for each UE. It is updated in main() of lte-uesoftmodem.c
......
...@@ -688,20 +688,20 @@ rb_found: ...@@ -688,20 +688,20 @@ rb_found:
ctxt.rnti = ue->ue_id; ctxt.rnti = ue->ue_id;
if (RC.nrrrc != NULL && NODE_IS_CU(RC.nrrrc[0]->node_type)) { if (RC.nrrrc != NULL && NODE_IS_CU(RC.nrrrc[0]->node_type)) {
MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0, MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0,
GTPV1U_GNB_TUNNEL_DATA_REQ, GTPV1U_TUNNEL_DATA_REQ,
sizeof(gtpv1u_gnb_tunnel_data_req_t) sizeof(gtpv1u_tunnel_data_req_t)
+ size + size
+ GTPU_HEADER_OVERHEAD_MAX); + GTPU_HEADER_OVERHEAD_MAX);
AssertFatal(message_p != NULL, "OUT OF MEMORY"); AssertFatal(message_p != NULL, "OUT OF MEMORY");
gtpv1u_gnb_tunnel_data_req_t *req=&GTPV1U_GNB_TUNNEL_DATA_REQ(message_p); gtpv1u_tunnel_data_req_t *req=&GTPV1U_TUNNEL_DATA_REQ(message_p);
uint8_t *gtpu_buffer_p = (uint8_t*)(req+1); uint8_t *gtpu_buffer_p = (uint8_t*)(req+1);
memcpy(gtpu_buffer_p+GTPU_HEADER_OVERHEAD_MAX, memcpy(gtpu_buffer_p+GTPU_HEADER_OVERHEAD_MAX,
buf, size); buf, size);
req->buffer = gtpu_buffer_p; req->buffer = gtpu_buffer_p;
req->length = size; req->length = size;
req->offset = GTPU_HEADER_OVERHEAD_MAX; req->offset = GTPU_HEADER_OVERHEAD_MAX;
req->rnti = ue->ue_id; req->ue_id = ue->ue_id;
req->pdusession_id = rb_id; req->bearer_id = rb_id;
LOG_I(PDCP, "%s() (drb %d) sending message to gtp size %d\n", LOG_I(PDCP, "%s() (drb %d) sending message to gtp size %d\n",
__func__, rb_id, size); __func__, rb_id, size);
extern instance_t CUuniqInstance; extern instance_t CUuniqInstance;
......
...@@ -536,15 +536,15 @@ rb_found: ...@@ -536,15 +536,15 @@ rb_found:
itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(0 /*ctxt_pP->module_id*/), msg); itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(0 /*ctxt_pP->module_id*/), msg);
return; return;
} else { } else {
MessageDef *msg = itti_alloc_new_message_sized(TASK_RLC_ENB, 0, GTPV1U_GNB_TUNNEL_DATA_REQ, MessageDef *msg = itti_alloc_new_message_sized(TASK_RLC_ENB, 0, GTPV1U_TUNNEL_DATA_REQ,
sizeof(gtpv1u_gnb_tunnel_data_req_t) + size); sizeof(gtpv1u_tunnel_data_req_t) + size);
gtpv1u_gnb_tunnel_data_req_t *req=&GTPV1U_GNB_TUNNEL_DATA_REQ(msg); gtpv1u_tunnel_data_req_t *req=&GTPV1U_TUNNEL_DATA_REQ(msg);
req->buffer=(uint8_t*)(req+1); req->buffer=(uint8_t*)(req+1);
memcpy(req->buffer,buf,size); memcpy(req->buffer,buf,size);
req->length=size; req->length=size;
req->offset=0; req->offset=0;
req->rnti=ue->rnti; req->ue_id=ue->ue_id;
req->pdusession_id=rb_id; req->bearer_id=rb_id;
LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size); LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size);
extern instance_t DUuniqInstance; extern instance_t DUuniqInstance;
itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg); itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg);
......
...@@ -21,13 +21,14 @@ ...@@ -21,13 +21,14 @@
#ifndef _NR_RLC_UE_MANAGER_H_ #ifndef _NR_RLC_UE_MANAGER_H_
#define _NR_RLC_UE_MANAGER_H_ #define _NR_RLC_UE_MANAGER_H_
#include "openair2/COMMON/platform_types.h"
#include "nr_rlc_entity.h" #include "nr_rlc_entity.h"
typedef void nr_rlc_ue_manager_t; typedef void nr_rlc_ue_manager_t;
typedef struct nr_rlc_ue_t { typedef struct nr_rlc_ue_t {
int rnti; int rnti;
ue_id_t ue_id;
nr_rlc_entity_t *srb[3]; nr_rlc_entity_t *srb[3];
nr_rlc_entity_t *drb[5]; nr_rlc_entity_t *drb[5];
} nr_rlc_ue_t; } nr_rlc_ue_t;
......
...@@ -431,14 +431,14 @@ rb_found: ...@@ -431,14 +431,14 @@ rb_found:
} else { } else {
// Fixme: very dirty workaround of incomplete F1-U implementation // Fixme: very dirty workaround of incomplete F1-U implementation
instance_t DUuniqInstance=0; instance_t DUuniqInstance=0;
MessageDef *msg = itti_alloc_new_message(TASK_RLC_ENB, 0, GTPV1U_ENB_TUNNEL_DATA_REQ); MessageDef *msg = itti_alloc_new_message_sized(TASK_RLC_ENB, 0, GTPV1U_TUNNEL_DATA_REQ, sizeof(gtpv1u_tunnel_data_req_t) + size);
gtpv1u_enb_tunnel_data_req_t *req=&GTPV1U_ENB_TUNNEL_DATA_REQ(msg); gtpv1u_tunnel_data_req_t *req=&GTPV1U_TUNNEL_DATA_REQ(msg);
req->buffer=malloc(size); req->buffer=(uint8_t*)(req+1);
memcpy(req->buffer,buf,size); memcpy(req->buffer,buf,size);
req->length=size; req->length=size;
req->offset=0; req->offset=0;
req->rnti=ue->rnti; req->ue_id=ue->rnti;
req->rab_id=rb_id+4; req->bearer_id=rb_id+4;
LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size); LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size);
itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg); itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg);
return; return;
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
# include "intertask_interface.h" # include "intertask_interface.h"
# include "s1ap_eNB.h" # include "s1ap_eNB.h"
# include "sctp_eNB_task.h" # include "sctp_eNB_task.h"
# include "gtpv1u_eNB_task.h" # include "openair3/ocp-gtpu/gtp_itf.h"
# include "flexran_agent.h" # include "flexran_agent.h"
# include "x2ap_eNB.h" # include "x2ap_eNB.h"
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
#include "rrc_eNB_M2AP.h" #include "rrc_eNB_M2AP.h"
#include "pdcp.h" #include "pdcp.h"
#include "gtpv1u_eNB_task.h" #include "openair3/ocp-gtpu/gtp_itf.h"
#include <openair3/ocp-gtpu/gtp_itf.h> #include <openair3/ocp-gtpu/gtp_itf.h>
#include "intertask_interface.h" #include "intertask_interface.h"
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#include "LTE_UERadioAccessCapabilityInformation.h" #include "LTE_UERadioAccessCapabilityInformation.h"
#include "gtpv1u_eNB_task.h" #include "openair3/ocp-gtpu/gtp_itf.h"
#include <openair3/ocp-gtpu/gtp_itf.h> #include <openair3/ocp-gtpu/gtp_itf.h>
#include "RRC/LTE/rrc_eNB_GTPV1U.h" #include "RRC/LTE/rrc_eNB_GTPV1U.h"
......
...@@ -406,7 +406,7 @@ typedef struct rrc_gNB_ue_context_s { ...@@ -406,7 +406,7 @@ typedef struct rrc_gNB_ue_context_s {
/* Uniquely identifies the UE between MME and eNB within the eNB. /* Uniquely identifies the UE between MME and eNB within the eNB.
* This id is encoded on 24bits. * This id is encoded on 24bits.
*/ */
rnti_t ue_id_rnti; ue_id_t ue_id_rnti;
// another key for protocol layers but should not be used as a key for RB tree // another key for protocol layers but should not be used as a key for RB tree
uid_t local_uid; uid_t local_uid;
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
#include "nr_pdcp/nr_pdcp_entity.h" #include "nr_pdcp/nr_pdcp_entity.h"
#include "pdcp.h" #include "pdcp.h"
#include "gtpv1u_eNB_task.h" #include "openair3/ocp-gtpu/gtp_itf.h"
#include "intertask_interface.h" #include "intertask_interface.h"
...@@ -1648,7 +1648,7 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( ...@@ -1648,7 +1648,7 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete(
} }
} }
create_tunnel_req.rnti = ctxt_pP->rnti; // warning put zero above create_tunnel_req.ue_id = ctxt_pP->rnti; // warning put zero above
create_tunnel_req.num_tunnels = j; create_tunnel_req.num_tunnels = j;
ret = gtpv1u_update_ngu_tunnel( ret = gtpv1u_update_ngu_tunnel(
ctxt_pP->instance, ctxt_pP->instance,
...@@ -3406,10 +3406,10 @@ static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, co ...@@ -3406,10 +3406,10 @@ static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, co
int rlc_tx_buffer_space = nr_rlc_get_available_tx_space(rnti, drb_id); int rlc_tx_buffer_space = nr_rlc_get_available_tx_space(rnti, drb_id);
LOG_I(NR_RRC, "Reported in DDD drb_id:%d, rnti:%d\n", drb_id, rnti); LOG_I(NR_RRC, "Reported in DDD drb_id:%d, rnti:%d\n", drb_id, rnti);
MessageDef *msg = itti_alloc_new_message_sized(TASK_RRC_GNB, 0, GTPV1U_DU_BUFFER_REPORT_REQ, MessageDef *msg = itti_alloc_new_message_sized(TASK_RRC_GNB, 0, GTPV1U_DU_BUFFER_REPORT_REQ,
sizeof(gtpv1u_gnb_tunnel_data_req_t)); sizeof(gtpv1u_tunnel_data_req_t));
gtpv1u_DU_buffer_report_req_t *req=&GTPV1U_DU_BUFFER_REPORT_REQ(msg); gtpv1u_DU_buffer_report_req_t *req=&GTPV1U_DU_BUFFER_REPORT_REQ(msg);
req->pdusession_id = drb_id; req->pdusession_id = drb_id;
req->rnti = rnti; req->ue_id = rnti;
req->buffer_availability = rlc_tx_buffer_space; //10000000; //Hardcoding to be removed and read the actual RLC buffer availability instead req->buffer_availability = rlc_tx_buffer_space; //10000000; //Hardcoding to be removed and read the actual RLC buffer availability instead
extern instance_t DUuniqInstance; extern instance_t DUuniqInstance;
itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg); itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg);
...@@ -3747,12 +3747,12 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { ...@@ -3747,12 +3747,12 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
if (fd) { if (fd) {
if (ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.presence == true) { if (ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.presence == true) {
fprintf(fd,"NR RRC UE rnti %x: S-TMSI %x failure timer %d/8\n", fprintf(fd,"NR RRC UE rnti %lx: S-TMSI %x failure timer %d/8\n",
ue_context_p->ue_id_rnti, ue_context_p->ue_id_rnti,
ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.fiveg_tmsi, ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.fiveg_tmsi,
ue_context_p->ue_context.ul_failure_timer); ue_context_p->ue_context.ul_failure_timer);
} else { } else {
fprintf(fd,"NR RRC UE rnti %x failure timer %d/8\n", fprintf(fd,"NR RRC UE rnti %lx failure timer %d/8\n",
ue_context_p->ue_id_rnti, ue_context_p->ue_id_rnti,
ue_context_p->ue_context.ul_failure_timer); ue_context_p->ue_context.ul_failure_timer);
} }
...@@ -3878,7 +3878,7 @@ void fill_DRB_configList(NR_DRB_ToAddModList_t *DRB_configList, pdu_session_to_s ...@@ -3878,7 +3878,7 @@ void fill_DRB_configList(NR_DRB_ToAddModList_t *DRB_configList, pdu_session_to_s
ie->cnAssociation->present = NR_DRB_ToAddMod__cnAssociation_PR_sdap_Config; ie->cnAssociation->present = NR_DRB_ToAddMod__cnAssociation_PR_sdap_Config;
// sdap_Config // sdap_Config
NR_SDAP_Config_t *sdap_config = ie->cnAssociation->choice.sdap_config; NR_SDAP_Config_t *sdap_config = ie->cnAssociation->choice.sdap_Config;
sdap_config = CALLOC(1, sizeof(*sdap_config)); sdap_config = CALLOC(1, sizeof(*sdap_config));
memset(sdap_config, 0, sizeof(*sdap_config)); memset(sdap_config, 0, sizeof(*sdap_config));
sdap_config->pdu_Session = pdu->sessionId; sdap_config->pdu_Session = pdu->sessionId;
...@@ -3887,15 +3887,15 @@ void fill_DRB_configList(NR_DRB_ToAddModList_t *DRB_configList, pdu_session_to_s ...@@ -3887,15 +3887,15 @@ void fill_DRB_configList(NR_DRB_ToAddModList_t *DRB_configList, pdu_session_to_s
sdap_config->defaultDRB = drb->defaultDRB; sdap_config->defaultDRB = drb->defaultDRB;
sdap_config->mappedQoS_FlowsToAdd = calloc(1, sizeof(struct NR_SDAP_Config__mappedQoS_FlowsToAdd)); sdap_config->mappedQoS_FlowsToAdd = calloc(1, sizeof(struct NR_SDAP_Config__mappedQoS_FlowsToAdd));
memset(sdap_config->mappedQoS_FlowsToAdd, 0, sizeof(struct NR_SDAP_Config__mappedQoS_FlowsToAdd)); // LTSFIXME
int numQosFlow2Setup=0;
for (int j=0; j < numQosFlow2Setup; j++) { for (int j=0; j < numQosFlow2Setup; j++) {
NR_QFI_t *qfi = calloc(1, sizeof(NR_QFI_t)); NR_QFI_t *qfi = calloc(1, sizeof(NR_QFI_t));
*qfi = drb->qosFlows[j].fiveQI; *qfi = drb->qosFlows[j].fiveQI;
ASN_SEQUENCE_ADD(&sdap_config->mappedQoS_FlowsToAdd->list, qfi); ASN_SEQUENCE_ADD(&sdap_config->mappedQoS_FlowsToAdd->list, qfi);
} }
sdap_config->mappedQoS_FlowsToRelease = NULL; sdap_config->mappedQoS_FlowsToRelease = NULL;
/*
// pdcp_Config // pdcp_Config
ie->reestablishPDCP = NULL; ie->reestablishPDCP = NULL;
ie->recoverPDCP = NULL; ie->recoverPDCP = NULL;
...@@ -3933,6 +3933,7 @@ void fill_DRB_configList(NR_DRB_ToAddModList_t *DRB_configList, pdu_session_to_s ...@@ -3933,6 +3933,7 @@ void fill_DRB_configList(NR_DRB_ToAddModList_t *DRB_configList, pdu_session_to_s
pdcp_config->ext1->cipheringDisabled = calloc(1, sizeof(*pdcp_config->ext1->cipheringDisabled)); pdcp_config->ext1->cipheringDisabled = calloc(1, sizeof(*pdcp_config->ext1->cipheringDisabled));
*pdcp_config->ext1->cipheringDisabled = NR_PDCP_Config__ext1__cipheringDisabled_true; *pdcp_config->ext1->cipheringDisabled = NR_PDCP_Config__ext1__cipheringDisabled_true;
} }
*/
} }
} }
...@@ -3943,26 +3944,26 @@ int rrc_gNB_process_e1_bearer_context_setup_req(e1ap_bearer_setup_req_t *req, in ...@@ -3943,26 +3944,26 @@ int rrc_gNB_process_e1_bearer_context_setup_req(e1ap_bearer_setup_req_t *req, in
NR_DRB_ToAddModList_t *DRB_configList; NR_DRB_ToAddModList_t *DRB_configList;
for (int i=0; i < req->numPDUSessions; i++) { for (int i=0; i < req->numPDUSessions; i++) {
pdu_session_to_setup_t *pdu = req->pduSession[i]; pdu_session_to_setup_t *pdu = &req->pduSession[i];
create_tunnel_req.pdusession_id[i] = pdu->sessionId; create_tunnel_req.pdusession_id[i] = pdu->sessionId;
create_tunnel_req.incoming_rb_id[i] = pdu->DRBnGRanList[0].id; // taking only the first DRB. TODO:change this create_tunnel_req.incoming_rb_id[i] = pdu->DRBnGRanList[0].id; // taking only the first DRB. TODO:change this
memcpy(&create_tunnel_req.dst_addr[i].buffer, memcpy(&create_tunnel_req.dst_addr[i].buffer,
pdu->tlAddress, &pdu->tlAddress,
sizeof(uint8_t)*20); sizeof(pdu->tlAddress));
create_tunnel_req.outgoing_teid = pdu->teID; create_tunnel_req.outgoing_teid[i] = pdu->teId;
fill_DRB_configList(DRB_configList, pdu); fill_DRB_configList(DRB_configList, pdu);
} }
create_tunnel_req.num_tunnels = req->numPDUSessions; create_tunnel_req.num_tunnels = req->numPDUSessions;
create_tunnel_req.rnti = (req->gNB_cu_cp_ue_id & 0xFFFF); create_tunnel_req.ue_id = (req->gNB_cu_cp_ue_id & 0xFFFF);
ret = gtpv1u_create_ngu_tunnel( int ret = gtpv1u_create_ngu_tunnel(
instance, instance,
&create_tunnel_req, &create_tunnel_req,
&create_tunnel_resp); &create_tunnel_resp);
uint8_t *kRRCenc = NULL; uint8_t *kRRCenc = NULL;
uint8_t *kRRCint = NULL; uint8_t *kRRCint = NULL;
/*
nr_derive_key_rrc_enc(cipheringAlgorithm, nr_derive_key_rrc_enc(cipheringAlgorithm,
encryptionKey, encryptionKey,
&kRRCenc); &kRRCenc);
...@@ -3970,7 +3971,7 @@ int rrc_gNB_process_e1_bearer_context_setup_req(e1ap_bearer_setup_req_t *req, in ...@@ -3970,7 +3971,7 @@ int rrc_gNB_process_e1_bearer_context_setup_req(e1ap_bearer_setup_req_t *req, in
nr_derive_key_rrc_int(integrityProtectionAlgorithm, nr_derive_key_rrc_int(integrityProtectionAlgorithm,
integrityProtectionKey, integrityProtectionKey,
&kRRCint); &kRRCint);
*/
return 0; return 0;
} }
......
...@@ -97,7 +97,7 @@ nr_rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP( ...@@ -97,7 +97,7 @@ nr_rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
LOG_D(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" RX CREATE_TUNNEL_RESP num tunnels %u \n", LOG_D(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" RX CREATE_TUNNEL_RESP num tunnels %u \n",
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP),
create_tunnel_resp_pP->num_tunnels); create_tunnel_resp_pP->num_tunnels);
rnti = create_tunnel_resp_pP->rnti; rnti = create_tunnel_resp_pP->ue_id;
ue_context_p = rrc_gNB_get_ue_context( ue_context_p = rrc_gNB_get_ue_context(
RC.nrrrc[ctxt_pP->module_id], RC.nrrrc[ctxt_pP->module_id],
ctxt_pP->rnti); ctxt_pP->rnti);
......
...@@ -39,8 +39,7 @@ ...@@ -39,8 +39,7 @@
#include "pdcp.h" #include "pdcp.h"
#include "pdcp_primitives.h" #include "pdcp_primitives.h"
#include "gtpv1u_eNB_task.h" #include "openair3/ocp-gtpu/gtp_itf.h"
#include "gtpv1u_gNB_task.h"
#include <openair3/ocp-gtpu/gtp_itf.h> #include <openair3/ocp-gtpu/gtp_itf.h>
#include "RRC/LTE/rrc_eNB_GTPV1U.h" #include "RRC/LTE/rrc_eNB_GTPV1U.h"
#include "RRC/NR/rrc_gNB_GTPV1U.h" #include "RRC/NR/rrc_gNB_GTPV1U.h"
...@@ -60,6 +59,7 @@ ...@@ -60,6 +59,7 @@
#include "f1ap_messages_types.h" #include "f1ap_messages_types.h"
#include "E1AP_SDAP-Configuration.h" #include "E1AP_SDAP-Configuration.h"
#include "E1AP_PDCP-Configuration.h" #include "E1AP_PDCP-Configuration.h"
#include "openair2/E1AP/e1ap.h"
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
...@@ -532,7 +532,7 @@ rrc_gNB_process_NGAP_INITIAL_CONTEXT_SETUP_REQ( ...@@ -532,7 +532,7 @@ rrc_gNB_process_NGAP_INITIAL_CONTEXT_SETUP_REQ(
} }
ue_context_p->ue_context.nb_of_pdusessions = NGAP_INITIAL_CONTEXT_SETUP_REQ (msg_p).nb_of_pdusessions; ue_context_p->ue_context.nb_of_pdusessions = NGAP_INITIAL_CONTEXT_SETUP_REQ (msg_p).nb_of_pdusessions;
create_tunnel_req.rnti = ue_context_p->ue_context.rnti; create_tunnel_req.ue_id = ue_context_p->ue_context.rnti;
create_tunnel_req.num_tunnels = pdu_sessions_done; create_tunnel_req.num_tunnels = pdu_sessions_done;
ret = gtpv1u_create_ngu_tunnel( ret = gtpv1u_create_ngu_tunnel(
...@@ -997,9 +997,9 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ( ...@@ -997,9 +997,9 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(
bearer_req->gNB_cu_cp_ue_id = gNB_ue_ngap_id; bearer_req->gNB_cu_cp_ue_id = gNB_ue_ngap_id;
bearer_req->cipheringAlgorithm = ue_context_p->ue_context.ciphering_algorithm; bearer_req->cipheringAlgorithm = ue_context_p->ue_context.ciphering_algorithm;
memcpy(bearer_req->encryptionKey, ue_context_p->ue_context.kgnb, strlen(ue_context_p->ue_context.kgnb)); memcpy(bearer_req->encryptionKey, ue_context_p->ue_context.kgnb, sizeof(ue_context_p->ue_context.kgnb));
bearer_req->integrityProtectionAlgorithm = ue_context_pP->ue_context.integrity_algorithm; bearer_req->integrityProtectionAlgorithm = ue_context_p->ue_context.integrity_algorithm;
memcpy(bearer_req->integrityProtectionKey, ue_context_pP->ue_context.kgnb, strlen(ue_context_p->ue_context.kgnb)); memcpy(bearer_req->integrityProtectionKey, ue_context_p->ue_context.kgnb, sizeof(ue_context_p->ue_context.kgnb));
bearer_req->ueDlAggMaxBitRate = msg->ueAggMaxBitRateDownlink; bearer_req->ueDlAggMaxBitRate = msg->ueAggMaxBitRateDownlink;
bearer_req->numPDUSessions = msg->nb_pdusessions_tosetup; bearer_req->numPDUSessions = msg->nb_pdusessions_tosetup;
...@@ -1094,7 +1094,7 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ( ...@@ -1094,7 +1094,7 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(
ue_context_p->ue_context.nb_of_pdusessions = msg->nb_pdusessions_tosetup; ue_context_p->ue_context.nb_of_pdusessions = msg->nb_pdusessions_tosetup;
ue_context_p->ue_context.gNB_ue_ngap_id = msg->gNB_ue_ngap_id; ue_context_p->ue_context.gNB_ue_ngap_id = msg->gNB_ue_ngap_id;
ue_context_p->ue_context.amf_ue_ngap_id = msg->amf_ue_ngap_id; ue_context_p->ue_context.amf_ue_ngap_id = msg->amf_ue_ngap_id;
create_tunnel_req.rnti = ue_context_p->ue_context.rnti; create_tunnel_req.ue_id = ue_context_p->ue_context.rnti;
create_tunnel_req.num_tunnels = pdu_sessions_done; create_tunnel_req.num_tunnels = pdu_sessions_done;
ret = gtpv1u_create_ngu_tunnel( ret = gtpv1u_create_ngu_tunnel(
...@@ -1762,7 +1762,7 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND( ...@@ -1762,7 +1762,7 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(
//gtp tunnel delete //gtp tunnel delete
LOG_I(NR_RRC, "gtp tunnel delete \n"); LOG_I(NR_RRC, "gtp tunnel delete \n");
gtpv1u_gnb_delete_tunnel_req_t req={0}; gtpv1u_gnb_delete_tunnel_req_t req={0};
req.rnti = ue_context_p->ue_context.rnti; req.ue_id = ue_context_p->ue_context.rnti;
for(i = 0; i < NB_RB_MAX; i++) { for(i = 0; i < NB_RB_MAX; i++) {
if(xid == ue_context_p->ue_context.pduSession[i].xid) { if(xid == ue_context_p->ue_context.pduSession[i].xid) {
......
...@@ -200,16 +200,16 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity, ...@@ -200,16 +200,16 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB,
0, 0,
GTPV1U_GNB_TUNNEL_DATA_REQ, GTPV1U_GNB_TUNNEL_DATA_REQ,
sizeof(gtpv1u_gnb_tunnel_data_req_t) sizeof(gtpv1u_tunnel_data_req_t)
+ size + GTPU_HEADER_OVERHEAD_MAX - offset); + size + GTPU_HEADER_OVERHEAD_MAX - offset);
AssertFatal(message_p != NULL, "OUT OF MEMORY"); AssertFatal(message_p != NULL, "OUT OF MEMORY");
gtpv1u_gnb_tunnel_data_req_t *req = &GTPV1U_TUNNEL_DATA_REQ(message_p); gtpv1u_tunnel_data_req_t *req = &GTPV1U_TUNNEL_DATA_REQ(message_p);
uint8_t *gtpu_buffer_p = (uint8_t *) (req + 1); uint8_t *gtpu_buffer_p = (uint8_t *) (req + 1);
memcpy(gtpu_buffer_p + GTPU_HEADER_OVERHEAD_MAX, buf + offset, size - offset); memcpy(gtpu_buffer_p + GTPU_HEADER_OVERHEAD_MAX, buf + offset, size - offset);
req->buffer = gtpu_buffer_p; req->buffer = gtpu_buffer_p;
req->length = size - offset; req->length = size - offset;
req->offset = GTPU_HEADER_OVERHEAD_MAX; req->offset = GTPU_HEADER_OVERHEAD_MAX;
req->rnti = ur_id; req->rnti = ue_id;
req->pdusession_id = pdusession_id; req->pdusession_id = pdusession_id;
LOG_D(SDAP, "%s() sending message to gtp size %d\n", __func__, size-offset); LOG_D(SDAP, "%s() sending message to gtp size %d\n", __func__, size-offset);
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p); itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
# include "intertask_interface.h" # include "intertask_interface.h"
# include "s1ap_eNB.h" # include "s1ap_eNB.h"
# include "sctp_eNB_task.h" # include "sctp_eNB_task.h"
# include "gtpv1u_eNB_task.h" # include "openair3/ocp-gtpu/gtp_itf.h"
# include "flexran_agent.h" # include "flexran_agent.h"
# include "x2ap_eNB.h" # include "x2ap_eNB.h"
......
...@@ -108,7 +108,7 @@ typedef struct gtpv1u_bearer_s { ...@@ -108,7 +108,7 @@ typedef struct gtpv1u_bearer_s {
} gtpv1u_bearer_t; } gtpv1u_bearer_t;
typedef struct { typedef struct {
map<int, gtpv1u_bearer_t> bearers; map<ue_id_t, gtpv1u_bearer_t> bearers;
teid_t outgoing_teid; teid_t outgoing_teid;
} teidData_t; } teidData_t;
...@@ -188,7 +188,7 @@ instance_t legacyInstanceMapping=0; ...@@ -188,7 +188,7 @@ instance_t legacyInstanceMapping=0;
auto ptrRnti=insT->ue2te_mapping.find(RnTi); \ auto ptrRnti=insT->ue2te_mapping.find(RnTi); \
\ \
if ( ptrRnti==insT->ue2te_mapping.end() ) { \ if ( ptrRnti==insT->ue2te_mapping.end() ) { \
LOG_E(GTPU, "[%ld] gtpv1uSend failed: while getting ue rnti %x in hashtable ue_mapping\n", instance, rnti); \ LOG_E(GTPU, "[%ld] gtpv1uSend failed: while getting ue id %x in hashtable ue_mapping\n", instance, rnti); \
pthread_mutex_unlock(&globGtp.gtp_lock); \ pthread_mutex_unlock(&globGtp.gtp_lock); \
return; \ return; \
} }
...@@ -197,7 +197,7 @@ instance_t legacyInstanceMapping=0; ...@@ -197,7 +197,7 @@ instance_t legacyInstanceMapping=0;
auto ptrRnti=insT->ue2te_mapping.find(RnTi); \ auto ptrRnti=insT->ue2te_mapping.find(RnTi); \
\ \
if ( ptrRnti==insT->ue2te_mapping.end() ) { \ if ( ptrRnti==insT->ue2te_mapping.end() ) { \
LOG_E(GTPU, "[%ld] gtpv1uSend failed: while getting ue rnti %x in hashtable ue_mapping\n", instance, rnti); \ LOG_E(GTPU, "[%ld] gtpv1uSend failed: while getting ue id %x in hashtable ue_mapping\n", instance, rnti); \
pthread_mutex_unlock(&globGtp.gtp_lock); \ pthread_mutex_unlock(&globGtp.gtp_lock); \
return GTPNOK; \ return GTPNOK; \
} }
...@@ -281,58 +281,25 @@ static int gtpv1uCreateAndSendMsg(int h, ...@@ -281,58 +281,25 @@ static int gtpv1uCreateAndSendMsg(int h,
return !GTPNOK; return !GTPNOK;
} }
static void gtpv1uSend(instance_t instance, gtpv1u_enb_tunnel_data_req_t *req, bool seqNumFlag, bool npduNumFlag) { static void gtpv1uSend(instance_t instance, gtpv1u_tunnel_data_req_t *req, bool seqNumFlag, bool npduNumFlag) {
uint8_t *buffer=req->buffer+req->offset; uint8_t *buffer=req->buffer+req->offset;
size_t length=req->length; size_t length=req->length;
rnti_t rnti=req->rnti; ue_id_t ueid=req->ue_id;
int rab_id=req->rab_id; int bearer_id=req->bearer_id;
pthread_mutex_lock(&globGtp.gtp_lock);
getInstRetVoid(compatInst(instance));
getRntiRetVoid(inst, rnti);
map<int, gtpv1u_bearer_t>::iterator ptr2=ptrRnti->second.bearers.find(rab_id);
if ( ptr2 == ptrRnti->second.bearers.end() ) {
LOG_E(GTPU,"[%ld] GTP-U instance: sending a packet to a non existant RNTI:RAB: %x/%x\n", instance, rnti, rab_id);
pthread_mutex_unlock(&globGtp.gtp_lock);
return;
}
LOG_D(GTPU,"[%ld] sending a packet to RNTI:RAB:teid %x/%x/%x, len %lu, oldseq %d, oldnum %d\n",
instance, rnti, rab_id,ptr2->second.teid_outgoing,length, ptr2->second.seqNum,ptr2->second.npduNum );
if(seqNumFlag)
ptr2->second.seqNum++;
if(npduNumFlag)
ptr2->second.npduNum++;
// copy to release the mutex
gtpv1u_bearer_t tmp=ptr2->second;
pthread_mutex_unlock(&globGtp.gtp_lock);
gtpv1uCreateAndSendMsg(
compatInst(instance), tmp.outgoing_ip_addr, tmp.outgoing_port, GTP_GPDU, tmp.teid_outgoing, buffer, length, seqNumFlag, npduNumFlag, tmp.seqNum, tmp.npduNum, NO_MORE_EXT_HDRS, NULL, 0);
}
static void gtpv1uSend2(instance_t instance, gtpv1u_gnb_tunnel_data_req_t *req, bool seqNumFlag, bool npduNumFlag) {
uint8_t *buffer=req->buffer+req->offset;
size_t length=req->length;
ue_id_t ue_id=req->ue_id;
int rab_id=req->pdusession_id;
pthread_mutex_lock(&globGtp.gtp_lock); pthread_mutex_lock(&globGtp.gtp_lock);
getInstRetVoid(compatInst(instance)); getInstRetVoid(compatInst(instance));
getRntiRetVoid(inst, ue_id); getRntiRetVoid(inst, ue_id);
map<int, gtpv1u_bearer_t>::iterator ptr2=ptrRnti->second.bearers.find(rab_id); auto ptr2=ptrUe->second.bearers.find(bearer_id);
if ( ptr2 == ptrRnti->second.bearers.end() ) { if ( ptr2 == ptrUe->second.bearers.end() ) {
LOG_D(GTPU,"GTP-U instance: %ld sending a packet to a non existant UE ID:RAB: %lu/%x\n", instance, ue_id, rab_id); LOG_E(GTPU,"[%ld] GTP-U instance: sending a packet to a non existant UE:RAB: %lx/%x\n", instance, ueid, bearer_id);
pthread_mutex_unlock(&globGtp.gtp_lock); pthread_mutex_unlock(&globGtp.gtp_lock);
return; return;
} }
LOG_D(GTPU,"[%ld] GTP-U sending a packet to UE ID:RAB:teid %lu/%x/%x, len %lu, oldseq %d, oldnum %d\n", LOG_D(GTPU,"[%ld] sending a packet to UE:RAB:teid %lx/%x/%x, len %lu, oldseq %d, oldnum %d\n",
instance, ue_id, rab_id,ptr2->second.teid_outgoing,length, ptr2->second.seqNum,ptr2->second.npduNum ); instance, ueid, bearer_id,ptr2->second.teid_outgoing,length, ptr2->second.seqNum,ptr2->second.npduNum );
if(seqNumFlag) if(seqNumFlag)
ptr2->second.seqNum++; ptr2->second.seqNum++;
...@@ -405,15 +372,15 @@ static void fillDlDeliveryStatusReport(extensionHeader_t *extensionHeader, uint3 ...@@ -405,15 +372,15 @@ static void fillDlDeliveryStatusReport(extensionHeader_t *extensionHeader, uint3
static void gtpv1uSendDlDeliveryStatus(instance_t instance, gtpv1u_DU_buffer_report_req_t *req){ static void gtpv1uSendDlDeliveryStatus(instance_t instance, gtpv1u_DU_buffer_report_req_t *req){
ue_id_t ue_id=req->ue_id; ue_id_t ue_id=req->ue_id;
int rab_id=req->pdusession_id; int bearer_id=req->pdusession_id;
pthread_mutex_lock(&globGtp.gtp_lock); pthread_mutex_lock(&globGtp.gtp_lock);
getInstRetVoid(compatInst(instance)); getInstRetVoid(compatInst(instance));
getRntiRetVoid(inst, ue_id); getRntiRetVoid(inst, ue_id);
map<int, gtpv1u_bearer_t>::iterator ptr2=ptrRnti->second.bearers.find(rab_id); auto ptr2=ptrUe->second.bearers.find(bearer_id);
if ( ptr2 == ptrRnti->second.bearers.end() ) { if ( ptr2 == ptrUe->second.bearers.end() ) {
LOG_D(GTPU,"GTP-U instance: %ld sending a packet to a non existant UE ID:RAB: %lu/%x\n", instance, ue_id, rab_id); LOG_D(GTPU,"GTP-U instance: %ld sending a packet to a non existant UE ID:RAB: %lu/%x\n", instance, ue_id, bearer_id);
pthread_mutex_unlock(&globGtp.gtp_lock); pthread_mutex_unlock(&globGtp.gtp_lock);
return; return;
} }
...@@ -423,7 +390,7 @@ static void gtpv1uSendDlDeliveryStatus(instance_t instance, gtpv1u_DU_buffer_rep ...@@ -423,7 +390,7 @@ static void gtpv1uSendDlDeliveryStatus(instance_t instance, gtpv1u_DU_buffer_rep
fillDlDeliveryStatusReport(extensionHeader, req->buffer_availability,0); fillDlDeliveryStatusReport(extensionHeader, req->buffer_availability,0);
LOG_I(GTPU,"[%ld] GTP-U sending DL Data Delivery status to UE ID:RAB:teid %lu/%x/%x, oldseq %d, oldnum %d\n", LOG_I(GTPU,"[%ld] GTP-U sending DL Data Delivery status to UE ID:RAB:teid %lu/%x/%x, oldseq %d, oldnum %d\n",
instance, ue_id, rab_id,ptr2->second.teid_outgoing, ptr2->second.seqNum,ptr2->second.npduNum ); instance, ue_id, bearer_id,ptr2->second.teid_outgoing, ptr2->second.seqNum,ptr2->second.npduNum );
// copy to release the mutex // copy to release the mutex
gtpv1u_bearer_t tmp=ptr2->second; gtpv1u_bearer_t tmp=ptr2->second;
pthread_mutex_unlock(&globGtp.gtp_lock); pthread_mutex_unlock(&globGtp.gtp_lock);
...@@ -431,23 +398,23 @@ static void gtpv1uSendDlDeliveryStatus(instance_t instance, gtpv1u_DU_buffer_rep ...@@ -431,23 +398,23 @@ static void gtpv1uSendDlDeliveryStatus(instance_t instance, gtpv1u_DU_buffer_rep
compatInst(instance), tmp.outgoing_ip_addr, tmp.outgoing_port, GTP_GPDU, tmp.teid_outgoing, NULL, 0, false, false, 0, 0, NR_RAN_CONTAINER, extensionHeader->buffer, extensionHeader->length); compatInst(instance), tmp.outgoing_ip_addr, tmp.outgoing_port, GTP_GPDU, tmp.teid_outgoing, NULL, 0, false, false, 0, 0, NR_RAN_CONTAINER, extensionHeader->buffer, extensionHeader->length);
} }
static void gtpv1uEndTunnel(instance_t instance, gtpv1u_enb_tunnel_data_req_t *req) { static void gtpv1uEndTunnel(instance_t instance, gtpv1u_tunnel_data_req_t *req) {
rnti_t rnti=req->rnti; ue_id_t ueid=req->ue_id;
int rab_id=req->rab_id; int bearer_id=req->bearer_id;
pthread_mutex_lock(&globGtp.gtp_lock); pthread_mutex_lock(&globGtp.gtp_lock);
getInstRetVoid(compatInst(instance)); getInstRetVoid(compatInst(instance));
getRntiRetVoid(inst, rnti); getRntiRetVoid(inst, ue_id);
map<int, gtpv1u_bearer_t>::iterator ptr2=ptrRnti->second.bearers.find(rab_id); auto ptr2=ptrUe->second.bearers.find(bearer_id);
if ( ptr2 == ptrRnti->second.bearers.end() ) { if ( ptr2 == ptrUe->second.bearers.end() ) {
LOG_E(GTPU,"[%ld] GTP-U sending a packet to a non existant RNTI:RAB: %x/%x\n", instance, rnti, rab_id); LOG_E(GTPU,"[%ld] GTP-U sending a packet to a non existant UE:RAB: %lx/%x\n", instance, ueid, bearer_id);
pthread_mutex_unlock(&globGtp.gtp_lock); pthread_mutex_unlock(&globGtp.gtp_lock);
return; return;
} }
LOG_D(GTPU,"[%ld] sending a end packet packet to RNTI:RAB:teid %x/%x/%x\n", LOG_D(GTPU,"[%ld] sending a end packet packet to UE:RAB:teid %lx/%x/%x\n",
instance, rnti, rab_id,ptr2->second.teid_outgoing); instance, ueid, bearer_id,ptr2->second.teid_outgoing);
gtpv1u_bearer_t tmp=ptr2->second; gtpv1u_bearer_t tmp=ptr2->second;
pthread_mutex_unlock(&globGtp.gtp_lock); pthread_mutex_unlock(&globGtp.gtp_lock);
Gtpv1uMsgHeaderT msgHdr; Gtpv1uMsgHeaderT msgHdr;
...@@ -584,9 +551,9 @@ void GtpuUpdateTunnelOutgoingTeid(instance_t instance, ue_id_t ue_id, ebi_t bear ...@@ -584,9 +551,9 @@ void GtpuUpdateTunnelOutgoingTeid(instance_t instance, ue_id_t ue_id, ebi_t bear
getInstRetVoid(compatInst(instance)); getInstRetVoid(compatInst(instance));
getRntiRetVoid(inst, ue_id); getRntiRetVoid(inst, ue_id);
map<int, gtpv1u_bearer_t>::iterator ptr2=ptrRnti->second.bearers.find(bearer_id); auto ptr2=ptrUe->second.bearers.find(bearer_id);
if ( ptr2 == ptrRnti->second.bearers.end() ) { if ( ptr2 == ptrUe->second.bearers.end() ) {
LOG_E(GTPU,"[%ld] Update tunnel for a existing ue id %lu, but wrong bearer_id %u\n", instance, ue_id, bearer_id); LOG_E(GTPU,"[%ld] Update tunnel for a existing ue id %lu, but wrong bearer_id %u\n", instance, ue_id, bearer_id);
pthread_mutex_unlock(&globGtp.gtp_lock); pthread_mutex_unlock(&globGtp.gtp_lock);
return; return;
...@@ -680,9 +647,9 @@ teid_t newGtpuCreateTunnel(instance_t instance, ...@@ -680,9 +647,9 @@ teid_t newGtpuCreateTunnel(instance_t instance,
int gtpv1u_create_s1u_tunnel(instance_t instance, int gtpv1u_create_s1u_tunnel(instance_t instance,
const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req, const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) { gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) {
LOG_D(GTPU, "[%ld] Start create tunnels for UE ID %lu, num_tunnels %d, sgw_S1u_teid %x\n", LOG_D(GTPU, "[%ld] Start create tunnels for UE ID %u, num_tunnels %d, sgw_S1u_teid %x\n",
instance, instance,
create_tunnel_req->ue_id, create_tunnel_req->rnti,
create_tunnel_req->num_tunnels, create_tunnel_req->num_tunnels,
create_tunnel_req->sgw_S1u_teid[0]); create_tunnel_req->sgw_S1u_teid[0]);
pthread_mutex_lock(&globGtp.gtp_lock); pthread_mutex_lock(&globGtp.gtp_lock);
...@@ -699,7 +666,7 @@ int gtpv1u_create_s1u_tunnel(instance_t instance, ...@@ -699,7 +666,7 @@ int gtpv1u_create_s1u_tunnel(instance_t instance,
create_tunnel_req->eps_bearer_id[i]); create_tunnel_req->eps_bearer_id[i]);
int incoming_rb_id=create_tunnel_req->eps_bearer_id[i]-4; int incoming_rb_id=create_tunnel_req->eps_bearer_id[i]-4;
teid_t teid = newGtpuCreateTunnel(compatInst(instance), teid_t teid = newGtpuCreateTunnel(compatInst(instance),
create_tunnel_req->ue_id, create_tunnel_req->rnti,
incoming_rb_id, incoming_rb_id,
create_tunnel_req->eps_bearer_id[i], create_tunnel_req->eps_bearer_id[i],
create_tunnel_req->sgw_S1u_teid[i], create_tunnel_req->sgw_S1u_teid[i],
...@@ -709,7 +676,7 @@ int gtpv1u_create_s1u_tunnel(instance_t instance, ...@@ -709,7 +676,7 @@ int gtpv1u_create_s1u_tunnel(instance_t instance,
pdcp_data_req, pdcp_data_req,
NULL); NULL);
create_tunnel_resp->status=0; create_tunnel_resp->status=0;
create_tunnel_resp->ue_id=create_tunnel_req->ue_id; create_tunnel_resp->rnti=create_tunnel_req->rnti;
create_tunnel_resp->num_tunnels=create_tunnel_req->num_tunnels; create_tunnel_resp->num_tunnels=create_tunnel_req->num_tunnels;
create_tunnel_resp->enb_S1u_teid[i]=teid; create_tunnel_resp->enb_S1u_teid[i]=teid;
create_tunnel_resp->eps_bearer_id[i] = create_tunnel_req->eps_bearer_id[i]; create_tunnel_resp->eps_bearer_id[i] = create_tunnel_req->eps_bearer_id[i];
...@@ -723,7 +690,7 @@ int gtpv1u_create_s1u_tunnel(instance_t instance, ...@@ -723,7 +690,7 @@ int gtpv1u_create_s1u_tunnel(instance_t instance,
int gtpv1u_update_s1u_tunnel( int gtpv1u_update_s1u_tunnel(
const instance_t instance, const instance_t instance,
const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req, const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req,
const rnti prior_rnti const rnti_t prior_rnti
) { ) {
LOG_D(GTPU, "[%ld] Start update tunnels for old RNTI %x, new RNTI %x, num_tunnels %d, sgw_S1u_teid %x, eps_bearer_id %x\n", LOG_D(GTPU, "[%ld] Start update tunnels for old RNTI %x, new RNTI %x, num_tunnels %d, sgw_S1u_teid %x, eps_bearer_id %x\n",
instance, instance,
...@@ -743,7 +710,7 @@ int gtpv1u_update_s1u_tunnel( ...@@ -743,7 +710,7 @@ int gtpv1u_update_s1u_tunnel(
auto it=inst->ue2te_mapping.find(prior_rnti); auto it=inst->ue2te_mapping.find(prior_rnti);
if ( it != inst->ue2te_mapping.end() ) { if ( it != inst->ue2te_mapping.end() ) {
LOG_W(GTPU,"[%ld] Update a not existing tunnel, start create the new one (new ue id %lu, old ue id %lu)\n", instance, create_tunnel_req->rnti, prior_rnti); LOG_W(GTPU,"[%ld] Update a not existing tunnel, start create the new one (new ue id %u, old ue id %u)\n", instance, create_tunnel_req->rnti, prior_rnti);
pthread_mutex_unlock(&globGtp.gtp_lock); pthread_mutex_unlock(&globGtp.gtp_lock);
gtpv1u_enb_create_tunnel_resp_t tmp; gtpv1u_enb_create_tunnel_resp_t tmp;
(void)gtpv1u_create_s1u_tunnel(instance, create_tunnel_req, &tmp); (void)gtpv1u_create_s1u_tunnel(instance, create_tunnel_req, &tmp);
...@@ -796,7 +763,7 @@ int gtpv1u_create_ngu_tunnel( const instance_t instance, ...@@ -796,7 +763,7 @@ int gtpv1u_create_ngu_tunnel( const instance_t instance,
int gtpv1u_update_ngu_tunnel( int gtpv1u_update_ngu_tunnel(
const instance_t instanceP, const instance_t instanceP,
const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req_pP, const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req_pP,
const ue_id_t prior_ue_id; const ue_id_t prior_ueid
) { ) {
AssertFatal( false, "to be developped\n"); AssertFatal( false, "to be developped\n");
return GTPNOK; return GTPNOK;
...@@ -827,7 +794,7 @@ int newGtpuDeleteAllTunnels(instance_t instance, ue_id_t ue_id) { ...@@ -827,7 +794,7 @@ int newGtpuDeleteAllTunnels(instance_t instance, ue_id_t ue_id) {
inst->ue2te_mapping.erase(ptrRnti); inst->ue2te_mapping.erase(ptrRnti);
pthread_mutex_unlock(&globGtp.gtp_lock); pthread_mutex_unlock(&globGtp.gtp_lock);
LOG_I(GTPU, "[%ld] Deleted all tunnels for ue id %x (%d tunnels deleted)\n", instance, ue_id, nb); LOG_I(GTPU, "[%ld] Deleted all tunnels for ue id %ld (%d tunnels deleted)\n", instance, ue_id, nb);
return !GTPNOK; return !GTPNOK;
} }
...@@ -954,7 +921,7 @@ static int Gtpv1uHandleEndMarker(int h, ...@@ -954,7 +921,7 @@ static int Gtpv1uHandleEndMarker(int h,
ctxt.module_id = 0; ctxt.module_id = 0;
ctxt.enb_flag = 1; ctxt.enb_flag = 1;
ctxt.instance = inst->addr.originInstance; ctxt.instance = inst->addr.originInstance;
ctxt.rnti = tunnel->second.rnti; ctxt.rnti = tunnel->second.ue_id;
ctxt.frame = 0; ctxt.frame = 0;
ctxt.subframe = 0; ctxt.subframe = 0;
ctxt.eNB_index = 0; ctxt.eNB_index = 0;
...@@ -1087,7 +1054,7 @@ static int Gtpv1uHandleGpdu(int h, ...@@ -1087,7 +1054,7 @@ static int Gtpv1uHandleGpdu(int h,
ctxt.module_id = 0; ctxt.module_id = 0;
ctxt.enb_flag = 1; ctxt.enb_flag = 1;
ctxt.instance = inst->addr.originInstance; ctxt.instance = inst->addr.originInstance;
ctxt.rnti = tunnel->second.rnti; ctxt.rnti = tunnel->second.ue_id;
ctxt.frame = 0; ctxt.frame = 0;
ctxt.subframe = 0; ctxt.subframe = 0;
ctxt.eNB_index = 0; ctxt.eNB_index = 0;
...@@ -1105,11 +1072,33 @@ static int Gtpv1uHandleGpdu(int h, ...@@ -1105,11 +1072,33 @@ static int Gtpv1uHandleGpdu(int h,
if (sdu_buffer_size > 0) { if (sdu_buffer_size > 0) {
if (qfi != -1 && tunnel->second.callBackSDAP) { if (qfi != -1 && tunnel->second.callBackSDAP) {
if (!tunnel->second.callBackSDAP(&ctxt, srb_flag, rb_id, mui, confirm, sdu_buffer_size, sdu_buffer, mode, &sourceL2Id, &destinationL2Id, qfi, rqi, tunnel->second.pdusession_id)) if ( !tunnel->second.callBackSDAP(&ctxt,
LOG_E(GTPU, "[%d] down layer refused incoming packet\n", h); tunnel->second.ue_id,
srb_flag,
rb_id,
mui,
confirm,
sdu_buffer_size,
sdu_buffer,
mode,
&sourceL2Id,
&destinationL2Id,
qfi,
rqi,
tunnel->second.pdusession_id) )
LOG_E(GTPU,"[%d] down layer refused incoming packet\n", h);
} else { } else {
if (!tunnel->second.callBack(&ctxt, srb_flag, rb_id, mui, confirm, sdu_buffer_size, sdu_buffer, mode, &sourceL2Id, &destinationL2Id)) if ( !tunnel->second.callBack(&ctxt,
LOG_E(GTPU, "[%d] down layer refused incoming packet\n", h); srb_flag,
rb_id,
mui,
confirm,
sdu_buffer_size,
sdu_buffer,
mode,
&sourceL2Id,
&destinationL2Id) )
LOG_E(GTPU,"[%d] down layer refused incoming packet\n", h);
} }
} }
...@@ -1231,16 +1220,10 @@ void *gtpv1uTask(void *args) { ...@@ -1231,16 +1220,10 @@ void *gtpv1uTask(void *args) {
switch (ITTI_MSG_ID(message_p)) { switch (ITTI_MSG_ID(message_p)) {
// DATA TO BE SENT TO UDP // DATA TO BE SENT TO UDP
case GTPV1U_ENB_TUNNEL_DATA_REQ: {
gtpv1uSend(compatInst(ITTI_MSG_DESTINATION_INSTANCE(message_p)),
&GTPV1U_ENB_TUNNEL_DATA_REQ(message_p), false, false);
itti_free(TASK_GTPV1_U, GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer);
}
break;
case GTPV1U_GNB_TUNNEL_DATA_REQ: { case GTPV1U_TUNNEL_DATA_REQ: {
gtpv1uSend2(compatInst(ITTI_MSG_DESTINATION_INSTANCE(message_p)), gtpv1uSend(compatInst(ITTI_MSG_DESTINATION_INSTANCE(message_p)),
&GTPV1U_GNB_TUNNEL_DATA_REQ(message_p), false, false); &GTPV1U_TUNNEL_DATA_REQ(message_p), false, false);
} }
break; break;
...@@ -1259,8 +1242,8 @@ void *gtpv1uTask(void *args) { ...@@ -1259,8 +1242,8 @@ void *gtpv1uTask(void *args) {
case GTPV1U_ENB_END_MARKER_REQ: case GTPV1U_ENB_END_MARKER_REQ:
gtpv1uEndTunnel(compatInst(ITTI_MSG_DESTINATION_INSTANCE(message_p)), gtpv1uEndTunnel(compatInst(ITTI_MSG_DESTINATION_INSTANCE(message_p)),
&GTPV1U_ENB_TUNNEL_DATA_REQ(message_p)); &GTPV1U_TUNNEL_DATA_REQ(message_p));
itti_free(TASK_GTPV1_U, GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer); itti_free(TASK_GTPV1_U, GTPV1U_TUNNEL_DATA_REQ(message_p).buffer);
break; break;
case GTPV1U_ENB_DATA_FORWARDING_REQ: case GTPV1U_ENB_DATA_FORWARDING_REQ:
......
...@@ -58,17 +58,32 @@ int gtpv1u_update_s1u_tunnel(const instance_t instanceP, ...@@ -58,17 +58,32 @@ int gtpv1u_update_s1u_tunnel(const instance_t instanceP,
const rnti_t prior_rnti const rnti_t prior_rnti
); );
int gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP); int gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP);
int gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP); int gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP);
int gtpv1u_create_x2u_tunnel( int gtpv1u_create_x2u_tunnel(const instance_t instanceP,
const instance_t instanceP, const gtpv1u_enb_create_x2u_tunnel_req_t *const create_tunnel_req_pP,
const gtpv1u_enb_create_x2u_tunnel_req_t *const create_tunnel_req_pP, gtpv1u_enb_create_x2u_tunnel_resp_t *const create_tunnel_resp_pP);
gtpv1u_enb_create_x2u_tunnel_resp_t *const create_tunnel_resp_pP);
int gtpv1u_delete_x2u_tunnel( const instance_t instanceP,
const gtpv1u_enb_delete_tunnel_req_t *const req_pP);
int
gtpv1u_create_ngu_tunnel(
const instance_t instanceP,
const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req_pP,
gtpv1u_gnb_create_tunnel_resp_t *const create_tunnel_resp_pP);
int gtpv1u_delete_ngu_tunnel( const instance_t instance,
gtpv1u_gnb_delete_tunnel_req_t *req);
int gtpv1u_update_ngu_tunnel( const instance_t instanceP,
const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req_pP,
const ue_id_t prior_rnti
);
// New API // New API
teid_t newGtpuCreateTunnel(instance_t instance, teid_t newGtpuCreateTunnel(instance_t instance,
rnti_t rnti, ue_id_t ue_id,
int incoming_bearer_id, int incoming_bearer_id,
int outgoing_rb_id, int outgoing_rb_id,
teid_t teid, teid_t teid,
...@@ -78,11 +93,58 @@ teid_t newGtpuCreateTunnel(instance_t instance, ...@@ -78,11 +93,58 @@ teid_t newGtpuCreateTunnel(instance_t instance,
gtpCallback callBack, gtpCallback callBack,
gtpCallbackSDAP callBackSDAP); gtpCallbackSDAP callBackSDAP);
void GtpuUpdateTunnelOutgoingTeid(instance_t instance, rnti_t rnti, ebi_t bearer_id, teid_t newOutgoingTeid); void GtpuUpdateTunnelOutgoingTeid(instance_t instance, rnti_t rnti, ebi_t bearer_id, teid_t newOutgoingTeid);
int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti); int newGtpuDeleteAllTunnels(instance_t instance, ue_id_t ue_id);
int newGtpuDeleteTunnels(instance_t instance, rnti_t rnti, int nbTunnels, pdusessionid_t *pdusession_id); int newGtpuDeleteTunnels(instance_t instance, ue_id_t ue_id, int nbTunnels, pdusessionid_t *pdusession_id);
instance_t gtpv1Init(openAddr_t context); instance_t gtpv1Init(openAddr_t context);
void *gtpv1uTask(void *args); void *gtpv1uTask(void *args);
// Legacy to fix
typedef struct gtpv1u_data_s {
/* RB tree of UEs */
hash_table_t *ue_mapping;
} gtpv1u_data_t;
#define GTPV1U_BEARER_OFFSET 3
#define GTPV1U_MAX_BEARERS_ID (max_val_LTE_DRB_Identity - GTPV1U_BEARER_OFFSET)
typedef enum {
BEARER_DOWN = 0,
BEARER_IN_CONFIG,
BEARER_UP,
BEARER_DL_HANDOVER,
BEARER_UL_HANDOVER,
BEARER_MAX,
} bearer_state_t;
typedef struct fixMe_gtpv1u_bearer_s {
/* TEID used in dl and ul */
teid_t teid_eNB; ///< eNB TEID
uintptr_t teid_eNB_stack_session; ///< eNB TEID
teid_t teid_sgw; ///< Remote TEID
in_addr_t sgw_ip_addr;
struct in6_addr sgw_ip6_addr;
teid_t teid_teNB;
in_addr_t tenb_ip_addr; ///< target eNB ipv4
struct in6_addr tenb_ip6_addr; ///< target eNB ipv6
tcp_udp_port_t port;
//NwGtpv1uStackSessionHandleT stack_session;
bearer_state_t state;
} fixMe_gtpv1u_bearer_t;
typedef struct gtpv1u_ue_data_s {
/* UE identifier for oaisim stack */
rnti_t ue_id;
/* Unique identifier used between PDCP and GTP-U to distinguish UEs */
uint32_t instance_id;
int num_bearers;
/* Bearer related data.
* Note that the first LCID available for data is 3 and we fixed the maximum
* number of e-rab per UE to be (32 [id range]), max RB is 11. The real rb id will 3 + rab_id (3..32).
*/
fixMe_gtpv1u_bearer_t bearers[GTPV1U_MAX_BEARERS_ID];
//RB_ENTRY(gtpv1u_ue_data_s) gtpv1u_ue_node;
} gtpv1u_ue_data_t;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file gtpv1u_eNB_task.h
* \brief
* \author Lionel Gauthier
* \company Eurecom
* \email: lionel.gauthier@eurecom.fr
*/
#ifndef GTPV1U_ENB_TASK_H_
#define GTPV1U_ENB_TASK_H_
typedef struct gtpv1u_data_s {
/* RB tree of UEs */
hash_table_t *ue_mapping;
} gtpv1u_data_t;
#define GTPV1U_BEARER_OFFSET 3
#define GTPV1U_MAX_BEARERS_ID (max_val_LTE_DRB_Identity - GTPV1U_BEARER_OFFSET)
typedef enum {
BEARER_DOWN = 0,
BEARER_IN_CONFIG,
BEARER_UP,
BEARER_DL_HANDOVER,
BEARER_UL_HANDOVER,
BEARER_MAX,
} bearer_state_t;
typedef struct fixMe_gtpv1u_bearer_s {
/* TEID used in dl and ul */
teid_t teid_eNB; ///< eNB TEID
uintptr_t teid_eNB_stack_session; ///< eNB TEID
teid_t teid_sgw; ///< Remote TEID
in_addr_t sgw_ip_addr;
struct in6_addr sgw_ip6_addr;
teid_t teid_teNB;
in_addr_t tenb_ip_addr; ///< target eNB ipv4
struct in6_addr tenb_ip6_addr; ///< target eNB ipv6
tcp_udp_port_t port;
//NwGtpv1uStackSessionHandleT stack_session;
bearer_state_t state;
} fixMe_gtpv1u_bearer_t;
typedef struct gtpv1u_ue_data_s {
/* UE identifier for oaisim stack */
rnti_t ue_id;
/* Unique identifier used between PDCP and GTP-U to distinguish UEs */
uint32_t instance_id;
int num_bearers;
/* Bearer related data.
* Note that the first LCID available for data is 3 and we fixed the maximum
* number of e-rab per UE to be (32 [id range]), max RB is 11. The real rb id will 3 + rab_id (3..32).
*/
fixMe_gtpv1u_bearer_t bearers[GTPV1U_MAX_BEARERS_ID];
//RB_ENTRY(gtpv1u_ue_data_s) gtpv1u_ue_node;
} gtpv1u_ue_data_t;
/*
int
gtpv1u_new_data_req(
uint8_t enb_id,
uint8_t ue_id,
uint8_t rab_id,
uint8_t *buffer,
uint32_t buf_len,
uint32_t buf_offset);*/
int gtpv1u_eNB_init(void);
void *gtpv1u_eNB_process_itti_msg(void *);
void *gtpv1u_eNB_task(void *args);
int
gtpv1u_create_x2u_tunnel(
const instance_t instanceP,
const gtpv1u_enb_create_x2u_tunnel_req_t *const create_tunnel_req_pP,
gtpv1u_enb_create_x2u_tunnel_resp_t *const create_tunnel_resp_pP);
int
gtpv1u_create_s1u_tunnel(
const instance_t instanceP,
const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req_pP,
gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP);
int
gtpv1u_update_s1u_tunnel(
const instance_t instanceP,
const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req_pP,
const rnti_t prior_rnti);
int gtpv1u_delete_x2u_tunnel(
const instance_t instanceP,
const gtpv1u_enb_delete_tunnel_req_t *const req_pP);
#endif /* GTPV1U_ENB_TASK_H_ */
/* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file gtpv1u_gNB_task.h
* \brief
* \author Lionel Gauthier Panos Matzakos
* \company Eurecom
* \email: lionel.gauthier@eurecom.fr
*/
#ifndef GTPV1U_GNB_TASK_H_
#define GTPV1U_GNB_TASK_H_
int gtpv1u_gNB_init(void);
void *gtpv1u_gNB_task(void *args);
void *nr_gtpv1u_gNB_task(void *args);
int
gtpv1u_create_ngu_tunnel(
const instance_t instanceP,
const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req_pP,
gtpv1u_gnb_create_tunnel_resp_t *const create_tunnel_resp_pP);
int
gtpv1u_update_ngu_tunnel(
const instance_t instanceP,
const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req_pP,
const rnti_t prior_rnti
);
int gtpv1u_delete_ngu_tunnel( const instance_t instance,
gtpv1u_gnb_delete_tunnel_req_t *req);
#endif /* GTPV1U_GNB_TASK_H_ */
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "sctp_eNB_task.h" #include "sctp_eNB_task.h"
#include "x2ap_eNB.h" #include "x2ap_eNB.h"
#include "s1ap_eNB.h" #include "s1ap_eNB.h"
#include "gtpv1u_eNB_task.h" #include "openair3/ocp-gtpu/gtp_itf.h"
#if ENABLE_RAL #if ENABLE_RAL
#include "lteRALue.h" #include "lteRALue.h"
#include "lteRALenb.h" #include "lteRALenb.h"
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "sctp_eNB_task.h" #include "sctp_eNB_task.h"
#include "x2ap_eNB.h" #include "x2ap_eNB.h"
#include "s1ap_eNB.h" #include "s1ap_eNB.h"
#include "gtpv1u_eNB_task.h" #include "openair3/ocp-gtpu/gtp_itf.h"
#include "m2ap_eNB.h" #include "m2ap_eNB.h"
#include "m2ap_MCE.h" #include "m2ap_MCE.h"
#include "m3ap_MME.h" #include "m3ap_MME.h"
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "sctp_eNB_task.h" #include "sctp_eNB_task.h"
#include "s1ap_eNB.h" #include "s1ap_eNB.h"
#include "openair3/NAS/UE/nas_ue_task.h" #include "openair3/NAS/UE/nas_ue_task.h"
#include "gtpv1u_eNB_task.h"
#if ENABLE_RAL #if ENABLE_RAL
#include "lteRALue.h" #include "lteRALue.h"
#include "lteRALenb.h" #include "lteRALenb.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment