# C++ headers
set(cpp_headers
- config.h
- httphelper.h
- ip_addr_helper.h
- ip_service.h
- logger.h
- net_helper.h
- serializeservicecontainer.h
- service_dhs.h
- service_dyndns.h
- service_dyns.h
- service_easydns.h
- service_gnudip.h
- service.h
- serviceholder.h
- service_ods.h
- service_tzo.h
- service_zoneedit.h
- tcp_service.h
- updater.h
- util.h
+ config.hpp
+ httphelper.hpp
+ ip_addr_helper.hpp
+ ip_service.hpp
+ logger.hpp
+ net_helper.hpp
+ serializeservicecontainer.hpp
+ service_dhs.hpp
+ service_dyndns.hpp
+ service_dyns.hpp
+ service_easydns.hpp
+ service_gnudip.hpp
+ service.hpp
+ serviceholder.hpp
+ service_ods.hpp
+ service_tzo.hpp
+ service_zoneedit.hpp
+ tcp_service.hpp
+ updater.hpp
+ util.hpp
)
add_executable(bpdyndnsd ${cpp_sources} ${cpp_headers})
* @license GPLv2
*/
-#include "config.h"
-
-#include "service_dhs.h"
-#include "service_ods.h"
-#include "service_dyndns.h"
-#include "service_dyns.h"
-#include "service_easydns.h"
-#include "service_tzo.h"
-#include "service_zoneedit.h"
-#include "service_gnudip.h"
+#include "config.hpp"
+
+#include "service_dhs.hpp"
+#include "service_ods.hpp"
+#include "service_dyndns.hpp"
+#include "service_dyns.hpp"
+#include "service_easydns.hpp"
+#include "service_tzo.hpp"
+#include "service_zoneedit.hpp"
+#include "service_gnudip.hpp"
#include <time.h>
#include <iostream>
+++ /dev/null
-/** @file
- * @brief Config class header. This class represents the actual configuration.
- *
- *
- *
- * @copyright Intra2net AG
- * @license GPLv2
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-#include <string>
-
-#include "logger.h"
-#include "serviceholder.h"
-#include "httphelper.h"
-#include "service.h"
-
-#include <boost/program_options.hpp>
-#include <boost/shared_ptr.hpp>
-
-
-class Config
-{
-
-private:
-
- boost::shared_ptr<boost::program_options::options_description> OptDescCmd;
- boost::shared_ptr<boost::program_options::options_description> OptDescConfMain;
- boost::shared_ptr<boost::program_options::options_description> OptDescConfService;
- boost::program_options::variables_map VariablesMap;
-
- Logger::Ptr Log;
- Serviceholder::Ptr ServiceHolder;
-
- bool DaemonMode;
- bool Syslog;
- bool EnableIPv6;
- int Loglevel;
- std::string ConfigPath;
- std::string WebcheckIpUrl;
- std::string WebcheckIpUrlAlt;
- int WebcheckInterval;
- std::string Proxy;
- int ProxyPort;
- std::string ExternalWarningLog;
- int ExternalWarningLevel;
- bool StartOffline;
- bool WebcheckEnabled;
- bool ExternalLogOnlyOnce;
-
- 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);
- int load_main_config_file(const std::string& full_filename);
- int load_service_config_file(const std::string& full_filename);
-
-public:
-
- typedef boost::shared_ptr<Config> Ptr;
-
- Config();
-
- Config(Logger::Ptr _log, Serviceholder::Ptr _serviceholder);
-
- ~Config();
-
- int parse_cmd_line(int argc, char *argv[]);
-
- int load_config_from_files();
-
- boost::shared_ptr<boost::program_options::options_description> get_opt_desc_cmd() const;
-
- boost::shared_ptr<boost::program_options::options_description> get_opt_desc_conf_main() const;
-
- boost::shared_ptr<boost::program_options::options_description> get_opt_desc_conf_service() const;
-
- bool get_daemon_mode() const;
-
- int get_loglevel() const;
-
- bool get_syslog() const;
-
- bool get_enable_ipv6() const;
-
- std::string get_proxy() const;
-
- int get_proxy_port() const;
-
- bool get_webcheck_enabled() const;
-
- void set_webcheck_enabled( bool webcheck_enabled );
-
- std::string get_webcheck_ip_url() const;
-
- std::string get_webcheck_ip_url_alt() const;
-
- int get_webcheck_interval() const;
-
- void delete_variables_map();
-
- int get_external_warning_level() const;
-
- std::string get_external_warning_log() const;
-
- bool get_start_offline() const;
-
- bool get_external_log_only_once() const;
-
-};
-
-#endif
* @license GPLv2
*/
-#include "httphelper.h"
+#include "httphelper.hpp"
using namespace std;
/**
* Constructor. Use this constructor if HTTP AUTH should be used. Username and password will then be set as HTTP auth options.
- * @param _log Logger Object
+ * @param _log Logger Object
* @param _proxy Proxy to use
* @param _proxy_port Proxy Port
* @param _username Username
/**
* Constructor. Use this constructor if you have to encode the username and password into the url
- * @param _log Logger Object
+ * @param _log Logger Object
* @param _proxy Proxy to use
* @param _proxy_port Proxy Port
*/
#ifndef HTTPHELPER_H
#define HTTPHELPER_H
-#include "logger.h"
+#include "logger.hpp"
#include <boost/shared_ptr.hpp>
#include <curl/curl.h>
* @license GPLv2
*/
-#include "ip_addr_helper.h"
+#include "ip_addr_helper.hpp"
#include <boost/asio.hpp>
#include <boost/regex.hpp>
#include <arpa/inet.h>
#ifndef IPADDRHELPER_H
#define IPADDRHELPER_H
-#include "logger.h"
+#include "logger.hpp"
#include <boost/shared_ptr.hpp>
#include <curl/curl.h>
*/
-#include "logger.h"
+#include "logger.hpp"
#include <iostream>
#include <syslog.h>
#include <sys/types.h>
#include <signal.h>
-#include "updater.h"
+#include "updater.hpp"
using namespace std;
* @license GPLv2
*/
-#include "net_helper.h"
-#include "tcp_service.h"
+#include "net_helper.hpp"
+#include "tcp_service.hpp"
using namespace std;
#ifndef NETHELPER_H
#define NETHELPER_H
-#include "logger.h"
-#include "ip_service.h"
+#include "logger.hpp"
+#include "ip_service.hpp"
#include <boost/shared_ptr.hpp>
* @license GPLv2
*/
-#include "serializeservicecontainer.h"
+#include "serializeservicecontainer.hpp"
// Following boost macros are needed for serialization of derived classes through a base class pointer (Service *).
BOOST_CLASS_EXPORT_GUID(ServiceOds, "ServiceOds")
#ifndef SERIALIZESERVICECONTAINER_H
#define SERIALIZESERVICECONTAINER_H
-#include "service.h"
-#include "logger.h"
+#include "service.hpp"
+#include "logger.hpp"
#include <boost/serialization/list.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/shared_ptr.hpp>
#include <list>
-#include "service_dhs.h"
-#include "service_ods.h"
-#include "service_dyndns.h"
-#include "service_dyns.h"
-#include "service_easydns.h"
-#include "service_tzo.h"
-#include "service_zoneedit.h"
-#include "service_gnudip.h"
+#include "service_dhs.hpp"
+#include "service_ods.hpp"
+#include "service_dyndns.hpp"
+#include "service_dyns.hpp"
+#include "service_easydns.hpp"
+#include "service_tzo.hpp"
+#include "service_zoneedit.hpp"
+#include "service_gnudip.hpp"
class SerializeServiceContainer
* @license GPLv2
*/
-#include "service.h"
+#include "service.hpp"
#include <boost/foreach.hpp>
using namespace std;
#ifndef SERVICE_H
#define SERVICE_H
-#include "logger.h"
+#include "logger.hpp"
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
* @license GPLv2
*/
-#include "service_dhs.h"
+#include "service_dhs.hpp"
#include <time.h>
#include <boost/foreach.hpp>
#ifndef ServiceDhs_H
#define ServiceDhs_H
-#include "service.h"
-#include "logger.h"
-#include "httphelper.h"
+#include "service.hpp"
+#include "logger.hpp"
+#include "httphelper.hpp"
#include <boost/shared_ptr.hpp>
#include <string>
* @license GPLv2
*/
-#include "service_dyndns.h"
+#include "service_dyndns.hpp"
#include <boost/foreach.hpp>
#ifndef ServiceDyndns_H
#define ServiceDyndns_H
-#include "service.h"
-#include "logger.h"
-#include "httphelper.h"
+#include "service.hpp"
+#include "logger.hpp"
+#include "httphelper.hpp"
#include <boost/shared_ptr.hpp>
#include <string>
* @license GPLv2
*/
-#include "service_dyns.h"
-#include "util.h"
+#include "service_dyns.hpp"
+#include "util.hpp"
#include <time.h>
#include <boost/foreach.hpp>
#ifndef ServiceDyns_H
#define ServiceDyns_H
-#include "service.h"
-#include "logger.h"
-#include "httphelper.h"
+#include "service.hpp"
+#include "logger.hpp"
+#include "httphelper.hpp"
#include <boost/shared_ptr.hpp>
#include <string>
* @license GPLv2
*/
-#include "service_easydns.h"
-#include "util.h"
+#include "service_easydns.hpp"
+#include "util.hpp"
#include <time.h>
#include <boost/foreach.hpp>
#ifndef ServiceEasydns_H
#define ServiceEasydns_H
-#include "service.h"
-#include "logger.h"
-#include "httphelper.h"
+#include "service.hpp"
+#include "logger.hpp"
+#include "httphelper.hpp"
#include <boost/shared_ptr.hpp>
#include <string>
* @license GPLv2
*/
-#include "service_gnudip.h"
-#include "util.h"
+#include "service_gnudip.hpp"
+#include "util.hpp"
#include <time.h>
#include <boost/foreach.hpp>
#ifndef ServiceGnudip_H
#define ServiceGnudip_H
-#include "service.h"
-#include "logger.h"
-#include "httphelper.h"
+#include "service.hpp"
+#include "logger.hpp"
+#include "httphelper.hpp"
#include <boost/shared_ptr.hpp>
#include <map>
* @license GPLv2
*/
-#include "service_ods.h"
-#include "net_helper.h"
-#include "util.h"
+#include "service_ods.hpp"
+#include "net_helper.hpp"
+#include "util.hpp"
using namespace std;
#ifndef ServiceOds_H
#define ServiceOds_H
-#include "service.h"
-#include "logger.h"
+#include "service.hpp"
+#include "logger.hpp"
#include <boost/shared_ptr.hpp>
#include <string>
* @license GPLv2
*/
-#include "service_tzo.h"
-#include "util.h"
+#include "service_tzo.hpp"
+#include "util.hpp"
#include <time.h>
#include <boost/foreach.hpp>
#ifndef ServiceTzo_H
#define ServiceTzo_H
-#include "service.h"
-#include "logger.h"
-#include "httphelper.h"
+#include "service.hpp"
+#include "logger.hpp"
+#include "httphelper.hpp"
#include <boost/shared_ptr.hpp>
#include <string>
* @license GPLv2
*/
-#include "service_zoneedit.h"
-#include "util.h"
+#include "service_zoneedit.hpp"
+#include "util.hpp"
#include <time.h>
#include <boost/foreach.hpp>
#ifndef ServiceZoneedit_H
#define ServiceZoneedit_H
-#include "service.h"
-#include "logger.h"
-#include "httphelper.h"
+#include "service.hpp"
+#include "logger.hpp"
+#include "httphelper.hpp"
#include <boost/shared_ptr.hpp>
#include <string>
* @license GPLv2
*/
-#include "serviceholder.h"
+#include "serviceholder.hpp"
#include <fstream>
#ifndef SERVICEHOLDER_H
#define SERVICEHOLDER_H
-#include "service.h"
-#include "serializeservicecontainer.h"
-#include "logger.h"
-#include "ip_addr_helper.h"
+#include "service.hpp"
+#include "serializeservicecontainer.hpp"
+#include "logger.hpp"
+#include "ip_addr_helper.hpp"
#include <boost/shared_ptr.hpp>
#include <list>
* @license GPLv2
*/
-#include "tcp_service.h"
+#include "tcp_service.hpp"
typedef boost::shared_ptr<SSLStream> SocketPtr;
#ifndef TCPSERVICE_H
#define TCPSERVICE_H
-#include "logger.h"
-#include "ip_service.h"
+#include "logger.hpp"
+#include "ip_service.hpp"
#include <boost/shared_ptr.hpp>
#include <boost/asio.hpp>
* @license GPLv2
*/
-#include "updater.h"
+#include "updater.hpp"
-#include "serviceholder.h"
+#include "serviceholder.hpp"
#include <boost/foreach.hpp>
/**
* Load the main config and the service definition files in config path.
- * @return 0 if all is fine,
+ * @return 0 if all is fine,
*/
int Updater::init_config_from_files() const
{
/**
* Init all Helper classes
- * @return
+ * @return
*/
int Updater::init_helper_classes()
{
#ifndef UPDATER_H
#define UPDATER_H
-#include "config.h"
-#include "ip_addr_helper.h"
-#include "httphelper.h"
-#include "logger.h"
-#include "serviceholder.h"
+#include "config.hpp"
+#include "ip_addr_helper.hpp"
+#include "httphelper.hpp"
+#include "logger.hpp"
+#include "serviceholder.hpp"
#include <boost/shared_ptr.hpp>
* @license GPLv2
*/
-#include "util.h"
+#include "util.hpp"
#include <sstream>
#include <openssl/evp.h>