Commit b683395d 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_cu_interface_management.c
	openair2/F1AP/f1ap_du_interface_management.c
parents 91d4cd3c eedfa493
......@@ -127,10 +127,15 @@ typedef struct f1ap_setup_req_s {
uint8_t sul_scs;
uint8_t sul_nrb;
uint8_t num_frequency_bands;
uint16_t nr_band[32];
uint8_t num_sul_frequency_bands;
uint16_t nr_sul_band[32];
uint8_t ul_num_frequency_bands;
uint16_t ul_nr_band[32];
uint8_t ul_num_sul_frequency_bands;
uint16_t ul_nr_sul_band[32];
uint8_t dl_num_frequency_bands;
uint16_t dl_nr_band[32];
uint8_t dl_num_sul_frequency_bands;
uint16_t dl_nr_sul_band[32];
} fdd;
struct {
......
......@@ -2473,11 +2473,21 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
// use nrb field to hold LTE N_RB_DL (0...5)
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.ul_nrb = rrc->carrier[0].mib.message.dl_Bandwidth;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.ul_nrb = rrc->carrier[0].mib.message.dl_Bandwidth;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.num_frequency_bands = 1;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.nr_band[0] = rrc->carrier[0].sib1->freqBandIndicator;
// RK: we need to check there value for FDD's frequency_bands DL/UL
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.ul_num_frequency_bands = 1;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.ul_nr_band[0] = rrc->carrier[0].sib1->freqBandIndicator;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.dl_num_frequency_bands = 1;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.dl_nr_band[0] = rrc->carrier[0].sib1->freqBandIndicator;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.ul_num_sul_frequency_bands = 0;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.ul_nr_sul_band[0] = rrc->carrier[0].sib1->freqBandIndicator;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.dl_num_sul_frequency_bands = 0;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.dl_nr_sul_band[0] = rrc->carrier[0].sib1->freqBandIndicator;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.sul_active = 0;
}
F1AP_SETUP_REQ (msg_p).measurement_timing_information[k] = NULL;
F1AP_SETUP_REQ (msg_p).measurement_timing_information[k] = "0";
F1AP_SETUP_REQ (msg_p).ranac[k] = 0;
F1AP_SETUP_REQ (msg_p).mib[k] = rrc->carrier[0].MIB;
F1AP_SETUP_REQ (msg_p).sib1[k] = rrc->carrier[0].SIB1;
......
......@@ -419,6 +419,7 @@ inline void ASN_DEBUG(const char *fmt, ...);
/** \brief Function callback prototype.
**/
typedef int (*f1ap_message_decoded_callback)(
instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *message_p
......
......@@ -33,12 +33,79 @@
#ifndef F1AP_CU_INTERFACE_MANAGEMENT_H_
#define F1AP_CU_INTERFACE_MANAGEMENT_H_
int CU_handle_F1_SETUP_REQUEST(uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* Reset
*/
int CU_send_RESET(instance_t instance, F1AP_Reset_t *Reset);
int CU_handle_RESET_ACKKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_handle_RESET(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_RESET_ACKNOWLEDGE(instance_t instance, F1AP_ResetAcknowledge_t *ResetAcknowledge);
/*
* Error Indication
*/
int CU_handle_ERROR_INDICATION(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_ERROR_INDICATION(instance_t instance, F1AP_ErrorIndication_t *ErrorIndication);
/*
* F1 Setup
*/
int CU_handle_F1_SETUP_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_F1_SETUP_RESPONSE(instance_t instance, f1ap_setup_resp_t *f1ap_setup_resp);
int CU_send_F1_SETUP_FAILURE(instance_t instance);
/*
* gNB-DU Configuration Update
*/
int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_gNB_DU_CONFIGURATION_FAILURE(instance_t instance,
F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure);
void CU_send_F1_SETUP_RESPONSE(instance_t instance, f1ap_setup_resp_t *f1ap_setup_resp);
int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge);
/*
* gNB-CU Configuration Update
*/
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_idP);
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* gNB-DU Resource Coordination
*/
int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
void CU_send_F1_SETUP_FAILURE(F1AP_F1SetupFailure_t *F1SetupFailure);
int CU_send_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse);
#endif /* F1AP_CU_INTERFACE_MANAGEMENT_H_ */
\ No newline at end of file
#endif /* F1AP_CU_INTERFACE_MANAGEMENT_H_ */
......@@ -31,21 +31,117 @@
*/
#include "f1ap_common.h"
#include "f1ap_encoder.h"
#include "f1ap_decoder.h"
#include "f1ap_itti_messaging.h"
#include "f1ap_cu_rrc_message_transfer.h"
// undefine C_RNTI from
// openair1/PHY/LTE_TRANSPORT/transport_common.h which
// replaces in ie->value.choice.C_RNTI, causing
// a compile error
#undef C_RNTI
/*
Initial UL RRC Message Transfer
*/
void CU_handle_UL_INITIAL_RRC_MESSAGE_TRANSFER(void) {
int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
printf("CU_handle_UL_INITIAL_RRC_MESSAGE_TRANSFER\n");
printf("CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER\n");
// decode the F1 message
// get the rrc message from the contauiner
// call func rrc_eNB_decode_ccch: <-- needs some update here
MessageDef *message_p;
F1AP_InitialULRRCMessageTransfer_t *container;
F1AP_InitialULRRCMessageTransferIEs_t *ie;
rnti_t rnti;
uint8_t *ccch_sdu;
sdu_size_t ccch_sdu_len;
int CC_id =0;
uint64_t du_ue_f1ap_id;
DevAssert(pdu != NULL);
if (stream != 0) {
LOG_E(F1AP, "[SCTP %d] Received F1 on stream != 0 (%d)\n",
assoc_id, stream);
return -1;
}
container = &pdu->choice.initiatingMessage->value.choice.InitialULRRCMessageTransfer;
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_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;
printf("du_ue_f1ap_id %lu \n", du_ue_f1ap_id);
/* NRCGI */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_NRCGI, true);
/* RNTI */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_C_RNTI, true);
BIT_STRING_TO_CELL_IDENTITY(&ie->value.choice.C_RNTI, rnti);
/* RRC Container */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_RRCContainer, true);
ccch_sdu = calloc(ie->value.choice.RRCContainer.size + 1, sizeof(char));
memcpy(ccch_sdu, ie->value.choice.RRCContainer.buf,
ie->value.choice.RRCContainer.size);
/* Convert the mme name to a printable string */
ccch_sdu[ie->value.choice.RRCContainer.size] = '\0';
printf ("RRCContainer %s \n", ccch_sdu);
ccch_sdu_len = ie->value.choice.RRCContainer.size;
// create an ITTI message
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);
memcpy (RRC_MAC_CCCH_DATA_IND (message_p).sdu, ccch_sdu, ccch_sdu_len);
RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = 0;
RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = ccch_sdu_len;
RRC_MAC_CCCH_DATA_IND (message_p).enb_index = instance; // CU instance
RRC_MAC_CCCH_DATA_IND (message_p).rnti = rnti;
RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
itti_send_msg_to_task (TASK_RRC_ENB, instance, message_p);
// OR creat the ctxt and srb_info struct required by rrc_eNB_decode_ccch
/*
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt,
instance, // to fix
ENB_FLAG_YES,
rnti,
0, // frame
0); // slot
CC_id = RRC_MAC_CCCH_DATA_IND(msg_p).CC_id;
srb_info_p = &RC.rrc[instance]->carrier[CC_id].Srb0;
if (ccch_sdu_len >= RRC_BUFFER_SIZE_MAX) {
LOG_E(RRC, "CCCH message has size %d > %d\n",ccch_sdu_len,RRC_BUFFER_SIZE_MAX);
break;
}
memcpy(srb_info_p->Rx_buffer.Payload,
ccch_sdu,
ccch_sdu_len);
srb_info->Rx_buffer.payload_size = ccch_sdu_len;
rrc_eNB_decode_ccch(&ctxt, srb_info, CC_id);
*/
// if size > 0
// CU_send_DL_RRC_MESSAGE_TRANSFER(C.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Tx_buffer.Payload, RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Tx_buffer.payload_size)
return 0;
}
......@@ -54,7 +150,7 @@ void CU_handle_UL_INITIAL_RRC_MESSAGE_TRANSFER(void) {
*/
//void CU_send_DL_RRC_MESSAGE_TRANSFER(F1AP_DLRRCMessageTransfer_t *DLRRCMessageTransfer) {
void CU_send_DL_RRC_MESSAGE_TRANSFER(void) {
int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance) {
F1AP_F1AP_PDU_t pdu;
F1AP_DLRRCMessageTransfer_t *out;
F1AP_DLRRCMessageTransferIEs_t *ie;
......@@ -150,6 +246,7 @@ void CU_send_DL_RRC_MESSAGE_TRANSFER(void) {
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n");
return -1;
}
printf("\n");
......@@ -157,14 +254,19 @@ void CU_send_DL_RRC_MESSAGE_TRANSFER(void) {
/* decode */
if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
printf("Failed to decode F1 setup request\n");
return -1;
}
//AssertFatal(1==0,"Not implemented yet\n");
return 0;
}
/*
UL RRC Message Transfer
*/
void CU_handle_UL_RRC_MESSAGE_TRANSFER(F1AP_ULRRCMessageTransfer_t *ULRRCMessageTransfer) {
int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
......@@ -33,4 +33,16 @@
#ifndef F1AP_CU_RRC_MESSAGE_TRANSFER_H_
#define F1AP_CU_RRC_MESSAGE_TRANSFER_H_
#endif /* F1AP_CU_RRC_MESSAGE_TRANSFER_H_ */
\ No newline at end of file
int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance);
int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
#endif /* F1AP_CU_RRC_MESSAGE_TRANSFER_H_ */
......@@ -65,12 +65,12 @@ void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
f1ap_du_data_from_du->sctp_out_streams = sctp_new_association_resp->out_streams;
}
void cu_task_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind) {
void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) {
int result;
DevAssert(sctp_data_ind != NULL);
f1ap_handle_message(sctp_data_ind->assoc_id, sctp_data_ind->stream,
f1ap_handle_message(instance, sctp_data_ind->assoc_id, sctp_data_ind->stream,
sctp_data_ind->buffer, sctp_data_ind->buffer_length);
result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
......@@ -132,7 +132,8 @@ void *F1AP_CU_task(void *arg) {
case SCTP_DATA_IND:
LOG_I(CU_F1AP, "SCTP_DATA_IND\n");
cu_task_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind);
cu_task_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_data_ind);
break;
case F1AP_SETUP_RESP: // from rrc
......
......@@ -24,7 +24,7 @@
void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind);
void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
void cu_task_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind);
void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind);
void cu_task_send_sctp_init_req(instance_t enb_id);
void *F1AP_CU_task(void *arg);
......
......@@ -19,8 +19,8 @@
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
/*! \file f1ap_cu_ue_context_management.c
* \brief F1AP UE Context Management, CU side
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
......@@ -30,14 +30,14 @@
* \warning
*/
/*
UE Context Setup
*/
#include "f1ap_common.h"
#include "f1ap_encoder.h"
#include "f1ap_decoder.h"
#include "f1ap_itti_messaging.h"
#include "f1ap_cu_ue_context_management.h"
//void CU_send_UE_CONTEXT_SETUP_REQUEST(F1AP_UEContextSetupRequest_t *UEContextSetupRequest) {
void CU_send_UE_CONTEXT_SETUP_REQUEST(void) {
int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance) {
F1AP_F1AP_PDU_t pdu;
F1AP_UEContextSetupRequest_t *out;
F1AP_UEContextSetupRequestIEs_t *ie;
......@@ -357,7 +357,7 @@ void CU_send_UE_CONTEXT_SETUP_REQUEST(void) {
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n");
return;
return -1;
}
printf("\n");
......@@ -365,44 +365,51 @@ void CU_send_UE_CONTEXT_SETUP_REQUEST(void) {
/* decode */
if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
printf("Failed to decode F1 setup request\n");
return -1;
}
//AssertFatal(1==0,"Not implemented yet\n");
return 0;
}
void CU_handle_UE_CONTEXT_SETUP_RESPONSE(F1AP_UEContextSetupResponse_t *UEContextSetupResponse) {
int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_handle_UE_CONTEXT_SETUP_FAILURE(F1AP_UEContextSetupFailure_t UEContextSetupFailure) {
int CU_handle_UE_CONTEXT_SETUP_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
/*
UE Context Release (gNB-CU initiated)
*/
void CU_handle_UE_CONTEXT_RELEASE_REQUEST(F1AP_UEContextReleaseRequest_t *UEContextReleaseRequest) {
int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_send_UE_CONTEXT_RELEASE_COMMAND(F1AP_UEContextReleaseCommand_t *UEContextReleaseCommand) {
int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
F1AP_UEContextReleaseCommand_t *UEContextReleaseCommand) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_handle_UE_CONTEXT_RELEASE_COMPLETE(F1AP_UEContextReleaseComplete_t *UEContextReleaseComplete) {
int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
/*
UE Context Modification Required (gNB-DU initiated)
*/
//void CU_send_UE_CONTEXT_MODIFICATION_REQUEST(F1AP_UEContextModificationRequest_t *UEContextModificationRequest) {
void CU_send_UE_CONTEXT_MODIFICATION_REQUEST(void) {
int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
F1AP_F1AP_PDU_t pdu;
F1AP_UEContextModificationRequest_t *out;
F1AP_UEContextModificationRequestIEs_t *ie;
......@@ -863,7 +870,7 @@ void CU_send_UE_CONTEXT_MODIFICATION_REQUEST(void) {
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n");
return;
return -1;
}
printf("\n");
......@@ -871,22 +878,34 @@ void CU_send_UE_CONTEXT_MODIFICATION_REQUEST(void) {
/* decode */
if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
printf("Failed to decode F1 setup request\n");
return -1;
}
return 0;
}
void CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(F1AP_UEContextModificationResponse_t *UEContextModificationResponse) {
int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(F1AP_UEContextModificationFailure_t EContextModificationFailure) {
int CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(F1AP_UEContextModificationRequired_t *UEContextModificationRequired) {
int CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
void CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t) {
int CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance,
F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t) {
AssertFatal(1==0,"Not implemented yet\n");
}
\ No newline at end of file
}
......@@ -19,8 +19,8 @@
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
/*! \file f1ap_cu_ue_context_management.h
* \brief header file of CU UE Context management
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
......@@ -28,4 +28,74 @@
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
*/
#ifndef F1AP_CU_UE_CONTEXT_MANAGEMENT_H_
#define F1AP_CU_UE_CONTEXT_MANAGEMENT_H_
/*
* UE Context Setup
*/
int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance);
int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_handle_UE_CONTEXT_SETUP_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* UE Context Release Request (gNB-DU initiated)
*/
int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* UE Context Release (gNB-CU initiated)
*/
int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
F1AP_UEContextReleaseCommand_t *UEContextReleaseCommand);
int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* UE Context Modification (gNB-CU initiated)
*/
int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance);
int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* UE Context Modification Required (gNB-DU initiated)
*/
int CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance,
F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t);
/*
* UE Inactivity Notification
*/
/*
* Notify
*/
#endif /* F1AP_CU_UE_CONTEXT_MANAGEMENT_H_ */
......@@ -33,12 +33,86 @@
#ifndef F1AP_DU_INTERFACE_MANAGEMENT_H_
#define F1AP_DU_INTERFACE_MANAGEMENT_H_
void DU_send_F1_SETUP_REQUEST(instance_t instance);
/*
* Reset
*/
int DU_handle_RESET(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_send_RESET_ACKKNOWLEDGE(instance_t instance, F1AP_ResetAcknowledge_t *ResetAcknowledge);
int DU_send_RESET(instance_t instance, F1AP_Reset_t *Reset);
int DU_handle_RESET_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* Error Indication
*/
int DU_send_ERROR_INDICATION(instance_t instance, F1AP_F1AP_PDU_t *pdu_p);
int DU_handle_ERROR_INDICATION(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* F1 Setup
*/
int DU_send_F1_SETUP_REQUEST(instance_t instance);
int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_handle_F1_SETUP_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* gNB-DU Configuration Update
*/
int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
instance_t du_mod_idP,
f1ap_setup_req_t *f1ap_du_data);
int DU_handle_gNB_DU_CONFIGURATION_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* gNB-CU Configuration Update
*/
int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
F1AP_GNBCUConfigurationUpdateFailure_t *GNBCUConfigurationUpdateFailure);
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
F1AP_GNBCUConfigurationUpdateAcknowledge_t *GNBCUConfigurationUpdateAcknowledge);
int DU_handle_F1_SETUP_RESPONSE(uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
void DU_handle_F1_SETUP_FAILURE(F1AP_F1AP_PDU_t *pdu_p);
/*
* gNB-DU Resource Coordination
*/
int DU_send_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest);
int DU_handle_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
#endif /* F1AP_DU_INTERFACE_MANAGEMENT_H_ */
\ No newline at end of file
#endif /* F1AP_DU_INTERFACE_MANAGEMENT_H_ */
......@@ -31,6 +31,9 @@
*/
#include "f1ap_common.h"
#include "f1ap_encoder.h"
#include "f1ap_decoder.h"
#include "f1ap_itti_messaging.h"
#include "f1ap_du_rrc_message_transfer.h"
// undefine C_RNTI from
// openair1/PHY/LTE_TRANSPORT/transport_common.h which
......@@ -41,12 +44,15 @@
extern f1ap_setup_req_t *f1ap_du_data;
/* DL RRC Message Transfer */
void DU_handle_DL_RRC_MESSAGE_TRANSFER(F1AP_DLRRCMessageTransfer_t *DLRRCMessageTransfer) {
int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
//void DU_send_UL_RRC_MESSAGE_TRANSFER(F1AP_ULRRCMessageTransfer_t *ULRRCMessageTransfer) {
void DU_send_UL_RRC_MESSAGE_TRANSFER(void) {
int DU_send_UL_RRC_MESSAGE_TRANSFER(void) {
F1AP_F1AP_PDU_t pdu;
F1AP_ULRRCMessageTransfer_t *out;
F1AP_ULRRCMessageTransferIEs_t *ie;
......@@ -105,6 +111,7 @@ void DU_send_UL_RRC_MESSAGE_TRANSFER(void) {
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n");
return -1;
}
printf("\n");
......@@ -115,10 +122,12 @@ void DU_send_UL_RRC_MESSAGE_TRANSFER(void) {
// printf("Failed to decode F1 setup request\n");
// }
//AssertFatal(1==0,"Not implemented yet\n");
return 0;
}
/* UL RRC Message Transfer */
void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
module_id_t module_idP,
int CC_idP,
int UE_id,
......@@ -163,7 +172,7 @@ void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[0], f1ap_du_data->mnc[0], f1ap_du_data->mnc_digit_length[0],
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[0], &nRCGI.nRCellIdentity);
ie->value.choice.NRCGI = nRCGI;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
......@@ -202,14 +211,16 @@ void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n");
return -1;
}
printf("\n");
//du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0);
du_f1ap_itti_send_sctp_data_req(0, f1ap_du_data->assoc_id, buffer, len, 0);
return 0;
/* decode */
// if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
// printf("Failed to decode F1 setup request\n");
// }
//AssertFatal(1==0,"Not implemented yet\n");
}
\ No newline at end of file
}
......@@ -34,4 +34,19 @@
#ifndef F1AP_DU_RRC_MESSAGE_TRANSFER_H_
#define F1AP_DU_RRC_MESSAGE_TRANSFER_H_
#endif /* F1AP_DU_RRC_MESSAGE_TRANSFER_H_ */
\ No newline at end of file
int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_send_UL_RRC_MESSAGE_TRANSFER(void);
int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
module_id_t module_idP,
int CC_idP,
int UE_id,
rnti_t rntiP,
uint8_t *sduP,
sdu_size_t sdu_lenP);
#endif /* F1AP_DU_RRC_MESSAGE_TRANSFER_H_ */
......@@ -97,13 +97,13 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
DU_send_F1_SETUP_REQUEST(instance);
}
void du_task_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind)
void du_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind)
{
int result;
DevAssert(sctp_data_ind != NULL);
f1ap_handle_message(sctp_data_ind->assoc_id, sctp_data_ind->stream,
f1ap_handle_message(instance, sctp_data_ind->assoc_id, sctp_data_ind->stream,
sctp_data_ind->buffer, sctp_data_ind->buffer_length);
result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
......@@ -154,7 +154,8 @@ void *F1AP_DU_task(void *arg) {
case SCTP_DATA_IND:
// ex: any F1 incoming message for DU ends here
LOG_I(DU_F1AP, "SCTP_DATA_IND\n");
du_task_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind);
du_task_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_data_ind);
break;
case TERMINATE_MESSAGE:
......
......@@ -24,7 +24,7 @@
void du_task_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1ap_setup_req);
void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
void du_task_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind);
void du_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind);
void *F1AP_DU_task(void *arg);
#endif /* DU_F1AP_TASK_H_ */
......@@ -19,8 +19,8 @@
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
/*! \file f1ap_du_ue_context_management.c
* \brief F1AP UE Context Management, DU side
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
......@@ -31,20 +31,22 @@
*/
#include "f1ap_common.h"
#include "f1ap_encoder.h"
#include "f1ap_decoder.h"
#include "f1ap_itti_messaging.h"
#include "f1ap_du_ue_context_management.h"
extern f1ap_setup_req_t *f1ap_du_data;
/*
UE Context Setup
*/
void DU_handle_UE_CONTEXT_SETUP_REQUEST(F1AP_UEContextSetupRequest_t *UEContextSetupRequest) {
int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
//void DU_send_UE_CONTEXT_SETUP_RESPONSE(F1AP_UEContextSetupResponse_t *UEContextSetupResponse) {
void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) {
int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance) {
F1AP_F1AP_PDU_t pdu;
F1AP_UEContextSetupResponse_t *out;
F1AP_UEContextSetupResponseIEs_t *ie;
......@@ -259,18 +261,8 @@ void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) {
/* - nRCGI */
F1AP_NRCGI_t nRCGI; // issue here
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &nRCGI.pLMN_Identity);
//
// INT32_TO_BIT_STRING(123, &nRCGI.nRCellIdentity);
// nRCGI.nRCellIdentity.buf = malloc((36+7)/8);
// nRCGI.nRCellIdentity.size = (36+7)/8;
// nRCGI.nRCellIdentity.bits_unused = 4;
// nRCGI.nRCellIdentity.buf[0] = 123;
//nRCGI.nRCellIdentity = 15;
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[0], &nRCGI.nRCellIdentity);
sCell_FailedtoSetup_item.sCell_ID = nRCGI;
......@@ -307,7 +299,7 @@ void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) {
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n");
return;
return -1;
}
printf("\n");
......@@ -317,41 +309,41 @@ void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) {
// printf("Failed to decode F1 setup request\n");
// }
//du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0);
return 0;
}
void DU_send_UE_CONTEXT_SETUP_FAILURE(F1AP_UEContextSetupFailure_t UEContextSetupFailure) {
int DU_send_UE_CONTEXT_SETUP_FAILURE(instance_t instance) {
AssertFatal(1==0,"Not implemented yet\n");
}
/*
UE Context Release Request (gNB-DU initiated).
*/
void DU_send_UE_CONTEXT_RELEASE_REQUEST(F1AP_UEContextReleaseRequest_t *UEContextReleaseRequest) {
int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_handle_UE_CONTEXT_RELEASE_COMMAND(F1AP_UEContextReleaseCommand_t *UEContextReleaseCommand) {
int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_send_UE_CONTEXT_RELEASE_COMPLETE(F1AP_UEContextReleaseComplete_t *UEContextReleaseComplete) {
int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance) {
AssertFatal(1==0,"Not implemented yet\n");
}
/*
UE Context Modification (gNB-CU initiated)
*/
void DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(F1AP_UEContextModificationRequest_t *UEContextModificationRequest) {
int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
//void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(F1AP_UEContextModificationResponse_t *UEContextModificationResponse) {
void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) {
int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance) {
F1AP_F1AP_PDU_t pdu;
F1AP_UEContextModificationResponse_t *out;
F1AP_UEContextModificationResponseIEs_t *ie;
......@@ -625,7 +617,7 @@ void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) {
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[0], &nRCGI.nRCellIdentity);
scell_failedtoSetupMod_item.sCell_ID = nRCGI;
......@@ -697,7 +689,7 @@ void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) {
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n");
return;
return -1;
}
printf("\n");
......@@ -707,17 +699,21 @@ void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) {
// printf("Failed to decode F1 setup request\n");
// }
//du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0);
return 0;
}
void DU_send_UE_CONTEXT_MODIFICATION_FAILURE(F1AP_UEContextModificationFailure_t UEContextModificationFailure) {
int DU_send_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(F1AP_UEContextModificationRequired_t *UEContextModificationRequired) {
int DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance) {
AssertFatal(1==0,"Not implemented yet\n");
}
void DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM(F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t) {
int DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
\ No newline at end of file
}
......@@ -33,4 +33,59 @@
#ifndef F1AP_DU_UE_CONTEXT_MANAGEMENT_H_
#define F1AP_DU_UE_CONTEXT_MANAGEMENT_H_
#endif /* F1AP_DU_UE_CONTEXT_MANAGEMENT_H_ */
\ No newline at end of file
/*
* UE Context Setup
*/
int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance);
int DU_send_UE_CONTEXT_SETUP_FAILURE(instance_t instance);
/*
* UE Context Release Request (gNB-DU initiated)
*/
int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance);
/*
* UE Context Release (gNB-CU initiated)
*/
int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance);
/*
* UE Context Modification (gNB-CU initiated)
*/
int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance);
int DU_send_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance);
/*
* UE Context Modification Required (gNB-DU initiated)
*/
int DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance);
int DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* UE Inactivity Notification
*/
/*
* Notify
*/
#endif /* F1AP_DU_UE_CONTEXT_MANAGEMENT_H_ */
......@@ -32,8 +32,10 @@
#include "f1ap_common.h"
#include "f1ap_handlers.h"
#include "f1ap_decoder.h"
#include "f1ap_cu_interface_management.h"
#include "f1ap_du_interface_management.h"
#include "f1ap_cu_rrc_message_transfer.h"
extern f1ap_setup_req_t *f1ap_du_data_from_du;
......@@ -42,19 +44,19 @@ f1ap_message_decoded_callback f1ap_messages_callback[][3] = {
{ 0, 0, 0 }, /* Reset */
{ CU_handle_F1_SETUP_REQUEST, DU_handle_F1_SETUP_RESPONSE, 0 }, /* F1Setup */
{ CU_handle_F1_SETUP_REQUEST, DU_handle_F1_SETUP_RESPONSE, DU_handle_F1_SETUP_FAILURE }, /* F1Setup */
{ 0, 0, 0 }, /* ErrorIndication */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* gNBDUConfigurationUpdate */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* gNBCUConfigurationUpdate */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* UEContextSetup */
{ 0, 0, 0 }, /* gNBDUConfigurationUpdate */
{ 0, 0, 0 }, /* gNBCUConfigurationUpdate */
{ 0, 0, 0 }, /* UEContextSetup */
{ 0, 0, 0 }, /* UEContextRelease */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* UEContextModification */
{ 0, 0, 0 }, /* UEContextModification */
{ 0, 0, 0 }, /* UEContextModificationRequired */
{ 0, 0, 0 }, /* UEMobilityCommand */
{ 0, 0, 0 }, /* UEContextReleaseRequest */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* InitialULRRCMessageTransfer */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* DLRRCMessageTransfer */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* ULRRCMessageTransfer */
{ CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER, 0, 0 }, /* InitialULRRCMessageTransfer */
{ 0, 0, 0 }, /* DLRRCMessageTransfer */
{ 0, 0, 0 }, /* ULRRCMessageTransfer */
{ 0, 0, 0 }, /* privateMessage */
{ 0, 0, 0 }, /* UEInactivityNotification */
{ 0, 0, 0 }, /* GNBDUResourceCoordination */
......@@ -77,7 +79,7 @@ static const char *f1ap_direction_String[] = {
return(f1ap_direction_String[f1ap_dir]);
}
int f1ap_handle_message(uint32_t assoc_id, int32_t stream,
int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
const uint8_t * const data, const uint32_t data_length)
{
F1AP_F1AP_PDU_t pdu;
......@@ -115,7 +117,7 @@ int f1ap_handle_message(uint32_t assoc_id, int32_t stream,
/* Calling the right handler */
ret = (*f1ap_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1])
(assoc_id, stream, &pdu);
(instance, assoc_id, stream, &pdu);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu);
return ret;
}
\ No newline at end of file
}
......@@ -33,7 +33,7 @@
#ifndef F1AP_HANDLERS_H_
#define F1AP_HANDLERS_H_
int f1ap_handle_message(uint32_t assoc_id, int32_t stream,
int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
const uint8_t * const data, const uint32_t data_length);
#endif /* F1AP_HANDLERS_H_ */
......@@ -367,7 +367,7 @@ rx_sdu(const module_id_t enb_mod_idP,
ra = &mac->common_channels[CC_idP].ra[ii];
if ((ra->rnti == current_rnti) && (ra->state != IDLE)) {
//int RC.cudu.du_flag = 1;
int du_flag = 1;
//int du_flag = 1;
mac_rrc_data_ind(
enb_mod_idP,
CC_idP,
......@@ -377,7 +377,7 @@ rx_sdu(const module_id_t enb_mod_idP,
(uint8_t *) payload_ptr,
rx_lengths[i],
0,
du_flag
RC.rrc[enb_mod_idP]->node_type
);
// prepare transmission of Msg4(RRCConnectionReconfiguration)
ra->state = MSGCRNTI;
......@@ -619,7 +619,7 @@ rx_sdu(const module_id_t enb_mod_idP,
}
//int RC.cudu.du_flag = 1;
int du_flag = 1;
//int du_flag = 1;
mac_rrc_data_ind(
enb_mod_idP,
CC_idP,
......@@ -629,7 +629,7 @@ rx_sdu(const module_id_t enb_mod_idP,
(uint8_t *) payload_ptr,
rx_lengths[i],
0,
du_flag
RC.rrc[enb_mod_idP]->node_type
);
......
......@@ -226,31 +226,31 @@ mac_rrc_data_req(
}
//--------------------------------------------------------------------------
int8_t
mac_du_data_ind(
const module_id_t module_idP,
const int CC_idP,
const int UE_id,
const rnti_t rntiP,
const uint8_t *sduP,
const sdu_size_t sdu_lenP
)
//--------------------------------------------------------------------------
{
printf(
"[F1 %d][RAPROC] CC_id %d current_rnti %x Received Msg3 from already registered UE %d: length %d, offset %ld\n",
module_idP, CC_idP, rntiP,
UE_id, sdu_lenP, sduP);
DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
module_idP,
CC_idP,
UE_id,
rntiP,
sduP,
sdu_lenP
);
}
// int8_t
// mac_du_data_ind(
// const module_id_t module_idP,
// const int CC_idP,
// const int UE_id,
// const rnti_t rntiP,
// const uint8_t *sduP,
// const sdu_size_t sdu_lenP
// )
// //--------------------------------------------------------------------------
// {
// printf(
// "[F1 %d][RAPROC] CC_id %d current_rnti %x Received Msg3 from already registered UE %d: length %d, offset %ld\n",
// module_idP, CC_idP, rntiP,
// UE_id, sdu_lenP, sduP);
// DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
// module_idP,
// CC_idP,
// UE_id,
// rntiP,
// sduP,
// sdu_lenP
// );
// }
//------------------------------------------------------------------------------
int8_t
......@@ -265,21 +265,25 @@ mac_rrc_data_ind(
const uint8_t* sduP,
const sdu_size_t sdu_lenP,
const uint8_t mbsfn_sync_areaP,
const int du_flag
const int node_type
)
//--------------------------------------------------------------------------
{
// navid update / Bing-Kai modify
if (du_flag) {
mac_du_data_ind(
module_idP,
CC_id,
UE_id,
rntiP,
sduP,
sdu_lenP);
}
LOG_E(RRC, "node_type == %d \n" , node_type);
if (node_type == ngran_eNB_DU) {
LOG_W(RRC,"[DU %d][RAPROC] Received SDU for CCCH on SRB %d length %d for UE id %d RNTI %x \n",
module_idP, srb_idP, sdu_lenP, UE_id, rntiP);
DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
module_idP,
CC_id,
UE_id,
rntiP,
sduP,
sdu_lenP
);
return(0);
}
SRB_INFO *Srb_info;
protocol_ctxt_t ctxt;
......
......@@ -428,7 +428,7 @@ mac_rrc_data_ind(
const uint8_t* sduP,
const sdu_size_t sdu_lenP,
const uint8_t mbsfn_sync_areaP,
const int du_flag
const int node_type
);
int8_t
......
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