2 * @brief Config class header. This class represents the actual configuration.
6 * @copyright Intra2net AG
16 #include "serviceholder.hpp"
17 #include "httphelper.hpp"
18 #include "service.hpp"
20 #include <boost/program_options.hpp>
21 #include <boost/shared_ptr.hpp>
29 boost::shared_ptr<boost::program_options::options_description> OptDescCmd;
30 boost::shared_ptr<boost::program_options::options_description> OptDescConfMain;
31 boost::shared_ptr<boost::program_options::options_description> OptDescConfService;
32 boost::program_options::variables_map VariablesMap;
35 Serviceholder::Ptr ServiceHolder;
42 std::string ConfigPath;
43 std::string WebcheckIpUrl;
44 std::string WebcheckIpUrlAlt;
48 std::string ExternalWarningLog;
49 int ExternalWarningLevel;
52 bool ExternalLogOnlyOnce;
54 int DialupBurstPeriodSeconds;
55 int DialupSleepSeconds;
56 std::string WanIpOverride;
58 Service::Ptr create_service(const std::string& protocol, const std::string& server, const std::string& hostname, const std::string& login, const std::string& password, const int update_interval, const int max_updates_within_interval, const int max_equal_updates_in_succession, const int dns_cache_ttl);
59 int load_main_config_file(const std::string& full_filename);
60 int load_service_config_file(const std::string& full_filename);
61 void define_config_options();
65 typedef boost::shared_ptr<Config> Ptr;
69 Config(Logger::Ptr _log, Serviceholder::Ptr _serviceholder);
73 int parse_cmd_line(int argc, char *argv[]);
75 int load_config_from_files();
77 boost::shared_ptr<boost::program_options::options_description> get_opt_desc_cmd() const;
79 boost::shared_ptr<boost::program_options::options_description> get_opt_desc_conf_main() const;
81 boost::shared_ptr<boost::program_options::options_description> get_opt_desc_conf_service() const;
83 bool get_daemon_mode() const;
85 int get_loglevel() const;
87 bool get_syslog() const;
89 bool get_log_passwords() const;
91 bool get_enable_ipv6() const;
93 std::string get_proxy() const;
95 int get_proxy_port() const;
97 bool get_webcheck_enabled() const;
99 void set_webcheck_enabled( bool webcheck_enabled );
101 std::string get_webcheck_ip_url() const;
103 std::string get_webcheck_ip_url_alt() const;
105 int get_webcheck_interval() const;
107 void delete_variables_map();
109 int get_external_warning_level() const;
111 std::string get_external_warning_log() const;
113 bool get_start_offline() const;
115 bool get_external_log_only_once() const;
117 bool get_dialup_mode() const;
118 int get_dialup_burst_period_seconds() const;
119 int get_dialup_sleep_seconds() const;
121 std::string get_wan_ip_override() const;