Adding options for OP and OPc in the UE. They cannot be simultanoulsy set.

master
Pedro Alvarez 7 years ago
parent 721be55f4f
commit ea5445f999

@ -43,7 +43,9 @@ typedef enum{
typedef struct{ typedef struct{
std::string mode; std::string mode;
std::string algo; std::string algo;
bool using_op;
std::string op; std::string op;
std::string opc;
std::string imsi; std::string imsi;
std::string imei; std::string imei;
std::string k; std::string k;

@ -129,7 +129,8 @@ void parse_args(all_args_t *args, int argc, char *argv[]) {
("usim.mode", bpo::value<string>(&args->usim.mode)->default_value("soft"), "USIM mode (soft or pcsc)") ("usim.mode", bpo::value<string>(&args->usim.mode)->default_value("soft"), "USIM mode (soft or pcsc)")
("usim.algo", bpo::value<string>(&args->usim.algo), "USIM authentication algorithm") ("usim.algo", bpo::value<string>(&args->usim.algo), "USIM authentication algorithm")
("usim.opc", bpo::value<string>(&args->usim.op), "USIM operator ciphered variant") ("usim.op", bpo::value<string>(&args->usim.op), "USIM operator code")
("usim.opc", bpo::value<string>(&args->usim.op), "USIM operator code (ciphered variant)")
("usim.imsi", bpo::value<string>(&args->usim.imsi), "USIM IMSI") ("usim.imsi", bpo::value<string>(&args->usim.imsi), "USIM IMSI")
("usim.imei", bpo::value<string>(&args->usim.imei), "USIM IMEI") ("usim.imei", bpo::value<string>(&args->usim.imei), "USIM IMEI")
("usim.k", bpo::value<string>(&args->usim.k), "USIM K") ("usim.k", bpo::value<string>(&args->usim.k), "USIM K")
@ -359,9 +360,28 @@ void parse_args(all_args_t *args, int argc, char *argv[]) {
cout << "Failed to read configuration file " << config_file << " - exiting" << endl; cout << "Failed to read configuration file " << config_file << " - exiting" << endl;
exit(1); exit(1);
} }
bpo::store(bpo::parse_config_file(conf, common), vm); bpo::store(bpo::parse_config_file(conf, common), vm);
bpo::notify(vm); bpo::notify(vm);
//Check conflicting OP/OPc options and which is being used
if (vm.count("usim.op") && !vm["usim.op"].defaulted() &&
vm.count("usim.opc") && !vm["usim.opc"].defaulted())
{
cout << "Conflicting options OP and OPc. Please configure either one or the other." << endl;
exit(1);
}
else
{
if(vm["usim.op"].defaulted()){
args->usim.using_op = true;
}
else{
args->usim.using_op = false;
}
}
cout << vm.count("usim.op") <<endl;
// Apply all_level to any unset layers // Apply all_level to any unset layers
if (vm.count("log.all_level")) { if (vm.count("log.all_level")) {
if (!vm.count("log.phy_level")) { if (!vm.count("log.phy_level")) {

Loading…
Cancel
Save