2 * @brief Config class implementation. This class represents the actual configuration.
6 * @copyright Intra2net AG
12 #include "service_dhs.hpp"
13 #include "service_ods.hpp"
14 #include "service_dyndns.hpp"
15 #include "service_dyns.hpp"
16 #include "service_easydns.hpp"
17 #include "service_tzo.hpp"
18 #include "service_zoneedit.hpp"
19 #include "service_gnudip.hpp"
20 #include "service_gnudip_fullhostname.hpp"
26 #include <boost/foreach.hpp>
27 #include <boost/filesystem.hpp>
28 #include <boost/regex.hpp>
29 #include <boost/algorithm/string.hpp>
32 namespace po = boost::program_options;
33 namespace fs = boost::filesystem;
34 namespace ba = boost::algorithm;
36 typedef boost::shared_ptr<boost::program_options::options_description> Options_descriptionPtr;
42 * Default Constructor. Available command line and config file options with their default values are defined here.
46 , ServiceHolder(new Serviceholder)
51 , ConfigPath("/etc/bpdyndnsd")
54 , ExternalWarningLog("")
55 , ExternalWarningLevel(0)
57 , WebcheckEnabled(false)
58 , ExternalLogOnlyOnce(false)
60 , DialupBurstPeriodSeconds(120)
61 , DialupSleepSeconds(10 * 60)
63 define_config_options();
68 * Constructor with Logger and Serviceholder objects. Available command line and config file options with their default values are defined here.
69 * @todo Move the program options init code to a function used by both constructors
71 Config::Config(Logger::Ptr _log, Serviceholder::Ptr _serviceholder)
73 , ServiceHolder(_serviceholder)
78 , ConfigPath("/etc/bpdyndnsd")
81 , ExternalWarningLog("")
82 , ExternalWarningLevel(0)
84 , WebcheckEnabled(false)
85 , ExternalLogOnlyOnce(false)
87 , DialupBurstPeriodSeconds(120)
88 , DialupSleepSeconds(10 * 60)
90 define_config_options();
103 * Define valid config options with default parameters.
105 void Config::define_config_options()
107 // Available service description config options
108 po::options_description opt_desc_service("Service description options");
109 opt_desc_service.add_options()
110 ("protocol",po::value<string>(),"The service protocol.")
111 ("server",po::value<string>(),"Servername needed for gnudip/dyndns protocol.")
112 ("host",po::value<string>(),"The hostname to update.")
113 ("login",po::value<string>(),"Login name.")
114 ("password",po::value<string>(),"Corresponding password.")
115 ("update_interval",po::value<int>()->default_value(-1),"Update interval in minutes.")
116 ("max_updates_within_interval",po::value<int>()->default_value(-1),"How many updates can be made in one interval.")
117 ("max_equal_updates_in_succession",po::value<int>()->default_value(-1),"How many updates with the same IP in succession should be made.")
118 ("dns_cache_ttl",po::value<int>()->default_value(-1),"How long a dns record is valid.")
121 // Available command line only options
122 po::options_description opt_desc_cmd_only("Command line only options");
123 opt_desc_cmd_only.add_options()
124 ("help,?","Show help.")
125 ("version,v","Show version.")
126 ("config,c",po::value<string>()->default_value("/etc/bpdyndnsd"),"Set the config path.")
129 // Available generic options. Valid on cmd or in config file.
130 po::options_description opt_desc_generic("Generic config options");
131 opt_desc_generic.add_options()
132 ("daemon_mode",po::value<bool>()->default_value(false),"Run as system daemon.")
133 ("loglevel",po::value<int>()->default_value(0),"Loglevel.")
134 ("syslog",po::value<bool>()->default_value(false),"Use syslog facility.")
135 ("enable_ipv6",po::value<bool>()->default_value(false),"Try to use IPv6.")
136 ("webcheck_enabled",po::value<bool>()->default_value(false),"Use webcheck url to determine actual IP address.")
137 ("webcheck_url",po::value<string>()->default_value(""),"Use this URL to determine IP.")
138 ("webcheck_url_alt",po::value<string>()->default_value(""),"Use this alternative URL to determine IP.")
139 ("webcheck_interval",po::value<int>()->default_value(10),"The webcheck interval in minutes.")
140 ("http_proxy",po::value<string>(),"Use this proxy for all http requests.")
141 ("http_proxy_port",po::value<int>(),"Port of the proxy.")
142 ("external_warning_log",po::value<string>()->default_value(""),"External programm to pass warning log messages to.")
143 ("external_warning_level",po::value<int>()->default_value(0),"Warning messages of which loglevel should be passed to external programm.")
144 ("external_log_only_once",po::value<bool>()->default_value(false),"Log the same external message only once until next reload or restart.")
145 ("start_offline",po::value<bool>()->default_value(false),"Start in offline mode.")
146 ("dialup_mode",po::value<bool>()->default_value(false),"Enable dialup mode (sleep periods between network traffic)")
147 ("dialup_burst_period_seconds",po::value<int>()->default_value(120),"Seconds of normal operation before entering dialup mode")
148 ("dialup_sleep_seconds",po::value<int>()->default_value(10 * 60),"Seconds to sleep between network traffic")
149 ("wan_ip_override",po::value<string>(),"Manual override for automatic WAN IP detection")
152 // Define valid command line parameters
153 OptDescCmd = Options_descriptionPtr(new po::options_description("Command line options"));
154 OptDescCmd->add(opt_desc_cmd_only);
155 OptDescCmd->add(opt_desc_generic);
156 OptDescCmd->add(opt_desc_service);
158 // Define valid config file options
159 OptDescConfMain = Options_descriptionPtr(new po::options_description("Config file options"));
160 OptDescConfMain->add(opt_desc_generic);
162 // Define valid service file options
163 OptDescConfService = Options_descriptionPtr(new po::options_description("Service file options"));
164 OptDescConfService->add(opt_desc_service);
169 * Parses the command line arguments and does the needed actions.
170 * @param argc Command line argument number given to main.
171 * @param argv[] Pointer to command line argument array given to main.
172 * @return 0 if all is fine, -1 if not.
174 int Config::parse_cmd_line(int argc, char *argv[])
178 po::store(po::parse_command_line(argc, argv, *this->OptDescCmd), VariablesMap);
179 po::notify(VariablesMap);
181 if ( VariablesMap.count("help") )
183 Log->print_usage(OptDescCmd);
186 else if ( VariablesMap.count("version") )
188 Log->print_version();
192 // Create a service object if all needed options are set on the command line
193 if ( VariablesMap.count("protocol") && VariablesMap.count("host") && VariablesMap.count("login") && VariablesMap.count("password") )
195 // Get the cmd parameter values for protocol host login and password
196 string protocol = VariablesMap["protocol"].as<string>();
197 string host = VariablesMap["host"].as<string>();
198 string login = VariablesMap["login"].as<string>();
199 string password = VariablesMap["password"].as<string>();
201 protocol = ba::to_lower_copy(protocol);
204 if ( VariablesMap.count("server") )
205 server = VariablesMap["server"].as<string>();
207 int update_interval = 0;
208 if ( VariablesMap.count("update_interval") )
209 update_interval = VariablesMap["update_interval"].as<int>();
211 int max_updates_within_interval = 0;
212 if ( VariablesMap.count("max_updates_within_interval") )
213 max_updates_within_interval = VariablesMap["max_updates_within_interval"].as<int>();
215 int max_equal_updates_in_succession = 0;
216 if ( VariablesMap.count("max_equal_updates_in_succession") )
217 max_equal_updates_in_succession = VariablesMap["max_equal_updates_in_succession"].as<int>();
219 int dns_cache_ttl = 0;
220 if ( VariablesMap.count("dns_cache_ttl") )
221 dns_cache_ttl = VariablesMap["dns_cache_ttl"].as<int>();
223 Service::Ptr service = create_service(protocol,server,host,login,password,update_interval,max_updates_within_interval,max_equal_updates_in_succession,dns_cache_ttl);
226 ServiceHolder->add_service(service);
227 Log->print_service_object("New Service object from command line options:", service->get_protocol(), service->get_hostname(), service->get_login() ,service->get_password(), service->get_update_interval(), service->get_max_updates_within_interval(), service->get_max_equal_updates_in_succession(), service->get_dns_cache_ttl() , service->get_actual_ip(), service->get_last_updates(), service->get_activated());
231 Log->print_invalid_service_config();
234 else if ( VariablesMap.count("protocol") || VariablesMap.count("host") || VariablesMap.count("login") || VariablesMap.count("password") )
236 Log->print_missing_cmd_service_option();
237 Log->print_usage(OptDescCmd);
241 if ( VariablesMap.count("config") )
243 fs::path full_config_path = fs::system_complete(fs::path(VariablesMap["config"].as<string>()));
244 ConfigPath = full_config_path.string();
245 if ( !fs::exists(full_config_path) || !fs::is_directory(full_config_path) )
247 // Config path doesn't exist or is not a directory
248 Log->print_error_config_path(ConfigPath);
253 if ( VariablesMap.count("daemon_mode") )
254 DaemonMode = VariablesMap["daemon_mode"].as<bool>();
256 if ( VariablesMap.count("loglevel") )
257 Loglevel = VariablesMap["loglevel"].as<int>();
259 if ( VariablesMap.count("syslog") )
260 Syslog = VariablesMap["syslog"].as<bool>();
262 if ( VariablesMap.count("enable_ipv6") )
263 EnableIPv6 = VariablesMap["enable_ipv6"].as<bool>();
265 if ( VariablesMap.count("webcheck_enabled") )
266 WebcheckEnabled = VariablesMap["webcheck_enabled"].as<bool>();
268 if ( VariablesMap.count("webcheck_url") )
269 WebcheckIpUrl = VariablesMap["webcheck_url"].as<string>();
271 if ( VariablesMap.count("webcheck_url_alt") )
272 WebcheckIpUrlAlt = VariablesMap["webcheck_url_alt"].as<string>();
274 if ( VariablesMap.count("webcheck_interval") )
275 WebcheckInterval = VariablesMap["webcheck_interval"].as<int>();
277 if ( VariablesMap.count("http_proxy") && VariablesMap.count("http_proxy_port") )
279 Proxy = VariablesMap["http_proxy"].as<string>();
280 ProxyPort = VariablesMap["http_proxy_port"].as<int>();
282 else if ( VariablesMap.count("http_proxy") || VariablesMap.count("http_proxy_port") )
284 Log->print_missing_cmd_proxy_option();
285 Log->print_usage(OptDescCmd);
289 if ( VariablesMap.count("external_warning_log") )
290 ExternalWarningLog = VariablesMap["external_warning_log"].as<string>();
292 if ( VariablesMap.count("external_warning_level") )
293 ExternalWarningLevel = VariablesMap["external_warning_level"].as<int>();
295 if ( VariablesMap.count("external_log_only_once") )
296 ExternalLogOnlyOnce = VariablesMap["external_log_only_once"].as<bool>();
298 if ( VariablesMap.count("start_offline") )
299 StartOffline = VariablesMap["start_offline"].as<bool>();
301 if ( VariablesMap.count("dialup_mode") )
302 DialupMode = VariablesMap["dialup_mode"].as<bool>();
303 if ( VariablesMap.count("dialup_burst_period_seconds") )
304 DialupBurstPeriodSeconds = VariablesMap["dialup_burst_period_seconds"].as<int>();
305 if ( VariablesMap.count("dialup_sleep_seconds") )
306 DialupSleepSeconds = VariablesMap["dialup_sleep_seconds"].as<int>();
308 if ( VariablesMap.count("wan_ip_override") )
309 WanIpOverride = VariablesMap["wan_ip_override"].as<string>();
311 catch( const po::unknown_option& e )
313 Log->print_unknown_cmd_option(e.what());
314 Log->print_usage(OptDescCmd);
317 catch( const po::multiple_occurrences& e )
319 Log->print_multiple_cmd_option(e.what());
320 Log->print_usage(OptDescCmd);
323 catch( const po::error& e )
325 Log->print_error_parsing_cmd(e.what());
326 Log->print_usage(OptDescCmd);
334 * Creates a Service object from the given parameters.
335 * @param protocol Protocol to use.
336 * @param host Hostname to update.
337 * @param login Login.
338 * @param password Password.
339 * @return A pointer to the created Service object.
341 Service::Ptr Config::create_service(const string &protocol, const string& server, const string& hostname, const string& login, const string& password, const int update_interval, const int max_updates_within_interval, const int max_equal_updates_in_succession, const int dns_cache_ttl)
343 // Test for valid hostname. Must contain 3 parts minimum.
344 list<string> fqhn_parts;
345 ba::split(fqhn_parts,hostname,boost::is_any_of("."));
346 if ( fqhn_parts.size() < 3 )
348 Log->print_invalid_hostname(hostname);
349 Service::Ptr service;
353 if(protocol == "dhs")
355 Service::Ptr service_dhs(new ServiceDhs(protocol,hostname,login,password,Log,update_interval,max_updates_within_interval,max_equal_updates_in_succession,dns_cache_ttl,Proxy,ProxyPort));
358 else if(protocol == "ods")
360 Service::Ptr service_ods(new ServiceOds(protocol,hostname,login,password,Log,update_interval,max_updates_within_interval,max_equal_updates_in_succession,dns_cache_ttl));
363 else if(protocol == "dyndns")
365 Service::Ptr service_dyndns(new ServiceDyndns(protocol,hostname,login,password,Log,update_interval,max_updates_within_interval,max_equal_updates_in_succession,dns_cache_ttl,Proxy,ProxyPort,server));
366 return service_dyndns;
368 else if(protocol == "dyns")
370 Service::Ptr service_dyns(new ServiceDyns(protocol,hostname,login,password,Log,update_interval,max_updates_within_interval,max_equal_updates_in_succession,dns_cache_ttl,Proxy,ProxyPort));
373 else if(protocol == "easydns")
375 Service::Ptr service_easydns(new ServiceEasydns(protocol,hostname,login,password,Log,update_interval,max_updates_within_interval,max_equal_updates_in_succession,dns_cache_ttl,Proxy,ProxyPort));
376 return service_easydns;
378 else if(protocol == "tzo")
380 Service::Ptr service_tzo(new ServiceTzo(protocol,hostname,login,password,Log,update_interval,max_updates_within_interval,max_equal_updates_in_succession,dns_cache_ttl,Proxy,ProxyPort));
383 else if(protocol == "zoneedit")
385 Service::Ptr service_zoneedit(new ServiceZoneedit(protocol,hostname,login,password,Log,update_interval,max_updates_within_interval,max_equal_updates_in_succession,dns_cache_ttl,Proxy,ProxyPort));
386 return service_zoneedit;
388 else if(protocol == "gnudip")
390 if ( !server.empty() )
392 Service::Ptr service_gnudip(new ServiceGnudip(protocol,server,hostname,login,password,Log,update_interval,max_updates_within_interval,max_equal_updates_in_succession,dns_cache_ttl,Proxy,ProxyPort));
393 return service_gnudip;
397 Log->print_gnudip_requires_servername();
398 Service::Ptr service;
402 else if(protocol == "gnudip-fullhostname")
404 if ( !server.empty() )
406 Service::Ptr service_gnudip_fullhostname(new ServiceGnudipFullhostname(protocol,server,hostname,login,password,Log,update_interval,max_updates_within_interval,max_equal_updates_in_succession,dns_cache_ttl,Proxy,ProxyPort));
407 return service_gnudip_fullhostname;
411 Log->print_gnudip_requires_servername();
412 Service::Ptr service;
418 Log->print_unknown_protocol(protocol);
419 Service::Ptr service;
426 * Loads a service config file, invoked by load_config_from_files.
427 * @param full_filename Filename of the service config file to load.
428 * @return 0 if all is fine, -1 otherwise.
430 int Config::load_service_config_file(const string& full_filename)
432 Log->print_load_service_conf(full_filename);
434 ifstream service_config_file(full_filename.c_str(),ifstream::in);
435 if(service_config_file.is_open())
439 po::variables_map vm;
440 po::parsed_options parsed_service_options = po::parse_config_file(service_config_file,*this->OptDescConfService,false);
441 po::store(parsed_service_options,vm);
444 if(vm.count("protocol") && vm.count("host") && vm.count("login") && vm.count("password"))
446 // create the corresponding service
447 string protocol = vm["protocol"].as<string>();
448 string host = vm["host"].as<string>();
449 string login = vm["login"].as<string>();
450 string password = vm["password"].as<string>();
452 protocol = ba::to_lower_copy(protocol);
455 if ( vm.count("server") )
456 server = vm["server"].as<string>();
458 int update_interval = 0;
459 if ( vm.count("update_interval") )
460 update_interval = vm["update_interval"].as<int>();
462 int max_updates_within_interval = 0;
463 if ( vm.count("max_updates_within_interval") )
464 max_updates_within_interval = vm["max_updates_within_interval"].as<int>();
466 int max_equal_updates_in_succession = 0;
467 if ( vm.count("max_equal_updates_in_succession") )
468 max_equal_updates_in_succession = vm["max_equal_updates_in_succession"].as<int>();
470 int dns_cache_ttl = 0;
471 if ( vm.count("dns_cache_ttl") )
472 dns_cache_ttl = vm["dns_cache_ttl"].as<int>();
474 Service::Ptr service = create_service(protocol,server,host,login,password,update_interval,max_updates_within_interval,max_equal_updates_in_succession,dns_cache_ttl);
477 ServiceHolder->add_service(service);
478 Log->print_service_object("New Service object from config:", service->get_protocol(), service->get_hostname(), service->get_login() ,service->get_password(), service->get_update_interval(), service->get_max_updates_within_interval(), service->get_max_equal_updates_in_succession(), service->get_dns_cache_ttl() , service->get_actual_ip(), service->get_last_updates(), service->get_activated());
482 Log->print_invalid_service_config();
485 else if ( vm.count("protocol") || vm.count("host") || vm.count("login") || vm.count("password") )
487 service_config_file.close();
488 Log->print_missing_service_conf_option(full_filename);
492 catch( const po::unknown_option& e )
494 // unknown option in config file detected
495 service_config_file.close();
496 Log->print_unknown_service_conf_option(full_filename,e.what());
499 catch( const po::multiple_occurrences& e )
501 service_config_file.close();
502 Log->print_multiple_service_conf_option(full_filename,e.what());
505 catch( const po::error& e )
507 service_config_file.close();
508 Log->print_error_parsing_config_file(full_filename,e.what());
511 service_config_file.close();
515 // error opening service config file for reading
516 Log->print_error_opening_r(full_filename);
524 * Loads the main config file, invoked by load_config_from_files
525 * @param full_filename The full filename of the main config file to load
526 * @return 0 if all is fine, -1 otherwise
528 int Config::load_main_config_file(const string& full_filename)
530 Log->print_load_main_conf(full_filename);
532 ifstream main_config_file(full_filename.c_str(),ifstream::in);
533 if(main_config_file.is_open())
537 po::parsed_options parsed_main_options = po::parse_config_file(main_config_file,*this->OptDescConfMain,false);
538 po::store(parsed_main_options,VariablesMap);
539 po::notify(VariablesMap);
541 if ( VariablesMap.count("daemon_mode") )
542 DaemonMode = VariablesMap["daemon_mode"].as<bool>();
544 if ( VariablesMap.count("loglevel") )
545 Loglevel = VariablesMap["loglevel"].as<int>();
547 if ( VariablesMap.count("syslog") )
548 Syslog = VariablesMap["syslog"].as<bool>();
550 if ( VariablesMap.count("enable_ipv6") )
551 EnableIPv6 = VariablesMap["enable_ipv6"].as<bool>();
553 if ( VariablesMap.count("webcheck_enabled") )
554 WebcheckEnabled = VariablesMap["webcheck_enabled"].as<bool>();
556 if ( VariablesMap.count("webcheck_url") )
557 WebcheckIpUrl = VariablesMap["webcheck_url"].as<string>();
559 if ( VariablesMap.count("webcheck_url_alt") )
560 WebcheckIpUrlAlt = VariablesMap["webcheck_url_alt"].as<string>();
562 if ( VariablesMap.count("webcheck_interval") )
563 WebcheckInterval = VariablesMap["webcheck_interval"].as<int>();
565 if ( VariablesMap.count("http_proxy") && VariablesMap.count("http_proxy_port") )
567 Proxy = VariablesMap["http_proxy"].as<string>();
568 ProxyPort = VariablesMap["http_proxy_port"].as<int>();
570 else if ( VariablesMap.count("http_proxy") || VariablesMap.count("http_proxy_port") )
572 main_config_file.close();
573 Log->print_missing_conf_proxy_option(full_filename);
577 if ( VariablesMap.count("external_warning_log") )
578 ExternalWarningLog = VariablesMap["external_warning_log"].as<string>();
580 if ( VariablesMap.count("external_warning_level") )
581 ExternalWarningLevel = VariablesMap["external_warning_level"].as<int>();
583 if ( VariablesMap.count("external_log_only_once") )
584 ExternalLogOnlyOnce = VariablesMap["external_log_only_once"].as<bool>();
586 if ( VariablesMap.count("start_offline") )
587 StartOffline = VariablesMap["start_offline"].as<bool>();
589 if ( VariablesMap.count("dialup_mode") )
590 DialupMode = VariablesMap["dialup_mode"].as<bool>();
591 if ( VariablesMap.count("dialup_burst_period_seconds") )
592 DialupBurstPeriodSeconds = VariablesMap["dialup_burst_period_seconds"].as<int>();
593 if ( VariablesMap.count("dialup_sleep_seconds") )
594 DialupSleepSeconds = VariablesMap["dialup_sleep_seconds"].as<int>();
596 if ( VariablesMap.count("wan_ip_override") )
597 WanIpOverride = VariablesMap["wan_ip_override"].as<string>();
599 catch( const po::unknown_option& e )
601 // unknown option in main config file detected
602 main_config_file.close();
603 Log->print_unknown_main_conf_option(e.what());
606 catch( const po::multiple_occurrences& e )
608 main_config_file.close();
609 Log->print_multiple_main_conf_option(full_filename,e.what());
612 main_config_file.close();
616 // error opening main config file for reading
617 Log->print_error_opening_r(full_filename);
625 * Loads the main and the service config file and does the needed action.
626 * @param config_path The path to the config directory.
627 * @return 0 if all is fine, -1 otherwise
629 int Config::load_config_from_files()
631 fs::path full_config_path = fs::path(ConfigPath);
633 fs::directory_iterator end_iter;
634 for ( fs::directory_iterator dir_itr(full_config_path) ; dir_itr != end_iter ; ++dir_itr )
636 if( fs::is_regular_file( dir_itr->status() ) )
638 #if BOOST_FILESYSTEM_VERSION >= 3
639 string actual_file = dir_itr->path().filename().string();
641 string actual_file = dir_itr->path().filename();
643 boost::regex expr(".*\\.conf$");
644 // If it is the main config file do the following
645 if ( actual_file == "bpdyndnsd.conf" )
647 // Load the main config file
648 string full_filename = dir_itr->path().string();
649 if ( load_main_config_file(full_filename) != 0 )
652 // If it is a service definition file *.conf, parse it and generate the corresponding service
653 else if ( boost::regex_search( actual_file,expr ) )
655 string full_filename = dir_itr->path().string();
656 if ( load_service_config_file(full_filename) != 0 )
661 // Config file successfully loaded
662 Log->print_conf_loaded(ConfigPath);
668 * Getter method for member OptDescCmd.
669 * @return options_description*.
671 Options_descriptionPtr Config::get_opt_desc_cmd() const
678 * Getter method for member OptDescConfMain.
679 * @return options_description*.
681 Options_descriptionPtr Config::get_opt_desc_conf_main() const
683 return OptDescConfMain;
688 * Getter method for member OptDescConfService.
689 * @return options_description*.
691 Options_descriptionPtr Config::get_opt_desc_conf_service() const
693 return OptDescConfService;
698 * Getter for member Loglevel.
699 * @return Member Loglevel.
701 int Config::get_loglevel() const
708 * Getter for member DaemonMode.
709 * @return TRUE if enabled, FALSE if disabled.
711 bool Config::get_daemon_mode() const
718 * Deletes the map with the previously parsed options.
719 * This is needed in case we reload the config and don't want the old cmd options to overwrite new config file options.
721 void Config::delete_variables_map()
723 VariablesMap.clear();
725 po::variables_map _variables_map;
726 VariablesMap = _variables_map;
731 * Getter for member Syslog.
732 * @return True if logging through syslog is enabled, false otherwise.
734 bool Config::get_syslog() const
741 * Getter for member EnableIPv6
742 * @return Wether IPv6 should be used or not.
744 bool Config::get_enable_ipv6() const
751 * Getter for member WebcheckEnabled
752 * @return Is webcheck enabled by default.
754 bool Config::get_webcheck_enabled() const
756 return WebcheckEnabled;
761 * Setter for member WebcheckEnabled
762 * @return Is webcheck enabled by default.
764 void Config::set_webcheck_enabled( bool webcheck_enabled )
766 WebcheckEnabled = webcheck_enabled;
771 * Getter for member WebcheckIpUrl
772 * @return The primary IP Webcheck URL
774 string Config::get_webcheck_ip_url() const
776 return WebcheckIpUrl;
781 * Getter for member WebcheckIpUrlAlt
782 * @return The alternative IP Webcheck URL
784 string Config::get_webcheck_ip_url_alt() const
786 return WebcheckIpUrlAlt;
791 * Get member WebcheckInterval
792 * @return WebcheckInterval
794 int Config::get_webcheck_interval() const
796 return WebcheckInterval;
804 string Config::get_proxy() const
811 * Get member ProxyPort
814 int Config::get_proxy_port() const
821 * Get member ExternalWarningLog
822 * @return ExternalWarningLog
824 string Config::get_external_warning_log() const
826 return ExternalWarningLog;
831 * Get member ExternalWarningLevel
832 * @return ExternalWaringLevel
834 int Config::get_external_warning_level() const
836 return ExternalWarningLevel;
841 * Get member StartOffline
842 * @return StartOffline
844 bool Config::get_start_offline() const
851 * Get member ExternalLogOnlyOnce
852 * @return StartOffline
854 bool Config::get_external_log_only_once() const
856 return ExternalLogOnlyOnce;
861 * Get member DialupMode
864 bool Config::get_dialup_mode() const
870 * Get member DialupBurstPeriodSeconds
871 * @return DialupBurstPeriodSeconds
873 int Config::get_dialup_burst_period_seconds() const
875 return DialupBurstPeriodSeconds;
879 * Get member DialupSleepSeconds
880 * @return DialupSleepSeconds
882 int Config::get_dialup_sleep_seconds() const
884 return DialupSleepSeconds;
888 * Get WAN override IP (if present)
889 * @return WanIpOverride
891 std::string Config::get_wan_ip_override() const
893 return WanIpOverride;