diff --git a/openair2/ENB_APP/flexran_agent_common.c b/openair2/ENB_APP/flexran_agent_common.c index f1556deef2a1e5edef9c07442e2070d61027b0fe..1cbf411c650045a3aff84d9cc0facf4c5faf79fe 100644 --- a/openair2/ENB_APP/flexran_agent_common.c +++ b/openair2/ENB_APP/flexran_agent_common.c @@ -1101,5 +1101,25 @@ int flexran_agent_destroy_rrc_measurement(Protocol__FlexranMessage *msg){ return 0; } +int flexran_agent_handle_enb_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) +{ + Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params; + Protocol__FlexEnbConfigReply *enb_config = input->enb_config_reply_msg; + + if (enb_config->n_cell_config == 0) { + LOG_W(FLEXRAN_AGENT, + "received enb_config_reply message does not contain a cell_config\n"); + *msg = NULL; + return 0; + } + + if (enb_config->n_cell_config > 1) + LOG_W(FLEXRAN_AGENT, "ignoring slice configs for other cell except cell 0\n"); + if (enb_config->cell_config[0]->slice_config) + prepare_update_slice_config(mod_id, enb_config->cell_config[0]->slice_config); + /* could test for cell configs here and maybe reconfigure/soft-restart */ + *msg = NULL; + return 0; +} diff --git a/openair2/ENB_APP/flexran_agent_common.h b/openair2/ENB_APP/flexran_agent_common.h index 057c5b9489a7332a9cdb8923f3abeb58a44f7d46..2738a2f3d325485a1fc29a9b78e97bda7d764081 100644 --- a/openair2/ENB_APP/flexran_agent_common.h +++ b/openair2/ENB_APP/flexran_agent_common.h @@ -167,4 +167,11 @@ void flexran_agent_send_update_stats(mid_t mod_id); err_code_t flexran_agent_enable_cont_stats_update(mid_t mod_id, xid_t xid, stats_request_config_t *stats_req) ; err_code_t flexran_agent_disable_cont_stats_update(mid_t mod_id); +/* Handle a received eNB config reply message as an "order" to reconfigure. It + * does not come as a reconfiguration message as this is a "structured" + * ProtoBuf message (as opposed to "unstructured" YAML). There is no destructor + * since we do not reply to this message (yet). Instead, the controller has to + * issue another eNB config request message. */ +int flexran_agent_handle_enb_config_reply(mid_t mod_id, const void* params, Protocol__FlexranMessage **msg); + #endif diff --git a/openair2/ENB_APP/flexran_agent_handler.c b/openair2/ENB_APP/flexran_agent_handler.c index 66123fd71c60197ec9c40297bce7dc59f1e66343..b3025bf769df4c00bc880b22b52437b39794b699 100644 --- a/openair2/ENB_APP/flexran_agent_handler.c +++ b/openair2/ENB_APP/flexran_agent_handler.c @@ -46,7 +46,7 @@ flexran_agent_message_decoded_callback agent_messages_callback[][3] = { {0, 0, 0}, /*PROTOCOK__FLEXRAN_MESSAGE__MSG_SF_TRIGGER_MSG*/ {0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UL_SR_INFO_MSG*/ {flexran_agent_enb_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REQUEST_MSG*/ - {0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG*/ + {flexran_agent_handle_enb_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_ENB_CONFIG_REPLY_MSG*/ {flexran_agent_ue_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_CONFIG_REQUEST_MSG*/ {0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_CONFIG_REPLY_MSG*/ {flexran_agent_lc_config_reply, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_LC_CONFIG_REQUEST_MSG*/