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)
52 , ConfigPath("/etc/bpdyndnsd")
55 , ExternalWarningLog("")
56 , ExternalWarningLevel(0)
58 , WebcheckEnabled(false)
59 , ExternalLogOnlyOnce(false)
61 , DialupBurstPeriodSeconds(120)
62 , DialupSleepSeconds(10 * 60)
64 define_config_options();
69 * Constructor with Logger and Serviceholder objects. Available command line and config file options with their default values are defined here.
70 * @todo Move the program options init code to a function used by both constructors
72 Config::Config(Logger::Ptr _log, Serviceholder::Ptr _serviceholder)
74 , ServiceHolder(_serviceholder)
80 , ConfigPath("/etc/bpdyndnsd")
83 , ExternalWarningLog("")
84 , ExternalWarningLevel(0)
86 , WebcheckEnabled(false)
87 , ExternalLogOnlyOnce(false)
89 , DialupBurstPeriodSeconds(120)
90 , DialupSleepSeconds(10 * 60)
92 define_config_options();
105 * Define valid config options with default parameters.
107 void Config::define_config_options()
109 // Available service description config options
110 po::options_description opt_desc_service("Service description options");
111 opt_desc_service.add_options()
112 ("protocol",po::value<string>(),"The service protocol.")
113 ("server",po::value<string>(),"Servername needed for gnudip/dyndns protocol.")
114 ("host",po::value<string>(),"The hostname to update.")
115 ("login",po::value<string>(),"Login name.")
116 ("password",po::value<string>(),"Corresponding password.")
117 ("update_interval",po::value<int>()->default_value(-1),"Update interval in minutes.")
118 ("max_updates_within_interval",po::value<int>()->default_value(-1),"How many updates can be made in one interval.")
119 ("max_equal_updates_in_succession",po::value<int>()->default_value(-1),"How many updates with the same IP in succession should be made.")
120 ("dns_cache_ttl",po::value<int>()->default_value(-1),"How long a dns record is valid.")
123 // Available command line only options
124 po::options_description opt_desc_cmd_only("Command line only options");
125 opt_desc_cmd_only.add_options()
126 ("help,?","Show help.")
127 ("version,v","Show version.")
128 ("config,c",po::value<string>()->default_value("/etc/bpdyndnsd"),"Set the config path.")
131 // Available generic options. Valid on cmd or in config file.
132 po::options_description opt_desc_generic("Generic config options");
133 opt_desc_generic.add_options()
134 ("daemon_mode",po::value<bool>()->default_value(false),"Run as system daemon.")
135 ("loglevel",po::value<int>()->default_value(0),"Loglevel.")
136 ("syslog",po::value<bool>()->default_value(false),"Use syslog facility.")
137 ("log_passwords",po::value<bool>()->default_value(false),"Log passwords in cleartext.")
138 ("enable_ipv6",po::value<bool>()->default_value(false),"Try to use IPv6.")
139 ("webcheck_enabled",po::value<bool>()->default_value(false),"Use webcheck url to determine actual IP address.")
140 ("webcheck_url",po::value<string>()->default_value(""),"Use this URL to determine IP.")
141 ("webcheck_url_alt",po::value<string>()->default_value(""),"Use this alternative URL to determine IP.")
142 ("webcheck_interval",po::value<int>()->default_value(10),"The webcheck interval in minutes.")
143 ("http_proxy",po::value<string>(),"Use this proxy for all http requests.")
144 ("http_proxy_port",po::value<int>(),"Port of the proxy.")
145 ("external_warning_log",po::value<string>()->default_value(""),"External programm to pass warning log messages to.")
146 ("external_warning_level",po::value<int>()->default_value(0),"Warning messages of which loglevel should be passed to external programm.")
147 ("external_log_only_once",po::value<bool>()->default_value(false),"Log the same external message only once until next reload or restart.")
148 ("start_offline",po::value<bool>()->default_value(false),"Start in offline mode.")
149 ("dialup_mode",po::value<bool>()->default_value(false),"Enable dialup mode (sleep periods between network traffic)")
150 ("dialup_burst_period_seconds",po::value<int>()->default_value(120),"Seconds of normal operation before entering dialup mode")
151 ("dialup_sleep_seconds",po::value<int>()->default_value(10 * 60),"Seconds to sleep between network traffic")
152 ("wan_ip_override",po::value<string>(),"Manual override for automatic WAN IP detection")
155 // Define valid command line parameters
156 OptDescCmd = Options_descriptionPtr(new po::options_description("Command line options"));
157 OptDescCmd->add(opt_desc_cmd_only);
158 OptDescCmd->add(opt_desc_generic);
159 OptDescCmd->add(opt_desc_service);
161 // Define valid config file options
162 OptDescConfMain = Options_descriptionPtr(new po::options_description("Config file options"));
163 OptDescConfMain->add(opt_desc_generic);
165 // Define valid service file options
166 OptDescConfService = Options_descriptionPtr(new po::options_description("Service file options"));
167 OptDescConfService->add(opt_desc_service);
172 * Parses the command line arguments and does the needed actions.
173 * @param argc Command line argument number given to main.
174 * @param argv[] Pointer to command line argument array given to main.
175 * @return 0 if all is fine, -1 if not.
177 int Config::parse_cmd_line(int argc, char *argv[])
181 po::store(po::parse_command_line(argc, argv, *this->OptDescCmd), VariablesMap);
182 po::notify(VariablesMap);
184 if ( VariablesMap.count("help") )
186 Log->print_usage(OptDescCmd);
189 else if ( VariablesMap.count("version") )
191 Log->print_version();
195 // Create a service object if all needed options are set on the command line
196 if ( VariablesMap.count("protocol") && VariablesMap.count("host") && VariablesMap.count("login") && VariablesMap.count("password") )
198 // Get the cmd parameter values for protocol host login and password
199 string protocol = VariablesMap["protocol"].as<string>();
200 string host = VariablesMap["host"].as<string>();
201 string login = VariablesMap["login"].as<string>();
202 string password = VariablesMap["password"].as<string>();
204 protocol = ba::to_lower_copy(protocol);
207 if ( VariablesMap.count("server") )
208 server = VariablesMap["server"].as<string>();
210 int update_interval = 0;
211 if ( VariablesMap.count("update_interval") )
212 update_interval = VariablesMap["update_interval"].as<int>();
214 int max_updates_within_interval = 0;
215 if ( VariablesMap.count("max_updates_within_interval") )
216 max_updates_within_interval = VariablesMap["max_updates_within_interval"].as<int>();
218 int max_equal_updates_in_succession = 0;
219 if ( VariablesMap.count("max_equal_updates_in_succession") )
220 max_equal_updates_in_succession = VariablesMap["max_equal_updates_in_succession"].as<int>();
222 int dns_cache_ttl = 0;
223 if ( VariablesMap.count("dns_cache_ttl") )
224 dns_cache_ttl = VariablesMap["dns_cache_ttl"].as<int>();
226 Service::Ptr service = create_service(protocol,server,host,login,password,update_interval,max_updates_within_interval,max_equal_updates_in_succession,dns_cache_ttl);
229 ServiceHolder->add_service(service);
230 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());
234 Log->print_invalid_service_config();
237 else if ( VariablesMap.count("protocol") || VariablesMap.count("host") || VariablesMap.count("login") || VariablesMap.count("password") )
239 Log->print_missing_cmd_service_option();
240 Log->print_usage(OptDescCmd);
244 if ( VariablesMap.count("config") )
246 fs::path full_config_path = fs::system_complete(fs::path(VariablesMap["config"].as<string>()));
247 ConfigPath = full_config_path.string();
248 if ( !fs::exists(full_config_path) || !fs::is_directory(full_config_path) )
250 // Config path doesn't exist or is not a directory
251 Log->print_error_config_path(ConfigPath);
256 if ( VariablesMap.count("daemon_mode") )
257 DaemonMode = VariablesMap["daemon_mode"].as<bool>();
259 if ( VariablesMap.count("loglevel") )
260 Loglevel = VariablesMap["loglevel"].as<int>();
262 if ( VariablesMap.count("syslog") )
263 Syslog = VariablesMap["syslog"].as<bool>();
265 if ( VariablesMap.count("log_passwords") )
266 LogPasswords = VariablesMap["log_passwords"].as<bool>();
268 if ( VariablesMap.count("enable_ipv6") )
269 EnableIPv6 = VariablesMap["enable_ipv6"].as<bool>();
271 if ( VariablesMap.count("webcheck_enabled") )
272 WebcheckEnabled = VariablesMap["webcheck_enabled"].as<bool>();
274 if ( VariablesMap.count("webcheck_url") )
275 WebcheckIpUrl = VariablesMap["webcheck_url"].as<string>();
277 if ( VariablesMap.count("webcheck_url_alt") )
278 WebcheckIpUrlAlt = VariablesMap["webcheck_url_alt"].as<string>();
280 if ( VariablesMap.count("webcheck_interval") )
281 WebcheckInterval = VariablesMap["webcheck_interval"].as<int>();
283 if ( VariablesMap.count("http_proxy") && VariablesMap.count("http_proxy_port") )
285 Proxy = VariablesMap["http_proxy"].as<string>();
286 ProxyPort = VariablesMap["http_proxy_port"].as<int>();
288 else if ( VariablesMap.count("http_proxy") || VariablesMap.count("http_proxy_port") )
290 Log->print_missing_cmd_proxy_option();
291 Log->print_usage(OptDescCmd);
295 if ( VariablesMap.count("external_warning_log") )
296 ExternalWarningLog = VariablesMap["external_warning_log"].as<string>();
298 if ( VariablesMap.count("external_warning_level") )
299 ExternalWarningLevel = VariablesMap["external_warning_level"].as<int>();
301 if ( VariablesMap.count("external_log_only_once") )
302 ExternalLogOnlyOnce = VariablesMap["external_log_only_once"].as<bool>();
304 if ( VariablesMap.count("start_offline") )
305 StartOffline = VariablesMap["start_offline"].as<bool>();
307 if ( VariablesMap.count("dialup_mode") )
308 DialupMode = VariablesMap["dialup_mode"].as<bool>();
309 if ( VariablesMap.count("dialup_burst_period_seconds") )
310 DialupBurstPeriodSeconds = VariablesMap["dialup_burst_period_seconds"].as<int>();
311 if ( VariablesMap.count("dialup_sleep_seconds") )
312 DialupSleepSeconds = VariablesMap["dialup_sleep_seconds"].as<int>();
314 if ( VariablesMap.count("wan_ip_override") )
315 WanIpOverride = VariablesMap["wan_ip_override"].as<string>();
317 catch( const po::unknown_option& e )
319 Log->print_unknown_cmd_option(e.what());
320 Log->print_usage(OptDescCmd);
323 catch( const po::multiple_occurrences& e )
325 Log->print_multiple_cmd_option(e.what());
326 Log->print_usage(OptDescCmd);
329 catch( const po::error& e )
331 Log->print_error_parsing_cmd(e.what());
332 Log->print_usage(OptDescCmd);
340 * Creates a Service object from the given parameters.
341 * @param protocol Protocol to use.
342 * @param host Hostname to update.
343 * @param login Login.
344 * @param password Password.
345 * @return A pointer to the created Service object.
347 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)
349 // Test for valid hostname. Must contain 3 parts minimum.
350 list<string> fqhn_parts;
351 ba::split(fqhn_parts,hostname,boost::is_any_of("."));
352 if ( fqhn_parts.size() < 3 )
354 Log->print_invalid_hostname(hostname);
355 Service::Ptr service;
359 if(protocol == "dhs")
361 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));
364 else if(protocol == "ods")
366 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));
369 else if(protocol == "dyndns")
371 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));
372 return service_dyndns;
374 else if(protocol == "dyns")
376 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));
379 else if(protocol == "easydns")
381 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));
382 return service_easydns;
384 else if(protocol == "tzo")
386 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));
389 else if(protocol == "zoneedit")
391 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));
392 return service_zoneedit;
394 else if(protocol == "gnudip")
396 if ( !server.empty() )
398 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));
399 return service_gnudip;
403 Log->print_gnudip_requires_servername();
404 Service::Ptr service;
408 else if(protocol == "gnudip-fullhostname")
410 if ( !server.empty() )
412 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));
413 return service_gnudip_fullhostname;
417 Log->print_gnudip_requires_servername();
418 Service::Ptr service;
424 Log->print_unknown_protocol(protocol);
425 Service::Ptr service;
432 * Loads a service config file, invoked by load_config_from_files.
433 * @param full_filename Filename of the service config file to load.
434 * @return 0 if all is fine, -1 otherwise.
436 int Config::load_service_config_file(const string& full_filename)
438 Log->print_load_service_conf(full_filename);
440 ifstream service_config_file(full_filename.c_str(),ifstream::in);
441 if(service_config_file.is_open())
445 po::variables_map vm;
446 po::parsed_options parsed_service_options = po::parse_config_file(service_config_file,*this->OptDescConfService,false);
447 po::store(parsed_service_options,vm);
450 if(vm.count("protocol") && vm.count("host") && vm.count("login") && vm.count("password"))
452 // create the corresponding service
453 string protocol = vm["protocol"].as<string>();
454 string host = vm["host"].as<string>();
455 string login = vm["login"].as<string>();
456 string password = vm["password"].as<string>();
458 protocol = ba::to_lower_copy(protocol);
461 if ( vm.count("server") )
462 server = vm["server"].as<string>();
464 int update_interval = 0;
465 if ( vm.count("update_interval") )
466 update_interval = vm["update_interval"].as<int>();
468 int max_updates_within_interval = 0;
469 if ( vm.count("max_updates_within_interval") )
470 max_updates_within_interval = vm["max_updates_within_interval"].as<int>();
472 int max_equal_updates_in_succession = 0;
473 if ( vm.count("max_equal_updates_in_succession") )
474 max_equal_updates_in_succession = vm["max_equal_updates_in_succession"].as<int>();
476 int dns_cache_ttl = 0;
477 if ( vm.count("dns_cache_ttl") )
478 dns_cache_ttl = vm["dns_cache_ttl"].as<int>();
480 Service::Ptr service = create_service(protocol,server,host,login,password,update_interval,max_updates_within_interval,max_equal_updates_in_succession,dns_cache_ttl);
483 ServiceHolder->add_service(service);
484 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());
488 Log->print_invalid_service_config();
491 else if ( vm.count("protocol") || vm.count("host") || vm.count("login") || vm.count("password") )
493 service_config_file.close();
494 Log->print_missing_service_conf_option(full_filename);
498 catch( const po::unknown_option& e )
500 // unknown option in config file detected
501 service_config_file.close();
502 Log->print_unknown_service_conf_option(full_filename,e.what());
505 catch( const po::multiple_occurrences& e )
507 service_config_file.close();
508 Log->print_multiple_service_conf_option(full_filename,e.what());
511 catch( const po::error& e )
513 service_config_file.close();
514 Log->print_error_parsing_config_file(full_filename,e.what());
517 service_config_file.close();
521 // error opening service config file for reading
522 Log->print_error_opening_r(full_filename);
530 * Loads the main config file, invoked by load_config_from_files
531 * @param full_filename The full filename of the main config file to load
532 * @return 0 if all is fine, -1 otherwise
534 int Config::load_main_config_file(const string& full_filename)
536 Log->print_load_main_conf(full_filename);
538 ifstream main_config_file(full_filename.c_str(),ifstream::in);
539 if(main_config_file.is_open())
543 po::parsed_options parsed_main_options = po::parse_config_file(main_config_file,*this->OptDescConfMain,false);
544 po::store(parsed_main_options,VariablesMap);
545 po::notify(VariablesMap);
547 if ( VariablesMap.count("daemon_mode") )
548 DaemonMode = VariablesMap["daemon_mode"].as<bool>();
550 if ( VariablesMap.count("loglevel") )
551 Loglevel = VariablesMap["loglevel"].as<int>();
553 if ( VariablesMap.count("syslog") )
554 Syslog = VariablesMap["syslog"].as<bool>();
556 if ( VariablesMap.count("log_passwords") )
557 LogPasswords = VariablesMap["log_passwords"].as<bool>();
559 if ( VariablesMap.count("enable_ipv6") )
560 EnableIPv6 = VariablesMap["enable_ipv6"].as<bool>();
562 if ( VariablesMap.count("webcheck_enabled") )
563 WebcheckEnabled = VariablesMap["webcheck_enabled"].as<bool>();
565 if ( VariablesMap.count("webcheck_url") )
566 WebcheckIpUrl = VariablesMap["webcheck_url"].as<string>();
568 if ( VariablesMap.count("webcheck_url_alt") )
569 WebcheckIpUrlAlt = VariablesMap["webcheck_url_alt"].as<string>();
571 if ( VariablesMap.count("webcheck_interval") )
572 WebcheckInterval = VariablesMap["webcheck_interval"].as<int>();
574 if ( VariablesMap.count("http_proxy") && VariablesMap.count("http_proxy_port") )
576 Proxy = VariablesMap["http_proxy"].as<string>();
577 ProxyPort = VariablesMap["http_proxy_port"].as<int>();
579 else if ( VariablesMap.count("http_proxy") || VariablesMap.count("http_proxy_port") )
581 main_config_file.close();
582 Log->print_missing_conf_proxy_option(full_filename);
586 if ( VariablesMap.count("external_warning_log") )
587 ExternalWarningLog = VariablesMap["external_warning_log"].as<string>();
589 if ( VariablesMap.count("external_warning_level") )
590 ExternalWarningLevel = VariablesMap["external_warning_level"].as<int>();
592 if ( VariablesMap.count("external_log_only_once") )
593 ExternalLogOnlyOnce = VariablesMap["external_log_only_once"].as<bool>();
595 if ( VariablesMap.count("start_offline") )
596 StartOffline = VariablesMap["start_offline"].as<bool>();
598 if ( VariablesMap.count("dialup_mode") )
599 DialupMode = VariablesMap["dialup_mode"].as<bool>();
600 if ( VariablesMap.count("dialup_burst_period_seconds") )
601 DialupBurstPeriodSeconds = VariablesMap["dialup_burst_period_seconds"].as<int>();
602 if ( VariablesMap.count("dialup_sleep_seconds") )
603 DialupSleepSeconds = VariablesMap["dialup_sleep_seconds"].as<int>();
605 if ( VariablesMap.count("wan_ip_override") )
606 WanIpOverride = VariablesMap["wan_ip_override"].as<string>();
608 catch( const po::unknown_option& e )
610 // unknown option in main config file detected
611 main_config_file.close();
612 Log->print_unknown_main_conf_option(e.what());
615 catch( const po::multiple_occurrences& e )
617 main_config_file.close();
618 Log->print_multiple_main_conf_option(full_filename,e.what());
621 main_config_file.close();
625 // error opening main config file for reading
626 Log->print_error_opening_r(full_filename);
634 * Loads the main and the service config file and does the needed action.
635 * @param config_path The path to the config directory.
636 * @return 0 if all is fine, -1 otherwise
638 int Config::load_config_from_files()
640 fs::path full_config_path = fs::path(ConfigPath);
642 fs::directory_iterator end_iter;
643 for ( fs::directory_iterator dir_itr(full_config_path) ; dir_itr != end_iter ; ++dir_itr )
645 if( fs::is_regular_file( dir_itr->status() ) )
647 #if BOOST_FILESYSTEM_VERSION >= 3
648 string actual_file = dir_itr->path().filename().string();
650 string actual_file = dir_itr->path().filename();
652 boost::regex expr(".*\\.conf$");
653 // If it is the main config file do the following
654 if ( actual_file == "bpdyndnsd.conf" )
656 // Load the main config file
657 string full_filename = dir_itr->path().string();
658 if ( load_main_config_file(full_filename) != 0 )
661 // If it is a service definition file *.conf, parse it and generate the corresponding service
662 else if ( boost::regex_search( actual_file,expr ) )
664 string full_filename = dir_itr->path().string();
665 if ( load_service_config_file(full_filename) != 0 )
670 // Config file successfully loaded
671 Log->print_conf_loaded(ConfigPath);
677 * Getter method for member OptDescCmd.
678 * @return options_description*.
680 Options_descriptionPtr Config::get_opt_desc_cmd() const
687 * Getter method for member OptDescConfMain.
688 * @return options_description*.
690 Options_descriptionPtr Config::get_opt_desc_conf_main() const
692 return OptDescConfMain;
697 * Getter method for member OptDescConfService.
698 * @return options_description*.
700 Options_descriptionPtr Config::get_opt_desc_conf_service() const
702 return OptDescConfService;
707 * Getter for member Loglevel.
708 * @return Member Loglevel.
710 int Config::get_loglevel() const
717 * Getter for member DaemonMode.
718 * @return TRUE if enabled, FALSE if disabled.
720 bool Config::get_daemon_mode() const
727 * Deletes the map with the previously parsed options.
728 * This is needed in case we reload the config and don't want the old cmd options to overwrite new config file options.
730 void Config::delete_variables_map()
732 VariablesMap.clear();
734 po::variables_map _variables_map;
735 VariablesMap = _variables_map;
740 * Getter for member Syslog.
741 * @return True if logging through syslog is enabled, false otherwise.
743 bool Config::get_syslog() const
750 * Getter for member LogPasswords.
751 * @return True if we want to log passwords in cleartext.
753 bool Config::get_log_passwords() const
760 * Getter for member EnableIPv6
761 * @return Wether IPv6 should be used or not.
763 bool Config::get_enable_ipv6() const
770 * Getter for member WebcheckEnabled
771 * @return Is webcheck enabled by default.
773 bool Config::get_webcheck_enabled() const
775 return WebcheckEnabled;
780 * Setter for member WebcheckEnabled
781 * @return Is webcheck enabled by default.
783 void Config::set_webcheck_enabled( bool webcheck_enabled )
785 WebcheckEnabled = webcheck_enabled;
790 * Getter for member WebcheckIpUrl
791 * @return The primary IP Webcheck URL
793 string Config::get_webcheck_ip_url() const
795 return WebcheckIpUrl;
800 * Getter for member WebcheckIpUrlAlt
801 * @return The alternative IP Webcheck URL
803 string Config::get_webcheck_ip_url_alt() const
805 return WebcheckIpUrlAlt;
810 * Get member WebcheckInterval
811 * @return WebcheckInterval
813 int Config::get_webcheck_interval() const
815 return WebcheckInterval;
823 string Config::get_proxy() const
830 * Get member ProxyPort
833 int Config::get_proxy_port() const
840 * Get member ExternalWarningLog
841 * @return ExternalWarningLog
843 string Config::get_external_warning_log() const
845 return ExternalWarningLog;
850 * Get member ExternalWarningLevel
851 * @return ExternalWaringLevel
853 int Config::get_external_warning_level() const
855 return ExternalWarningLevel;
860 * Get member StartOffline
861 * @return StartOffline
863 bool Config::get_start_offline() const
870 * Get member ExternalLogOnlyOnce
871 * @return StartOffline
873 bool Config::get_external_log_only_once() const
875 return ExternalLogOnlyOnce;
880 * Get member DialupMode
883 bool Config::get_dialup_mode() const
889 * Get member DialupBurstPeriodSeconds
890 * @return DialupBurstPeriodSeconds
892 int Config::get_dialup_burst_period_seconds() const
894 return DialupBurstPeriodSeconds;
898 * Get member DialupSleepSeconds
899 * @return DialupSleepSeconds
901 int Config::get_dialup_sleep_seconds() const
903 return DialupSleepSeconds;
907 * Get WAN override IP (if present)
908 * @return WanIpOverride
910 std::string Config::get_wan_ip_override() const
912 return WanIpOverride;