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 { ...@@ -127,10 +127,15 @@ typedef struct f1ap_setup_req_s {
uint8_t sul_scs; uint8_t sul_scs;
uint8_t sul_nrb; uint8_t sul_nrb;
uint8_t num_frequency_bands; uint8_t ul_num_frequency_bands;
uint16_t nr_band[32]; uint16_t ul_nr_band[32];
uint8_t num_sul_frequency_bands; uint8_t ul_num_sul_frequency_bands;
uint16_t nr_sul_band[32]; 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; } fdd;
struct { struct {
......
...@@ -2473,11 +2473,21 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) { ...@@ -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) // 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.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).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).ranac[k] = 0;
F1AP_SETUP_REQ (msg_p).mib[k] = rrc->carrier[0].MIB; F1AP_SETUP_REQ (msg_p).mib[k] = rrc->carrier[0].MIB;
F1AP_SETUP_REQ (msg_p).sib1[k] = rrc->carrier[0].SIB1; F1AP_SETUP_REQ (msg_p).sib1[k] = rrc->carrier[0].SIB1;
......
...@@ -419,6 +419,7 @@ inline void ASN_DEBUG(const char *fmt, ...); ...@@ -419,6 +419,7 @@ inline void ASN_DEBUG(const char *fmt, ...);
/** \brief Function callback prototype. /** \brief Function callback prototype.
**/ **/
typedef int (*f1ap_message_decoded_callback)( typedef int (*f1ap_message_decoded_callback)(
instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *message_p F1AP_F1AP_PDU_t *message_p
......
...@@ -31,25 +31,32 @@ ...@@ -31,25 +31,32 @@
*/ */
#include "f1ap_common.h" #include "f1ap_common.h"
#include "f1ap_du_interface_management.h" #include "f1ap_encoder.h"
#include "f1ap_decoder.h"
#include "f1ap_itti_messaging.h"
#include "f1ap_cu_interface_management.h"
extern f1ap_setup_req_t *f1ap_du_data_from_du; extern f1ap_setup_req_t *f1ap_du_data_from_du;
/*
Reset int CU_send_RESET(instance_t instance, F1AP_Reset_t *Reset) {
*/
void CU_send_RESET(F1AP_Reset_t *Reset) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
void CU_handle_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) { int CU_handle_RESET_ACKKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
void CU_handle_RESET(F1AP_Reset_t *Reset) { int CU_handle_RESET(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
void CU_send_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) { int CU_send_RESET_ACKNOWLEDGE(instance_t instance, F1AP_ResetAcknowledge_t *ResetAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -57,11 +64,14 @@ void CU_send_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) { ...@@ -57,11 +64,14 @@ void CU_send_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) {
/* /*
Error Indication Error Indication
*/ */
void CU_handle_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) { int CU_handle_ERROR_INDICATION(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
void CU_send_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) { int CU_send_ERROR_INDICATION(instance_t instance, F1AP_ErrorIndication_t *ErrorIndication) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -69,9 +79,10 @@ void CU_send_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) { ...@@ -69,9 +79,10 @@ void CU_send_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) {
/* /*
F1 Setup F1 Setup
*/ */
int CU_handle_F1_SETUP_REQUEST(uint32_t assoc_id, int CU_handle_F1_SETUP_REQUEST(instance_t instance,
uint32_t stream, uint32_t assoc_id,
F1AP_F1AP_PDU_t *pdu) uint32_t stream,
F1AP_F1AP_PDU_t *pdu)
{ {
printf("CU_handle_F1_SETUP_REQUEST\n"); printf("CU_handle_F1_SETUP_REQUEST\n");
...@@ -127,7 +138,6 @@ int CU_handle_F1_SETUP_REQUEST(uint32_t assoc_id, ...@@ -127,7 +138,6 @@ int CU_handle_F1_SETUP_REQUEST(uint32_t assoc_id,
served_celles_item_p = &(((F1AP_GNB_DU_Served_Cells_ItemIEs_t *)ie->value.choice.GNB_DU_Served_Cells_List.list.array[i])->value.choice.GNB_DU_Served_Cells_Item); served_celles_item_p = &(((F1AP_GNB_DU_Served_Cells_ItemIEs_t *)ie->value.choice.GNB_DU_Served_Cells_List.list.array[i])->value.choice.GNB_DU_Served_Cells_Item);
/* tac */ /* tac */
// @issue in here
OCTET_STRING_TO_INT16(&(served_celles_item_p->served_Cell_Information.fiveGS_TAC), F1AP_SETUP_REQ(message_p).tac[i]); OCTET_STRING_TO_INT16(&(served_celles_item_p->served_Cell_Information.fiveGS_TAC), F1AP_SETUP_REQ(message_p).tac[i]);
printf ("F1AP_SETUP_REQ(message_p).tac[%d] %d \n", i, F1AP_SETUP_REQ(message_p).tac[i]); printf ("F1AP_SETUP_REQ(message_p).tac[%d] %d \n", i, F1AP_SETUP_REQ(message_p).tac[i]);
...@@ -212,11 +222,17 @@ int CU_handle_F1_SETUP_REQUEST(uint32_t assoc_id, ...@@ -212,11 +222,17 @@ int CU_handle_F1_SETUP_REQUEST(uint32_t assoc_id,
// } tdd; // } tdd;
// } nr_mode_info[F1AP_MAX_NB_CELLS]; // } nr_mode_info[F1AP_MAX_NB_CELLS];
if (num_cells_available > 0) {
return itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(assoc_id), message_p); itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(instance), message_p);
} else {
CU_send_F1_SETUP_FAILURE(instance);
return -1;
}
return 0;
} }
void CU_send_F1_SETUP_RESPONSE(instance_t instance, f1ap_setup_resp_t *f1ap_setup_resp) { int CU_send_F1_SETUP_RESPONSE(instance_t instance,
f1ap_setup_resp_t *f1ap_setup_resp) {
module_id_t enb_mod_idP; module_id_t enb_mod_idP;
module_id_t cu_mod_idP; module_id_t cu_mod_idP;
...@@ -337,6 +353,7 @@ void CU_send_F1_SETUP_RESPONSE(instance_t instance, f1ap_setup_resp_t *f1ap_setu ...@@ -337,6 +353,7 @@ void CU_send_F1_SETUP_RESPONSE(instance_t instance, f1ap_setup_resp_t *f1ap_setu
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); printf("Failed to encode F1 setup request\n");
return -1;
} }
// printf("\n"); // printf("\n");
...@@ -348,12 +365,92 @@ void CU_send_F1_SETUP_RESPONSE(instance_t instance, f1ap_setup_resp_t *f1ap_setu ...@@ -348,12 +365,92 @@ void CU_send_F1_SETUP_RESPONSE(instance_t instance, f1ap_setup_resp_t *f1ap_setu
//printf("F1 setup response present = %d\n", out->value.present); //printf("F1 setup response present = %d\n", out->value.present);
//f1ap_send_sctp_data_req(instance_p->instance, f1ap_mme_data_p->assoc_id, buffer, len, 0); //f1ap_send_sctp_data_req(instance_p->instance, f1ap_mme_data_p->assoc_id, buffer, len, 0);
return 0;
} }
void CU_send_F1_SETUP_FAILURE(F1AP_F1SetupFailure_t *F1SetupFailure) { int CU_send_F1_SETUP_FAILURE(instance_t instance) {
AssertFatal(1==0,"Not implemented yet\n"); printf("CU_send_F1_SETUP_FAILURE\n");
//AssertFatal(1==0,"Not implemented yet\n");
//f1ap_send_sctp_data_req(instance_p->instance, f1ap_mme_data_p->assoc_id, buffer, len, 0); module_id_t enb_mod_idP;
module_id_t cu_mod_idP;
enb_mod_idP = (module_id_t)12;
cu_mod_idP = (module_id_t)34;
F1AP_F1AP_PDU_t pdu;
F1AP_F1SetupFailure_t *out;
F1AP_F1SetupFailureIEs_t *ie;
uint8_t *buffer;
uint32_t len;
/* Create */
/* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_unsuccessfulOutcome;
pdu.choice.unsuccessfulOutcome = (F1AP_UnsuccessfulOutcome_t *)calloc(1, sizeof(F1AP_UnsuccessfulOutcome_t));
pdu.choice.unsuccessfulOutcome->procedureCode = F1AP_ProcedureCode_id_F1Setup;
pdu.choice.unsuccessfulOutcome->criticality = F1AP_Criticality_reject;
pdu.choice.unsuccessfulOutcome->value.present = F1AP_UnsuccessfulOutcome__value_PR_F1SetupFailure;
out = &pdu.choice.unsuccessfulOutcome->value.choice.F1SetupFailure;
/* mandatory */
/* c1. Transaction ID (integer value)*/
ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_F1SetupFailureIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, cu_mod_idP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. Cause */
ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Cause;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_F1SetupFailureIEs__value_PR_Cause;
ie->value.choice.Cause.present = F1AP_Cause_PR_radioNetwork;
ie->value.choice.Cause.choice.radioNetwork = F1AP_CauseRadioNetwork_unspecified;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c3. TimeToWait */
if (0) {
ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_TimeToWait;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_F1SetupFailureIEs__value_PR_TimeToWait;
ie->value.choice.TimeToWait = F1AP_TimeToWait_v10s;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* optional */
/* c4. CriticalityDiagnostics*/
if (0) {
ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_CriticalityDiagnostics;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_F1SetupFailureIEs__value_PR_CriticalityDiagnostics;
ie->value.choice.CriticalityDiagnostics.procedureCode = (F1AP_ProcedureCode_t *)calloc(1, sizeof(F1AP_ProcedureCode_t));
*ie->value.choice.CriticalityDiagnostics.procedureCode = F1AP_ProcedureCode_id_UEContextSetup;
ie->value.choice.CriticalityDiagnostics.triggeringMessage = (F1AP_TriggeringMessage_t *)calloc(1, sizeof(F1AP_TriggeringMessage_t));
*ie->value.choice.CriticalityDiagnostics.triggeringMessage = F1AP_TriggeringMessage_initiating_message;
ie->value.choice.CriticalityDiagnostics.procedureCriticality = (F1AP_Criticality_t *)calloc(1, sizeof(F1AP_Criticality_t));
*ie->value.choice.CriticalityDiagnostics.procedureCriticality = F1AP_Criticality_reject;
ie->value.choice.CriticalityDiagnostics.transactionID = (F1AP_TransactionID_t *)calloc(1, sizeof(F1AP_TransactionID_t));
*ie->value.choice.CriticalityDiagnostics.transactionID = 0;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n");
return -1;
}
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
return 0;
} }
...@@ -362,15 +459,20 @@ void CU_send_F1_SETUP_FAILURE(F1AP_F1SetupFailure_t *F1SetupFailure) { ...@@ -362,15 +459,20 @@ void CU_send_F1_SETUP_FAILURE(F1AP_F1SetupFailure_t *F1SetupFailure) {
gNB-DU Configuration Update gNB-DU Configuration Update
*/ */
void CU_handle_gNB_DU_CONFIGURATION_UPDATE(F1AP_GNBDUConfigurationUpdate_t *GNBDUConfigurationUpdate) { int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
void CU_send_gNB_DU_CONFIGURATION_FAILURE(F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure) { int CU_send_gNB_DU_CONFIGURATION_FAILURE(instance_t instance,
F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
void CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge) { int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -381,7 +483,7 @@ void CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBDUConfigurationUpda ...@@ -381,7 +483,7 @@ void CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBDUConfigurationUpda
*/ */
//void CU_send_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) { //void CU_send_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) {
void CU_send_gNB_CU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du_mod_idP) { int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_idP) {
F1AP_F1AP_PDU_t pdu; F1AP_F1AP_PDU_t pdu;
F1AP_GNBCUConfigurationUpdate_t *out; F1AP_GNBCUConfigurationUpdate_t *out;
F1AP_GNBCUConfigurationUpdateIEs_t *ie; F1AP_GNBCUConfigurationUpdateIEs_t *ie;
...@@ -411,7 +513,7 @@ void CU_send_gNB_CU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -411,7 +513,7 @@ void CU_send_gNB_CU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
ie->id = F1AP_ProtocolIE_ID_id_TransactionID; ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID; ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP); ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(instance, du_mod_idP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
...@@ -747,21 +849,36 @@ void CU_send_gNB_CU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -747,21 +849,36 @@ void CU_send_gNB_CU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); printf("Failed to encode F1 setup request\n");
return; return -1;
} }
printf("\n"); cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
return 0;
/* decode */
if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
printf("Failed to decode F1 setup request\n");
}
} }
void CU_handle_gNB_CU_CONFIGURATION_UPDATE_FALIURE(F1AP_GNBCUConfigurationUpdateFailure_t *GNBCUConfigurationUpdateFailure) { int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
void CU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBCUConfigurationUpdateAcknowledge_t *GNBCUConfigurationUpdateAcknowledge) { int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(0, "Not implemented yet\n");
}
int CU_send_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse) {
AssertFatal(0, "Not implemented yet\n");
}
...@@ -33,12 +33,79 @@ ...@@ -33,12 +33,79 @@
#ifndef F1AP_CU_INTERFACE_MANAGEMENT_H_ #ifndef F1AP_CU_INTERFACE_MANAGEMENT_H_
#define F1AP_CU_INTERFACE_MANAGEMENT_H_ #define F1AP_CU_INTERFACE_MANAGEMENT_H_
int CU_handle_F1_SETUP_REQUEST(uint32_t assoc_id, /*
uint32_t stream, * Reset
F1AP_F1AP_PDU_t *pdu); */
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_ */ #endif /* F1AP_CU_INTERFACE_MANAGEMENT_H_ */
\ No newline at end of file
...@@ -31,21 +31,117 @@ ...@@ -31,21 +31,117 @@
*/ */
#include "f1ap_common.h" #include "f1ap_common.h"
#include "f1ap_encoder.h"
#include "f1ap_decoder.h"
#include "f1ap_itti_messaging.h"
#include "f1ap_cu_rrc_message_transfer.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 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 // decode the F1 message
// get the rrc message from the contauiner // get the rrc message from the contauiner
// call func rrc_eNB_decode_ccch: <-- needs some update here // 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 // 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) // 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) { ...@@ -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(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_F1AP_PDU_t pdu;
F1AP_DLRRCMessageTransfer_t *out; F1AP_DLRRCMessageTransfer_t *out;
F1AP_DLRRCMessageTransferIEs_t *ie; F1AP_DLRRCMessageTransferIEs_t *ie;
...@@ -150,6 +246,7 @@ void CU_send_DL_RRC_MESSAGE_TRANSFER(void) { ...@@ -150,6 +246,7 @@ void CU_send_DL_RRC_MESSAGE_TRANSFER(void) {
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); printf("Failed to encode F1 setup request\n");
return -1;
} }
printf("\n"); printf("\n");
...@@ -157,14 +254,19 @@ void CU_send_DL_RRC_MESSAGE_TRANSFER(void) { ...@@ -157,14 +254,19 @@ void CU_send_DL_RRC_MESSAGE_TRANSFER(void) {
/* decode */ /* decode */
if (f1ap_decode_pdu(&pdu, buffer, len) > 0) { if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
printf("Failed to decode F1 setup request\n"); printf("Failed to decode F1 setup request\n");
return -1;
} }
//AssertFatal(1==0,"Not implemented yet\n");
return 0;
} }
/* /*
UL RRC Message Transfer 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"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -33,4 +33,16 @@ ...@@ -33,4 +33,16 @@
#ifndef F1AP_CU_RRC_MESSAGE_TRANSFER_H_ #ifndef F1AP_CU_RRC_MESSAGE_TRANSFER_H_
#define F1AP_CU_RRC_MESSAGE_TRANSFER_H_ #define F1AP_CU_RRC_MESSAGE_TRANSFER_H_
#endif /* F1AP_CU_RRC_MESSAGE_TRANSFER_H_ */ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
\ No newline at end of file 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 ...@@ -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; 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; int result;
DevAssert(sctp_data_ind != NULL); 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); sctp_data_ind->buffer, sctp_data_ind->buffer_length);
result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer); result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
...@@ -132,7 +132,8 @@ void *F1AP_CU_task(void *arg) { ...@@ -132,7 +132,8 @@ void *F1AP_CU_task(void *arg) {
case SCTP_DATA_IND: case SCTP_DATA_IND:
LOG_I(CU_F1AP, "SCTP_DATA_IND\n"); 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; break;
case F1AP_SETUP_RESP: // from rrc case F1AP_SETUP_RESP: // from rrc
......
...@@ -24,7 +24,7 @@ ...@@ -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_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_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 cu_task_send_sctp_init_req(instance_t enb_id);
void *F1AP_CU_task(void *arg); void *F1AP_CU_task(void *arg);
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
/*! \file f1ap_du_interface_management.h /*! \file f1ap_cu_ue_context_management.c
* \brief f1ap interface management for DU * \brief F1AP UE Context Management, CU side
* \author EURECOM/NTUST * \author EURECOM/NTUST
* \date 2018 * \date 2018
* \version 0.1 * \version 0.1
...@@ -30,14 +30,14 @@ ...@@ -30,14 +30,14 @@
* \warning * \warning
*/ */
/*
UE Context Setup
*/
#include "f1ap_common.h" #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(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_F1AP_PDU_t pdu;
F1AP_UEContextSetupRequest_t *out; F1AP_UEContextSetupRequest_t *out;
F1AP_UEContextSetupRequestIEs_t *ie; F1AP_UEContextSetupRequestIEs_t *ie;
...@@ -357,7 +357,7 @@ void CU_send_UE_CONTEXT_SETUP_REQUEST(void) { ...@@ -357,7 +357,7 @@ void CU_send_UE_CONTEXT_SETUP_REQUEST(void) {
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); printf("Failed to encode F1 setup request\n");
return; return -1;
} }
printf("\n"); printf("\n");
...@@ -365,44 +365,51 @@ void CU_send_UE_CONTEXT_SETUP_REQUEST(void) { ...@@ -365,44 +365,51 @@ void CU_send_UE_CONTEXT_SETUP_REQUEST(void) {
/* decode */ /* decode */
if (f1ap_decode_pdu(&pdu, buffer, len) > 0) { if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
printf("Failed to decode F1 setup request\n"); printf("Failed to decode F1 setup request\n");
return -1;
} }
//AssertFatal(1==0,"Not implemented yet\n"); //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"); 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"); AssertFatal(1==0,"Not implemented yet\n");
} }
/* int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
UE Context Release (gNB-CU initiated) uint32_t assoc_id,
*/ uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
void CU_handle_UE_CONTEXT_RELEASE_REQUEST(F1AP_UEContextReleaseRequest_t *UEContextReleaseRequest) {
AssertFatal(1==0,"Not implemented yet\n"); 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"); 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"); 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(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_F1AP_PDU_t pdu;
F1AP_UEContextModificationRequest_t *out; F1AP_UEContextModificationRequest_t *out;
F1AP_UEContextModificationRequestIEs_t *ie; F1AP_UEContextModificationRequestIEs_t *ie;
...@@ -863,7 +870,7 @@ void CU_send_UE_CONTEXT_MODIFICATION_REQUEST(void) { ...@@ -863,7 +870,7 @@ void CU_send_UE_CONTEXT_MODIFICATION_REQUEST(void) {
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); printf("Failed to encode F1 setup request\n");
return; return -1;
} }
printf("\n"); printf("\n");
...@@ -871,22 +878,34 @@ void CU_send_UE_CONTEXT_MODIFICATION_REQUEST(void) { ...@@ -871,22 +878,34 @@ void CU_send_UE_CONTEXT_MODIFICATION_REQUEST(void) {
/* decode */ /* decode */
if (f1ap_decode_pdu(&pdu, buffer, len) > 0) { if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
printf("Failed to decode F1 setup request\n"); 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"); 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"); 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"); 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"); AssertFatal(1==0,"Not implemented yet\n");
} }
\ No newline at end of file
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
/*! \file f1ap_du_interface_management.h /*! \file f1ap_cu_ue_context_management.h
* \brief f1ap interface management for DU * \brief header file of CU UE Context management
* \author EURECOM/NTUST * \author EURECOM/NTUST
* \date 2018 * \date 2018
* \version 0.1 * \version 0.1
...@@ -28,4 +28,74 @@ ...@@ -28,4 +28,74 @@
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note * \note
* \warning * \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_ */
...@@ -31,30 +31,34 @@ ...@@ -31,30 +31,34 @@
*/ */
#include "f1ap_common.h" #include "f1ap_common.h"
#include "f1ap_encoder.h"
#include "f1ap_decoder.h"
#include "f1ap_itti_messaging.h"
#include "f1ap_du_interface_management.h" #include "f1ap_du_interface_management.h"
#include "assertions.h" #include "assertions.h"
extern f1ap_setup_req_t *f1ap_du_data; extern f1ap_setup_req_t *f1ap_du_data;
/* int DU_handle_RESET(instance_t instance,
Reset uint32_t assoc_id,
*/ uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
void DU_handle_RESET(F1AP_Reset_t *Reset) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
void DU_send_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) { int DU_send_RESET_ACKKNOWLEDGE(instance_t instance, F1AP_ResetAcknowledge_t *ResetAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
void DU_send_RESET(F1AP_Reset_t *Reset) { int DU_send_RESET(instance_t instance, F1AP_Reset_t *Reset) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
void DU_handle_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) { int DU_handle_RESET_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -63,11 +67,14 @@ void DU_handle_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) { ...@@ -63,11 +67,14 @@ void DU_handle_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) {
Error Indication Error Indication
*/ */
void DU_send_ERROR_INDICATION(struct F1AP_F1AP_PDU_t *pdu_p) { int DU_send_ERROR_INDICATION(instance_t instance, F1AP_F1AP_PDU_t *pdu_p) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
void DU_handle_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) { int DU_handle_ERROR_INDICATION(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -77,7 +84,7 @@ void DU_handle_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) { ...@@ -77,7 +84,7 @@ void DU_handle_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) {
*/ */
// SETUP REQUEST // SETUP REQUEST
void DU_send_F1_SETUP_REQUEST(instance_t instance) { int DU_send_F1_SETUP_REQUEST(instance_t instance) {
module_id_t enb_mod_idP; module_id_t enb_mod_idP;
module_id_t du_mod_idP; module_id_t du_mod_idP;
...@@ -203,73 +210,157 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance) { ...@@ -203,73 +210,157 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance) {
//f1ap_du_data->fdd_flag = 1; //f1ap_du_data->fdd_flag = 1;
if (f1ap_du_data->fdd_flag) { // FDD if (f1ap_du_data->fdd_flag) { // FDD
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD; nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD;
/* > FDD >> FDD Info */
F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t)); F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t));
/* >>> UL NRFreqInfo */
fDD_Info->uL_NRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].fdd.ul_nr_arfcn;
F1AP_FreqBandNrItem_t ul_freqBandNrItem;
memset((void *)&ul_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
ul_freqBandNrItem.freqBandIndicatorNr = 777L;
F1AP_SupportedSULFreqBandItem_t ul_supportedSULFreqBandItem;
memset((void *)&ul_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
ul_supportedSULFreqBandItem.freqBandIndicatorNr = 777L;
ASN_SEQUENCE_ADD(&ul_freqBandNrItem.supportedSULBandList.list, &ul_supportedSULFreqBandItem);
ASN_SEQUENCE_ADD(&fDD_Info->uL_NRFreqInfo.freqBandListNr.list, &ul_freqBandNrItem);
/* >>> DL NRFreqInfo */ /* FDD.1 UL NRFreqInfo */
fDD_Info->dL_NRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].fdd.dl_nr_arfcn; /* FDD.1.1 UL NRFreqInfo ARFCN */
fDD_Info->uL_NRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].fdd.ul_nr_arfcn; // Integer
F1AP_FreqBandNrItem_t dl_freqBandNrItem;
memset((void *)&dl_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t)); /* FDD.1.2 F1AP_SUL_Information */
dl_freqBandNrItem.freqBandIndicatorNr = 777L; if(0) { // Optional
F1AP_SUL_Information_t *fdd_sul_info = (F1AP_SUL_Information_t *)calloc(1, sizeof(F1AP_SUL_Information_t));
F1AP_SupportedSULFreqBandItem_t dl_supportedSULFreqBandItem; fdd_sul_info->sUL_NRARFCN = 0;
memset((void *)&dl_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t)); fdd_sul_info->sUL_transmission_Bandwidth.nRSCS = 0;
dl_supportedSULFreqBandItem.freqBandIndicatorNr = 777L; fdd_sul_info->sUL_transmission_Bandwidth.nRNRB = 0;
ASN_SEQUENCE_ADD(&dl_freqBandNrItem.supportedSULBandList.list, &dl_supportedSULFreqBandItem); fDD_Info->uL_NRFreqInfo.sul_Information = fdd_sul_info;
}
ASN_SEQUENCE_ADD(&fDD_Info->dL_NRFreqInfo.freqBandListNr.list, &dl_freqBandNrItem);
/* FDD.1.3 freqBandListNr */
/* >>> UL Transmission Bandwidth */ int fdd_ul_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].fdd.ul_num_frequency_bands;
printf("fdd_ul_num_available_freq_Bands = %d \n", fdd_ul_num_available_freq_Bands);
int fdd_ul_j;
for (fdd_ul_j=0;
fdd_ul_j<fdd_ul_num_available_freq_Bands;
fdd_ul_j++) {
F1AP_FreqBandNrItem_t nr_freqBandNrItem;
memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
/* FDD.1.3.1 freqBandIndicatorNr*/
nr_freqBandNrItem.freqBandIndicatorNr = f1ap_du_data->nr_mode_info[i].fdd.ul_nr_band[fdd_ul_j]; //
/* FDD.1.3.2 supportedSULBandList*/
int num_available_supported_SULBands = f1ap_du_data->nr_mode_info[i].fdd.ul_num_sul_frequency_bands;
printf("num_available_supported_SULBands = %d \n", num_available_supported_SULBands);
int fdd_ul_k;
for (fdd_ul_k=0;
fdd_ul_k<num_available_supported_SULBands;
fdd_ul_k++) {
F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem;
memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
/* FDD.1.3.2.1 freqBandIndicatorNr */
nr_supportedSULFreqBandItem.freqBandIndicatorNr = f1ap_du_data->nr_mode_info[i].fdd.ul_nr_sul_band[fdd_ul_k]; //
ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
} // for FDD : UL supported_SULBands
ASN_SEQUENCE_ADD(&fDD_Info->uL_NRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
} // for FDD : UL freq_Bands
/* FDD.2 DL NRFreqInfo */
/* FDD.2.1 DL NRFreqInfo ARFCN */
fDD_Info->dL_NRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].fdd.dl_nr_arfcn; // Integer
/* FDD.2.2 F1AP_SUL_Information */
if(0) { // Optional
F1AP_SUL_Information_t *fdd_sul_info = (F1AP_SUL_Information_t *)calloc(1, sizeof(F1AP_SUL_Information_t));
fdd_sul_info->sUL_NRARFCN = 0;
fdd_sul_info->sUL_transmission_Bandwidth.nRSCS = 0;
fdd_sul_info->sUL_transmission_Bandwidth.nRNRB = 0;
fDD_Info->dL_NRFreqInfo.sul_Information = fdd_sul_info;
}
/* FDD.2.3 freqBandListNr */
int fdd_dl_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].fdd.dl_num_frequency_bands;
printf("fdd_dl_num_available_freq_Bands = %d \n", fdd_dl_num_available_freq_Bands);
int fdd_dl_j;
for (fdd_dl_j=0;
fdd_dl_j<fdd_dl_num_available_freq_Bands;
fdd_dl_j++) {
F1AP_FreqBandNrItem_t nr_freqBandNrItem;
memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
/* FDD.2.3.1 freqBandIndicatorNr*/
nr_freqBandNrItem.freqBandIndicatorNr = f1ap_du_data->nr_mode_info[i].fdd.dl_nr_band[fdd_dl_j]; //
/* FDD.2.3.2 supportedSULBandList*/
int num_available_supported_SULBands = f1ap_du_data->nr_mode_info[i].fdd.dl_num_sul_frequency_bands;
printf("num_available_supported_SULBands = %d \n", num_available_supported_SULBands);
int fdd_dl_k;
for (fdd_dl_k=0;
fdd_dl_k<num_available_supported_SULBands;
fdd_dl_k++) {
F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem;
memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
/* FDD.2.3.2.1 freqBandIndicatorNr */
nr_supportedSULFreqBandItem.freqBandIndicatorNr = f1ap_du_data->nr_mode_info[i].fdd.dl_nr_sul_band[fdd_dl_k]; //
ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
} // for FDD : DL supported_SULBands
ASN_SEQUENCE_ADD(&fDD_Info->dL_NRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
} // for FDD : DL freq_Bands
/* FDD.3 UL Transmission Bandwidth */
fDD_Info->uL_Transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].fdd.ul_scs; fDD_Info->uL_Transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].fdd.ul_scs;
fDD_Info->uL_Transmission_Bandwidth.nRNRB = f1ap_du_data->nr_mode_info[i].fdd.ul_nrb; fDD_Info->uL_Transmission_Bandwidth.nRNRB = f1ap_du_data->nr_mode_info[i].fdd.ul_nrb;
/* >>> DL Transmission Bandwidth */ /* FDD.4 DL Transmission Bandwidth */
fDD_Info->dL_Transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].fdd.dl_scs; fDD_Info->dL_Transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].fdd.dl_scs;
fDD_Info->dL_Transmission_Bandwidth.nRNRB = f1ap_du_data->nr_mode_info[i].fdd.dl_nrb; fDD_Info->dL_Transmission_Bandwidth.nRNRB = f1ap_du_data->nr_mode_info[i].fdd.dl_nrb;
nR_Mode_Info.choice.fDD = fDD_Info; nR_Mode_Info.choice.fDD = fDD_Info;
} else { // TDD } else { // TDD
nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_tDD; nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_tDD;
/* > TDD >> TDD Info */
F1AP_TDD_Info_t *tDD_Info = (F1AP_TDD_Info_t *)calloc(1, sizeof(F1AP_TDD_Info_t)); F1AP_TDD_Info_t *tDD_Info = (F1AP_TDD_Info_t *)calloc(1, sizeof(F1AP_TDD_Info_t));
/* >>> ARFCN */
tDD_Info->nRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].tdd.nr_arfcn; // Integer
F1AP_FreqBandNrItem_t nr_freqBandNrItem;
memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
// RK: missing params
nr_freqBandNrItem.freqBandIndicatorNr = 555L;
F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem;
memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
nr_supportedSULFreqBandItem.freqBandIndicatorNr = 444L;
ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
ASN_SEQUENCE_ADD(&tDD_Info->nRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
tDD_Info->transmission_Bandwidth.nRSCS= f1ap_du_data->nr_mode_info[i].tdd.scs; /* TDD.1 nRFreqInfo */
tDD_Info->transmission_Bandwidth.nRNRB= f1ap_du_data->nr_mode_info[i].tdd.nrb; /* TDD.1.1 nRFreqInfo ARFCN */
tDD_Info->nRFreqInfo.nRARFCN = f1ap_du_data->nr_mode_info[i].tdd.nr_arfcn; // Integer
/* TDD.1.2 F1AP_SUL_Information */
if(0) { // Optional
F1AP_SUL_Information_t *tdd_sul_info = (F1AP_SUL_Information_t *)calloc(1, sizeof(F1AP_SUL_Information_t));
tdd_sul_info->sUL_NRARFCN = 0;
tdd_sul_info->sUL_transmission_Bandwidth.nRSCS = 0;
tdd_sul_info->sUL_transmission_Bandwidth.nRNRB = 0;
tDD_Info->nRFreqInfo.sul_Information = tdd_sul_info;
}
/* TDD.1.3 freqBandListNr */
int tdd_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].tdd.num_frequency_bands;
printf("tdd_num_available_freq_Bands = %d \n", tdd_num_available_freq_Bands);
int j;
for (j=0;
j<tdd_num_available_freq_Bands;
j++) {
F1AP_FreqBandNrItem_t nr_freqBandNrItem;
memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t));
/* TDD.1.3.1 freqBandIndicatorNr*/
nr_freqBandNrItem.freqBandIndicatorNr = *f1ap_du_data->nr_mode_info[i].tdd.nr_band; //
/* TDD.1.3.2 supportedSULBandList*/
int num_available_supported_SULBands = f1ap_du_data->nr_mode_info[i].tdd.num_sul_frequency_bands;
printf("num_available_supported_SULBands = %d \n", num_available_supported_SULBands);
int k;
for (k=0;
k<num_available_supported_SULBands;
k++) {
F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem;
memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t));
/* TDD.1.3.2.1 freqBandIndicatorNr */
nr_supportedSULFreqBandItem.freqBandIndicatorNr = *f1ap_du_data->nr_mode_info[i].tdd.nr_sul_band; //
ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem);
} // for TDD : supported_SULBands
ASN_SEQUENCE_ADD(&tDD_Info->nRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem);
} // for TDD : freq_Bands
/* TDD.2 transmission_Bandwidth */
tDD_Info->transmission_Bandwidth.nRSCS = f1ap_du_data->nr_mode_info[i].tdd.scs;
tDD_Info->transmission_Bandwidth.nRNRB = f1ap_du_data->nr_mode_info[i].tdd.nrb;
nR_Mode_Info.choice.tDD = tDD_Info; nR_Mode_Info.choice.tDD = tDD_Info;
} } // if nR_Mode_Info
served_cell_information.nR_Mode_Info = nR_Mode_Info; served_cell_information.nR_Mode_Info = nR_Mode_Info;
/* - measurementTimingConfiguration */ /* - measurementTimingConfiguration */
char *measurementTimingConfiguration = "0"; //&f1ap_du_data->measurement_timing_information[i]; // sept. 2018 char *measurementTimingConfiguration = f1ap_du_data->measurement_timing_information[i]; // sept. 2018
OCTET_STRING_fromBuf(&served_cell_information.measurementTimingConfiguration, OCTET_STRING_fromBuf(&served_cell_information.measurementTimingConfiguration,
measurementTimingConfiguration, measurementTimingConfiguration,
...@@ -301,14 +392,18 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance) { ...@@ -301,14 +392,18 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance) {
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); printf("Failed to encode F1 setup request\n");
return -1;
} }
du_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data->assoc_id, buffer, len, 0); du_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data->assoc_id, buffer, len, 0);
return 0;
} }
int DU_handle_F1_SETUP_RESPONSE(uint32_t assoc_id, int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
uint32_t stream, uint32_t assoc_id,
F1AP_F1AP_PDU_t *pdu) uint32_t stream,
F1AP_F1AP_PDU_t *pdu)
{ {
printf("DU_handle_F1_SETUP_RESPONSE\n"); printf("DU_handle_F1_SETUP_RESPONSE\n");
...@@ -413,8 +508,12 @@ int DU_handle_F1_SETUP_RESPONSE(uint32_t assoc_id, ...@@ -413,8 +508,12 @@ int DU_handle_F1_SETUP_RESPONSE(uint32_t assoc_id,
} }
// SETUP FAILURE // SETUP FAILURE
void DU_handle_F1_SETUP_FAILURE(F1AP_F1AP_PDU_t *pdu_p) { int DU_handle_F1_SETUP_FAILURE(instance_t instance,
AssertFatal(1==0,"Not implemented yet\n"); uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
LOG_E(DU_F1AP, "DU_handle_F1_SETUP_FAILURE\n");
return 0;
} }
...@@ -423,7 +522,9 @@ void DU_handle_F1_SETUP_FAILURE(F1AP_F1AP_PDU_t *pdu_p) { ...@@ -423,7 +522,9 @@ void DU_handle_F1_SETUP_FAILURE(F1AP_F1AP_PDU_t *pdu_p) {
*/ */
//void DU_send_gNB_DU_CONFIGURATION_UPDATE(F1AP_GNBDUConfigurationUpdate_t *GNBDUConfigurationUpdate) { //void DU_send_gNB_DU_CONFIGURATION_UPDATE(F1AP_GNBDUConfigurationUpdate_t *GNBDUConfigurationUpdate) {
void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du_mod_idP, f1ap_setup_req_t *f1ap_du_data) { int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
instance_t du_mod_idP,
f1ap_setup_req_t *f1ap_du_data) {
F1AP_F1AP_PDU_t pdu; F1AP_F1AP_PDU_t pdu;
F1AP_GNBDUConfigurationUpdate_t *out; F1AP_GNBDUConfigurationUpdate_t *out;
F1AP_GNBDUConfigurationUpdateIEs_t *ie; F1AP_GNBDUConfigurationUpdateIEs_t *ie;
...@@ -449,7 +550,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -449,7 +550,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
ie->id = F1AP_ProtocolIE_ID_id_TransactionID; ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie->criticality = F1AP_Criticality_reject; ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_TransactionID; ie->value.present = F1AP_GNBDUConfigurationUpdateIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP); ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(instance, du_mod_idP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
...@@ -480,15 +581,15 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -480,15 +581,15 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &nRCGI.pLMN_Identity); 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[i], &nRCGI.nRCellIdentity);
served_cell_information.nRCGI = nRCGI; served_cell_information.nRCGI = nRCGI;
/* - nRPCI */ /* - nRPCI */
served_cell_information.nRPCI = 321L; // int 0..1007 served_cell_information.nRPCI = f1ap_du_data->nr_pci[i]; // int 0..1007
/* - fiveGS_TAC */ /* - fiveGS_TAC */
OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC, OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
"10", &f1ap_du_data->tac[i],
3); 3);
/* - Configured_EPS_TAC */ /* - Configured_EPS_TAC */
...@@ -634,7 +735,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -634,7 +735,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
F1AP_NRCGI_t oldNRCGI; F1AP_NRCGI_t oldNRCGI;
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
&oldNRCGI.pLMN_Identity); &oldNRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &oldNRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[i], &oldNRCGI.nRCellIdentity);
served_cells_to_modify_item.oldNRCGI = oldNRCGI; served_cells_to_modify_item.oldNRCGI = oldNRCGI;
...@@ -646,15 +747,15 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -646,15 +747,15 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[i], &nRCGI.nRCellIdentity);
served_cell_information.nRCGI = nRCGI; served_cell_information.nRCGI = nRCGI;
/* - nRPCI */ /* - nRPCI */
served_cell_information.nRPCI = 321L; // int 0..1007 served_cell_information.nRPCI = f1ap_du_data->nr_pci[i]; // int 0..1007
/* - fiveGS_TAC */ /* - fiveGS_TAC */
OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC, OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
"10", &f1ap_du_data->tac[i],
3); 3);
/* - Configured_EPS_TAC */ /* - Configured_EPS_TAC */
...@@ -800,7 +901,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -800,7 +901,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
F1AP_NRCGI_t oldNRCGI; F1AP_NRCGI_t oldNRCGI;
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
&oldNRCGI.pLMN_Identity); &oldNRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &oldNRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[i], &oldNRCGI.nRCellIdentity);
served_cells_to_delete_item.oldNRCGI = oldNRCGI; served_cells_to_delete_item.oldNRCGI = oldNRCGI;
/* ADD */ /* ADD */
...@@ -836,7 +937,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -836,7 +937,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
F1AP_NRCGI_t nRCGI; F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
&nRCGI.pLMN_Identity); &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[i], &nRCGI.nRCellIdentity);
active_cells_item.nRCGI = nRCGI; active_cells_item.nRCGI = nRCGI;
/* ADD */ /* ADD */
...@@ -850,6 +951,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -850,6 +951,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); printf("Failed to encode F1 setup request\n");
return -1;
} }
printf("\n"); printf("\n");
...@@ -859,32 +961,55 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du ...@@ -859,32 +961,55 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
/* decode */ /* decode */
if (f1ap_decode_pdu(&pdu, buffer, len) > 0) { if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
printf("Failed to decode F1 setup request\n"); printf("Failed to decode F1 setup request\n");
return -1;
} }
return 0;
} }
void DU_handle_gNB_DU_CONFIGURATION_FAILURE(F1AP_GNBDUConfigurationUpdateFailure_t GNBDUConfigurationUpdateFailure) { int DU_handle_gNB_DU_CONFIGURATION_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
void DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBDUConfigurationUpdateAcknowledge_t GNBDUConfigurationUpdateAcknowledge) { int DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
/* int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
gNB-CU Configuration Update uint32_t assoc_id,
*/ uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
void DU_handle_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
void DU_send_gNB_CU_CONFIGURATION_UPDATE_FALIURE(F1AP_GNBCUConfigurationUpdateFailure_t *GNBCUConfigurationUpdateFailure) { int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
F1AP_GNBCUConfigurationUpdateFailure_t *GNBCUConfigurationUpdateFailure) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
void DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBCUConfigurationUpdateAcknowledge_t *GNBCUConfigurationUpdateAcknowledge) { int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
F1AP_GNBCUConfigurationUpdateAcknowledge_t *GNBCUConfigurationUpdateAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int DU_send_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest) {
AssertFatal(0, "Not implemented yet\n");
}
int DU_handle_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(0, "Not implemented yet\n");
}
...@@ -33,12 +33,86 @@ ...@@ -33,12 +33,86 @@
#ifndef F1AP_DU_INTERFACE_MANAGEMENT_H_ #ifndef F1AP_DU_INTERFACE_MANAGEMENT_H_
#define 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_ */ #endif /* F1AP_DU_INTERFACE_MANAGEMENT_H_ */
\ No newline at end of file
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
*/ */
#include "f1ap_common.h" #include "f1ap_common.h"
#include "f1ap_encoder.h"
#include "f1ap_decoder.h"
#include "f1ap_itti_messaging.h"
#include "f1ap_du_rrc_message_transfer.h" #include "f1ap_du_rrc_message_transfer.h"
// undefine C_RNTI from // undefine C_RNTI from
// openair1/PHY/LTE_TRANSPORT/transport_common.h which // openair1/PHY/LTE_TRANSPORT/transport_common.h which
...@@ -41,12 +44,15 @@ ...@@ -41,12 +44,15 @@
extern f1ap_setup_req_t *f1ap_du_data; extern f1ap_setup_req_t *f1ap_du_data;
/* DL RRC Message Transfer */ /* 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"); 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(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_F1AP_PDU_t pdu;
F1AP_ULRRCMessageTransfer_t *out; F1AP_ULRRCMessageTransfer_t *out;
F1AP_ULRRCMessageTransferIEs_t *ie; F1AP_ULRRCMessageTransferIEs_t *ie;
...@@ -105,6 +111,7 @@ void DU_send_UL_RRC_MESSAGE_TRANSFER(void) { ...@@ -105,6 +111,7 @@ void DU_send_UL_RRC_MESSAGE_TRANSFER(void) {
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); printf("Failed to encode F1 setup request\n");
return -1;
} }
printf("\n"); printf("\n");
...@@ -115,10 +122,12 @@ void DU_send_UL_RRC_MESSAGE_TRANSFER(void) { ...@@ -115,10 +122,12 @@ void DU_send_UL_RRC_MESSAGE_TRANSFER(void) {
// printf("Failed to decode F1 setup request\n"); // printf("Failed to decode F1 setup request\n");
// } // }
//AssertFatal(1==0,"Not implemented yet\n"); //AssertFatal(1==0,"Not implemented yet\n");
return 0;
} }
/* UL RRC Message Transfer */ /* 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, module_id_t module_idP,
int CC_idP, int CC_idP,
int UE_id, int UE_id,
...@@ -163,7 +172,7 @@ void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER( ...@@ -163,7 +172,7 @@ void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
F1AP_NRCGI_t nRCGI; 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], MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[0], f1ap_du_data->mnc[0], f1ap_du_data->mnc_digit_length[0],
&nRCGI.pLMN_Identity); &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; ie->value.choice.NRCGI = nRCGI;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
...@@ -202,14 +211,16 @@ void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER( ...@@ -202,14 +211,16 @@ void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); printf("Failed to encode F1 setup request\n");
return -1;
} }
printf("\n"); 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 */ /* decode */
// if (f1ap_decode_pdu(&pdu, buffer, len) > 0) { // if (f1ap_decode_pdu(&pdu, buffer, len) > 0) {
// printf("Failed to decode F1 setup request\n"); // printf("Failed to decode F1 setup request\n");
// } // }
//AssertFatal(1==0,"Not implemented yet\n"); //AssertFatal(1==0,"Not implemented yet\n");
} }
\ No newline at end of file
...@@ -34,4 +34,19 @@ ...@@ -34,4 +34,19 @@
#ifndef F1AP_DU_RRC_MESSAGE_TRANSFER_H_ #ifndef F1AP_DU_RRC_MESSAGE_TRANSFER_H_
#define F1AP_DU_RRC_MESSAGE_TRANSFER_H_ #define F1AP_DU_RRC_MESSAGE_TRANSFER_H_
#endif /* F1AP_DU_RRC_MESSAGE_TRANSFER_H_ */ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
\ No newline at end of file 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 ...@@ -97,13 +97,13 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
DU_send_F1_SETUP_REQUEST(instance); 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; int result;
DevAssert(sctp_data_ind != NULL); 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); sctp_data_ind->buffer, sctp_data_ind->buffer_length);
result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer); result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
...@@ -154,7 +154,8 @@ void *F1AP_DU_task(void *arg) { ...@@ -154,7 +154,8 @@ void *F1AP_DU_task(void *arg) {
case SCTP_DATA_IND: case SCTP_DATA_IND:
// ex: any F1 incoming message for DU ends here // ex: any F1 incoming message for DU ends here
LOG_I(DU_F1AP, "SCTP_DATA_IND\n"); 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; break;
case TERMINATE_MESSAGE: case TERMINATE_MESSAGE:
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
void du_task_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1ap_setup_req); 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_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); void *F1AP_DU_task(void *arg);
#endif /* DU_F1AP_TASK_H_ */ #endif /* DU_F1AP_TASK_H_ */
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
/*! \file f1ap_du_interface_management.h /*! \file f1ap_du_ue_context_management.c
* \brief f1ap interface management for DU * \brief F1AP UE Context Management, DU side
* \author EURECOM/NTUST * \author EURECOM/NTUST
* \date 2018 * \date 2018
* \version 0.1 * \version 0.1
...@@ -31,20 +31,22 @@ ...@@ -31,20 +31,22 @@
*/ */
#include "f1ap_common.h" #include "f1ap_common.h"
#include "f1ap_encoder.h"
#include "f1ap_decoder.h"
#include "f1ap_itti_messaging.h"
#include "f1ap_du_ue_context_management.h" #include "f1ap_du_ue_context_management.h"
extern f1ap_setup_req_t *f1ap_du_data; extern f1ap_setup_req_t *f1ap_du_data;
/* int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
UE Context Setup uint32_t assoc_id,
*/ uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
void DU_handle_UE_CONTEXT_SETUP_REQUEST(F1AP_UEContextSetupRequest_t *UEContextSetupRequest) {
AssertFatal(1==0,"Not implemented yet\n"); 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(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_F1AP_PDU_t pdu;
F1AP_UEContextSetupResponse_t *out; F1AP_UEContextSetupResponse_t *out;
F1AP_UEContextSetupResponseIEs_t *ie; F1AP_UEContextSetupResponseIEs_t *ie;
...@@ -259,18 +261,8 @@ void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) { ...@@ -259,18 +261,8 @@ void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) {
/* - nRCGI */ /* - nRCGI */
F1AP_NRCGI_t nRCGI; // issue here 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); 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; sCell_FailedtoSetup_item.sCell_ID = nRCGI;
...@@ -307,7 +299,7 @@ void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) { ...@@ -307,7 +299,7 @@ void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) {
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); printf("Failed to encode F1 setup request\n");
return; return -1;
} }
printf("\n"); printf("\n");
...@@ -317,41 +309,41 @@ void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) { ...@@ -317,41 +309,41 @@ void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) {
// printf("Failed to decode F1 setup request\n"); // printf("Failed to decode F1 setup request\n");
// } // }
//du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0); //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"); 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"); 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"); 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"); AssertFatal(1==0,"Not implemented yet\n");
} }
/* int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance,
UE Context Modification (gNB-CU initiated) uint32_t assoc_id,
*/ uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
void DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(F1AP_UEContextModificationRequest_t *UEContextModificationRequest) {
AssertFatal(1==0,"Not implemented yet\n"); 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(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_F1AP_PDU_t pdu;
F1AP_UEContextModificationResponse_t *out; F1AP_UEContextModificationResponse_t *out;
F1AP_UEContextModificationResponseIEs_t *ie; F1AP_UEContextModificationResponseIEs_t *ie;
...@@ -625,7 +617,7 @@ void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) { ...@@ -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], MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
&nRCGI.pLMN_Identity); &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; scell_failedtoSetupMod_item.sCell_ID = nRCGI;
...@@ -697,7 +689,7 @@ void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) { ...@@ -697,7 +689,7 @@ void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) {
/* encode */ /* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
printf("Failed to encode F1 setup request\n"); printf("Failed to encode F1 setup request\n");
return; return -1;
} }
printf("\n"); printf("\n");
...@@ -707,17 +699,21 @@ void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) { ...@@ -707,17 +699,21 @@ void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) {
// printf("Failed to decode F1 setup request\n"); // printf("Failed to decode F1 setup request\n");
// } // }
//du_f1ap_itti_send_sctp_data_req(instance, f1ap_setup_req->assoc_id, buffer, len, 0); //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"); 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"); 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"); AssertFatal(1==0,"Not implemented yet\n");
} }
\ No newline at end of file
...@@ -33,4 +33,59 @@ ...@@ -33,4 +33,59 @@
#ifndef F1AP_DU_UE_CONTEXT_MANAGEMENT_H_ #ifndef F1AP_DU_UE_CONTEXT_MANAGEMENT_H_
#define 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 @@ ...@@ -32,8 +32,10 @@
#include "f1ap_common.h" #include "f1ap_common.h"
#include "f1ap_handlers.h" #include "f1ap_handlers.h"
#include "f1ap_decoder.h"
#include "f1ap_cu_interface_management.h" #include "f1ap_cu_interface_management.h"
#include "f1ap_du_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; extern f1ap_setup_req_t *f1ap_du_data_from_du;
...@@ -42,19 +44,19 @@ f1ap_message_decoded_callback f1ap_messages_callback[][3] = { ...@@ -42,19 +44,19 @@ f1ap_message_decoded_callback f1ap_messages_callback[][3] = {
{ 0, 0, 0 }, /* Reset */ { 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 */ { 0, 0, 0 }, /* ErrorIndication */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* gNBDUConfigurationUpdate */ { 0, 0, 0 }, /* gNBDUConfigurationUpdate */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* gNBCUConfigurationUpdate */ { 0, 0, 0 }, /* gNBCUConfigurationUpdate */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* UEContextSetup */ { 0, 0, 0 }, /* UEContextSetup */
{ 0, 0, 0 }, /* UEContextRelease */ { 0, 0, 0 }, /* UEContextRelease */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* UEContextModification */ { 0, 0, 0 }, /* UEContextModification */
{ 0, 0, 0 }, /* UEContextModificationRequired */ { 0, 0, 0 }, /* UEContextModificationRequired */
{ 0, 0, 0 }, /* UEMobilityCommand */ { 0, 0, 0 }, /* UEMobilityCommand */
{ 0, 0, 0 }, /* UEContextReleaseRequest */ { 0, 0, 0 }, /* UEContextReleaseRequest */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* InitialULRRCMessageTransfer */ { CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER, 0, 0 }, /* InitialULRRCMessageTransfer */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* DLRRCMessageTransfer */ { 0, 0, 0 }, /* DLRRCMessageTransfer */
{ CU_handle_F1_SETUP_REQUEST, 0, 0 }, /* ULRRCMessageTransfer */ { 0, 0, 0 }, /* ULRRCMessageTransfer */
{ 0, 0, 0 }, /* privateMessage */ { 0, 0, 0 }, /* privateMessage */
{ 0, 0, 0 }, /* UEInactivityNotification */ { 0, 0, 0 }, /* UEInactivityNotification */
{ 0, 0, 0 }, /* GNBDUResourceCoordination */ { 0, 0, 0 }, /* GNBDUResourceCoordination */
...@@ -77,7 +79,7 @@ static const char *f1ap_direction_String[] = { ...@@ -77,7 +79,7 @@ static const char *f1ap_direction_String[] = {
return(f1ap_direction_String[f1ap_dir]); 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) const uint8_t * const data, const uint32_t data_length)
{ {
F1AP_F1AP_PDU_t pdu; F1AP_F1AP_PDU_t pdu;
...@@ -115,7 +117,7 @@ int f1ap_handle_message(uint32_t assoc_id, int32_t stream, ...@@ -115,7 +117,7 @@ int f1ap_handle_message(uint32_t assoc_id, int32_t stream,
/* Calling the right handler */ /* Calling the right handler */
ret = (*f1ap_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1]) 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); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu);
return ret; return ret;
} }
\ No newline at end of file
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#ifndef F1AP_HANDLERS_H_ #ifndef F1AP_HANDLERS_H_
#define 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); const uint8_t * const data, const uint32_t data_length);
#endif /* F1AP_HANDLERS_H_ */ #endif /* F1AP_HANDLERS_H_ */
...@@ -367,7 +367,7 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -367,7 +367,7 @@ rx_sdu(const module_id_t enb_mod_idP,
ra = &mac->common_channels[CC_idP].ra[ii]; ra = &mac->common_channels[CC_idP].ra[ii];
if ((ra->rnti == current_rnti) && (ra->state != IDLE)) { if ((ra->rnti == current_rnti) && (ra->state != IDLE)) {
//int RC.cudu.du_flag = 1; //int RC.cudu.du_flag = 1;
int du_flag = 1; //int du_flag = 1;
mac_rrc_data_ind( mac_rrc_data_ind(
enb_mod_idP, enb_mod_idP,
CC_idP, CC_idP,
...@@ -377,7 +377,7 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -377,7 +377,7 @@ rx_sdu(const module_id_t enb_mod_idP,
(uint8_t *) payload_ptr, (uint8_t *) payload_ptr,
rx_lengths[i], rx_lengths[i],
0, 0,
du_flag RC.rrc[enb_mod_idP]->node_type
); );
// prepare transmission of Msg4(RRCConnectionReconfiguration) // prepare transmission of Msg4(RRCConnectionReconfiguration)
ra->state = MSGCRNTI; ra->state = MSGCRNTI;
...@@ -619,7 +619,7 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -619,7 +619,7 @@ rx_sdu(const module_id_t enb_mod_idP,
} }
//int RC.cudu.du_flag = 1; //int RC.cudu.du_flag = 1;
int du_flag = 1; //int du_flag = 1;
mac_rrc_data_ind( mac_rrc_data_ind(
enb_mod_idP, enb_mod_idP,
CC_idP, CC_idP,
...@@ -629,7 +629,7 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -629,7 +629,7 @@ rx_sdu(const module_id_t enb_mod_idP,
(uint8_t *) payload_ptr, (uint8_t *) payload_ptr,
rx_lengths[i], rx_lengths[i],
0, 0,
du_flag RC.rrc[enb_mod_idP]->node_type
); );
......
...@@ -226,31 +226,31 @@ mac_rrc_data_req( ...@@ -226,31 +226,31 @@ mac_rrc_data_req(
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
int8_t // int8_t
mac_du_data_ind( // mac_du_data_ind(
const module_id_t module_idP, // const module_id_t module_idP,
const int CC_idP, // const int CC_idP,
const int UE_id, // const int UE_id,
const rnti_t rntiP, // const rnti_t rntiP,
const uint8_t *sduP, // const uint8_t *sduP,
const sdu_size_t sdu_lenP // const sdu_size_t sdu_lenP
) // )
//-------------------------------------------------------------------------- // //--------------------------------------------------------------------------
{ // {
printf( // printf(
"[F1 %d][RAPROC] CC_id %d current_rnti %x Received Msg3 from already registered UE %d: length %d, offset %ld\n", // "[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, // module_idP, CC_idP, rntiP,
UE_id, sdu_lenP, sduP); // UE_id, sdu_lenP, sduP);
DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER( // DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
module_idP, // module_idP,
CC_idP, // CC_idP,
UE_id, // UE_id,
rntiP, // rntiP,
sduP, // sduP,
sdu_lenP // sdu_lenP
); // );
} // }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int8_t int8_t
...@@ -265,21 +265,25 @@ mac_rrc_data_ind( ...@@ -265,21 +265,25 @@ mac_rrc_data_ind(
const uint8_t* sduP, const uint8_t* sduP,
const sdu_size_t sdu_lenP, const sdu_size_t sdu_lenP,
const uint8_t mbsfn_sync_areaP, const uint8_t mbsfn_sync_areaP,
const int du_flag const int node_type
) )
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
{ {
LOG_E(RRC, "node_type == %d \n" , node_type);
// navid update / Bing-Kai modify if (node_type == ngran_eNB_DU) {
if (du_flag) { LOG_W(RRC,"[DU %d][RAPROC] Received SDU for CCCH on SRB %d length %d for UE id %d RNTI %x \n",
mac_du_data_ind( module_idP, srb_idP, sdu_lenP, UE_id, rntiP);
module_idP,
CC_id, DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
UE_id, module_idP,
rntiP, CC_id,
sduP, UE_id,
sdu_lenP); rntiP,
} sduP,
sdu_lenP
);
return(0);
}
SRB_INFO *Srb_info; SRB_INFO *Srb_info;
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt;
......
...@@ -428,7 +428,7 @@ mac_rrc_data_ind( ...@@ -428,7 +428,7 @@ mac_rrc_data_ind(
const uint8_t* sduP, const uint8_t* sduP,
const sdu_size_t sdu_lenP, const sdu_size_t sdu_lenP,
const uint8_t mbsfn_sync_areaP, const uint8_t mbsfn_sync_areaP,
const int du_flag const int node_type
); );
int8_t 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