From: Bob Halley Date: Fri, 23 Feb 2024 02:33:00 +0000 (-0800) Subject: Add RESINFO type. X-Git-Tag: v2.7.0rc1~80 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6695d80786397a11415f889c5b1f5f64fd8b3522;p=thirdparty%2Fdnspython.git Add RESINFO type. --- diff --git a/dns/rdatatype.py b/dns/rdatatype.py index e6c58186..b5ef8efe 100644 --- a/dns/rdatatype.py +++ b/dns/rdatatype.py @@ -105,6 +105,7 @@ class RdataType(dns.enum.IntEnum): CAA = 257 AVC = 258 AMTRELAY = 260 + RESINFO = 261 TA = 32768 DLV = 32769 @@ -326,6 +327,7 @@ URI = RdataType.URI CAA = RdataType.CAA AVC = RdataType.AVC AMTRELAY = RdataType.AMTRELAY +RESINFO = RdataType.RESINFO TA = RdataType.TA DLV = RdataType.DLV diff --git a/dns/rdtypes/ANY/RESINFO.py b/dns/rdtypes/ANY/RESINFO.py new file mode 100644 index 00000000..76c8ea2a --- /dev/null +++ b/dns/rdtypes/ANY/RESINFO.py @@ -0,0 +1,24 @@ +# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license + +# 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.immutable +import dns.rdtypes.txtbase + + +@dns.immutable.immutable +class RESINFO(dns.rdtypes.txtbase.TXTBase): + """RESINFO record""" diff --git a/dns/rdtypes/ANY/__init__.py b/dns/rdtypes/ANY/__init__.py index 3824a0a0..1c9308c0 100644 --- a/dns/rdtypes/ANY/__init__.py +++ b/dns/rdtypes/ANY/__init__.py @@ -51,6 +51,7 @@ __all__ = [ "OPENPGPKEY", "OPT", "PTR", + "RESINFO", "RP", "RRSIG", "RT", diff --git a/doc/rdata-subclasses.rst b/doc/rdata-subclasses.rst index 98c3b5a7..c7be8b22 100644 --- a/doc/rdata-subclasses.rst +++ b/doc/rdata-subclasses.rst @@ -439,6 +439,13 @@ Universal Types A ``dns.name.Name``, the target name. +.. autoclass:: dns.rdtypes.ANY.RESINFO.RESINFO + :members: + + .. attribute:: strings + + A tuple of ``bytes``, the list of strings. + .. autoclass:: dns.rdtypes.ANY.RP.RP :members: diff --git a/doc/rdatatype-list.rst b/doc/rdatatype-list.rst index c2c3b19b..97176a50 100644 --- a/doc/rdatatype-list.rst +++ b/doc/rdatatype-list.rst @@ -119,6 +119,8 @@ Rdatatypes :annotation: = 12 .. py:data:: dns.rdatatype.PX :annotation: = 26 +.. py:data:: dns.rdatatype.RESINFO + :annotation: = 261 .. py:data:: dns.rdatatype.RP :annotation: = 17 .. py:data:: dns.rdatatype.RRSIG diff --git a/tests/example b/tests/example index 8aec4940..adc42aa9 100644 --- a/tests/example +++ b/tests/example @@ -261,3 +261,4 @@ ech="abcd" ipv4hint=1.2.3.4,4.3.2.1 ipv6hint=1::2,3::4 key12345="foo" ) https01 HTTPS 0 svc https02 HTTPS 1 . port=8002 ech="abcd" +resinfo RESINFO qnamemin exterr=15,16,17 infourl=https://resolver.example.com/guide \ No newline at end of file diff --git a/tests/example1.good b/tests/example1.good index 045365c0..d5d728a6 100644 --- a/tests/example1.good +++ b/tests/example1.good @@ -116,6 +116,7 @@ openpgpkey 3600 IN OPENPGPKEY mQENBEteQDsBCADYnatn9+5t43AdJlVk9dZC2RM0idPQcmrrKc ptr01 3600 IN PTR @ px01 3600 IN PX 65535 foo. bar. px02 3600 IN PX 65535 . . +resinfo 3600 IN RESINFO "qnamemin" "exterr=15,16,17" "infourl=https://resolver.example.com/guide" rp01 3600 IN RP mbox-dname txt-dname rp02 3600 IN RP . . rrsig01 3600 IN RRSIG NSEC 1 3 3600 20200101000000 20030101000000 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/vILz 45IkskceFGgiWCn/GxHhai6VAuHAoNUz 4YoU1tVfSCSqQYn6//11U6Nld80jEeC8 aTrO+KKmCaY= diff --git a/tests/example2.good b/tests/example2.good index 5bb13768..76890e72 100644 --- a/tests/example2.good +++ b/tests/example2.good @@ -116,6 +116,7 @@ openpgpkey.example. 3600 IN OPENPGPKEY mQENBEteQDsBCADYnatn9+5t43AdJlVk9dZC2RM0i ptr01.example. 3600 IN PTR example. px01.example. 3600 IN PX 65535 foo. bar. px02.example. 3600 IN PX 65535 . . +resinfo.example. 3600 IN RESINFO "qnamemin" "exterr=15,16,17" "infourl=https://resolver.example.com/guide" rp01.example. 3600 IN RP mbox-dname.example. txt-dname.example. rp02.example. 3600 IN RP . . rrsig01.example. 3600 IN RRSIG NSEC 1 3 3600 20200101000000 20030101000000 2143 foo.example. MxFcby9k/yvedMfQgKzhH5er0Mu/vILz 45IkskceFGgiWCn/GxHhai6VAuHAoNUz 4YoU1tVfSCSqQYn6//11U6Nld80jEeC8 aTrO+KKmCaY= diff --git a/tests/example3.good b/tests/example3.good index 045365c0..d5d728a6 100644 --- a/tests/example3.good +++ b/tests/example3.good @@ -116,6 +116,7 @@ openpgpkey 3600 IN OPENPGPKEY mQENBEteQDsBCADYnatn9+5t43AdJlVk9dZC2RM0idPQcmrrKc ptr01 3600 IN PTR @ px01 3600 IN PX 65535 foo. bar. px02 3600 IN PX 65535 . . +resinfo 3600 IN RESINFO "qnamemin" "exterr=15,16,17" "infourl=https://resolver.example.com/guide" rp01 3600 IN RP mbox-dname txt-dname rp02 3600 IN RP . . rrsig01 3600 IN RRSIG NSEC 1 3 3600 20200101000000 20030101000000 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/vILz 45IkskceFGgiWCn/GxHhai6VAuHAoNUz 4YoU1tVfSCSqQYn6//11U6Nld80jEeC8 aTrO+KKmCaY= diff --git a/tests/example4.good b/tests/example4.good index 3c154a0b..264ccb28 100644 --- a/tests/example4.good +++ b/tests/example4.good @@ -117,6 +117,7 @@ openpgpkey 3600 IN OPENPGPKEY mQENBEteQDsBCADYnatn9+5t43AdJlVk9dZC2RM0idPQcmrrKc ptr01 3600 IN PTR @ px01 3600 IN PX 65535 foo. bar. px02 3600 IN PX 65535 . . +resinfo 3600 IN RESINFO "qnamemin" "exterr=15,16,17" "infourl=https://resolver.example.com/guide" rp01 3600 IN RP mbox-dname txt-dname rp02 3600 IN RP . . rrsig01 3600 IN RRSIG NSEC 1 3 3600 20200101000000 20030101000000 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/vILz 45IkskceFGgiWCn/GxHhai6VAuHAoNUz 4YoU1tVfSCSqQYn6//11U6Nld80jEeC8 aTrO+KKmCaY=