Don't update the same IP more than 2 times in success.
[bpdyndnsd] / src / service_dhs.hpp
CommitLineData
089a7152
BS
1/** @file
2 * @brief DHS Service class header. This class represents the DHS service.
3 *
4 *
5 *
6 * @copyright Intra2net AG
7 * @license GPLv2
8*/
9
629d8110
BS
10#ifndef ServiceDhs_H
11#define ServiceDhs_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 18#include <string>
089a7152
BS
19#include <list>
20
ca5d6889 21
629d8110 22class ServiceDhs : public Service
089a7152
BS
23{
24
25private:
26
27 friend class boost::serialization::access;
28 template<class Archive>
ca5d6889
BS
29 void serialize(Archive & ar, const unsigned int version)
30 {
31 ar & boost::serialization::base_object<Service>(*this);
32 }
089a7152
BS
33
34 std::string BaseUrl;
35
36 HTTPHelper::Ptr HTTPHelp;
37
38 std::list<std::string> separate_domain_and_host_part(const std::string& str) const;
089a7152
BS
39 std::string assemble_base_url(const std::string& hostname, const std::string& domain_part) const;
40
41public:
42
629d8110 43 typedef boost::shared_ptr<ServiceDhs> Ptr;
089a7152 44
629d8110 45 ServiceDhs();
089a7152 46
4553e833 47 ServiceDhs(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);
089a7152 48
629d8110 49 ~ServiceDhs();
089a7152
BS
50
51 int perform_update(const std::string& ip);
52};
53
54#endif