summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Vcelak <jv@fcelda.cz>2015-10-31 06:42:07 +0100
committerJan Vcelak <jv@fcelda.cz>2015-10-31 11:23:15 +0100
commit860c43de92e614cbf941cd905e962261c97cb702 (patch)
tree128f867a82102ae54b96633fb80f45f7382fc4fb
parent7bba8158b88271d245a6eb45387af888a0413014 (diff)
downloaddnspython-860c43de92e614cbf941cd905e962261c97cb702.tar.gz
Add support for CDS record type
-rw-r--r--dns/rdatatype.py2
-rw-r--r--dns/rdtypes/ANY/CDS.py19
-rw-r--r--dns/rdtypes/ANY/__init__.py1
-rw-r--r--tests/example1
-rw-r--r--tests/example1.good1
-rw-r--r--tests/example2.good1
-rw-r--r--tests/example3.good1
7 files changed, 26 insertions, 0 deletions
diff --git a/dns/rdatatype.py b/dns/rdatatype.py
index ae6b6ec..6071406 100644
--- a/dns/rdatatype.py
+++ b/dns/rdatatype.py
@@ -80,6 +80,7 @@ NSEC3 = 50
NSEC3PARAM = 51
TLSA = 52
HIP = 55
+CDS = 59
SPF = 99
UNSPEC = 103
TKEY = 249
@@ -144,6 +145,7 @@ _by_text = {
'NSEC3PARAM' : NSEC3PARAM,
'TLSA' : TLSA,
'HIP' : HIP,
+ 'CDS' : CDS,
'SPF' : SPF,
'UNSPEC' : UNSPEC,
'TKEY' : TKEY,
diff --git a/dns/rdtypes/ANY/CDS.py b/dns/rdtypes/ANY/CDS.py
new file mode 100644
index 0000000..15fe012
--- /dev/null
+++ b/dns/rdtypes/ANY/CDS.py
@@ -0,0 +1,19 @@
+# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
+#
+# Permission to use, copy, modify, and distribute this software and its
+# documentation for any purpose with or without fee is hereby granted,
+# provided that the above copyright notice and this permission notice
+# appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+import dns.rdtypes.dsbase
+
+class CDS(dns.rdtypes.dsbase.DSBase):
+ """CDS record"""
diff --git a/dns/rdtypes/ANY/__init__.py b/dns/rdtypes/ANY/__init__.py
index 721e9dd..b95048b 100644
--- a/dns/rdtypes/ANY/__init__.py
+++ b/dns/rdtypes/ANY/__init__.py
@@ -17,6 +17,7 @@
__all__ = [
'AFSDB',
+ 'CDS',
'CERT',
'CNAME',
'DLV',
diff --git a/tests/example b/tests/example
index 07394ae..fca0ade 100644
--- a/tests/example
+++ b/tests/example
@@ -194,6 +194,7 @@ wks03 WKS 10.0.0.2 6 ( 65535 )
x2501 X25 "123456789"
dlv01 DLV 12345 3 1 123456789abcdef67890123456789abcdef67890
ds01 DS 12345 3 1 123456789abcdef67890123456789abcdef67890
+cds01 CDS 12345 3 1 123456789abcdef67890123456789abcdef67890
apl01 APL 1:192.168.32.0/21 !1:192.168.38.0/28
apl02 APL 1:224.0.0.0/4 2:FF00:0:0:0:0:0:0:0/8
unknown2 TYPE999 \# 8 0a0000010a000001
diff --git a/tests/example1.good b/tests/example1.good
index 62e8e28..1e96be8 100644
--- a/tests/example1.good
+++ b/tests/example1.good
@@ -20,6 +20,7 @@ caa03 3600 IN CAA 0 iodef "http://iodef.example.com/"
caa04 3600 IN CAA 0 issue "ca.example.net; account=230123"
caa05 3600 IN CAA 0 issue "ca.example.net; policy=ev"
caa06 3600 IN CAA 128 tbs "Unknown"
+cds01 3600 IN CDS 12345 3 1 123456789abcdef67890123456789abcdef67890
cert01 3600 IN CERT 65534 65535 PRIVATEOID MxFcby9k/yvedMfQgKzhH5er0Mu/vILz 45IkskceFGgiWCn/GxHhai6VAuHAoNUz 4YoU1tVfSCSqQYn6//11U6Nld80jEeC8 aTrO+KKmCaY=
cname01 3600 IN CNAME cname-target.
cname02 3600 IN CNAME cname-target
diff --git a/tests/example2.good b/tests/example2.good
index 4a92012..5895179 100644
--- a/tests/example2.good
+++ b/tests/example2.good
@@ -20,6 +20,7 @@ caa03.example. 3600 IN CAA 0 iodef "http://iodef.example.com/"
caa04.example. 3600 IN CAA 0 issue "ca.example.net; account=230123"
caa05.example. 3600 IN CAA 0 issue "ca.example.net; policy=ev"
caa06.example. 3600 IN CAA 128 tbs "Unknown"
+cds01.example. 3600 IN CDS 12345 3 1 123456789abcdef67890123456789abcdef67890
cert01.example. 3600 IN CERT 65534 65535 PRIVATEOID MxFcby9k/yvedMfQgKzhH5er0Mu/vILz 45IkskceFGgiWCn/GxHhai6VAuHAoNUz 4YoU1tVfSCSqQYn6//11U6Nld80jEeC8 aTrO+KKmCaY=
cname01.example. 3600 IN CNAME cname-target.
cname02.example. 3600 IN CNAME cname-target.example.
diff --git a/tests/example3.good b/tests/example3.good
index 62e8e28..1e96be8 100644
--- a/tests/example3.good
+++ b/tests/example3.good
@@ -20,6 +20,7 @@ caa03 3600 IN CAA 0 iodef "http://iodef.example.com/"
caa04 3600 IN CAA 0 issue "ca.example.net; account=230123"
caa05 3600 IN CAA 0 issue "ca.example.net; policy=ev"
caa06 3600 IN CAA 128 tbs "Unknown"
+cds01 3600 IN CDS 12345 3 1 123456789abcdef67890123456789abcdef67890
cert01 3600 IN CERT 65534 65535 PRIVATEOID MxFcby9k/yvedMfQgKzhH5er0Mu/vILz 45IkskceFGgiWCn/GxHhai6VAuHAoNUz 4YoU1tVfSCSqQYn6//11U6Nld80jEeC8 aTrO+KKmCaY=
cname01 3600 IN CNAME cname-target.
cname02 3600 IN CNAME cname-target