Commit | Line | Data |
---|---|---|
089a7152 BS |
1 | /** @file |
2 | * @brief DYNS Service class header. This class represents the DYNS service. | |
3 | * | |
4 | * | |
5 | * | |
6 | * @copyright Intra2net AG | |
7 | * @license GPLv2 | |
8 | */ | |
9 | ||
10 | #ifndef SERVICE_DYNS_H | |
11 | #define SERVICE_DYNS_H | |
12 | ||
13 | #include <string> | |
14 | ||
15 | #include "service.h" | |
16 | #include "logger.h" | |
17 | ||
18 | #include <boost/serialization/array.hpp> | |
19 | #include <boost/shared_ptr.hpp> | |
20 | #include <list> | |
21 | ||
22 | class SERVICE_DYNS : public Service | |
23 | { | |
24 | ||
25 | private: | |
26 | ||
27 | friend class boost::serialization::access; | |
28 | template<class Archive> | |
29 | void serialize(Archive & ar, const unsigned int version); | |
30 | ||
31 | std::string BaseUrl; | |
32 | ||
33 | HTTPHelper::Ptr HTTPHelp; | |
34 | ||
35 | std::string assemble_base_url(const std::string& fqhn, const std::string& username, const std::string& password) const; | |
36 | ||
37 | std::string parse_status_code(const std::string& data) const; | |
38 | ||
39 | public: | |
40 | ||
41 | typedef boost::shared_ptr<SERVICE_DYNS> Ptr; | |
42 | ||
43 | SERVICE_DYNS(); | |
44 | ||
45 | SERVICE_DYNS(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 dns_cache_ttl, const std::string& proxy, const int proxy_port); | |
46 | ||
47 | ~SERVICE_DYNS(); | |
48 | ||
49 | int perform_update(const std::string& ip); | |
50 | }; | |
51 | ||
52 | #endif |