]> gitweb.michael.orlitzky.com - djbdns-logparse.git/blobdiff - bin/djbdns-logparse.py
bin/djbdns-logparse.py: fiddle with the convert_ip() comments.
[djbdns-logparse.git] / bin / djbdns-logparse.py
index 50161fa827d046885d3f6ea135aeed978cd5e2bd..3a25a5a52bf4dceb4e5376c4644abf12a361918d 100755 (executable)
@@ -33,9 +33,15 @@ query_type = {
      24: "sig",
      25: "key",
      28: "aaaa",
+     33: "srv",
+     35: "naptr",
      38: "a6",
+     48: "dnskey",
+     52: "tlsa",
+     65: "https",
     252: "axfr",
     255: "any",
+    257: "caa"
 }
 
 # for tinydns only
@@ -62,12 +68,10 @@ def convert_ip(ip : str):
 
     """
     if len(ip) == 8:
-        # IPv4, eg. "7f000001" -> "127.0.0.1"
+        # IPv4, eg. "7f000001" -> "7f 00 00 01" -> "127.0.0.1"
         return "%d.%d.%d.%d" % tuple(pack(">L", int(ip, 16)))
     elif len(ip) == 32:
-        # IPv6 is actually simpler -- it's just a string-slicing operation,
-        # eg. "00000000000000000000ffff7f000001" ->
-        # "0000:0000:0000:0000:0000:ffff:7f00:0001"
+        # IPv6 is actually simpler -- it's just a string-slicing operation.
         return ":".join([ip[(4*i) : (4*i+4)] for i in range(8)])