Commit f3cbfe17 authored by Robert Schmidt's avatar Robert Schmidt

trigger RC -> bearer

parent 585b2e05
......@@ -214,22 +214,43 @@ sm_ag_if_ans_t write_subs_rc_sm(void const* src)
return ans;
}
void rrc_gNB_trigger_new_bearer(int rnti);
void rrc_gNB_trigger_release_bearer(int rnti);
sm_ag_if_ans_t write_ctrl_rc_sm(void const* data)
{
assert(data != NULL);
// assert(data->type == RAN_CONTROL_CTRL_V1_03 );
// assert(data->type == RAN_CONTROL_CTRL_V1_03 );
rc_ctrl_req_data_t const* ctrl = (rc_ctrl_req_data_t const*)data;
if(ctrl->hdr.format == FORMAT_1_E2SM_RC_CTRL_HDR){
if(ctrl->hdr.frmt_1.ric_style_type == 1 && ctrl->hdr.frmt_1.ctrl_act_id == 2){
printf("QoS flow mapping configuration \n");
//mir
//int const rnti = get_single_ue_rnti();
int const rnti = -1;
printf("QoS flow mapping configuration with rnti %d \n", rnti);
e2sm_rc_ctrl_msg_frmt_1_t const* frmt_1 = &ctrl->msg.frmt_1;
printf("int_ran %ld \n", frmt_1->ran_param[0].ran_param_val.flag_true->int_ran);
for(size_t i = 0; i < frmt_1->sz_ran_param; ++i){
seq_ran_param_t const* rp = frmt_1->ran_param;
if(rp[i].ran_param_id == 1){
assert(rp[i].ran_param_val.type == ELEMENT_KEY_FLAG_TRUE_RAN_PARAMETER_VAL_TYPE );
printf("DRB ID %ld \n", rp[i].ran_param_val.flag_true->int_ran);
if(rp[i].ran_param_val.flag_true->int_ran == 5){
printf("[O-RAN RC]: Creating a new bearer\n");
fflush(stdout);
rrc_gNB_trigger_new_bearer(rnti);
} else if(rp[i].ran_param_val.flag_true->int_ran == 4){
printf("[O-RAN RC]: Releasing bearer\n");
fflush(stdout);
rrc_gNB_trigger_release_bearer(rnti);
} else{
assert(0!=0 && "Unknown int_ran");
}
} else if(rp[i].ran_param_id == 2){
assert(rp[i].ran_param_val.type == LIST_RAN_PARAMETER_VAL_TYPE);
printf("List of QoS Flows to be modified \n");
......
......@@ -2655,11 +2655,22 @@ static pdu_session_to_setup_t fill_pdu_session(const rrc_pdu_session_param_t *se
return pdu;
}
static int get_single_ue_rnti(void)
{
rrc_gNB_ue_context_t *ue_context_p = NULL;
RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &(RC.nrrrc[0]->rrc_ue_head)) {
return ue_context_p->ue_context.rnti;
}
return -1;
}
extern instance_t get_f1_gtp_instance(void);
void rrc_gNB_trigger_new_bearer(int rnti)
{
/* get RRC and UE */
gNB_RRC_INST *rrc = RC.nrrrc[0];
if (rnti < 0)
rnti = get_single_ue_rnti();
rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context_by_rnti_any_du(rrc, rnti);
if (ue_context_p == NULL) {
LOG_E(RRC, "unknown UE RNTI %04x\n", rnti);
......@@ -2774,6 +2785,8 @@ void rrc_gNB_trigger_release_bearer(int rnti)
{
/* get RRC and UE */
gNB_RRC_INST *rrc = RC.nrrrc[0];
if (rnti < 0)
rnti = get_single_ue_rnti();
rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context_by_rnti_any_du(rrc, rnti);
if (ue_context_p == NULL) {
LOG_E(RRC, "unknown UE RNTI %04x\n", rnti);
......
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