service_dyns.cpp
service_easydns.cpp
service_gnudip.cpp
+ service_gnudip_fullhostname.cpp
serviceholder.cpp
service_ods.cpp
service_tzo.cpp
service_dyns.hpp
service_easydns.hpp
service_gnudip.hpp
+ service_gnudip_fullhostname.hpp
service.hpp
serviceholder.hpp
service_ods.hpp
#include "service_tzo.hpp"
#include "service_zoneedit.hpp"
#include "service_gnudip.hpp"
+#include "service_gnudip_fullhostname.hpp"
#include <time.h>
#include <iostream>
return service;
}
}
+ else if(protocol == "gnudip-fullhostname")
+ {
+ if ( !server.empty() )
+ {
+ Service::Ptr service_gnudip_fullhostname(new ServiceGnudipFullhostname(protocol,server,hostname,login,password,Log,update_interval,max_updates_within_interval,max_equal_updates_in_succession,dns_cache_ttl,Proxy,ProxyPort));
+ return service_gnudip_fullhostname;
+ }
+ else
+ {
+ Log->print_gnudip_requires_servername();
+ Service::Ptr service;
+ return service;
+ }
+ }
else
{
Log->print_unknown_protocol(protocol);
BOOST_CLASS_EXPORT_GUID(ServiceTzo, "ServiceTzo")
BOOST_CLASS_EXPORT_GUID(ServiceZoneedit, "ServiceZoneedit")
BOOST_CLASS_EXPORT_GUID(ServiceGnudip, "ServiceGnudip")
+BOOST_CLASS_EXPORT_GUID(ServiceGnudipFullhostname, "ServiceGnudipFullhostname")
SerializeServiceContainer::SerializeServiceContainer()
#include "service_tzo.hpp"
#include "service_zoneedit.hpp"
#include "service_gnudip.hpp"
+#include "service_gnudip_fullhostname.hpp"
class SerializeServiceContainer
}
// Now its time to issue the second http_get operation
- string url = assemble_update_url(salt, sign_time, sign, secret, ip);
+ string url = this->assemble_update_url(salt, sign_time, sign, secret, ip);
// perform the update operation
http_status_code = HTTPHelp->http_get(url);
class ServiceGnudip : public Service
{
-private:
+protected:
friend class boost::serialization::access;
template<class Archive>
std::string assemble_base_url(const std::string& gnudip_server) const;
std::map<std::string,std::string> parse_initial_request(const std::string& curl_data) const;
- std::string assemble_update_url(const std::string& salt, const std::string& curr_time, const std::string& sign, const std::string& secret, const std::string& ip) const;
+ virtual std::string assemble_update_url(const std::string& salt, const std::string& curr_time, const std::string& sign, const std::string& secret, const std::string& ip) const;
std::string parse_return_code(const std::string& curl_data) const;
public:
--- /dev/null
+/** @file
+ * @brief GNUDIP Service class implementation. This class represents the GNUDIP service.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
+#include "service_gnudip_fullhostname.hpp"
+#include "util.hpp"
+
+
+using namespace std;
+
+
+/**
+ * Default Constructor, needed for object serialization.
+ */
+ServiceGnudipFullhostname::ServiceGnudipFullhostname()
+{
+}
+
+
+/**
+ * Constructor.
+ * @param _hostname The hostname to update
+ * @param _login The login name.
+ * @param _password The corresponding password.
+ */
+ServiceGnudipFullhostname::ServiceGnudipFullhostname(const string& _protocol, const string& _gnudip_server, const string& _hostname, const string& _login, const 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 string& _proxy, const int _proxy_port)
+ : ServiceGnudip(_protocol, _gnudip_server, _hostname, _login, _password, _logger, _update_interval, _max_updates_within_interval, _max_equal_updates_in_succession, _dns_cache_ttl, _proxy, _proxy_port)
+{
+}
+
+
+/**
+ * Default destructor
+ */
+ServiceGnudipFullhostname::~ServiceGnudipFullhostname()
+{
+}
+
+/**
+ * Get the assembled update url.
+ * @param salt Salt from the initial request
+ * @param time Time from the initial request
+ * @param sign Sign from the initial request
+ * @param secret Computed md5 secret in HEX
+ * @param ip IP to update
+ * @return The assembled update url.
+ */
+string ServiceGnudipFullhostname::assemble_update_url(const string& salt, const string& curr_time, const string& sign, const string& secret, const string& ip) const
+{
+ string url = BaseUrl;
+
+ url.append("?salt=");
+ url.append(salt);
+ url.append("&time=");
+ url.append(curr_time);
+ url.append("&sign=");
+ url.append(sign);
+ url.append("&user=");
+ url.append(get_login());
+ url.append("&domn=");
+ url.append(get_hostname());
+ url.append("&pass=");
+ url.append(secret);
+ url.append("&reqc=0&addr=");
+ url.append(ip);
+
+ return url;
+}
+
--- /dev/null
+/** @file
+ * @brief GNUDIP Service class header. This class represents the GNUDIP service.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
+#ifndef ServiceGnudipFullhostname_H
+#define ServiceGnudipFullhostname_H
+
+#include "service_gnudip.hpp"
+
+class ServiceGnudipFullhostname : public ServiceGnudip
+{
+
+private:
+
+ friend class boost::serialization::access;
+ template<class Archive>
+ void serialize(Archive & ar, const unsigned int version)
+ {
+ ar & boost::serialization::base_object<ServiceGnudip>(*this);
+ }
+
+ std::string assemble_update_url(const std::string& salt, const std::string& curr_time, const std::string& sign, const std::string& secret, const std::string& ip) const;
+
+public:
+
+ typedef boost::shared_ptr<ServiceGnudipFullhostname> Ptr;
+
+ ServiceGnudipFullhostname();
+
+ ServiceGnudipFullhostname(const std::string& _protocol, const std::string& _gnudip_server ,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);
+
+ ~ServiceGnudipFullhostname();
+
+};
+
+#endif