Commit e469278b authored by KARIM BOUTIBA's avatar KARIM BOUTIBA Committed by Robert Schmidt

Fix ASN.1 encoding for multiple DRBs

parent 0cacf29d
...@@ -1242,7 +1242,7 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr ...@@ -1242,7 +1242,7 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr
// DRB Configuration // DRB Configuration
for (int i = bearer_id_start; i < bearer_id_start + nb_bearers_to_setup; i++ ){ for (int i = bearer_id_start; i < bearer_id_start + nb_bearers_to_setup; i++ ){
const NR_RLC_Config_PR rlc_conf = use_rlc_um_for_drb ? NR_RLC_Config_PR_um_Bi_Directional : NR_RLC_Config_PR_am; const NR_RLC_Config_PR rlc_conf = use_rlc_um_for_drb ? NR_RLC_Config_PR_um_Bi_Directional : NR_RLC_Config_PR_am;
NR_RLC_BearerConfig_t *rlc_BearerConfig = get_DRB_RLC_BearerConfig(3 + i, i, rlc_conf, priority[i-bearer_id_start]); NR_RLC_BearerConfig_t *rlc_BearerConfig = get_DRB_RLC_BearerConfig(3 + i, i, rlc_conf, priority[i-1]);
ASN_SEQUENCE_ADD(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig); ASN_SEQUENCE_ADD(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig);
ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig); ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig);
} }
......
...@@ -784,7 +784,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( ...@@ -784,7 +784,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
int qos_flow_index = 0; int qos_flow_index = 0;
int pdu_sessions_done = 0; int pdu_sessions_done = 0;
int i; int i;
uint8_t drb_id_to_setup_start = 1; uint8_t drb_id_to_setup_start = 0;
uint8_t nb_drb_to_setup = rrc->configuration.drbs; uint8_t nb_drb_to_setup = rrc->configuration.drbs;
long drb_priority[NGAP_MAX_DRBS_PER_UE]; long drb_priority[NGAP_MAX_DRBS_PER_UE];
NR_CellGroupConfig_t *cellGroupConfig = NULL; NR_CellGroupConfig_t *cellGroupConfig = NULL;
...@@ -903,6 +903,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( ...@@ -903,6 +903,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
rrc->configuration.enable_sdap, rrc->configuration.enable_sdap,
rrc->security.do_drb_integrity, rrc->security.do_drb_integrity,
rrc->security.do_drb_ciphering); rrc->security.do_drb_ciphering);
if (drb_id_to_setup_start == 0) drb_id_to_setup_start = DRB_config->drb_Identity;
ASN_SEQUENCE_ADD(&(*DRB_configList)->list, DRB_config); ASN_SEQUENCE_ADD(&(*DRB_configList)->list, DRB_config);
ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config); ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config);
} }
...@@ -3238,9 +3239,6 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha ...@@ -3238,9 +3239,6 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha
} }
} }
uint8_t drb_id_to_setup_start = 0;
uint8_t nb_drb_to_setup = 0;
long drb_priority[1] = {13}; // For now, we assume only one drb per pdu sessions with a default preiority (will be dynamique in future)
/* Configure SRB2 */ /* Configure SRB2 */
NR_SRB_ToAddMod_t *SRB2_config = NULL; NR_SRB_ToAddMod_t *SRB2_config = NULL;
...@@ -3264,6 +3262,9 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha ...@@ -3264,6 +3262,9 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha
/* Configure DRB */ /* Configure DRB */
NR_DRB_ToAddMod_t *DRB_config = NULL; NR_DRB_ToAddMod_t *DRB_config = NULL;
NR_DRB_ToAddModList_t *DRB_configList = NULL; NR_DRB_ToAddModList_t *DRB_configList = NULL;
uint8_t drb_id_to_setup_start = 0;
uint8_t nb_drb_to_setup = 0;
long drb_priority[1] = {13}; // For now, we assume only one drb per pdu session with a default priority (will be dynamic in future)
if(req->drbs_to_be_setup_length>0){ if(req->drbs_to_be_setup_length>0){
if(ue_context_p->ue_context.DRB_configList == NULL){ if(ue_context_p->ue_context.DRB_configList == NULL){
ue_context_p->ue_context.DRB_configList = CALLOC(1, sizeof(*ue_context_p->ue_context.DRB_configList)); ue_context_p->ue_context.DRB_configList = CALLOC(1, sizeof(*ue_context_p->ue_context.DRB_configList));
...@@ -3273,13 +3274,13 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha ...@@ -3273,13 +3274,13 @@ static void rrc_DU_process_ue_context_setup_request(MessageDef *msg_p, const cha
for (int i=0; i<req->drbs_to_be_setup_length; i++){ for (int i=0; i<req->drbs_to_be_setup_length; i++){
DRB_config = CALLOC(1, sizeof(*DRB_config)); DRB_config = CALLOC(1, sizeof(*DRB_config));
DRB_config->drb_Identity = req->drbs_to_be_setup[i].drb_id; DRB_config->drb_Identity = req->drbs_to_be_setup[i].drb_id;
if (drb_id_to_setup_start == 0) drb_id_to_setup_start = DRB_config->drb_Identity;
ASN_SEQUENCE_ADD(&DRB_configList->list, DRB_config); ASN_SEQUENCE_ADD(&DRB_configList->list, DRB_config);
f1ap_drb_to_be_setup_t drb_p = req->drbs_to_be_setup[i]; f1ap_drb_to_be_setup_t drb_p = req->drbs_to_be_setup[i];
transport_layer_addr_t addr; transport_layer_addr_t addr;
memcpy(addr.buffer, &drb_p.up_ul_tnl[0].tl_address, sizeof(drb_p.up_ul_tnl[0].tl_address)); memcpy(addr.buffer, &drb_p.up_ul_tnl[0].tl_address, sizeof(drb_p.up_ul_tnl[0].tl_address));
addr.length=sizeof(drb_p.up_ul_tnl[0].tl_address)*8; addr.length=sizeof(drb_p.up_ul_tnl[0].tl_address)*8;
extern instance_t DUuniqInstance; extern instance_t DUuniqInstance;
if (!drb_id_to_setup_start) drb_id_to_setup_start = drb_p.drb_id;
incoming_teid = newGtpuCreateTunnel(DUuniqInstance, incoming_teid = newGtpuCreateTunnel(DUuniqInstance,
req->rnti, req->rnti,
drb_p.drb_id, drb_p.drb_id,
...@@ -3407,6 +3408,8 @@ static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, co ...@@ -3407,6 +3408,8 @@ static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, co
/* Configure DRB */ /* Configure DRB */
NR_DRB_ToAddMod_t *DRB_config = NULL; NR_DRB_ToAddMod_t *DRB_config = NULL;
NR_DRB_ToAddModList_t *DRB_configList = NULL; NR_DRB_ToAddModList_t *DRB_configList = NULL;
uint8_t drb_id_to_setup_start = 0;
long drb_priority[1] = {13}; // For now, we assume only one drb per pdu session with a default priority (will be dynamic in future)
if(req->drbs_to_be_setup_length>0){ if(req->drbs_to_be_setup_length>0){
if(ue_context_p->ue_context.DRB_configList == NULL){ if(ue_context_p->ue_context.DRB_configList == NULL){
ue_context_p->ue_context.DRB_configList = CALLOC(1, sizeof(*ue_context_p->ue_context.DRB_configList)); ue_context_p->ue_context.DRB_configList = CALLOC(1, sizeof(*ue_context_p->ue_context.DRB_configList));
...@@ -3415,6 +3418,7 @@ static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, co ...@@ -3415,6 +3418,7 @@ static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, co
for (int i=0; i<req->drbs_to_be_setup_length; i++){ for (int i=0; i<req->drbs_to_be_setup_length; i++){
DRB_config = CALLOC(1, sizeof(*DRB_config)); DRB_config = CALLOC(1, sizeof(*DRB_config));
DRB_config->drb_Identity = req->drbs_to_be_setup[i].drb_id; DRB_config->drb_Identity = req->drbs_to_be_setup[i].drb_id;
if (drb_id_to_setup_start == 0) drb_id_to_setup_start = DRB_config->drb_Identity;
ASN_SEQUENCE_ADD(&DRB_configList->list, DRB_config); ASN_SEQUENCE_ADD(&DRB_configList->list, DRB_config);
f1ap_drb_to_be_setup_t drb_p = req->drbs_to_be_setup[i]; f1ap_drb_to_be_setup_t drb_p = req->drbs_to_be_setup[i];
transport_layer_addr_t addr; transport_layer_addr_t addr;
...@@ -3436,8 +3440,6 @@ static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, co ...@@ -3436,8 +3440,6 @@ static void rrc_DU_process_ue_context_modification_request(MessageDef *msg_p, co
if(req->srbs_to_be_setup_length>0 || req->drbs_to_be_setup_length>0){ if(req->srbs_to_be_setup_length>0 || req->drbs_to_be_setup_length>0){
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t)); cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
uint8_t drb_id_to_setup_start = 1;
long drb_priority[1] = {13}; // For now, we assume only one drb per pdu sessions with a default preiority (will be dynamique in future)
fill_mastercellGroupConfig(cellGroupConfig, fill_mastercellGroupConfig(cellGroupConfig,
ue_context_p->ue_context.masterCellGroup, ue_context_p->ue_context.masterCellGroup,
rrc->um_on_default_drb, rrc->um_on_default_drb,
......
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