diff --git a/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c b/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c index 90421197d1..99b03f2583 100644 --- a/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c +++ b/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c @@ -53,6 +53,28 @@ static void init_once_rc(void) init_rc_subs_data(&rc_subs_data); } +static seq_ev_trg_style_t fill_ev_tr_format_4(const char *ev_style_name) +{ + seq_ev_trg_style_t ev_trig_style = {0}; + + // RIC Event Trigger Style Type + // Mandatory + // 9.3.3 + ev_trig_style.style = 4; + + // RIC Event Trigger Style Name + // Mandatory + // 9.3.4 + ev_trig_style.name = cp_str_to_ba(ev_style_name); + + // RIC Event Trigger Format Type + // Mandatory + // 9.3.5 + ev_trig_style.format = FORMAT_4_E2SM_RC_EV_TRIGGER_FORMAT; + + return ev_trig_style; +} + static void fill_rc_ev_trig(ran_func_def_ev_trig_t* ev_trig) { // Sequence of EVENT TRIGGER styles @@ -61,29 +83,7 @@ static void fill_rc_ev_trig(ran_func_def_ev_trig_t* ev_trig) ev_trig->seq_ev_trg_style = calloc(ev_trig->sz_seq_ev_trg_style, sizeof(seq_ev_trg_style_t)); assert(ev_trig->seq_ev_trg_style != NULL && "Memory exhausted"); - seq_ev_trg_style_t* ev_trig_style = &ev_trig->seq_ev_trg_style[0]; - - // RIC Event Trigger Style Type - // Mandatory - // 9.3.3 - // 6.2.2.2. - // INTEGER - ev_trig_style->style = 4; - - // RIC Event Trigger Style Name - // Mandatory - // 9.3.4 - // 6.2.2.3 - //PrintableString(SIZE(1..150,...)) - const char ev_style_name[] = "UE Information Change"; - ev_trig_style->name = cp_str_to_ba(ev_style_name); - - // RIC Event Trigger Format Type - // Mandatory - // 9.3.5 - // 6.2.2.4. - // INTEGER - ev_trig_style->format = FORMAT_4_E2SM_RC_EV_TRIGGER_FORMAT; + ev_trig->seq_ev_trg_style[0] = fill_ev_tr_format_4("UE Information Change"); // Sequence of RAN Parameters for L2 Variables // [0 - 65535] @@ -106,6 +106,67 @@ static void fill_rc_ev_trig(ran_func_def_ev_trig_t* ev_trig) ev_trig->seq_ran_param_id_cell = NULL; } +static seq_report_sty_t fill_report_style_4(const char *report_name) +{ + seq_report_sty_t report_style = {0}; + + // RIC Report Style Type + // Mandatory + // 9.3.3 + report_style.report_type = 4; + + // RIC Report Style Name + // Mandatory + // 9.3.4 + report_style.name = cp_str_to_ba(report_name); + + // Supported RIC Event Trigger Style Type + // Mandatory + // 9.3.3 + report_style.ev_trig_type = FORMAT_4_E2SM_RC_EV_TRIGGER_FORMAT; + + // RIC Report Action Format Type + // Mandatory + // 9.3.5 + report_style.act_frmt_type = FORMAT_1_E2SM_RC_ACT_DEF; + + // RIC Indication Header Format Type + // Mandatory + // 9.3.5 + report_style.ind_hdr_type = FORMAT_1_E2SM_RC_IND_HDR; + + // RIC Indication Message Format Type + // Mandatory + // 9.3.5 + report_style.ind_msg_type = FORMAT_2_E2SM_RC_IND_MSG; + + // Sequence of RAN Parameters Supported + // [0 - 65535] + report_style.sz_seq_ran_param = 1; + report_style.ran_param = calloc(report_style.sz_seq_ran_param, sizeof(seq_ran_param_3_t)); + assert(report_style.ran_param != NULL && "Memory exhausted"); + + // RAN Parameter ID + // Mandatory + // 9.3.8 + // [1- 4294967295] + report_style.ran_param[0].id = E2SM_RC_RS4_RRC_STATE_CHANGED_TO; + + // RAN Parameter Name + // Mandatory + // 9.3.9 + // [1-150] + const char ran_param_name[] = "RRC State Changed To"; + report_style.ran_param[0].name = cp_str_to_ba(ran_param_name); + + // RAN Parameter Definition + // Optional + // 9.3.51 + report_style.ran_param[0].def = NULL; + + return report_style; +} + static void fill_rc_report(ran_func_def_report_t* report) { // Sequence of REPORT styles @@ -114,74 +175,7 @@ static void fill_rc_report(ran_func_def_report_t* report) report->seq_report_sty = calloc(report->sz_seq_report_sty, sizeof(seq_report_sty_t)); assert(report->seq_report_sty != NULL && "Memory exhausted"); - seq_report_sty_t* report_style = &report->seq_report_sty[0]; - - // RIC Report Style Type - // Mandatory - // 9.3.3 - // 6.2.2.2. - // INTEGER - report_style->report_type = 4; - - // RIC Report Style Name - // Mandatory - // 9.3.4 - // 6.2.2.3. - // PrintableString(SIZE(1..150,...)) - const char report_name[] = "UE Information"; - report_style->name = cp_str_to_ba(report_name); - - // Supported RIC Event Trigger Style Type - // Mandatory - // 9.3.3 - // 6.2.2.2. - // INTEGER - report_style->ev_trig_type = FORMAT_4_E2SM_RC_EV_TRIGGER_FORMAT; - - // RIC Report Action Format Type - // Mandatory - // 9.3.5 - // 6.2.2.4. - // INTEGER - report_style->act_frmt_type = FORMAT_1_E2SM_RC_ACT_DEF; - - // RIC Indication Header Format Type - // Mandatory - // 9.3.5 - // 6.2.2.4. - // INTEGER - report_style->ind_hdr_type = FORMAT_1_E2SM_RC_IND_HDR; - - // RIC Indication Message Format Type - // Mandatory - // 9.3.5 - // 6.2.2.4. - // INTEGER - report_style->ind_msg_type = FORMAT_2_E2SM_RC_IND_MSG; - - // Sequence of RAN Parameters Supported - // [0 - 65535] - report_style->sz_seq_ran_param = 1; - report_style->ran_param = calloc(report_style->sz_seq_ran_param, sizeof(seq_ran_param_3_t)); - assert(report_style->ran_param != NULL && "Memory exhausted"); - - // RAN Parameter ID - // Mandatory - // 9.3.8 - // [1- 4294967295] - report_style->ran_param[0].id = E2SM_RC_RS4_RRC_STATE_CHANGED_TO; - - // RAN Parameter Name - // Mandatory - // 9.3.9 - // [1-150] - const char ran_param_name[] = "RRC State"; - report_style->ran_param[0].name = cp_str_to_ba(ran_param_name); - - // RAN Parameter Definition - // Optional - // 9.3.51 - report_style->ran_param[0].def = NULL; + report->seq_report_sty[0] = fill_report_style_4("UE Information"); } static void fill_rc_control(ran_func_def_ctrl_t* ctrl) diff --git a/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc_subs.h b/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc_subs.h index 80fc7e5706..702e08511e 100644 --- a/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc_subs.h +++ b/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc_subs.h @@ -25,60 +25,6 @@ #include "openair2/E2AP/flexric/src/sm/rc_sm/ie/rc_data_ie.h" #include "common/utils/ds/seq_arr.h" -typedef enum { // 8.2.1 RAN Parameters for Report Service Style 1 - E2SM_RC_RS1_UE_EVENT_ID = 1, - E2SM_RC_RS1_NI_MESSAGE = 2, - E2SM_RC_RS1_RRC_MESSAGE = 3, - E2SM_RC_RS1_UE_ID = 4, - E2SM_RC_RS1_OLD_AMF_UE_NGAP_ID = 5, - E2SM_RC_RS1_CELL_GLOBAL_ID = 6, - - END_E2SM_RC_RS1_RAN_PARAM_ID -} report_style_1_ran_param_id_e; - -typedef enum { // 8.2.2 RAN Parameters for Report Service Style 2 - E2SM_RC_RS2_CURRENT_UE_ID = 1, - E2SM_RC_RS2_OLD_UE_ID = 2, - E2SM_RC_RS2_CURRENT_RRC_STATE = 3, - E2SM_RC_RS2_OLD_RRC_STATE = 4, - E2SM_RC_RS2_UE_CONTEXT_INFORMATION_CONTAINER = 5, - E2SM_RC_RS2_CELL_GLOBAL_ID = 6, - E2SM_RC_RS2_UE_INFORMATION = 7, - - END_E2SM_RC_RS2_RAN_PARAM_ID -} report_style_2_ran_param_id_e; - -typedef enum { // 8.2.3 RAN Parameters for Report Service Style 3 - E2SM_RC_RS3_CELL_CONTEXT_INFORMATION = 1, - E2SM_RC_RS3_CELL_DELETED = 2, - E2SM_RC_RS3_NEIGHBOUR_RELATION_TABLE = 3, - - END_E2SM_RC_RS3_RAN_PARAM_ID -} report_style_3_ran_param_id_e; - -typedef enum { // 8.2.4 RAN Parameters for Report Service Style 4 - E2SM_RC_RS4_UL_MAC_CE = 100, - E2SM_RC_RS4_DL_MAC_CE = 101, - E2SM_RC_RS4_DL_BUFFER_OCCUPANCY = 102, - E2SM_RC_RS4_CURRENT_RRC_STATE = 201, - E2SM_RC_RS4_RRC_STATE_CHANGED_TO = 202, - E2SM_RC_RS4_RRC_MESSAGE = 203, - E2SM_RC_RS4_OLD_UE_ID = 300, - E2SM_RC_RS4_CURRENT_UE_ID = 301, - E2SM_RC_RS4_NI_MESSAGE = 302, - E2SM_RC_RS4_CELL_GLOBAL_ID = 400, - - END_E2SM_RC_RS4_RAN_PARAM_ID -} report_style_4_ran_param_id_e; - -typedef enum { // 8.2.5 RAN Parameters for Report Service Style 5 - E2SM_RC_RS5_UE_CONTEXT_INFORMATION = 1, - E2SM_RC_RS5_CELL_CONTEXT_INFORMATION = 2, - E2SM_RC_RS5_NEIGHBOUR_RELATION_TABLE = 3, - - END_E2SM_RC_RS5_RAN_PARAM_ID -} report_style_5_ran_param_id_e; - typedef struct ran_param_data { uint32_t ric_req_id; e2sm_rc_event_trigger_t ev_tr;