]> git.ipfire.org Git - ddns.git/commitdiff
Add dyns.cx|net as new provider.
authorStefan Schantl <stefan.schantl@ipfire.org>
Thu, 28 Aug 2014 19:29:59 +0000 (21:29 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 28 Aug 2014 19:29:59 +0000 (21:29 +0200)
README
ddns.conf.sample
src/ddns/providers.py

diff --git a/README b/README
index fb7a8ff9b26d003a130a999d6655ab691e48986a..32765ff73929496f2e1ee3a7eb1cdf0042975351 100644 (file)
--- a/README
+++ b/README
@@ -55,6 +55,7 @@ SUPPORTED PROVIDERS:
        domopoli.de
        dtdns.com
        dyndns.org
        domopoli.de
        dtdns.com
        dyndns.org
+       dyns.cx|net
        dynu.com
        easydns.com
        enom.com
        dynu.com
        easydns.com
        enom.com
index 2a9642fc2952c07861df6908ad33e50faa47ccfa..e2f61ea285fface11effe62bec0188f55f7b5e75 100644 (file)
 # username = user
 # password = pass
 
 # username = user
 # password = pass
 
+# [text.dyns.net]
+# provider = dyns.net
+# username = user
+# password = pass
+
 # [test.dynu.com]
 # provider = dynu.com
 # username = user
 # [test.dynu.com]
 # provider = dynu.com
 # username = user
index 00a3855bbffab6d61679ccc7614eaac0cef18352..2ffc35d50953da4fe44823c5b7b647f05d34c4c3 100644 (file)
@@ -556,6 +556,50 @@ class DDNSProviderDomopoli(DDNSProtocolDynDNS2, DDNSProvider):
        url = "http://dyndns.domopoli.de/nic/update"
 
 
        url = "http://dyndns.domopoli.de/nic/update"
 
 
+class DDNSProviderDynsNet(DDNSProvider):
+       handle    = "dyns.net"
+       name      = "DyNS"
+       website   = "http://www.dyns.net/"
+       protocols = ("ipv4",)
+
+       # There is very detailed informatio about how to send the update request and
+       # the possible response codes. (Currently we are using the v1.1 proto)
+       # http://www.dyns.net/documentation/technical/protocol/
+
+       url = "http://www.dyns.net/postscript011.php"
+
+       def update(self):
+               data = {
+                       "ip"       : self.get_address("ipv4"),
+                       "host"     : self.hostname,
+                       "username" : self.username,
+                       "password" : self.password,
+               }
+
+               # Send update to the server.
+               response = self.send_request(self.url, data=data)
+
+               # Get the full response message.
+               output = response.read()
+
+               # Handle success messages.
+               if output.startswith("200"):
+                       return
+
+               # Handle error codes.
+               if output.startswith("400"):
+                       raise DDNSRequestError(_("Malformed request has been sent."))
+               elif output.startswith("401"):
+                       raise DDNSAuthenticationError
+               elif output.startswith("402"):
+                       raise DDNSRequestError(_("Too frequent update requests have been sent."))
+               elif output.startswith("403"):
+                       raise DDNSInternalServerError
+
+               # If we got here, some other update error happened.
+               raise DDNSUpdateError(_("Server response: %s") % output) 
+
+
 class DDNSProviderEnomCom(DDNSResponseParserXML, DDNSProvider):
        handle    = "enom.com"
        name      = "eNom Inc."
 class DDNSProviderEnomCom(DDNSResponseParserXML, DDNSProvider):
        handle    = "enom.com"
        name      = "eNom Inc."