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 @@
#include "RRC/LTE/defs_NB_IoT.h"
#include "RRC/LTE/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 {
......
......@@ -257,8 +257,6 @@ typedef struct IttiMsgText_s {
#include <openair3/MME_APP/mme_app.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 *);
#include <openair3/SCTP/sctp_eNB_task.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(
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)
- 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
......
......@@ -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_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_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_ind_t, Gtpv1uEndMarkerInd)
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)
......@@ -29,7 +29,7 @@
#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_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_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDataForwardingInd
#define GTPV1U_ENB_END_MARKER_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uEndMarkerReq
......@@ -37,8 +37,6 @@
#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_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
......@@ -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
} 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;
uint32_t length;
uint32_t offset; ///< start of message offset in buffer
rnti_t rnti;
rb_id_t rab_id;
} gtpv1u_enb_tunnel_data_req_t;
ue_id_t ue_id;
rb_id_t bearer_id;
} gtpv1u_tunnel_data_req_t;
typedef struct gtpv1u_enb_data_forwarding_req_s {
uint8_t *buffer;
......@@ -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)
teid_t gnb_NGu_teid; ///< local NGU Tunnel Endpoint Identifier to be deleted
} 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 {
uint32_t buffer_availability;
......
......@@ -41,7 +41,7 @@
# include "intertask_interface.h"
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# include "gtpv1u_eNB_task.h"
# include "openair3/ocp-gtpu/gtp_itf.h"
# include "flexran_agent.h"
# include "x2ap_eNB.h"
......
......@@ -45,7 +45,7 @@
#include "intertask_interface.h"
#include "ngap_gNB.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 "f1ap_cu_task.h"
#include "f1ap_du_task.h"
......
......@@ -58,7 +58,7 @@
#include "openair3/S1AP/s1ap_eNB.h"
#include <pthread.h>
# include "gtpv1u_eNB_task.h"
# include "openair3/ocp-gtpu/gtp_itf.h"
#include <openair3/ocp-gtpu/gtp_itf.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,
const rb_id_t rb_id, const mui_t mui,
confirm_t confirm, sdu_size_t size, mem_block_t *sdu,
const uint32_t *const sourceID, const uint32_t *const destID) {
uint8_t *gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U,
size + GTPU_HEADER_OVERHEAD_MAX);
AssertFatal(gtpu_buffer_p != NULL, "OUT OF MEMORY");
memcpy(gtpu_buffer_p+GTPU_HEADER_OVERHEAD_MAX,
MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0, GTPV1U_TUNNEL_DATA_REQ,
sizeof(gtpv1u_tunnel_data_req_t) +
size + 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,
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->offset = GTPU_HEADER_OVERHEAD_MAX;
req->rnti = ctxt->rnti;
req->rab_id = rb_id+4;
req->ue_id = ctxt->rnti;
req->bearer_id = rb_id+4;
LOG_D(PDCP, "%s() (drb %ld) sending message to gtp size %d\n",
__func__, rb_id, size);
extern instance_t CUuniqInstance;
......@@ -643,7 +642,6 @@ pdcp_data_ind(
uint16_t pdcp_uid=0;
MessageDef *message_p = NULL;
uint8_t *gtpu_buffer_p = NULL;
uint32_t rx_hfn_for_count;
int pdcp_sn_for_count;
int security_ok;
......@@ -1050,22 +1048,23 @@ pdcp_data_ind(
if (LINK_ENB_PDCP_TO_GTPV1U) {
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,
rb_id + 4,
sdu_buffer_sizeP - payload_offset );
//LOG_T(PDCP,"Sending to GTPV1U %d bytes\n", sdu_buffer_sizeP - payload_offset);
gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U,
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);
message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0, GTPV1U_TUNNEL_DATA_REQ,
sizeof(gtpv1u_tunnel_data_req_t) +
sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX );
AssertFatal(message_p != NULL, "OUT OF MEMORY");
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer = gtpu_buffer_p;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).length = sdu_buffer_sizeP - payload_offset;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rnti = ctxt_pP->rnti;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rab_id = rb_id + 4;
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_buffer_pP->data[payload_offset],
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);
packet_forwarded = true;
}
......
......@@ -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);
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:
ctxt.rnti = ue->ue_id;
if (RC.nrrrc != NULL && NODE_IS_CU(RC.nrrrc[0]->node_type)) {
MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0,
GTPV1U_GNB_TUNNEL_DATA_REQ,
sizeof(gtpv1u_gnb_tunnel_data_req_t)
GTPV1U_TUNNEL_DATA_REQ,
sizeof(gtpv1u_tunnel_data_req_t)
+ size
+ GTPU_HEADER_OVERHEAD_MAX);
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);
memcpy(gtpu_buffer_p+GTPU_HEADER_OVERHEAD_MAX,
buf, size);
req->buffer = gtpu_buffer_p;
req->length = size;
req->offset = GTPU_HEADER_OVERHEAD_MAX;
req->rnti = ue->ue_id;
req->pdusession_id = rb_id;
req->ue_id = ue->ue_id;
req->bearer_id = rb_id;
LOG_I(PDCP, "%s() (drb %d) sending message to gtp size %d\n",
__func__, rb_id, size);
extern instance_t CUuniqInstance;
......
......@@ -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);
return;
} else {
MessageDef *msg = itti_alloc_new_message_sized(TASK_RLC_ENB, 0, GTPV1U_GNB_TUNNEL_DATA_REQ,
sizeof(gtpv1u_gnb_tunnel_data_req_t) + size);
gtpv1u_gnb_tunnel_data_req_t *req=&GTPV1U_GNB_TUNNEL_DATA_REQ(msg);
MessageDef *msg = itti_alloc_new_message_sized(TASK_RLC_ENB, 0, GTPV1U_TUNNEL_DATA_REQ,
sizeof(gtpv1u_tunnel_data_req_t) + size);
gtpv1u_tunnel_data_req_t *req=&GTPV1U_TUNNEL_DATA_REQ(msg);
req->buffer=(uint8_t*)(req+1);
memcpy(req->buffer,buf,size);
req->length=size;
req->offset=0;
req->rnti=ue->rnti;
req->pdusession_id=rb_id;
req->ue_id=ue->ue_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);
extern instance_t DUuniqInstance;
itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg);
......
......@@ -21,13 +21,14 @@
#ifndef _NR_RLC_UE_MANAGER_H_
#define _NR_RLC_UE_MANAGER_H_
#include "openair2/COMMON/platform_types.h"
#include "nr_rlc_entity.h"
typedef void nr_rlc_ue_manager_t;
typedef struct nr_rlc_ue_t {
int rnti;
ue_id_t ue_id;
nr_rlc_entity_t *srb[3];
nr_rlc_entity_t *drb[5];
} nr_rlc_ue_t;
......
......@@ -431,14 +431,14 @@ rb_found:
} else {
// Fixme: very dirty workaround of incomplete F1-U implementation
instance_t DUuniqInstance=0;
MessageDef *msg = itti_alloc_new_message(TASK_RLC_ENB, 0, GTPV1U_ENB_TUNNEL_DATA_REQ);
gtpv1u_enb_tunnel_data_req_t *req=&GTPV1U_ENB_TUNNEL_DATA_REQ(msg);
req->buffer=malloc(size);
MessageDef *msg = itti_alloc_new_message_sized(TASK_RLC_ENB, 0, GTPV1U_TUNNEL_DATA_REQ, sizeof(gtpv1u_tunnel_data_req_t) + size);
gtpv1u_tunnel_data_req_t *req=&GTPV1U_TUNNEL_DATA_REQ(msg);
req->buffer=(uint8_t*)(req+1);
memcpy(req->buffer,buf,size);
req->length=size;
req->offset=0;
req->rnti=ue->rnti;
req->rab_id=rb_id+4;
req->ue_id=ue->rnti;
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);
itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg);
return;
......
......@@ -41,7 +41,7 @@
# include "intertask_interface.h"
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# include "gtpv1u_eNB_task.h"
# include "openair3/ocp-gtpu/gtp_itf.h"
# include "flexran_agent.h"
# include "x2ap_eNB.h"
......
......@@ -85,7 +85,7 @@
#include "rrc_eNB_M2AP.h"
#include "pdcp.h"
#include "gtpv1u_eNB_task.h"
#include "openair3/ocp-gtpu/gtp_itf.h"
#include <openair3/ocp-gtpu/gtp_itf.h>
#include "intertask_interface.h"
......
......@@ -50,7 +50,7 @@
#include "LTE_UERadioAccessCapabilityInformation.h"
#include "gtpv1u_eNB_task.h"
#include "openair3/ocp-gtpu/gtp_itf.h"
#include <openair3/ocp-gtpu/gtp_itf.h>
#include "RRC/LTE/rrc_eNB_GTPV1U.h"
......
......@@ -406,7 +406,7 @@ typedef struct rrc_gNB_ue_context_s {
/* Uniquely identifies the UE between MME and eNB within the eNB.
* 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
uid_t local_uid;
......
......@@ -88,7 +88,7 @@
#include "nr_pdcp/nr_pdcp_entity.h"
#include "pdcp.h"
#include "gtpv1u_eNB_task.h"
#include "openair3/ocp-gtpu/gtp_itf.h"
#include "intertask_interface.h"
......@@ -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;
ret = gtpv1u_update_ngu_tunnel(
ctxt_pP->instance,
......@@ -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);
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,
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);
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
extern instance_t DUuniqInstance;
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) {
if (fd) {
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_context.Initialue_identity_5g_s_TMSI.fiveg_tmsi,
ue_context_p->ue_context.ul_failure_timer);
} 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_context.ul_failure_timer);
}
......@@ -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;
// 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));
memset(sdap_config, 0, sizeof(*sdap_config));
sdap_config->pdu_Session = pdu->sessionId;
......@@ -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->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++) {
NR_QFI_t *qfi = calloc(1, sizeof(NR_QFI_t));
*qfi = drb->qosFlows[j].fiveQI;
ASN_SEQUENCE_ADD(&sdap_config->mappedQoS_FlowsToAdd->list, qfi);
}
sdap_config->mappedQoS_FlowsToRelease = NULL;
/*
// pdcp_Config
ie->reestablishPDCP = NULL;
ie->recoverPDCP = NULL;
......@@ -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 = 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
NR_DRB_ToAddModList_t *DRB_configList;
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.incoming_rb_id[i] = pdu->DRBnGRanList[0].id; // taking only the first DRB. TODO:change this
memcpy(&create_tunnel_req.dst_addr[i].buffer,
pdu->tlAddress,
sizeof(uint8_t)*20);
create_tunnel_req.outgoing_teid = pdu->teID;
&pdu->tlAddress,
sizeof(pdu->tlAddress));
create_tunnel_req.outgoing_teid[i] = pdu->teId;
fill_DRB_configList(DRB_configList, pdu);
}
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,
&create_tunnel_req,
&create_tunnel_resp);
uint8_t *kRRCenc = NULL;
uint8_t *kRRCint = NULL;
/*
nr_derive_key_rrc_enc(cipheringAlgorithm,
encryptionKey,
&kRRCenc);
......@@ -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,
integrityProtectionKey,
&kRRCint);
*/
return 0;
}
......
......@@ -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",
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP),
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(
RC.nrrrc[ctxt_pP->module_id],
ctxt_pP->rnti);
......
......@@ -39,8 +39,7 @@
#include "pdcp.h"
#include "pdcp_primitives.h"
#include "gtpv1u_eNB_task.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/NR/rrc_gNB_GTPV1U.h"
......@@ -60,6 +59,7 @@
#include "f1ap_messages_types.h"
#include "E1AP_SDAP-Configuration.h"
#include "E1AP_PDCP-Configuration.h"
#include "openair2/E1AP/e1ap.h"
extern RAN_CONTEXT_t RC;
......@@ -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;
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;
ret = gtpv1u_create_ngu_tunnel(
......@@ -997,9 +997,9 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(
bearer_req->gNB_cu_cp_ue_id = gNB_ue_ngap_id;
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));
bearer_req->integrityProtectionAlgorithm = ue_context_pP->ue_context.integrity_algorithm;
memcpy(bearer_req->integrityProtectionKey, ue_context_pP->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_p->ue_context.integrity_algorithm;
memcpy(bearer_req->integrityProtectionKey, ue_context_p->ue_context.kgnb, sizeof(ue_context_p->ue_context.kgnb));
bearer_req->ueDlAggMaxBitRate = msg->ueAggMaxBitRateDownlink;
bearer_req->numPDUSessions = msg->nb_pdusessions_tosetup;
......@@ -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.gNB_ue_ngap_id = msg->gNB_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;
ret = gtpv1u_create_ngu_tunnel(
......@@ -1762,7 +1762,7 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(
//gtp tunnel delete
LOG_I(NR_RRC, "gtp tunnel delete \n");
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++) {
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,
MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB,
0,
GTPV1U_GNB_TUNNEL_DATA_REQ,
sizeof(gtpv1u_gnb_tunnel_data_req_t)
sizeof(gtpv1u_tunnel_data_req_t)
+ size + GTPU_HEADER_OVERHEAD_MAX - offset);
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);
memcpy(gtpu_buffer_p + GTPU_HEADER_OVERHEAD_MAX, buf + offset, size - offset);
req->buffer = gtpu_buffer_p;
req->length = size - offset;
req->offset = GTPU_HEADER_OVERHEAD_MAX;
req->rnti = ur_id;
req->rnti = ue_id;
req->pdusession_id = pdusession_id;
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);
......
......@@ -41,7 +41,7 @@
# include "intertask_interface.h"
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# include "gtpv1u_eNB_task.h"
# include "openair3/ocp-gtpu/gtp_itf.h"
# include "flexran_agent.h"
# include "x2ap_eNB.h"
......
This diff is collapsed.
......@@ -58,17 +58,32 @@ int gtpv1u_update_s1u_tunnel(const instance_t instanceP,
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_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_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_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
teid_t newGtpuCreateTunnel(instance_t instance,
rnti_t rnti,
ue_id_t ue_id,
int incoming_bearer_id,
int outgoing_rb_id,
teid_t teid,
......@@ -78,11 +93,58 @@ teid_t newGtpuCreateTunnel(instance_t instance,
gtpCallback callBack,
gtpCallbackSDAP callBackSDAP);
void GtpuUpdateTunnelOutgoingTeid(instance_t instance, rnti_t rnti, ebi_t bearer_id, teid_t newOutgoingTeid);
int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti);
int newGtpuDeleteTunnels(instance_t instance, rnti_t rnti, int nbTunnels, pdusessionid_t *pdusession_id);
int newGtpuDeleteAllTunnels(instance_t instance, ue_id_t ue_id);
int newGtpuDeleteTunnels(instance_t instance, ue_id_t ue_id, int nbTunnels, pdusessionid_t *pdusession_id);
instance_t gtpv1Init(openAddr_t context);
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
}
#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 @@
#include "sctp_eNB_task.h"
#include "x2ap_eNB.h"
#include "s1ap_eNB.h"
#include "gtpv1u_eNB_task.h"
#include "openair3/ocp-gtpu/gtp_itf.h"
#if ENABLE_RAL
#include "lteRALue.h"
#include "lteRALenb.h"
......
......@@ -28,7 +28,7 @@
#include "sctp_eNB_task.h"
#include "x2ap_eNB.h"
#include "s1ap_eNB.h"
#include "gtpv1u_eNB_task.h"
#include "openair3/ocp-gtpu/gtp_itf.h"
#include "m2ap_eNB.h"
#include "m2ap_MCE.h"
#include "m3ap_MME.h"
......
......@@ -27,7 +27,6 @@
#include "sctp_eNB_task.h"
#include "s1ap_eNB.h"
#include "openair3/NAS/UE/nas_ue_task.h"
#include "gtpv1u_eNB_task.h"
#if ENABLE_RAL
#include "lteRALue.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