Commit | Line | Data |
---|---|---|
089a7152 BS |
1 | /** @file |
2 | * @brief DYNDNS Service class header. This class represents the DYNDNS service. | |
3 | * | |
4 | * | |
5 | * | |
6 | * @copyright Intra2net AG | |
7 | * @license GPLv2 | |
8 | */ | |
9 | ||
629d8110 BS |
10 | #ifndef ServiceDyndns_H |
11 | #define ServiceDyndns_H | |
089a7152 | 12 | |
4de6a9b8 BS |
13 | #include "service.hpp" |
14 | #include "logger.hpp" | |
15 | #include "httphelper.hpp" | |
089a7152 | 16 | |
089a7152 | 17 | #include <boost/shared_ptr.hpp> |
ca5d6889 BS |
18 | #include <string> |
19 | ||
089a7152 | 20 | |
629d8110 | 21 | class ServiceDyndns : public Service |
089a7152 BS |
22 | { |
23 | ||
24 | private: | |
25 | ||
26 | friend class boost::serialization::access; | |
27 | template<class Archive> | |
ca5d6889 BS |
28 | void serialize(Archive & ar, const unsigned int version) |
29 | { | |
30 | ar & boost::serialization::base_object<Service>(*this); | |
31 | } | |
089a7152 | 32 | |
f04a7cb4 | 33 | std::string AlternativeServer; // Needed for NO-IP |
089a7152 BS |
34 | std::string BaseUrl; |
35 | ||
36 | HTTPHelper::Ptr HTTPHelp; | |
37 | ||
38 | std::string assemble_base_url(const std::string& fqhn) const; | |
39 | ||
40 | public: | |
41 | ||
629d8110 | 42 | typedef boost::shared_ptr<ServiceDyndns> Ptr; |
089a7152 | 43 | |
629d8110 | 44 | ServiceDyndns(); |
089a7152 | 45 | |
4553e833 | 46 | ServiceDyndns(const std::string& _protocol, const std::string& _hostname, const std::string& _login, const std::string& _password, const Logger::Ptr& _logger, const int _update_interval, const int _max_updates_within_interval, const int _max_equal_updates_in_succession, const int dns_cache_ttl, const std::string& proxy, const int proxy_port, const std::string& _alternative_server = ""); |
089a7152 | 47 | |
629d8110 | 48 | ~ServiceDyndns(); |
089a7152 | 49 | |
d008afbe | 50 | UpdateErrorCode perform_update(const std::string& ip); |
089a7152 BS |
51 | |
52 | }; | |
53 | ||
54 | #endif |