gnb,config: Added five_qi_cfg to rrc_nr_config_t. Starting to add

five_qi_field to parse the rb.conf for 5g configuration.
master
Pedro Alvarez 3 years ago
parent 4bf7d8f524
commit 43a2678841

@ -37,7 +37,6 @@
// }
qci_config = (
{
qci=7;
pdcp_config = {
@ -91,5 +90,4 @@ qci_config = (
dl_max_retx_thresh = 32;
};
}
);

@ -635,6 +635,22 @@ int field_qci::parse(libconfig::Setting& root)
return 0;
}
int field_five_qi::parse(libconfig::Setting& root)
{
uint32_t nof_five_qi = (uint32_t)root.getLength();
for (uint32_t i = 0; i < nof_five_qi; i++) {
libconfig::Setting& q = root[i];
uint32_t five_qi = q["five_qi"];
rrc_nr_cfg_five_qi_t five_qi_cfg;
cfg.insert(std::make_pair(five_qi, five_qi_cfg));
}
return 0;
}
namespace rr_sections {
int parse_rr(all_args_t* args_, rrc_cfg_t* rrc_cfg_, rrc_nr_cfg_t* rrc_nr_cfg_)
@ -1223,15 +1239,15 @@ int parse_cfg_files(all_args_t* args_, rrc_cfg_t* rrc_cfg_, rrc_nr_cfg_t* rrc_nr
}
try {
if (drb_sections::parse_drb(args_, rrc_cfg_) != SRSRAN_SUCCESS) {
fprintf(stderr, "Error parsing DRB configuration\n");
if (rb_sections::parse_rb(args_, rrc_cfg_, rrc_nr_cfg_) != SRSRAN_SUCCESS) {
fprintf(stderr, "Error parsing RB configuration\n");
return SRSRAN_ERROR;
}
} catch (const SettingTypeException& stex) {
fprintf(stderr, "Error parsing DRB configuration: %s\n", stex.getPath());
fprintf(stderr, "Error parsing RB configuration: %s\n", stex.getPath());
return SRSRAN_ERROR;
} catch (const ConfigException& cex) {
fprintf(stderr, "Error parsing DRB configuration\n");
fprintf(stderr, "Error parsing RB configuration\n");
return SRSRAN_ERROR;
}
@ -2102,9 +2118,9 @@ int parse_sibs(all_args_t* args_, rrc_cfg_t* rrc_cfg_, srsenb::phy_cfg_t* phy_co
} // namespace sib_sections
namespace drb_sections {
namespace rb_sections {
int parse_drb(all_args_t* args_, rrc_cfg_t* rrc_cfg_)
int parse_rb(all_args_t* args_, rrc_cfg_t* rrc_cfg_, rrc_nr_cfg_t* rrc_nr_cfg_)
{
parser::section srb1("srb1_config");
bool srb1_present = false;
@ -2125,11 +2141,15 @@ int parse_drb(all_args_t* args_, rrc_cfg_t* rrc_cfg_)
parser::section qci("qci_config");
qci.add_field(new field_qci(rrc_cfg_->qci_cfg));
parser::section five_qi("five_qi_config");
five_qi.add_field(new field_five_qi(rrc_nr_cfg_->five_qi_cfg));
// Run parser with two sections
parser p(args_->enb_files.rb_config);
p.add_section(&srb1);
p.add_section(&srb2);
p.add_section(&qci);
p.add_section(&five_qi);
int ret = p.parse();
if (not srb1_present) {
@ -2142,6 +2162,6 @@ int parse_drb(all_args_t* args_, rrc_cfg_t* rrc_cfg_)
return ret;
}
} // namespace drb_sections
} // namespace rb_sections
} // namespace srsenb

@ -22,6 +22,7 @@
#include <string>
#include "srsenb/hdr/stack/rrc/rrc.h"
#include "srsgnb/hdr/stack/rrc/rrc_nr_config.h"
#include "srsran/asn1/asn1_utils.h"
namespace srsenb {
@ -58,11 +59,12 @@ int parse_sibs(all_args_t* args_, rrc_cfg_t* rrc_cfg_, srsenb::phy_cfg_t* phy_co
} // namespace sib_sections
// drb.conf parsing
namespace drb_sections {
// rb.conf parsing
namespace rb_sections {
int parse_drb(all_args_t* args, rrc_cfg_t* rrc_cfg);
} // namespace drb_sections
int parse_rb(all_args_t* args, rrc_cfg_t* rrc_cfg, rrc_nr_cfg_t* rrc_nr_cfg);
} // namespace rb_sections
// rr.conf parsing
namespace rr_sections {
@ -189,6 +191,17 @@ private:
std::map<uint32_t, rrc_cfg_qci_t>& cfg;
};
class field_five_qi final : public parser::field_itf
{
public:
explicit field_five_qi(std::map<uint32_t, rrc_nr_cfg_five_qi_t>& cfg_) : cfg(cfg_) {}
const char* get_name() override { return "field_5qi"; }
int parse(Setting& root) override;
private:
std::map<uint32_t, rrc_nr_cfg_five_qi_t>& cfg;
};
// ASN1 parsers
class field_asn1 : public parser::field_itf

@ -460,7 +460,7 @@ void parse_args(all_args_t* args, int argc, char* argv[])
}
if (!config_exists(args->enb_files.rb_config, "rb.conf")) {
cout << "Failed to read DRB configuration file " << args->enb_files.rb_config << " - exiting" << endl;
cout << "Failed to read RB configuration file " << args->enb_files.rb_config << " - exiting" << endl;
exit(1);
}

@ -45,6 +45,12 @@ struct rrc_cell_cfg_nr_t {
typedef std::vector<rrc_cell_cfg_nr_t> rrc_cell_list_nr_t;
struct rrc_nr_cfg_five_qi_t {
bool configured = false;
asn1::rrc_nr::pdcp_cfg_s pdcp_cfg;
asn1::rrc_nr::rlc_cfg_c rlc_cfg;
};
struct rrc_nr_cfg_t {
rrc_cell_list_nr_t cell_list;
uint32_t inactivity_timeout_ms = 100000;
@ -53,6 +59,8 @@ struct rrc_nr_cfg_t {
uint16_t mnc;
bool is_standalone;
std::map<uint32_t, rrc_nr_cfg_five_qi_t> five_qi_cfg;
std::array<srsran::CIPHERING_ALGORITHM_ID_NR_ENUM, srsran::CIPHERING_ALGORITHM_ID_NR_N_ITEMS> nea_preference_list;
std::array<srsran::INTEGRITY_ALGORITHM_ID_NR_ENUM, srsran::INTEGRITY_ALGORITHM_ID_NR_N_ITEMS> nia_preference_list;

Loading…
Cancel
Save