|
|
|
@ -70,6 +70,39 @@ bool sib_is_present(const sched_info_list_l& l, sib_type_e sib_num)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int field_additional_plmns::parse(libconfig::Setting& root)
|
|
|
|
|
{
|
|
|
|
|
if (root.getLength() > ASN1_RRC_MAX_PLMN_MINUS1_R14) {
|
|
|
|
|
ERROR("PLMN-IdentityList cannot have more than %d entries", ASN1_RRC_MAX_PLMN_R11);
|
|
|
|
|
return SRSRAN_ERROR;
|
|
|
|
|
}
|
|
|
|
|
// Reserve the first place to the primary PLMN, see "SystemInformationBlockType1 field descriptions" in TS 36.331
|
|
|
|
|
data->plmn_id_list.resize((uint32_t)root.getLength() + 1);
|
|
|
|
|
for (uint32_t i = 0; i < data->plmn_id_list.size() - 1; i++) {
|
|
|
|
|
std::string mcc_str, mnc_str;
|
|
|
|
|
if (!root[i].lookupValue("mcc", mcc_str)) {
|
|
|
|
|
ERROR("Missing field mcc in additional_plmn=%d\n", i);
|
|
|
|
|
return SRSRAN_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!root[i].lookupValue("mnc", mnc_str)) {
|
|
|
|
|
ERROR("Missing field mnc in additional_plmn=%d\n", i);
|
|
|
|
|
return SRSRAN_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
srsran::plmn_id_t plmn;
|
|
|
|
|
if (plmn.from_string(mcc_str + mnc_str) == SRSRAN_ERROR) {
|
|
|
|
|
ERROR("Could not convert %s to a plmn_id in additional_plmn=%d", (mcc_str + mnc_str).c_str(), i);
|
|
|
|
|
return SRSRAN_ERROR;
|
|
|
|
|
}
|
|
|
|
|
srsran::to_asn1(&data->plmn_id_list[i + 1].plmn_id, plmn);
|
|
|
|
|
if (not parse_enum_by_str(data->plmn_id_list[i + 1].cell_reserved_for_oper, "cell_reserved_for_oper", root[i])) {
|
|
|
|
|
data->plmn_id_list[i + 1].cell_reserved_for_oper = plmn_id_info_s::cell_reserved_for_oper_e_::not_reserved;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int field_sched_info::parse(libconfig::Setting& root)
|
|
|
|
|
{
|
|
|
|
|
data->sched_info_list.resize((uint32_t)root.getLength());
|
|
|
|
@ -2161,6 +2194,13 @@ int parse_sib1(std::string filename, sib_type1_s* data)
|
|
|
|
|
sib1.add_field(make_asn1_enum_number_parser("si_window_length", &data->si_win_len));
|
|
|
|
|
sib1.add_field(new parser::field<uint8_t>("system_info_value_tag", &data->sys_info_value_tag));
|
|
|
|
|
|
|
|
|
|
// additional_plmns subsection uses a custom field class
|
|
|
|
|
parser::section additional_plmns("additional_plmns");
|
|
|
|
|
sib1.add_subsection(&additional_plmns);
|
|
|
|
|
bool dummy_bool = true;
|
|
|
|
|
additional_plmns.set_optional(&dummy_bool);
|
|
|
|
|
additional_plmns.add_field(new field_additional_plmns(&data->cell_access_related_info));
|
|
|
|
|
|
|
|
|
|
// sched_info subsection uses a custom field class
|
|
|
|
|
parser::section sched_info("sched_info");
|
|
|
|
|
sib1.add_subsection(&sched_info);
|
|
|
|
@ -2594,7 +2634,10 @@ int parse_sibs(all_args_t* args_, rrc_cfg_t* rrc_cfg_, srsenb::phy_cfg_t* phy_co
|
|
|
|
|
return SRSRAN_ERROR;
|
|
|
|
|
}
|
|
|
|
|
sib_type1_s::cell_access_related_info_s_* cell_access = &sib1->cell_access_related_info;
|
|
|
|
|
cell_access->plmn_id_list.resize(1);
|
|
|
|
|
// In case additional PLMNs were given, resizing will remove them
|
|
|
|
|
if (cell_access->plmn_id_list.size() == 0) {
|
|
|
|
|
cell_access->plmn_id_list.resize(1);
|
|
|
|
|
}
|
|
|
|
|
srsran::plmn_id_t plmn;
|
|
|
|
|
if (plmn.from_string(mcc_str + mnc_str) == SRSRAN_ERROR) {
|
|
|
|
|
ERROR("Could not convert %s to a plmn_id", (mcc_str + mnc_str).c_str());
|
|
|
|
|