Commit 3aa9f4c0 authored by Guido Casati's avatar Guido Casati

Use F1 gNB-DU Configuration Update Acknowledge lib in stack

parent b8ee622f
...@@ -149,42 +149,20 @@ int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, sctp_assoc_t asso ...@@ -149,42 +149,20 @@ int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, sctp_assoc_t asso
return 0; return 0;
} }
int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE( int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(sctp_assoc_t assoc_id, f1ap_gnb_du_configuration_update_acknowledge_t *msg)
sctp_assoc_t assoc_id,
f1ap_gnb_du_configuration_update_acknowledge_t *GNBDUConfigurationUpdateAcknowledge)
{ {
F1AP_F1AP_PDU_t pdu = {};
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
/* Encode F1 gNB-CU Configuration Update message */
/* Create */ F1AP_F1AP_PDU_t *pdu = encode_f1ap_du_configuration_update_acknowledge(msg);
/* 0. Message */ /* Encode F1AP PDU */
if (f1ap_encode_pdu(pdu, &buffer, &len) < 0) {
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome; ASN_STRUCT_FREE(asn_DEF_F1AP_F1AP_PDU, pdu);
asn1cCalloc(pdu.choice.successfulOutcome, succOut); LOG_E(F1AP, "Failed to encode F1 gNB-DU Configuration Update Acknowledge\n");
succOut->procedureCode = F1AP_ProcedureCode_id_gNBDUConfigurationUpdate;
succOut->criticality = F1AP_Criticality_reject;
succOut->value.present = F1AP_SuccessfulOutcome__value_PR_GNBDUConfigurationUpdateAcknowledge;
F1AP_GNBDUConfigurationUpdateAcknowledge_t *ack = &succOut->value.choice.GNBDUConfigurationUpdateAcknowledge;
/* Mandatory */
/* Transaction Id */
asn1cSequenceAdd(ack->protocolIEs.list, F1AP_GNBDUConfigurationUpdateAcknowledgeIEs_t, ie1);
ie1->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie1->criticality = F1AP_Criticality_reject;
ie1->value.present = F1AP_GNBDUConfigurationUpdateAcknowledgeIEs__value_PR_TransactionID;
ie1->value.choice.TransactionID = GNBDUConfigurationUpdateAcknowledge->transaction_id;
/* Todo add optional fields */
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 gNB-DU CONFIGURATION UPDATE\n");
return -1; return -1;
} }
LOG_DUMPMSG(F1AP, LOG_DUMP_CHAR, buffer, len, "F1AP gNB-DU CONFIGURATION UPDATE : "); LOG_DUMPMSG(F1AP, LOG_DUMP_CHAR, buffer, len, "F1AP gNB-DU CONFIGURATION UPDATE : ");
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu); ASN_STRUCT_FREE(asn_DEF_F1AP_F1AP_PDU, pdu);
f1ap_itti_send_sctp_data_req(assoc_id, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
......
...@@ -245,6 +245,30 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, sctp_assoc_t asso ...@@ -245,6 +245,30 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, sctp_assoc_t asso
return 0; return 0;
} }
/**
* @brief F1 gNB-DU Configuration Update Acknowledge decoding and message transfer
*/
int DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
sctp_assoc_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu)
{
// Decoding
f1ap_gnb_du_configuration_update_acknowledge_t in = {0};
if (!decode_f1ap_du_configuration_update_acknowledge(pdu, &in)) {
LOG_E(F1AP, "Failed to decode gNB-DU Configuration Update Acknowledge\n");
free_f1ap_du_configuration_update_acknowledge(&in);
return -1;
}
// Allocate and send an ITTI message
MessageDef *msg_p = itti_alloc_new_message(TASK_DU_F1, 0, F1AP_GNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE);
f1ap_gnb_du_configuration_update_acknowledge_t *msg = &F1AP_GNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_p);
// Copy the decoded message to the ITTI message (RRC thread will free it)
*msg = in; // Copy the decoded message to the ITTI message (RRC thread will free it)
itti_send_msg_to_task(TASK_GNB_APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
return 0;
}
int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(sctp_assoc_t assoc_id, int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(sctp_assoc_t assoc_id,
f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure) { f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure) {
AssertFatal(1==0,"received gNB CU CONFIGURATION UPDATE FAILURE with cause %d\n", AssertFatal(1==0,"received gNB CU CONFIGURATION UPDATE FAILURE with cause %d\n",
......
...@@ -64,4 +64,9 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(sctp_assoc_t assoc_id, ...@@ -64,4 +64,9 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(sctp_assoc_t assoc_id,
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(sctp_assoc_t assoc_id, int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(sctp_assoc_t assoc_id,
f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge); f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge);
int DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
sctp_assoc_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
#endif /* F1AP_DU_INTERFACE_MANAGEMENT_H_ */ #endif /* F1AP_DU_INTERFACE_MANAGEMENT_H_ */
...@@ -48,7 +48,7 @@ static const f1ap_message_processing_t f1ap_messages_processing[][3] = { ...@@ -48,7 +48,7 @@ static const f1ap_message_processing_t f1ap_messages_processing[][3] = {
// {CU_handle_RESET, DU_handle_RESET_ACKNOWLEDGE, 0}, /* Reset */ // {CU_handle_RESET, DU_handle_RESET_ACKNOWLEDGE, 0}, /* Reset */
{CU_handle_F1_SETUP_REQUEST, DU_handle_F1_SETUP_RESPONSE, DU_handle_F1_SETUP_FAILURE}, /* 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_gNB_DU_CONFIGURATION_UPDATE, 0, 0}, /* gNBDUConfigurationUpdate */ {CU_handle_gNB_DU_CONFIGURATION_UPDATE, DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE, 0}, /* gNBDUConfigurationUpdate */
{DU_handle_gNB_CU_CONFIGURATION_UPDATE, CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE, 0}, /* gNBCUConfigurationUpdate */ {DU_handle_gNB_CU_CONFIGURATION_UPDATE, CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE, 0}, /* gNBCUConfigurationUpdate */
{DU_handle_UE_CONTEXT_SETUP_REQUEST, CU_handle_UE_CONTEXT_SETUP_RESPONSE, 0}, /* UEContextSetup */ {DU_handle_UE_CONTEXT_SETUP_REQUEST, CU_handle_UE_CONTEXT_SETUP_RESPONSE, 0}, /* UEContextSetup */
{DU_handle_UE_CONTEXT_RELEASE_COMMAND, CU_handle_UE_CONTEXT_RELEASE_COMPLETE, 0}, /* UEContextRelease */ {DU_handle_UE_CONTEXT_RELEASE_COMMAND, CU_handle_UE_CONTEXT_RELEASE_COMPLETE, 0}, /* UEContextRelease */
......
...@@ -247,6 +247,11 @@ void *gNB_app_task(void *args_p) ...@@ -247,6 +247,11 @@ void *gNB_app_task(void *args_p)
AssertFatal(cell_to_activate == 1,"No cells to activate or cells > 1 %d\n",cell_to_activate); AssertFatal(cell_to_activate == 1,"No cells to activate or cells > 1 %d\n",cell_to_activate);
break; break;
case F1AP_GNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE:
LOG_E(GNB_APP, "[gNB %ld] Handling of %s message not implemented yet\n", instance, msg_name);
break;
case NGAP_DEREGISTERED_GNB_IND: case NGAP_DEREGISTERED_GNB_IND:
LOG_W(GNB_APP, "[gNB %ld] Received %s: associated AMF %d\n", instance, msg_name, LOG_W(GNB_APP, "[gNB %ld] Received %s: associated AMF %d\n", instance, msg_name,
NGAP_DEREGISTERED_GNB_IND(msg_p).nb_amf); NGAP_DEREGISTERED_GNB_IND(msg_p).nb_amf);
......
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