]> git.ipfire.org Git - oddments/ddns.git/commitdiff
zzzz.io: Also support IPv6
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 7 Sep 2014 18:58:29 +0000 (18:58 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 7 Sep 2014 18:58:29 +0000 (18:58 +0000)
src/ddns/providers.py

index 271f2c3658f88ba18148a0ded188878902f8b2c4..acec95b7a6e0ffd1afba2d36cd76a7101243d056 100644 (file)
@@ -1158,7 +1158,7 @@ class DDNSProviderZZZZ(DDNSProvider):
        handle    = "zzzz.io"
        name      = "zzzz"
        website   = "https://zzzz.io"
        handle    = "zzzz.io"
        name      = "zzzz"
        website   = "https://zzzz.io"
-       protocols = ("ipv4",)
+       protocols = ("ipv6", "ipv4",)
 
        # Detailed information about the update request can be found here:
        # https://zzzz.io/faq/
 
        # Detailed information about the update request can be found here:
        # https://zzzz.io/faq/
@@ -1169,11 +1169,21 @@ class DDNSProviderZZZZ(DDNSProvider):
        url = "https://zzzz.io/api/v1/update"
 
        def update(self):
        url = "https://zzzz.io/api/v1/update"
 
        def update(self):
+               for protocol in self.protocols:
+                       address = self.get_address(protocol)
+
+                       if address:
+                               self.update_for_protocol(protocol, address)
+
+       def update_for_protocol(self, proto, address):
                data = {
                data = {
-                       "ip"    : self.get_address("ipv4"),
+                       "ip"    : address,
                        "token" : self.token,
                }
 
                        "token" : self.token,
                }
 
+               if proto == "ipv6":
+                       data["type"] = "aaaa"
+
                # zzzz uses the host from the full hostname as part
                # of the update url.
                host, domain = self.hostname.split(".", 1)
                # zzzz uses the host from the full hostname as part
                # of the update url.
                host, domain = self.hostname.split(".", 1)