Commit af402766 authored by Frédéric Leroy's avatar Frédéric Leroy

feat(conf2uedata): add a selector for writing files

parent 6c588589
...@@ -42,7 +42,7 @@ int main(int argc, char**argv) { ...@@ -42,7 +42,7 @@ int main(int argc, char**argv) {
exit(1); exit(1);
} }
if ( parse_config_file(output_dir, conf_file) == false ) { if ( parse_config_file(output_dir, conf_file, OUTPUT_ALL) == false ) {
exit(1); exit(1);
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "conf_user_data.h" #include "conf_user_data.h"
#include "conf_user_plmn.h" #include "conf_user_plmn.h"
bool parse_config_file(const char *output_dir, const char *conf_filename) { bool parse_config_file(const char *output_dir, const char *conf_filename, int output_flags) {
int rc = true; int rc = true;
int ret; int ret;
int ue_nb = 0; int ue_nb = 0;
...@@ -65,7 +65,6 @@ bool parse_config_file(const char *output_dir, const char *conf_filename) { ...@@ -65,7 +65,6 @@ bool parse_config_file(const char *output_dir, const char *conf_filename) {
return false; return false;
} }
gen_user_data(&user_data_conf, &user_data); gen_user_data(&user_data_conf, &user_data);
write_user_data(output_dir, i, &user_data);
rc = parse_ue_sim_param(ue_setting, i, &usim_data_conf); rc = parse_ue_sim_param(ue_setting, i, &usim_data_conf);
if (rc != true) { if (rc != true) {
...@@ -73,11 +72,21 @@ bool parse_config_file(const char *output_dir, const char *conf_filename) { ...@@ -73,11 +72,21 @@ bool parse_config_file(const char *output_dir, const char *conf_filename) {
return false; return false;
} }
gen_usim_data(&usim_data_conf, &usim_data, &user_plmns, networks); gen_usim_data(&usim_data_conf, &usim_data, &user_plmns, networks);
write_usim_data(output_dir, i, &usim_data);
gen_emm_data(&emm_data, usim_data_conf.hplmn, usim_data_conf.msin, gen_emm_data(&emm_data, usim_data_conf.hplmn, usim_data_conf.msin,
user_plmns.equivalents_home.size, networks); user_plmns.equivalents_home.size, networks);
write_emm_data(output_dir, i, &emm_data);
if ( output_flags & OUTPUT_UEDATA ) {
write_user_data(output_dir, i, &user_data);
}
if ( output_flags & OUTPUT_USIM ) {
write_usim_data(output_dir, i, &usim_data);
}
if ( output_flags & OUTPUT_EMM ) {
write_emm_data(output_dir, i, &emm_data);
}
user_plmns_free(&user_plmns); user_plmns_free(&user_plmns);
......
...@@ -6,7 +6,12 @@ ...@@ -6,7 +6,12 @@
#define UE "UE" #define UE "UE"
#define OUTPUT_EMM 1
#define OUTPUT_USIM 2
#define OUTPUT_UEDATA 4
#define OUTPUT_ALL 7
bool get_config_from_file(const char *filename, config_t *config); bool get_config_from_file(const char *filename, config_t *config);
bool parse_config_file(const char *output_dir, const char *filename); bool parse_config_file(const char *output_dir, const char *filename, int output_flags);
#endif #endif
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