Add DynU as new provider.
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 17 Jun 2014 17:26:28 +0000 (19:26 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Tue, 17 Jun 2014 17:26:28 +0000 (19:26 +0200)
ddns.conf.sample
src/ddns/__init__.py
src/ddns/providers.py

index bc41f83..fae8ba0 100644 (file)
 # username = user
 # password = pass
 
+# [test.dynu.com]
+# provider = dynu.com
+# username = user
+# password = pass
+
 # [test.freedns.afraid.org]
 # provider = freedns.afraid.org
 # token = token
index 30a1b8a..83e337c 100644 (file)
@@ -95,6 +95,7 @@ class DDNSCore(object):
                        DDNSProviderDNSpark,
                        DDNSProviderDtDNS,
                        DDNSProviderDynDNS,
+                       DDNSProviderDynU,
                        DDNSProviderFreeDNSAfraidOrg,
                        DDNSProviderNOIP,
                        DDNSProviderLightningWireLabs,
index e936d72..ab05f77 100644 (file)
@@ -361,6 +361,29 @@ class DDNSProviderDynDNS(DDNSProvider):
                raise DDNSUpdateError
 
 
+class DDNSProviderDynU(DDNSProviderDynDNS):
+       INFO = {
+               "handle"    : "dynu.com",
+               "name"      : "Dynu",
+               "website"   : "http://dynu.com/",
+               "protocols" : ["ipv6", "ipv4",]
+       }
+
+
+       # Detailed information about the request and response codes
+       # are available on the providers webpage.
+       # http://dynu.com/Default.aspx?page=dnsapi
+
+       url = "https://api.dynu.com/nic/update"
+
+       def _prepare_request_data(self):
+               data = {
+                       "hostname" : self.hostname,
+                       "myip"     : self.get_address("ipv4"),
+                       "myipv6"   : self.get_address("ipv6"),
+               }
+
+
 class DDNSProviderFreeDNSAfraidOrg(DDNSProvider):
        INFO = {
                "handle"    : "freedns.afraid.org",