Commit ec21db63 authored by Sakthivel Velumani's avatar Sakthivel Velumani Committed by laurent

GTP PDCP change rnti to ue id

parent a97dfedb
......@@ -43,7 +43,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 {
......
......@@ -256,8 +256,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
......
......@@ -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"
......
......@@ -102,7 +102,7 @@ nfapi_ue_release_request_body_t release_rntis;
instance_t DUuniqInstance=0;
instance_t CUuniqInstance=0;
teid_t newGtpuCreateTunnel(instance_t instance,
rnti_t rnti,
ue_id_t ue_id,
int incoming_bearer_id,
int outgoing_bearer_id,
teid_t outgoing_teid,
......@@ -114,7 +114,7 @@ teid_t newGtpuCreateTunnel(instance_t instance,
return 0;
}
int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti) {
int newGtpuDeleteAllTunnels(instance_t instance, ue_id_t ue_id) {
return 0;
}
......@@ -189,7 +189,7 @@ 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
const ue_id_t prior_ue_id
){
return 0;
}
......
......@@ -94,7 +94,7 @@ int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind) { return(0);
instance_t DUuniqInstance=0;
instance_t CUuniqInstance=0;
teid_t newGtpuCreateTunnel(instance_t instance,
rnti_t rnti,
ue_id_t ue_id,
int incoming_bearer_id,
int outgoing_bearer_id,
teid_t outgoing_teid,
......@@ -106,7 +106,7 @@ teid_t newGtpuCreateTunnel(instance_t instance,
return 0;
}
int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti) {
int newGtpuDeleteAllTunnels(instance_t instance, ue_id_t ue_id) {
return 0;
}
......@@ -150,7 +150,7 @@ 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
const ue_id_t prior_ue_id
){
return 0;
}
......
......@@ -98,7 +98,7 @@ nfapi_ue_release_request_body_t release_rntis;
instance_t DUuniqInstance=0;
instance_t CUuniqInstance=0;
teid_t newGtpuCreateTunnel(instance_t instance,
rnti_t rnti,
ue_id_t ue_id,
int incoming_bearer_id,
int outgoing_bearer_id,
teid_t outgoing_teid,
......@@ -110,7 +110,7 @@ teid_t newGtpuCreateTunnel(instance_t instance,
return 0;
}
int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti) {
int newGtpuDeleteAllTunnels(instance_t instance, ue_id_t ue_id) {
return 0;
}
......@@ -189,7 +189,7 @@ 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
const ue_id_t prior_ue_id
){
return 0;
}
......
......@@ -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;
......@@ -133,39 +124,39 @@ typedef struct gtpv1u_enb_data_forwarding_req_s {
} gtpv1u_enb_data_forwarding_req_t;
typedef struct gtpv1u_enb_data_forwarding_ind_s {
uint32_t frame;
uint8_t enb_flag;
rb_id_t rb_id;
uint32_t muip;
uint32_t confirmp;
uint32_t sdu_size;
uint8_t *sdu_p;
uint8_t mode;
uint16_t rnti;
uint8_t module_id;
uint8_t eNB_index;
uint32_t frame;
uint8_t enb_flag;
rb_id_t rb_id;
uint32_t muip;
uint32_t confirmp;
uint32_t sdu_size;
uint8_t *sdu_p;
uint8_t mode;
uint16_t rnti;
uint8_t module_id;
uint8_t eNB_index;
} gtpv1u_enb_data_forwarding_ind_t;
typedef struct gtpv1u_enb_end_marker_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;
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_end_marker_req_t;
typedef struct gtpv1u_enb_end_marker_ind_s {
uint32_t frame;
uint8_t enb_flag;
rb_id_t rb_id;
uint32_t muip;
uint32_t confirmp;
uint32_t sdu_size;
uint8_t *sdu_p;
uint8_t mode;
uint16_t rnti;
uint8_t module_id;
uint8_t eNB_index;
uint32_t frame;
uint8_t enb_flag;
rb_id_t rb_id;
uint32_t muip;
uint32_t confirmp;
uint32_t sdu_size;
uint8_t *sdu_p;
uint8_t mode;
uint16_t rnti;
uint8_t module_id;
uint8_t eNB_index;
} gtpv1u_enb_end_marker_ind_t;
typedef struct {
......@@ -177,7 +168,7 @@ typedef struct {
typedef struct gtpv1u_gnb_create_tunnel_req_s {
rnti_t rnti;
ue_id_t ue_id;
int num_tunnels;
//teid_t upf_NGu_teid[NR_GTPV1U_MAX_BEARERS_PER_UE]; ///< Tunnel Endpoint Identifier
teid_t outgoing_teid[NR_GTPV1U_MAX_BEARERS_PER_UE];
......@@ -191,34 +182,29 @@ typedef struct gtpv1u_gnb_create_tunnel_req_s {
typedef struct gtpv1u_gnb_create_tunnel_resp_s {
uint8_t status; ///< Status of S1U endpoint creation (Failed = 0xFF or Success = 0x0)
rnti_t rnti;
ue_id_t ue_id;
int num_tunnels;
teid_t gnb_NGu_teid[NR_GTPV1U_MAX_BEARERS_PER_UE]; ///< Tunnel Endpoint Identifier
pdusessionid_t pdusession_id[NR_GTPV1U_MAX_BEARERS_PER_UE];
int bearer_id[NR_GTPV1U_MAX_BEARERS_PER_UE];
transport_layer_addr_t gnb_addr;
} gtpv1u_gnb_create_tunnel_resp_t;
typedef struct gtpv1u_gnb_delete_tunnel_req_s {
rnti_t rnti;
ue_id_t ue_id;
uint8_t num_pdusession;
pdusessionid_t pdusession_id[NR_GTPV1U_MAX_BEARERS_PER_UE];
} gtpv1u_gnb_delete_tunnel_req_t;
typedef struct gtpv1u_gnb_delete_tunnel_resp_s {
rnti_t rnti;
ue_id_t ue_id;
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
rnti_t rnti;
pdusessionid_t pdusession_id;
} gtpv1u_gnb_tunnel_data_req_t;
typedef struct gtpv1u_DU_buffer_report_req_s {
uint32_t buffer_availability;
rnti_t rnti;
ue_id_t ue_id;
pdusessionid_t pdusession_id;
} gtpv1u_DU_buffer_report_req_t;
......
......@@ -49,7 +49,7 @@ typedef uint32_t slot_t;
typedef uint16_t module_id_t;
typedef uint8_t slice_id_t;
typedef uint8_t eNB_index_t;
typedef uint16_t ue_id_t;
typedef uint64_t ue_id_t;
typedef int16_t smodule_id_t;
typedef long rb_id_t;
typedef long srb_id_t;
......
......@@ -33,6 +33,7 @@ void apply_macrlc_config(gNB_RRC_INST *rrc,
}
bool sdap_data_req(protocol_ctxt_t *ctxt_p,
const ue_id_t ue_id,
const srb_flag_t srb_flag,
const rb_id_t rb_id,
const mui_t mui,
......
......@@ -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"
......@@ -209,20 +209,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;
......@@ -649,7 +648,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;
......@@ -1056,22 +1054,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
......
......@@ -406,8 +406,9 @@ static void *enb_tun_read_thread(void *_)
extern int nas_sock_fd[];
char rx_buf[NL_MAX_PAYLOAD];
int len;
int rnti;
protocol_ctxt_t ctxt;
ue_id_t ue_id;
int has_ue;
int rb_id = 1;
pthread_setname_np( pthread_self(),"enb_tun_read");
......@@ -422,10 +423,10 @@ static void *enb_tun_read_thread(void *_)
LOG_D(PDCP, "%s(): nas_sock_fd read returns len %d\n", __func__, len);
nr_pdcp_manager_lock(nr_pdcp_ue_manager);
rnti = nr_pdcp_get_first_rnti(nr_pdcp_ue_manager);
has_ue = nr_pdcp_get_first_ue_id(nr_pdcp_ue_manager, &ue_id);
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
if (rnti == -1) continue;
if (!has_ue) continue;
ctxt.module_id = 0;
ctxt.enb_flag = 1;
......@@ -434,14 +435,13 @@ static void *enb_tun_read_thread(void *_)
ctxt.subframe = 0;
ctxt.eNB_index = 0;
ctxt.brOption = 0;
ctxt.rnti = rnti;
ctxt.rnti = (rnti_t) ue_id;
uint8_t qfi = 7;
bool rqi = 0;
int pdusession_id = 10;
sdap_data_req(&ctxt, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED,
sdap_data_req(&ctxt, ue_id, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED,
RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf,
PDCP_TRANSMISSION_MODE_DATA, NULL, NULL, qfi, rqi, pdusession_id);
}
......@@ -454,8 +454,9 @@ static void *ue_tun_read_thread(void *_)
extern int nas_sock_fd[];
char rx_buf[NL_MAX_PAYLOAD];
int len;
int rnti;
protocol_ctxt_t ctxt;
ue_id_t ue_id;
int has_ue;
int rb_id = 1;
pthread_setname_np( pthread_self(),"ue_tun_read");
......@@ -469,10 +470,10 @@ static void *ue_tun_read_thread(void *_)
LOG_D(PDCP, "%s(): nas_sock_fd read returns len %d\n", __func__, len);
nr_pdcp_manager_lock(nr_pdcp_ue_manager);
rnti = nr_pdcp_get_first_rnti(nr_pdcp_ue_manager);
has_ue = nr_pdcp_get_first_ue_id(nr_pdcp_ue_manager, &ue_id);
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
if (rnti == -1) continue;
if (!has_ue) continue;
ctxt.module_id = 0;
ctxt.enb_flag = 0;
......@@ -481,14 +482,13 @@ static void *ue_tun_read_thread(void *_)
ctxt.subframe = 0;
ctxt.eNB_index = 0;
ctxt.brOption = 0;
ctxt.rnti = rnti;
ctxt.rnti = ue_id;
bool dc = SDAP_HDR_UL_DATA_PDU;
extern uint8_t nas_qfi;
extern uint8_t nas_pduid;
sdap_data_req(&ctxt, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED,
sdap_data_req(&ctxt, ue_id, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED,
RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf,
PDCP_TRANSMISSION_MODE_DATA, NULL, NULL, nas_qfi, dc, nas_pduid);
}
......@@ -621,13 +621,13 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
int i;
if (IS_SOFTMODEM_NOS1 || UE_NAS_USE_TUN) {
LOG_D(PDCP, "IP packet received with size %d, to be sent to SDAP interface, UE rnti: %d\n", size, ue->rnti);
LOG_D(PDCP, "IP packet received with size %d, to be sent to SDAP interface, UE rnti: %d\n", size, (int)ue->ue_id);
sdap_data_ind(entity->rb_id,
entity->is_gnb,
entity->has_sdap,
entity->has_sdapULheader,
entity->pdusession_id,
ue->rnti,
ue->ue_id,
buf,
size);
}
......@@ -640,7 +640,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
}
LOG_E(PDCP, "%s:%d:%s: fatal, no RB found for ue %d\n",
__FILE__, __LINE__, __FUNCTION__, ue->rnti);
__FILE__, __LINE__, __FUNCTION__, (int)ue->ue_id);
exit(1);
rb_found:
......@@ -651,7 +651,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
ue->drb[rb_id-1]->has_sdap,
ue->drb[rb_id-1]->has_sdapULheader,
ue->drb[rb_id-1]->pdusession_id,
ue->rnti,
ue->ue_id,
buf,
size);
}
......@@ -675,7 +675,7 @@ static void deliver_pdu_drb(void *_ue, nr_pdcp_entity_t *entity,
}
LOG_E(PDCP, "%s:%d:%s: fatal, no RB found for ue %d\n",
__FILE__, __LINE__, __FUNCTION__, ue->rnti);
__FILE__, __LINE__, __FUNCTION__, (int)ue->ue_id);
exit(1);
rb_found:
......@@ -687,23 +687,23 @@ rb_found:
ctxt.eNB_index = 0;
ctxt.brOption = 0;
ctxt.rnti = ue->rnti;
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->rnti;
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;
......@@ -734,7 +734,7 @@ static void deliver_sdu_srb(void *_ue, nr_pdcp_entity_t *entity,
}
LOG_E(PDCP, "%s:%d:%s: fatal, no SRB found for ue %d\n",
__FILE__, __LINE__, __FUNCTION__, ue->rnti);
__FILE__, __LINE__, __FUNCTION__, (int)ue->ue_id);
exit(1);
srb_found:
......@@ -742,7 +742,7 @@ srb_found:
MessageDef *message_p = itti_alloc_new_message(TASK_PDCP_GNB, 0, F1AP_UL_RRC_MESSAGE);
AssertFatal(message_p != NULL, "OUT OF MEMORY\n");
f1ap_ul_rrc_message_t *ul_rrc = &F1AP_UL_RRC_MESSAGE(message_p);
ul_rrc->rnti = ue->rnti;
ul_rrc->rnti = ue->ue_id;
ul_rrc->srb_id = srb_id;
ul_rrc->rrc_container = malloc(size);
AssertFatal(ul_rrc->rrc_container != NULL, "OUT OF MEMORY\n");
......@@ -758,7 +758,7 @@ srb_found:
NR_RRC_DCCH_DATA_IND(message_p).dcch_index = srb_id;
NR_RRC_DCCH_DATA_IND(message_p).sdu_p = rrc_buffer_p;
NR_RRC_DCCH_DATA_IND(message_p).sdu_size = size;
NR_RRC_DCCH_DATA_IND(message_p).rnti = ue->rnti;
NR_RRC_DCCH_DATA_IND(message_p).rnti = ue->ue_id;
itti_send_msg_to_task(TASK_RRC_NRUE, 0, message_p);
}
}
......@@ -780,7 +780,7 @@ static void deliver_pdu_srb(void *_ue, nr_pdcp_entity_t *entity,
}
LOG_E(PDCP, "%s:%d:%s: fatal, no SRB found for ue %d\n",
__FILE__, __LINE__, __FUNCTION__, ue->rnti);
__FILE__, __LINE__, __FUNCTION__, (int)ue->ue_id);
exit(1);
srb_found:
......@@ -798,7 +798,7 @@ srb_found:
ctxt.eNB_index = 0;
ctxt.brOption = 0;
ctxt.rnti = ue->rnti;
ctxt.rnti = ue->ue_id;
memblock = get_free_mem_block(size, __FUNCTION__);
memcpy(memblock->data, buf, size);
......@@ -813,7 +813,7 @@ srb_found:
F1AP_DL_RRC_MESSAGE (message_p).gNB_CU_ue_id = 0;
F1AP_DL_RRC_MESSAGE (message_p).gNB_DU_ue_id = 0;
F1AP_DL_RRC_MESSAGE (message_p).old_gNB_DU_ue_id = 0xFFFFFFFF; // unknown
F1AP_DL_RRC_MESSAGE (message_p).rnti = ue->rnti;
F1AP_DL_RRC_MESSAGE (message_p).rnti = ue->ue_id;
F1AP_DL_RRC_MESSAGE (message_p).srb_id = srb_id;
F1AP_DL_RRC_MESSAGE (message_p).execute_duplication = 1;
F1AP_DL_RRC_MESSAGE (message_p).RAT_frequency_priority_information.en_dc = 0;
......
......@@ -24,6 +24,7 @@
#include <pthread.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include "LOG/log.h"
......@@ -75,17 +76,17 @@ void nr_pdcp_manager_unlock(nr_pdcp_ue_manager_t *_m)
}
/* must be called with lock acquired */
nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *_m, int rnti)
nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *_m, ue_id_t ue_id)
{
/* TODO: optimze */
nr_pdcp_ue_manager_internal_t *m = _m;
int i;
for (i = 0; i < m->ue_count; i++)
if (m->ue_list[i]->rnti == rnti)
if (m->ue_list[i]->ue_id == ue_id)
return m->ue_list[i];
LOG_D(PDCP, "%s:%d:%s: new UE 0x%x\n", __FILE__, __LINE__, __FUNCTION__, rnti);
LOG_D(PDCP, "%s:%d:%s: new UE 0x%"PRIx64"\n", __FILE__, __LINE__, __FUNCTION__, ue_id);
m->ue_count++;
m->ue_list = realloc(m->ue_list, sizeof(nr_pdcp_ue_t *) * m->ue_count);
......@@ -99,13 +100,13 @@ nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *_m, int rnti)
exit(1);
}
m->ue_list[m->ue_count-1]->rnti = rnti;
m->ue_list[m->ue_count-1]->ue_id = ue_id;
return m->ue_list[m->ue_count-1];
}
/* must be called with lock acquired */
void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *_m, int rnti)
void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *_m, ue_id_t ue_id)
{
nr_pdcp_ue_manager_internal_t *m = _m;
nr_pdcp_ue_t *ue;
......@@ -113,13 +114,13 @@ void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *_m, int rnti)
int j;
for (i = 0; i < m->ue_count; i++)
if (m->ue_list[i]->rnti == rnti)
if (m->ue_list[i]->ue_id == ue_id)
break;
if (i == m->ue_count) {
LOG_D(PDCP, "%s:%d:%s: warning: ue %d not found\n",
LOG_D(PDCP, "%s:%d:%s: warning: ue 0x%"PRIx64" not found\n",
__FILE__, __LINE__, __FUNCTION__,
rnti);
ue_id);
return;
}
......@@ -203,10 +204,11 @@ int nr_pdcp_manager_get_ue_count(nr_pdcp_ue_manager_t *_m)
return m->ue_count;
}
int nr_pdcp_get_first_rnti(nr_pdcp_ue_manager_t *_m)
int nr_pdcp_get_first_ue_id(nr_pdcp_ue_manager_t *_m, ue_id_t *ret)
{
nr_pdcp_ue_manager_internal_t *m = _m;
if (m->ue_count == 0)
return -1;
return m->ue_list[0]->rnti;
return 0;
*ret = m->ue_list[0]->ue_id;
return 1;
}
......@@ -24,10 +24,12 @@
#include "nr_pdcp_entity.h"
#include "platform_types.h"
typedef void nr_pdcp_ue_manager_t;
typedef struct nr_pdcp_ue_t {
int rnti;
ue_id_t ue_id;
nr_pdcp_entity_t *srb[3];
nr_pdcp_entity_t *drb[MAX_DRBS_PER_UE];
} nr_pdcp_ue_t;
......@@ -43,8 +45,8 @@ int nr_pdcp_manager_get_enb_flag(nr_pdcp_ue_manager_t *m);
void nr_pdcp_manager_lock(nr_pdcp_ue_manager_t *m);
void nr_pdcp_manager_unlock(nr_pdcp_ue_manager_t *m);
nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *m, int rnti);
void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *m, int rnti);
nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *m, ue_id_t ue_id);
void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *m, ue_id_t ue_id);
nr_pdcp_ue_t **nr_pdcp_manager_get_ue_list(nr_pdcp_ue_manager_t *_m);
int nr_pdcp_manager_get_ue_count(nr_pdcp_ue_manager_t *_m);
......@@ -62,7 +64,7 @@ void nr_pdcp_ue_add_drb_pdcp_entity(nr_pdcp_ue_t *ue, int drb_id,
/* hacks */
/***********************************************************************/
/* returns -1 if no UE */
int nr_pdcp_get_first_rnti(nr_pdcp_ue_manager_t *m);
/* returns 0 if no UE, 1 otherwise */
int nr_pdcp_get_first_ue_id(nr_pdcp_ue_manager_t *m, ue_id_t *ret);
#endif /* _NR_PDCP_UE_MANAGER_H_ */
......@@ -539,15 +539,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->rnti;
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,7 +21,7 @@
#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;
......
......@@ -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;
......
......@@ -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"
......
......@@ -411,7 +411,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;
......
......@@ -85,12 +85,10 @@
#include "rrc_eNB_S1AP.h"
#include "rrc_gNB_NGAP.h"
#include "rrc_eNB_GTPV1U.h"
#include "rrc_gNB_GTPV1U.h"
#include "nr_pdcp/nr_pdcp_entity.h"
#include "pdcp.h"
#include "gtpv1u_eNB_task.h"
#include "intertask_interface.h"
#include "SIMULATION/TOOLS/sim.h" // for taus
......@@ -1660,7 +1658,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,
......@@ -3468,10 +3466,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 + 3);
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);
......
......@@ -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"
......@@ -530,7 +529,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(
......@@ -1012,7 +1011,7 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(
ue_context_p->ue_context.nb_of_pdusessions = NGAP_PDUSESSION_SETUP_REQ(msg_p).nb_pdusessions_tosetup;
ue_context_p->ue_context.gNB_ue_ngap_id = NGAP_PDUSESSION_SETUP_REQ(msg_p).gNB_ue_ngap_id;
ue_context_p->ue_context.amf_ue_ngap_id = NGAP_PDUSESSION_SETUP_REQ(msg_p).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(
......@@ -1682,7 +1681,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) {
......
......@@ -25,6 +25,7 @@ uint8_t nas_qfi;
uint8_t nas_pduid;
bool sdap_data_req(protocol_ctxt_t *ctxt_p,
const ue_id_t ue_id,
const srb_flag_t srb_flag,
const rb_id_t rb_id,
const mui_t mui,
......@@ -38,10 +39,10 @@ bool sdap_data_req(protocol_ctxt_t *ctxt_p,
const bool rqi,
const int pdusession_id) {
nr_sdap_entity_t *sdap_entity;
sdap_entity = nr_sdap_get_entity(ctxt_p->rnti, pdusession_id);
sdap_entity = nr_sdap_get_entity(ue_id, pdusession_id);
if(sdap_entity == NULL) {
LOG_E(SDAP, "%s:%d:%s: Entity not found with ue rnti: %x and pdusession id: %d\n", __FILE__, __LINE__, __FUNCTION__, ctxt_p->rnti, pdusession_id);
LOG_E(SDAP, "%s:%d:%s: Entity not found with ue: 0x%"PRIx64" and pdusession id: %d\n", __FILE__, __LINE__, __FUNCTION__, ue_id, pdusession_id);
return 0;
}
......@@ -66,11 +67,11 @@ void sdap_data_ind(rb_id_t pdcp_entity,
int has_sdap,
int has_sdapULheader,
int pdusession_id,
int rnti,
ue_id_t ue_id,
char *buf,
int size) {
nr_sdap_entity_t *sdap_entity;
sdap_entity = nr_sdap_get_entity(rnti, pdusession_id);
sdap_entity = nr_sdap_get_entity(ue_id, pdusession_id);
if(sdap_entity == NULL) {
LOG_E(SDAP, "%s:%d:%s: Entity not found for ue rnti: %x and pdusession id: %d\n", __FILE__, __LINE__, __FUNCTION__, rnti, pdusession_id);
......@@ -83,7 +84,7 @@ void sdap_data_ind(rb_id_t pdcp_entity,
has_sdap,
has_sdapULheader,
pdusession_id,
rnti,
ue_id,
buf,
size);
}
......
......@@ -33,6 +33,7 @@
* Uplink - nrUE
*/
bool sdap_data_req(protocol_ctxt_t *ctxt_p,
const ue_id_t ue_id,
const srb_flag_t srb_flag,
const rb_id_t rb_id,
const mui_t mui,
......@@ -57,7 +58,7 @@ void sdap_data_ind(rb_id_t pdcp_entity,
int has_sdap,
int has_sdapULheader,
int pdusession_id,
int rnti,
ue_id_t ue_id,
char *buf,
int size
);
......
......@@ -175,7 +175,7 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
int has_sdap,
int has_sdapHeader,
int pdusession_id,
int rnti,
ue_id_t ue_id,
char *buf,
int size) {
/* The offset of the SDAP header, it might be 0 if the has_sdap is not true in the pdcp entity. */
......@@ -203,18 +203,18 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
// Pushing SDAP SDU to GTP-U Layer
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 - offset);
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 + offset, size - offset);
req->buffer = gtpu_buffer_p;
req->length = size - offset;
req->offset = GTPU_HEADER_OVERHEAD_MAX;
req->rnti = rnti;
req->pdusession_id = pdusession_id;
req->ue_id = ue_id;
req->bearer_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);
} else { //nrUE
......@@ -250,7 +250,7 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
if(!entity->qfi2drb_table[sdap_hdr->QFI].drb_id && entity->default_drb){
nr_sdap_ul_hdr_t sdap_ctrl_pdu = entity->sdap_construct_ctrl_pdu(sdap_hdr->QFI);
rb_id_t sdap_ctrl_pdu_drb = entity->sdap_map_ctrl_pdu(entity, pdcp_entity, SDAP_CTRL_PDU_MAP_DEF_DRB, sdap_hdr->QFI);
entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu);
entity->sdap_submit_ctrl_pdu(ue_id, sdap_ctrl_pdu_drb, sdap_ctrl_pdu);
}
/*
......@@ -266,7 +266,7 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity,
has_sdapHeader ){
nr_sdap_ul_hdr_t sdap_ctrl_pdu = entity->sdap_construct_ctrl_pdu(sdap_hdr->QFI);
rb_id_t sdap_ctrl_pdu_drb = entity->sdap_map_ctrl_pdu(entity, pdcp_entity, SDAP_CTRL_PDU_MAP_RULE_DRB, sdap_hdr->QFI);
entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu);
entity->sdap_submit_ctrl_pdu(ue_id, sdap_ctrl_pdu_drb, sdap_ctrl_pdu);
}
/*
......
......@@ -105,7 +105,7 @@ typedef struct nr_sdap_entity_s {
int has_sdap,
int has_sdapULheader,
int pdusession_id,
int rnti,
ue_id_t ue_id,
char *buf,
int size);
......
This diff is collapsed.
This diff is collapsed.
/*
* 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_ */
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