From d48647bb72904e4ee619f0d62245e60b51628207 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Tue, 20 Sep 2016 13:00:33 -0700 Subject: [PATCH] Add AVC RR support. --- ChangeLog | 6 ++++-- dns/rdatatype.py | 2 ++ dns/rdtypes/ANY/AVC.py | 23 +++++++++++++++++++++++ tests/example | 1 + tests/example1.good | 1 + tests/example2.good | 1 + tests/example3.good | 1 + 7 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 dns/rdtypes/ANY/AVC.py diff --git a/ChangeLog b/ChangeLog index 521873fe..78a2961a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,8 +7,10 @@ http://unicode.org/reports/tr46/ for more info on what this means. - * Problems with newlines in various output modes have been - addressed, but I suspect there is more to come in this area. + * Add AVC RR support. + + * Some problems with newlines in various output modes have been + addressed. * More miscellaneous fixes for the Python 2/3 codeline merge. diff --git a/dns/rdatatype.py b/dns/rdatatype.py index cde1a0a1..15284f64 100644 --- a/dns/rdatatype.py +++ b/dns/rdatatype.py @@ -96,6 +96,7 @@ MAILA = 254 ANY = 255 URI = 256 CAA = 257 +AVC = 258 TA = 32768 DLV = 32769 @@ -166,6 +167,7 @@ _by_text = { 'ANY': ANY, 'URI': URI, 'CAA': CAA, + 'AVC': AVC, 'TA': TA, 'DLV': DLV, } diff --git a/dns/rdtypes/ANY/AVC.py b/dns/rdtypes/ANY/AVC.py new file mode 100644 index 00000000..137c9de9 --- /dev/null +++ b/dns/rdtypes/ANY/AVC.py @@ -0,0 +1,23 @@ +# Copyright (C) 2016 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.txtbase + + +class AVC(dns.rdtypes.txtbase.TXTBase): + + """AVC record + + @see: U{http://www.iana.org/assignments/dns-parameters/AVC/avc-completed-template}""" diff --git a/tests/example b/tests/example index 5983754b..f91da99b 100644 --- a/tests/example +++ b/tests/example @@ -196,3 +196,4 @@ caa04 CAA 0 issue "ca.example.net; account=230123" caa05 CAA 0 issue "ca.example.net; policy=ev" caa06 CAA 128 tbs "Unknown" csync0 CSYNC 12345 0 A MX RRSIG NSEC TYPE1234 +avc01 AVC "app-name:WOLFGANG|app-class:OAM|business=yes" diff --git a/tests/example1.good b/tests/example1.good index 215d99f8..0769da69 100644 --- a/tests/example1.good +++ b/tests/example1.good @@ -14,6 +14,7 @@ afsdb01 3600 IN AFSDB 0 hostname afsdb02 3600 IN AFSDB 65535 . apl01 3600 IN APL 1:192.168.32.0/21 !1:192.168.38.0/28 apl02 3600 IN APL 1:224.0.0.0/4 2:FF00:0:0:0:0:0:0:0/8 +avc01 3600 IN AVC "app-name:WOLFGANG|app-class:OAM|business=yes" b 300 IN CNAME foo.net. c 300 IN A 73.80.65.49 caa01 3600 IN CAA 0 issue "ca.example.net" diff --git a/tests/example2.good b/tests/example2.good index 07029306..57933886 100644 --- a/tests/example2.good +++ b/tests/example2.good @@ -14,6 +14,7 @@ afsdb01.example. 3600 IN AFSDB 0 hostname.example. afsdb02.example. 3600 IN AFSDB 65535 . apl01.example. 3600 IN APL 1:192.168.32.0/21 !1:192.168.38.0/28 apl02.example. 3600 IN APL 1:224.0.0.0/4 2:FF00:0:0:0:0:0:0:0/8 +avc01.example. 3600 IN AVC "app-name:WOLFGANG|app-class:OAM|business=yes" b.example. 300 IN CNAME foo.net. c.example. 300 IN A 73.80.65.49 caa01.example. 3600 IN CAA 0 issue "ca.example.net" diff --git a/tests/example3.good b/tests/example3.good index 215d99f8..0769da69 100644 --- a/tests/example3.good +++ b/tests/example3.good @@ -14,6 +14,7 @@ afsdb01 3600 IN AFSDB 0 hostname afsdb02 3600 IN AFSDB 65535 . apl01 3600 IN APL 1:192.168.32.0/21 !1:192.168.38.0/28 apl02 3600 IN APL 1:224.0.0.0/4 2:FF00:0:0:0:0:0:0:0/8 +avc01 3600 IN AVC "app-name:WOLFGANG|app-class:OAM|business=yes" b 300 IN CNAME foo.net. c 300 IN A 73.80.65.49 caa01 3600 IN CAA 0 issue "ca.example.net" -- 2.47.3