]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
add more type codes, make NSEC a singleton, fix whitespace
authorBob Halley <halley@dnspython.org>
Tue, 31 Mar 2009 01:03:55 +0000 (01:03 +0000)
committerBob Halley <halley@dnspython.org>
Tue, 31 Mar 2009 01:03:55 +0000 (01:03 +0000)
dns/rdatatype.py

index 432733a9d5b267f9cd7421acc6a9700536ae214c..924290f45cded4a123d79786c29c50449befa471 100644 (file)
@@ -76,6 +76,9 @@ RRSIG = 46
 NSEC = 47
 DNSKEY = 48
 DHCID = 49
+NSEC3 = 50
+NSEC3PARAM = 51
+HIP = 55
 SPF = 99
 UNSPEC = 103
 TKEY = 249
@@ -85,6 +88,8 @@ AXFR = 252
 MAILB = 253
 MAILA = 254
 ANY = 255
+TA = 32768
+DLV = 32769
 
 _by_text = {
     'NONE' : NONE,
@@ -133,6 +138,9 @@ _by_text = {
     'NSEC' : NSEC,
     'DNSKEY' : DNSKEY,
     'DHCID' : DHCID,
+    'NSEC3' : NSEC3,
+    'NSEC3PARAM' : NSEC3PARAM,
+    'HIP' : HIP,
     'SPF' : SPF,
     'UNSPEC' : UNSPEC,
     'TKEY' : TKEY,
@@ -141,7 +149,9 @@ _by_text = {
     'AXFR' : AXFR,
     'MAILB' : MAILB,
     'MAILA' : MAILA,
-    'ANY' : ANY
+    'ANY' : ANY,
+    'TA' : TA,
+    'DLV' : DLV,
     }
 
 # We construct the inverse mapping programmatically to ensure that we
@@ -159,6 +169,7 @@ _singletons = {
     SOA : True,
     NXT : True,
     DNAME : True,
+    NSEC : True,
     # CNAME is technically a singleton, but we allow multiple CNAMEs.
     }
 
@@ -175,7 +186,7 @@ def from_text(text):
     @raises dns.rdatatype.UnknownRdatatype: the type is unknown
     @raises ValueError: the rdata type value is not >= 0 and <= 65535
     @rtype: int"""
-    
+
     value = _by_text.get(text.upper())
     if value is None:
         match = _unknown_type_pattern.match(text)
@@ -192,7 +203,7 @@ def to_text(value):
     @type value: int
     @raises ValueError: the rdata type value is not >= 0 and <= 65535
     @rtype: string"""
-    
+
     if value < 0 or value > 65535:
         raise ValueError, "type must be between >= 0 and <= 65535"
     text = _by_value.get(value)
@@ -205,7 +216,7 @@ def is_metatype(rdtype):
     @param rdtype: the type
     @type rdtype: int
     @rtype: bool"""
-    
+
     if rdtype >= TKEY and rdtype <= ANY or _metatypes.has_key(rdtype):
         return True
     return False
@@ -215,7 +226,7 @@ def is_singleton(rdtype):
     @param rdtype: the type
     @type rdtype: int
     @rtype: bool"""
-    
+
     if _singletons.has_key(rdtype):
         return True
     return False