Commit 7ea6cb25 authored by Raymond Knopp's avatar Raymond Knopp

Merge branch 'feature-127-protocol-split' of...

Merge branch 'feature-127-protocol-split' of https://gitlab.eurecom.fr/oai/openairinterface5g into feature-127-protocol-split

Conflicts:
	openair2/F1AP/f1ap_du_rrc_message_transfer.c
parents a6d3efb9 cee89cb3
......@@ -83,6 +83,8 @@ typedef struct f1ap_setup_req_s {
uint16_t sctp_in_streams;
uint16_t sctp_out_streams;
uint16_t default_sctp_stream_id;
// F1_Setup_Req payload
uint64_t gNB_DU_id;
char *gNB_DU_name;
......@@ -247,6 +249,7 @@ typedef struct f1ap_initial_ul_rrc_message_s {
typedef struct f1ap_ul_rrc_message_s {
uint32_t gNB_CU_ue_id;
uint32_t gNB_DU_ue_id;
uint16_t rnti;
uint8_t srb_id;
uint8_t *rrc_container;
int rrc_container_length;
......@@ -265,18 +268,25 @@ typedef struct f1ap_drb_to_be_setup_s {
} f1ap_drb_to_be_setup_t;
typedef struct f1ap_ue_context_setup_req_s {
uint32_t gNB_CU_ue_id;
uint32_t gNB_CU_ue_id; // BK: need to replace by use from rnti
uint32_t *gNB_DU_ue_id;
uint16_t rnti;
// SpCell Info
uint16_t mcc;
uint16_t mnc;
uint8_t mnc_digit_length;
uint64_t nr_cellid;
uint8_t servCellIndex;
uint8_t cellULConfigured;
uint32_t servCellId;
uint8_t *cu_to_du_rrc_information;
uint8_t cu_to_du_rrc_information_length;
f1ap_drb_to_be_setup_t *drbs_to_be_setup;
uint8_t drbs_to_be_setup_length;
f1ap_drb_to_be_setup_t *drbs_to_be_setup; // BK: need to replace by s1ap_initial_context_setup_req
uint8_t drbs_to_be_setup_length; // BK: need to replace by s1ap_initial_context_setup_req
s1ap_initial_context_setup_req_t *s1ap_initial_context_setup_req;
// coniatner for the rrc_eNB_generate_SecurityModeCommand message
uint8_t *rrc_container;
int rrc_container_length;
} f1ap_ue_context_setup_req_t;
#endif /* F1AP_MESSAGES_TYPES_H_ */
......@@ -271,7 +271,7 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
return -1;
}
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_assoc_id, buffer, len, 0);
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_assoc_id /* BK: fix me*/ , buffer, len, 0 /* BK: fix me*/);
return 0;
}
......@@ -332,7 +332,10 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_SRBID, true);
srb_id = ie->value.choice.SRBID;
LOG_D(CU_F1AP, "srb_id %lu \n", srb_id);
if (srb_id < 1 )
LOG_E(CU_F1AP, "Unexpected UL RRC MESSAGE for srb_id %lu (CCCH)\n", srb_id);
else
LOG_D(CU_F1AP, "UL RRC MESSAGE for srb_id %lu in DCCH \n", srb_id);
// issue in here
......@@ -340,16 +343,25 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
/* RRC Container */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_RRCContainer, true);
// BK: need check
// create an ITTI message and copy SDU
message_p = itti_alloc_new_message (TASK_CU_F1, RRC_MAC_CCCH_DATA_IND);
memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
ccch_sdu_len = ie->value.choice.RRCContainer.size;
memcpy(RRC_MAC_CCCH_DATA_IND (message_p).sdu, ie->value.choice.RRCContainer.buf,
ccch_sdu_len);
// print message in debug mode
LOG_D(CU_F1AP, "RRCContainer(CCCH) :");
for (int i=0;i<ie->value.choice.RRCContainer.size;i++) LOG_D(CU_F1AP, "%2x ",RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]);
LOG_D(CU_F1AP, "\n");
// create an ITTI message and copy SDU
message_p = itti_alloc_new_message (TASK_CU_F1, RRC_DCCH_DATA_IND);
memset (RRC_DCCH_DATA_IND (message_p).sdu_p, 0, CCCH_SDU_SIZE);
RRC_DCCH_DATA_IND (message_p).sdu_size = ie->value.choice.RRCContainer.size;
memcpy(RRC_DCCH_DATA_IND (message_p).sdu_p, ie->value.choice.RRCContainer.buf,
ie->value.choice.RRCContainer.size);
RRC_DCCH_DATA_IND (message_p).dcch_index = srb_id;
RRC_DCCH_DATA_IND (message_p).rnti = f1ap_get_rnti_by_cu_id(&f1ap_cu_ue[instance],cu_ue_f1ap_id);
RRC_DCCH_DATA_IND (message_p).module_id = instance;
RRC_DCCH_DATA_IND (message_p).eNB_index = instance; // not needed for CU
itti_send_msg_to_task(TASK_RRC_ENB, instance, message_p);
return 0;
}
......@@ -147,10 +147,8 @@ void *F1AP_CU_task(void *arg) {
case F1AP_DL_RRC_MESSAGE: // from rrc
LOG_I(CU_F1AP, "CU Task Received F1AP_DL_RRC_MESSAGE\n");
// CU_send_f1setup_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
// &F1AP_SETUP_RESP(received_msg));
CU_send_DL_RRC_MESSAGE_TRANSFER(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&F1AP_SETUP_RESP(received_msg));
&F1AP_DL_RRC_MESSAGE(received_msg));
break;
// case F1AP_SETUP_RESPONSE: // This is from RRC
......
......@@ -107,13 +107,15 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
LOG_D(DU_F1AP, "du_ue_f1ap_id %lu \n", du_ue_f1ap_id); // this should be the one transmitted via initial ul rrc message transfer
LOG_D(DU_F1AP, "du_ue_f1ap_id %lu associated with UE RNTI %x \n",
du_ue_f1ap_id,
f1ap_get_rnti_by_du_id(&f1ap_du_ue[instance],du_ue_f1ap_id)); // this should be the one transmitted via initial ul rrc message transfer
if (f1ap_du_add_cu_ue_id(&f1ap_du_ue[instance],du_ue_f1ap_id,cu_ue_f1ap_id) < 0 ) {
LOG_E(DU_F1AP, "Failed to find the F1AP UID \n");
//return -1;
}
/* optional */
/* oldgNB_DU_UE_F1AP_ID */
if (0) {
......@@ -313,11 +315,8 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
}
//void DU_send_UL_RRC_MESSAGE_TRANSFER(F1AP_ULRRCMessageTransfer_t *ULRRCMessageTransfer) {
int DU_send_UL_RRC_MESSAGE_TRANSFER(protocol_ctxt_t* ctxt_pP,
rb_id_t srb_idP,
uint8_t *sduP,
sdu_size_t sdu_lenP) {
int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
f1ap_ul_rrc_message_t *f1ap_ul_rrc) {
LOG_D(DU_F1AP, "DU_send_UL_RRC_MESSAGE_TRANSFER \n");
......@@ -344,7 +343,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(protocol_ctxt_t* ctxt_pP,
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_du_ue[ctxt_pP->module_id].cu_ue_f1ap_id[f1ap_get_uid_by_rnti(&f1ap_du_ue[ctxt_pP->module_id], ctxt_pP->rnti)];
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_du_ue[instance].cu_ue_f1ap_id[f1ap_get_uid_by_rnti(&f1ap_du_ue[instance], f1ap_ul_rrc->rnti)];
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
......@@ -353,7 +352,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(protocol_ctxt_t* ctxt_pP,
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_du_ue[ctxt_pP->module_id].du_ue_f1ap_id[f1ap_get_uid_by_rnti(&f1ap_du_ue[ctxt_pP->module_id], ctxt_pP->rnti)];
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_du_ue[instance].du_ue_f1ap_id[f1ap_get_uid_by_rnti(&f1ap_du_ue[instance], f1ap_ul_rrc->rnti)];
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
......@@ -362,7 +361,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(protocol_ctxt_t* ctxt_pP,
ie->id = F1AP_ProtocolIE_ID_id_SRBID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_SRBID;
ie->value.choice.SRBID = srb_idP;
ie->value.choice.SRBID = f1ap_ul_rrc->srb_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// issue in here
......@@ -372,7 +371,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(protocol_ctxt_t* ctxt_pP,
ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_RRCContainer;
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, sduP, sdu_lenP);
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, f1ap_ul_rrc->rrc_container, f1ap_ul_rrc->rrc_container_length);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* encode */
......@@ -381,9 +380,11 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(protocol_ctxt_t* ctxt_pP,
return -1;
}
du_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data->assoc_id, buffer, len, f1ap_du_data->default_sctp_stream_id);
return 0;
}
/* UL RRC Message Transfer */
int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
int CC_idP,
......@@ -476,14 +477,16 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
return -1;
}
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_allocate_new_UE_context(RC.rrc[module_idP]);
ue_context_p->ue_id_rnti = rntiP;
ue_context_p->ue_context.rnti = rntiP;
ue_context_p->ue_context.random_ue_identity = rntiP;
ue_context_p->ue_context.Srb0.Active = 1;
RB_INSERT(rrc_ue_tree_s, &RC.rrc[module_idP]->rrc_ue_head, ue_context_p);
du_f1ap_itti_send_sctp_data_req(0, f1ap_du_data->assoc_id, buffer, len, 0);
du_f1ap_itti_send_sctp_data_req(module_idP, f1ap_du_data->assoc_id, buffer, len, f1ap_du_data->default_sctp_stream_id);
#endif
return 0;
}
......
......@@ -39,10 +39,8 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_send_UL_RRC_MESSAGE_TRANSFER(protocol_ctxt_t* ctxt_pP,
rb_id_t srb_idP,
uint8_t *sduP,
sdu_size_t sdu_lenP);
int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
f1ap_ul_rrc_message_t *f1ap_ul_rrc);
int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
int CC_idP,
......
......@@ -93,6 +93,7 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
f1ap_du_data->assoc_id = sctp_new_association_resp->assoc_id;
f1ap_du_data->sctp_in_streams = sctp_new_association_resp->in_streams;
f1ap_du_data->sctp_out_streams = sctp_new_association_resp->out_streams;
f1ap_du_data->default_sctp_stream_id = 0;
DU_send_F1_SETUP_REQUEST(instance);
......@@ -159,6 +160,12 @@ void *F1AP_DU_task(void *arg) {
&received_msg->ittiMsg.sctp_data_ind);
break;
case F1AP_UL_RRC_MESSAGE: // from rrc
LOG_I(DU_F1AP, "DU Task Received F1AP_UL_RRC_MESSAGE\n");
DU_send_UL_RRC_MESSAGE_TRANSFER(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&F1AP_UL_RRC_MESSAGE(received_msg));
break;
case TERMINATE_MESSAGE:
LOG_W(DU_F1AP, " *** Exiting DU_F1AP thread\n");
itti_exit_task();
......
......@@ -56,10 +56,13 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
container = &pdu->choice.initiatingMessage->value.choice.UEContextSetupRequest;
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
f1ap_ue_context_setup_req->gNB_CU_ue_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
/* optional */
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, false);
if (ie) {
......@@ -70,6 +73,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
f1ap_ue_context_setup_req->gNB_DU_ue_id = NULL;
}
/* SpCell_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_SpCell_ID, true);
PLMNID_TO_MCC_MNC(&ie->value.choice.NRCGI.pLMN_Identity,
......@@ -78,15 +82,42 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
f1ap_ue_context_setup_req->mnc_digit_length);
BIT_STRING_TO_NR_CELL_IDENTITY(&ie->value.choice.NRCGI.nRCellIdentity, f1ap_ue_context_setup_req->nr_cellid);
/* TODO: decode candidate SpCell */
/* TODO: decode CUtoDURRCInformation */
/* ServCellIndex */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_ServCellndex, true);
f1ap_ue_context_setup_req->servCellIndex = ie->value.choice.ServCellIndex;
/* optional */
/* CellULConfigured */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_SpCellULConfigured, false); // SpCellULConfigured
if (ie) {
f1ap_ue_context_setup_req->cellULConfigured = malloc(sizeof(uint32_t));
if (f1ap_ue_context_setup_req->cellULConfigured)
f1ap_ue_context_setup_req->cellULConfigured = ie->value.choice.CellULConfigured;
} else {
f1ap_ue_context_setup_req->cellULConfigured = NULL;
}
/* CUtoDURRCInformation */
/* Candidate_SpCell_List */
/* optional */
/* DRXCycle */
/* optional */
/* ResourceCoordinationTransferContainer */
/* TODO: Candidate_SpCell_List */
/* SCell_ToBeSetup_List */
/* TODO: SCell_ToBeSetup_List */
/* SRBs_ToBeSetup_List */
/* TODO: SRBs_ToBeSetup_List */
/* DRBs_ToBeSetup_List */
/* Decode DRBs_ToBeSetup_List */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
......
......@@ -37,6 +37,8 @@
#include "f1ap_du_interface_management.h"
#include "f1ap_cu_rrc_message_transfer.h"
#include "f1ap_du_rrc_message_transfer.h"
#include "f1ap_cu_ue_context_management.h"
#include "f1ap_du_ue_context_management.h"
extern f1ap_setup_req_t *f1ap_du_data_from_du;
......@@ -49,7 +51,7 @@ f1ap_message_decoded_callback f1ap_messages_callback[][3] = {
{ 0, 0, 0 }, /* ErrorIndication */
{ 0, 0, 0 }, /* gNBDUConfigurationUpdate */
{ 0, 0, 0 }, /* gNBCUConfigurationUpdate */
{ 0, 0, 0 }, /* UEContextSetup */
{ DU_handle_UE_CONTEXT_SETUP_REQUEST, CU_handle_UE_CONTEXT_SETUP_RESPONSE, 0 }, /* UEContextSetup */
{ 0, 0, 0 }, /* UEContextRelease */
{ 0, 0, 0 }, /* UEContextModification */
{ 0, 0, 0 }, /* UEContextModificationRequired */
......
......@@ -63,7 +63,7 @@ async_server_thread_init (void)
//create log_list
//log_list_init(&log_list);
AssertFatal(0, "this should not be reached!\n");
//AssertFatal(0, "this should not be reached!\n");
async_server_shutdown = 0;
if ((pthread_mutex_init (&async_server_lock, NULL) != 0)
......
......@@ -512,6 +512,11 @@ typedef struct HANDOVER_INFO_UE_s {
uint8_t measFlag;
} HANDOVER_INFO_UE;
typedef struct RRC_CONTAINER_s{
char *buffer;
uint8_t size;
} RRC_CONTAINER_t;
typedef struct eNB_RRC_UE_s {
uint8_t primaryCC_id;
#if (RRC_VERSION >= MAKE_VERSION(10, 0, 0))
......@@ -539,6 +544,7 @@ typedef struct eNB_RRC_UE_s {
HANDOVER_INFO* handover_info;
MeasResults_t* measResults;
RRC_CONTAINER_t *security_mode_cmd;
UE_EUTRA_Capability_t* UE_Capability;
ImsiMobileIdentity_t imsi;
......
......@@ -1095,7 +1095,28 @@ rrc_eNB_process_RRCConnectionSetupComplete(
rrc_eNB_generate_SecurityModeCommand(
ctxt_pP,
ue_context_pP);
/*
if ((RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_CU) ||
(RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_CU) ||
(RC.rrc[ctxt_pP->module_id]->node_type == ngran_ng_eNB_CU)) {
message_p = itti_alloc_new_message (TASK_RRC_ENB, F1AP_UE_CONTEXT_SETUP_REQ);
F1AP_UE_CONTEXT_SETUP_REQ (message_p).rrc_container = ue_p->Srb0.Tx_buffer.Payload;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).rrc_container_length = ue_p->Srb0.Tx_buffer.payload_size;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).gNB_CU_ue_id = 0;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).gNB_DU_ue_id = 0;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).old_gNB_DU_ue_id = 0xFFFFFFFF; // unknown
F1AP_UE_CONTEXT_SETUP_REQ (message_p).rnti = ue_p->rnti;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).srb_id = CCCH;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).execute_duplication = 1;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).RAT_frequency_priority_information.en_dc = 0;
itti_send_msg_to_task (TASK_CU_F1, ctxt_pP->module_id, message_p);
LOG_D(RRC, "Send F1AP_UE_CONTEXT_SETUP_REQ with ITTI\n");
}
*/
// rrc_eNB_generate_UECapabilityEnquiry(enb_mod_idP,frameP,ue_mod_idP);
}
}
......@@ -1146,7 +1167,9 @@ rrc_eNB_generate_SecurityModeCommand(
rrc_eNB_mui,
size);
rrc_data_req(
if ((RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB) ||
(RC.rrc[ctxt_pP->module_id]->node_type == ngran_ng_eNB)) {
rrc_data_req(
ctxt_pP,
DCCH,
rrc_eNB_mui++,
......@@ -1154,6 +1177,7 @@ rrc_eNB_generate_SecurityModeCommand(
size,
buffer,
PDCP_TRANSMISSION_MODE_CONTROL);
}
}
......@@ -6944,14 +6968,28 @@ if (ue_context_p->ue_context.nb_of_modify_e_rabs > 0) {
if (ul_dcch_msg->message.choice.c1.choice.rrcConnectionSetupComplete.criticalExtensions.choice.c1.
present ==
RRCConnectionSetupComplete__criticalExtensions__c1_PR_rrcConnectionSetupComplete_r8) {
rrc_eNB_process_RRCConnectionSetupComplete(
ctxt_pP,
ue_context_p,
&ul_dcch_msg->message.choice.c1.choice.rrcConnectionSetupComplete.criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8);
ue_context_p->ue_context.Status = RRC_CONNECTED;
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_CONNECTED \n",
if ((RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_DU) ||
(RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_DU) ) {
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_ENB, F1AP_UL_RRC_MESSAGE);
F1AP_UL_RRC_MESSAGE (message_p).rrc_container = &ul_dcch_msg->message.choice.c1.choice.rrcConnectionSetupComplete.criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8;
F1AP_UL_RRC_MESSAGE (message_p).rrc_container_length = strlen(&ul_dcch_msg->message.choice.c1.choice.rrcConnectionSetupComplete.criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8);
F1AP_UL_RRC_MESSAGE (message_p).gNB_CU_ue_id = 0;
F1AP_UL_RRC_MESSAGE (message_p).gNB_DU_ue_id = 0;
F1AP_UL_RRC_MESSAGE (message_p).rnti = ue_context_p->ue_context.rnti;
F1AP_UL_RRC_MESSAGE (message_p).srb_id = DCCH;
itti_send_msg_to_task (TASK_DU_F1, ctxt_pP->module_id, message_p);
LOG_D(RRC, "Send F1AP_UL_RRC_MESSAGE with ITTI\n");
} else { // eNB or CU node type
rrc_eNB_process_RRCConnectionSetupComplete(
ctxt_pP,
ue_context_p,
&ul_dcch_msg->message.choice.c1.choice.rrcConnectionSetupComplete.criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8);
ue_context_p->ue_context.Status = RRC_CONNECTED;
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_CONNECTED \n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
}
//WARNING:Inform the controller about the UE activation. Should be moved to RRC agent in the future
if (rrc_agent_registered[ctxt_pP->module_id]) {
agent_rrc_xface[ctxt_pP->eNB_index]->flexran_agent_notify_ue_state_change(ctxt_pP->module_id,
......
......@@ -1059,6 +1059,28 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
rrc_eNB_generate_UECapabilityEnquiry (&ctxt, ue_context_p);
}
}
/*
if ((RC.rrc[ctxt.module_id]->node_type == ngran_eNB_CU) ||
(RC.rrc[ctxt.module_id]->node_type == ngran_ng_eNB_CU) ||
(RC.rrc[ctxt.module_id]->node_type == ngran_gNB_CU) ){
message_p = itti_alloc_new_message (TASK_RRC_ENB, F1AP_UE_CONTEXT_SETUP_REQ);
F1AP_UE_CONTEXT_SETUP_REQ (message_p).rrc_container = ue_p->Srb0.Tx_buffer.Payload;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).rrc_container_length = ue_p->Srb0.Tx_buffer.payload_size;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).gNB_CU_ue_id = 0;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).gNB_DU_ue_id = 0;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).old_gNB_DU_ue_id = 0xFFFFFFFF; // unknown
F1AP_UE_CONTEXT_SETUP_REQ (message_p).rnti = ue_p->rnti;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).srb_id = CCCH;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).execute_duplication = 1;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).RAT_frequency_priority_information.en_dc = 0;
itti_send_msg_to_task (TASK_CU_F1, ctxt_pP->module_id, message_p);
LOG_D(RRC, "Send F1AP_UE_CONTEXT_SETUP_REQ with ITTI\n");
}
*/
return (0);
}
}
......
......@@ -283,7 +283,7 @@ do { \
} while(0)
/* TS 38.473 v15.1.1 section 9.3.2.3:
/* TS 38.473 v15.2.1 section 9.3.2.3:
* TRANSPORT LAYER ADDRESS for IPv4 is 32bit (TS 38.414)
*/
#define TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(mACRO, bITsTRING) \
......@@ -323,6 +323,38 @@ do { \
(bITsTRING)->bits_unused = 4; \
} while(0)
/* TS 38.473 v15.2.1 section 9.3.1.55:
* MaskedIMEISV is BIT_STRING(64)
*/
#define MaskedIMEISV_TO_BIT_STRING(mACRO, bITsTRING) \
do { \
(bITsTRING)->buf = calloc(8, sizeof(uint8_t)); \
(bITsTRING)->buf[0] = (mACRO) >> 56 & 0xFF; \
(bITsTRING)->buf[1] = (mACRO) >> 48 & 0xFF; \
(bITsTRING)->buf[2] = (mACRO) >> 40 & 0xFF; \
(bITsTRING)->buf[3] = (mACRO) >> 32 & 0xFF; \
(bITsTRING)->buf[4] = (mACRO) >> 24 & 0xFF; \
(bITsTRING)->buf[5] = (mACRO) >> 16 & 0xFF; \
(bITsTRING)->buf[6] = (mACRO) >> 8 & 0xFF; \
(bITsTRING)->buf[7] = (mACRO) >> 4 & 0xFF; \
(bITsTRING)->size = 8; \
(bITsTRING)->bits_unused = 0; \
} while(0)
#define BIT_STRING_TO_MaskedIMEISV(bITsTRING, mACRO) \
do { \
DevCheck((bITsTRING)->size == 8, (bITsTRING)->size, 8, 0); \
DevCheck((bITsTRING)->bits_unused == 0, (bITsTRING)->bits_unused, 0, 0); \
mACRO = ((bITsTRING)->buf[0] << 56) + \
((bITsTRING)->buf[1] << 48) + \
((bITsTRING)->buf[2] << 40) + \
((bITsTRING)->buf[3] << 32) + \
((bITsTRING)->buf[4] << 24) + \
((bITsTRING)->buf[5] << 16) + \
((bITsTRING)->buf[6] << 8) + \
((bITsTRING)->buf[7]); \
} while (0)
/* TS 36.413 v10.9.0 section 9.2.1.37:
* Macro eNB ID:
* Equal to the 20 leftmost bits of the Cell
......
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