X-Git-Url: https://git.stg.codes/ssmd.git/blobdiff_plain/ae26516a8828d54ab7c0e0bca92031a54a15ed62..HEAD:/src/settings.cpp diff --git a/src/settings.cpp b/src/settings.cpp index 5d04ad2..897793c 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1,8 +1,8 @@ #include "logger.h" #include "settings.h" -using GTS::Settings; -using GTS::SettingsParser; +using SSMD::Settings; +using SSMD::SettingsParser; SettingsParser::SettingsParser() : _desc("Allowed options") @@ -10,17 +10,20 @@ SettingsParser::SettingsParser() // Declare the supported options. _desc.add_options() ("help", "produce help message") - ("config,c", po::value()->default_value("/etc/gssmd/gssmd.conf"), "config file location") + ("config,c", po::value()->default_value("/etc/ssmd/ssmd.conf"), "config file location") ("daemon,d", "daemonize after start") - ("debug", "gssmd debugging") + ("debug", "ssmd debugging") ("log-file", po::value(), "log file location") ("pid-file", po::value(), "PID file location") ("switch-sync-interval,s", po::value(), "switch synchronization interval") ("info-sync-interval,i", po::value(), "info synchronization interval") ("up-profile-id", po::value(), "switch's upload profile id") ("down-profile-id", po::value(), "switch's download profile id") + ("max-acl-per-pdu", po::value(), "maximum ACL's per PDU") ("data-url", po::value(), "data access URL") - ("version,v", "show gssmd version and exit") + ("script-base", po::value(), "base dir for scripts") + ("dump-scripts", "dump SNMP command into shell scripts") + ("version,v", "show ssmd version and exit") ; } @@ -28,14 +31,13 @@ void SettingsParser::init(int argc, char * argv[]) { po::variables_map vm; po::store(po::parse_command_line(argc, argv, _desc), vm); - po::notify(vm); + po::notify(vm); _settings._isHelp = vm.count("help"); _settings._isVersion = vm.count("version"); - if (vm.count("config")) { + if (vm.count("config")) _settings._configFile = vm["config"].as(); - } if (!_settings._isHelp && !_settings._isVersion) { @@ -47,40 +49,31 @@ void SettingsParser::init(int argc, char * argv[]) } } - if (vm.count("debug")) { + if (vm.count("debug")) _settings._isDebug = true; - } - if (vm.count("daemon")) { + if (vm.count("daemon")) _settings._isDaemon = true; - } - if (vm.count("log-file")) { + if (vm.count("log-file")) _settings._logFile = vm["log-file"].as(); - } - - if (vm.count("pid-file")) { + if (vm.count("pid-file")) _settings._PIDFile = vm["pid-file"].as(); - } - - if (vm.count("switch-sync-interval")) { + if (vm.count("switch-sync-interval")) _settings._switchSyncInterval = vm["switch-sync-interval"].as(); - } - - if (vm.count("info-sync-interval")) { + if (vm.count("info-sync-interval")) _settings._infoSyncInterval = vm["info-sync-interval"].as(); - } - - if (vm.count("up-profile-id")) { + if (vm.count("up-profile-id")) _settings._upProfileId = vm["up-profile-id"].as(); - } - - if (vm.count("down-profile-id")) { + if (vm.count("down-profile-id")) _settings._downProfileId = vm["down-profile-id"].as(); - } - - if (vm.count("data-url")) { + if (vm.count("max-acl-per-pdu")) + _settings._downProfileId = vm["max-acl-per-pdu"].as(); + if (vm.count("data-url")) _settings._dataURL = vm["data-url"].as(); - } + if (vm.count("script-base")) + _settings._scriptBase = vm["script-base"].as(); + if (vm.count("dump-scripts")) + _settings._dumpScripts = true; } void SettingsParser::reloadConfig()