From 17cc510a3c101c2f24c1a5770d725b5da4ca06d5 Mon Sep 17 00:00:00 2001 From: Bing-Kai Hong Date: Fri, 7 Sep 2018 14:13:56 +0200 Subject: [PATCH] add itti_receive_msg at CU and DU --- openair2/F1AP/CU_F1AP.c | 1 + openair2/F1AP/DU_F1AP.c | 2 ++ openair2/F1AP/f1ap_handlers.c | 8 ++++---- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/openair2/F1AP/CU_F1AP.c b/openair2/F1AP/CU_F1AP.c index 726eeba0f7..2c766074bd 100644 --- a/openair2/F1AP/CU_F1AP.c +++ b/openair2/F1AP/CU_F1AP.c @@ -134,6 +134,7 @@ void *F1AP_CU_task(void *arg) { itti_mark_task_ready(TASK_CU_F1); while (1) { + itti_receive_msg(TASK_CU_F1, &received_msg); switch (ITTI_MSG_ID(received_msg)) { case F1AP_CU_SCTP_REQ: diff --git a/openair2/F1AP/DU_F1AP.c b/openair2/F1AP/DU_F1AP.c index 599616a546..c7acd198c6 100644 --- a/openair2/F1AP/DU_F1AP.c +++ b/openair2/F1AP/DU_F1AP.c @@ -117,6 +117,8 @@ void *F1AP_DU_task(void *arg) { // SCTP while (1) { + itti_receive_msg(TASK_DU_F1, &received_msg); + switch (ITTI_MSG_ID(received_msg)) { // case TERMINATE_MESSAGE: diff --git a/openair2/F1AP/f1ap_handlers.c b/openair2/F1AP/f1ap_handlers.c index 0ddd1a9675..a436696fe0 100644 --- a/openair2/F1AP/f1ap_handlers.c +++ b/openair2/F1AP/f1ap_handlers.c @@ -54,7 +54,7 @@ int f1ap_handle_f1_setup_request(uint32_t assoc_id, /* Handlers matrix. Only f1 related procedure present here */ -f1ap_message_decoded_callback messages_callback[][3] = { +f1ap_message_decoded_callback f1ap_messages_callback[][3] = { { 0, 0, 0 }, /* Reset */ @@ -110,7 +110,7 @@ int f1ap_handle_message(uint32_t assoc_id, int32_t stream, } /* Checking procedure Code and direction of message */ - if (pdu.choice.initiatingMessage->procedureCode > sizeof(messages_callback) / (3 * sizeof( + if (pdu.choice.initiatingMessage->procedureCode > sizeof(f1ap_messages_callback) / (3 * sizeof( f1ap_message_decoded_callback)) || (pdu.present > F1AP_F1AP_PDU_PR_unsuccessfulOutcome)) { //F1AP_ERROR("[SCTP %d] Either procedureCode %ld or direction %d exceed expected\n", @@ -124,7 +124,7 @@ int f1ap_handle_message(uint32_t assoc_id, int32_t stream, /* No handler present. * This can mean not implemented or no procedure for eNB (wrong direction). */ - if (messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1] == NULL) { + if (f1ap_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1] == NULL) { // F1AP_ERROR("[SCTP %d] No handler for procedureCode %ld in %s\n", // assoc_id, pdu.choice.initiatingMessage->procedureCode, // f1ap_direction2String(pdu.present - 1)); @@ -136,7 +136,7 @@ int f1ap_handle_message(uint32_t assoc_id, int32_t stream, } /* Calling the right handler */ - ret = (*messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1]) + ret = (*f1ap_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1]) (assoc_id, stream, &pdu); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu); return ret;