2 * @brief Config class header. This class represents the actual configuration.
6 * @copyright Intra2net AG
16 #include "serviceholder.h"
17 #include "httphelper.h"
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;
41 std::string ConfigPath;
42 std::string WebcheckIpUrl;
43 std::string WebcheckIpUrlAlt;
47 std::string ExternalWarningLog;
48 int ExternalWarningLevel;
51 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 dns_cache_ttl);
52 int load_main_config_file(const std::string& full_filename);
53 int load_service_config_file(const std::string& full_filename);
57 typedef boost::shared_ptr<Config> Ptr;
61 Config(Logger::Ptr _log, Serviceholder::Ptr _serviceholder);
65 int parse_cmd_line(int argc, char *argv[]);
67 int load_config_from_files();
69 boost::shared_ptr<boost::program_options::options_description> get_opt_desc_cmd() const;
71 boost::shared_ptr<boost::program_options::options_description> get_opt_desc_conf_main() const;
73 boost::shared_ptr<boost::program_options::options_description> get_opt_desc_conf_service() const;
75 bool get_daemon_mode() const;
77 int get_loglevel() const;
79 bool get_syslog() const;
81 bool get_enable_ipv6() const;
83 std::string get_proxy() const;
85 int get_proxy_port() const;
87 std::string get_webcheck_ip_url() const;
89 std::string get_webcheck_ip_url_alt() const;
91 int get_webcheck_interval() const;
93 void delete_variables_map();
95 int get_external_warning_level() const;
97 std::string get_external_warning_log() const;
99 bool get_start_offline() const;