diff --git a/src/lib/dns/Makefile.am b/src/lib/dns/Makefile.am index deb71701e6bdbd742816a92866a2ca34ef0ef84f..f028ce0792b0af719f9239b779ff3c98e8ee1618 100644 --- a/src/lib/dns/Makefile.am +++ b/src/lib/dns/Makefile.am @@ -79,6 +79,35 @@ EXTRA_DIST += rdata/generic/afsdb_18.h EXTRA_DIST += rdata/generic/any_255.txt EXTRA_DIST += rdata/generic/axfr_252.txt EXTRA_DIST += rdata/generic/ixfr_251.txt +EXTRA_DIST += rdata/generic/cert_37.txt +EXTRA_DIST += rdata/generic/gpos_27.txt +EXTRA_DIST += rdata/generic/hip_55.txt +EXTRA_DIST += rdata/generic/ipseckey_45.txt +EXTRA_DIST += rdata/generic/isdn_20.txt +EXTRA_DIST += rdata/generic/key_25.txt +EXTRA_DIST += rdata/generic/l32_105.txt +EXTRA_DIST += rdata/generic/l64_106.txt +EXTRA_DIST += rdata/generic/loc_29.txt +EXTRA_DIST += rdata/generic/lp_107.txt +EXTRA_DIST += rdata/generic/mb_7.txt +EXTRA_DIST += rdata/generic/md_3.txt +EXTRA_DIST += rdata/generic/mf_4.txt +EXTRA_DIST += rdata/generic/mg_8.txt +EXTRA_DIST += rdata/generic/mr_9.txt +EXTRA_DIST += rdata/generic/nid_104.txt +EXTRA_DIST += rdata/generic/null_10.txt +EXTRA_DIST += rdata/generic/nxt_30.txt +EXTRA_DIST += rdata/generic/proforma.txt +EXTRA_DIST += rdata/generic/rt_21.txt +EXTRA_DIST += rdata/generic/sig_24.txt +EXTRA_DIST += rdata/generic/tkey_249.txt +EXTRA_DIST += rdata/generic/tlsa_52.txt +EXTRA_DIST += rdata/generic/unspec_103.txt +EXTRA_DIST += rdata/generic/uri_256.txt +EXTRA_DIST += rdata/generic/x25_19.txt +EXTRA_DIST += rdata/generic/maila_254.txt +EXTRA_DIST += rdata/generic/mailb_253.txt +EXTRA_DIST += rdata/generic/caa_257.txt EXTRA_DIST += rdata/hs_4/a_1.cc EXTRA_DIST += rdata/hs_4/a_1.h EXTRA_DIST += rdata/in_1/a_1.cc @@ -89,6 +118,13 @@ EXTRA_DIST += rdata/in_1/dhcid_49.cc EXTRA_DIST += rdata/in_1/dhcid_49.h EXTRA_DIST += rdata/in_1/srv_33.cc EXTRA_DIST += rdata/in_1/srv_33.h +EXTRA_DIST += rdata/in_1/a6_38.txt +EXTRA_DIST += rdata/in_1/apl_42.txt +EXTRA_DIST += rdata/in_1/kx_36.txt +EXTRA_DIST += rdata/in_1/nsap-ptr_23.txt +EXTRA_DIST += rdata/in_1/nsap_22.txt +EXTRA_DIST += rdata/in_1/px_26.txt +EXTRA_DIST += rdata/in_1/wks_11.txt EXTRA_DIST += rdata/none_254 #EXTRA_DIST += rdata/template.cc #EXTRA_DIST += rdata/template.h diff --git a/src/lib/dns/gen-rdatacode.py.in b/src/lib/dns/gen-rdatacode.py.in index e71469c45fefc75d6ea1fd8fe5aacddb804f2c3b..b22cd6977187b9aa81a80a5dcbabb85dbe14a5d5 100755 --- a/src/lib/dns/gen-rdatacode.py.in +++ b/src/lib/dns/gen-rdatacode.py.in @@ -40,7 +40,7 @@ new_rdata_factory_users = [('aaaa', 'in'), ('txt', 'generic') ] -re_typecode = re.compile('([\da-z]+)_(\d+)') +re_typecode = re.compile('([\da-z\-]+)_(\d+)') classcode2txt = {} typecode2txt = {} # "AXFR"=>252 etc: for meta types and types well-known but not implemented @@ -286,7 +286,15 @@ def generate_typeclasscode(fileprefix, basemtime, code2txt, type_or_class): pydef_txt = '' for code in code2txt.keys(): codetxt = code2txt[code].upper() - declarationtxt += ' ' * 4 + 'static const RR' + cap_key + '& ' + codetxt + '();\n' + # Workaround by heuristics: there's a "NULL" RR type, but it would + # cause conflict with the C/C++ macro. We use Null as a special case. + if codetxt == 'NULL': + codetxt = 'Null' + # Likewise, convert "NSAP-PTR" to "NSAP_PTR". + if codetxt == 'NSAP-PTR': + codetxt = "NSAP_PTR" + declarationtxt += ' ' * 4 + 'static const RR' + cap_key + '& ' + \ + codetxt + '();\n' deftxt += '''inline const RR''' + cap_key + '''& RR''' + cap_key + '''::''' + codetxt + '''() { static RR''' + cap_key + ''' ''' + lower_key + '''(''' + code + '''); diff --git a/src/lib/dns/rdata/generic/caa_257.txt b/src/lib/dns/rdata/generic/caa_257.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/caa_257.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/cert_37.txt b/src/lib/dns/rdata/generic/cert_37.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/cert_37.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/gpos_27.txt b/src/lib/dns/rdata/generic/gpos_27.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/gpos_27.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/hip_55.txt b/src/lib/dns/rdata/generic/hip_55.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/hip_55.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/ipseckey_45.txt b/src/lib/dns/rdata/generic/ipseckey_45.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/ipseckey_45.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/isdn_20.txt b/src/lib/dns/rdata/generic/isdn_20.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/isdn_20.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/key_25.txt b/src/lib/dns/rdata/generic/key_25.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/key_25.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/l32_105.txt b/src/lib/dns/rdata/generic/l32_105.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/l32_105.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/l64_106.txt b/src/lib/dns/rdata/generic/l64_106.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/l64_106.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/loc_29.txt b/src/lib/dns/rdata/generic/loc_29.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/loc_29.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/lp_107.txt b/src/lib/dns/rdata/generic/lp_107.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/lp_107.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/maila_254.txt b/src/lib/dns/rdata/generic/maila_254.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/maila_254.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/mailb_253.txt b/src/lib/dns/rdata/generic/mailb_253.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/mailb_253.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/mb_7.txt b/src/lib/dns/rdata/generic/mb_7.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/mb_7.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/md_3.txt b/src/lib/dns/rdata/generic/md_3.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/md_3.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/mf_4.txt b/src/lib/dns/rdata/generic/mf_4.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/mf_4.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/mg_8.txt b/src/lib/dns/rdata/generic/mg_8.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/mg_8.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/mr_9.txt b/src/lib/dns/rdata/generic/mr_9.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/mr_9.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/nid_104.txt b/src/lib/dns/rdata/generic/nid_104.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/nid_104.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/null_10.txt b/src/lib/dns/rdata/generic/null_10.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/null_10.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/nxt_30.txt b/src/lib/dns/rdata/generic/nxt_30.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/nxt_30.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/proforma.txt b/src/lib/dns/rdata/generic/proforma.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/proforma.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/rt_21.txt b/src/lib/dns/rdata/generic/rt_21.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/rt_21.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/sig_24.txt b/src/lib/dns/rdata/generic/sig_24.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/sig_24.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/tkey_249.txt b/src/lib/dns/rdata/generic/tkey_249.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/tkey_249.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/tlsa_52.txt b/src/lib/dns/rdata/generic/tlsa_52.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/tlsa_52.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/unspec_103.txt b/src/lib/dns/rdata/generic/unspec_103.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/unspec_103.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/uri_256.txt b/src/lib/dns/rdata/generic/uri_256.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/uri_256.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/generic/x25_19.txt b/src/lib/dns/rdata/generic/x25_19.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/generic/x25_19.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/in_1/a6_38.txt b/src/lib/dns/rdata/in_1/a6_38.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/in_1/a6_38.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/in_1/apl_42.txt b/src/lib/dns/rdata/in_1/apl_42.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/in_1/apl_42.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/in_1/kx_36.txt b/src/lib/dns/rdata/in_1/kx_36.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/in_1/kx_36.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/in_1/nsap-ptr_23.txt b/src/lib/dns/rdata/in_1/nsap-ptr_23.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/in_1/nsap-ptr_23.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/in_1/nsap_22.txt b/src/lib/dns/rdata/in_1/nsap_22.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/in_1/nsap_22.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/in_1/px_26.txt b/src/lib/dns/rdata/in_1/px_26.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/in_1/px_26.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/rdata/in_1/wks_11.txt b/src/lib/dns/rdata/in_1/wks_11.txt new file mode 100644 index 0000000000000000000000000000000000000000..da319445a1ee3c4cb410f0eea1e32ca9c2fd16e6 --- /dev/null +++ b/src/lib/dns/rdata/in_1/wks_11.txt @@ -0,0 +1,4 @@ +This RR type is not yet implemented; this file is used to generate +the corresponding RRType constant and a mapping with its textual +representation, without the Rdata code. When the Rdata support is +complete this file must be removed. diff --git a/src/lib/dns/tests/rrclass_unittest.cc b/src/lib/dns/tests/rrclass_unittest.cc index 11f1c5448eab871d3664264e4187d6abdf32724d..17af873c5088c05903031e4dfcae7850f5956bc0 100644 --- a/src/lib/dns/tests/rrclass_unittest.cc +++ b/src/lib/dns/tests/rrclass_unittest.cc @@ -148,4 +148,29 @@ TEST_F(RRClassTest, LeftShiftOperator) { oss << RRClass::IN(); EXPECT_EQ(RRClass::IN().toText(), oss.str()); } + +// Below, we'll check definitions for all well-known RR classes; whether they +// are defined and have the correct parameter values. Test data are generated +// from the list available at: +// http://www.iana.org/assignments/dns-parameters/dns-parameters.xml +struct ClassParam { + const char* const txt; // "IN", "CH", etc + const uint16_t code; // 1, 3, + const RRClass& (*obj)(); // RRClass::IN(), etc +} known_classes[] = { + {"IN", 1, RRClass::IN}, {"CH", 3, RRClass::CH}, {"HS", 4, RRClass::HS}, + {"NONE", 254, RRClass::NONE}, {"ANY", 255, RRClass::ANY}, + {NULL, 0, NULL} +}; + +TEST(RRClassConstTest, wellKnowns) { + for (int i = 0; known_classes[i].txt; ++i) { + SCOPED_TRACE("Checking well known RRClass: " + + string(known_classes[i].txt)); + EXPECT_EQ(known_classes[i].code, + RRClass(known_classes[i].txt).getCode()); + EXPECT_EQ(known_classes[i].code, + (*known_classes[i].obj)().getCode()); + } +} } diff --git a/src/lib/dns/tests/rrtype_unittest.cc b/src/lib/dns/tests/rrtype_unittest.cc index 28ecee65d41df71590c828fde1337b6170a24905..ee302a1c41c0c83215ed04e60bb6ace2fc3be12e 100644 --- a/src/lib/dns/tests/rrtype_unittest.cc +++ b/src/lib/dns/tests/rrtype_unittest.cc @@ -145,4 +145,57 @@ TEST_F(RRTypeTest, LeftShiftOperator) { oss << RRType::A(); EXPECT_EQ(RRType::A().toText(), oss.str()); } + +// Below, we'll check definitions for all well-known RR types; whether they +// are defined and have the correct parameter values. Test data are generated +// from the list available at: +// http://www.iana.org/assignments/dns-parameters/dns-parameters.xml +struct TypeParam { + const char* const txt; // "A", "AAAA", "NS", etc + const uint16_t code; // 1, 28, 2, etc + const RRType& (*obj)(); // RRType::A(), etc +} known_types[] = { + {"A", 1, RRType::A}, {"NS", 2, RRType::NS}, {"MD", 3, RRType::MD}, + {"MF", 4, RRType::MF}, {"CNAME", 5, RRType::CNAME}, + {"SOA", 6, RRType::SOA}, {"MB", 7, RRType::MB}, {"MG", 8, RRType::MG}, + {"MR", 9, RRType::MR}, {"NULL", 10, RRType::Null}, + {"WKS", 11, RRType::WKS}, {"PTR", 12, RRType::PTR}, + {"HINFO", 13, RRType::HINFO}, {"MINFO", 14, RRType::MINFO}, + {"MX", 15, RRType::MX}, {"TXT", 16, RRType::TXT}, {"RP", 17, RRType::RP}, + {"AFSDB", 18, RRType::AFSDB}, {"X25", 19, RRType::X25}, + {"ISDN", 20, RRType::ISDN}, {"RT", 21, RRType::RT}, + {"NSAP", 22, RRType::NSAP}, {"NSAP-PTR", 23, RRType::NSAP_PTR}, + {"SIG", 24, RRType::SIG}, {"KEY", 25, RRType::KEY}, + {"PX", 26, RRType::PX}, {"GPOS", 27, RRType::GPOS}, + {"AAAA", 28, RRType::AAAA}, {"LOC", 29, RRType::LOC}, + {"NXT", 30, RRType::NXT}, {"SRV", 33, RRType::SRV}, + {"NAPTR", 35, RRType::NAPTR}, {"KX", 36, RRType::KX}, + {"CERT", 37, RRType::CERT}, {"A6", 38, RRType::A6}, + {"DNAME", 39, RRType::DNAME}, {"OPT", 41, RRType::OPT}, + {"APL", 42, RRType::APL}, {"DS", 43, RRType::DS}, + {"SSHFP", 44, RRType::SSHFP}, {"IPSECKEY", 45, RRType::IPSECKEY}, + {"RRSIG", 46, RRType::RRSIG}, {"NSEC", 47, RRType::NSEC}, + {"DNSKEY", 48, RRType::DNSKEY}, {"DHCID", 49, RRType::DHCID}, + {"NSEC3", 50, RRType::NSEC3}, {"NSEC3PARAM", 51, RRType::NSEC3PARAM}, + {"TLSA", 52, RRType::TLSA}, {"HIP", 55, RRType::HIP}, + {"SPF", 99, RRType::SPF}, {"UNSPEC", 103, RRType::UNSPEC}, + {"NID", 104, RRType::NID}, {"L32", 105, RRType::L32}, + {"L64", 106, RRType::L64}, {"LP", 107, RRType::LP}, + {"TKEY", 249, RRType::TKEY}, {"TSIG", 250, RRType::TSIG}, + {"IXFR", 251, RRType::IXFR}, {"AXFR", 252, RRType::AXFR}, + {"MAILB", 253, RRType::MAILB}, {"MAILA", 254, RRType::MAILA}, + {"ANY", 255, RRType::ANY}, {"URI", 256, RRType::URI}, + {"CAA", 257, RRType::CAA}, {"DLV", 32769, RRType::DLV}, + {NULL, 0, NULL} +}; + +TEST(RRTypeConstTest, wellKnowns) { + for (int i = 0; known_types[i].txt; ++i) { + SCOPED_TRACE("Checking well known RRType: " + + string(known_types[i].txt)); + EXPECT_EQ(known_types[i].code, RRType(known_types[i].txt).getCode()); + EXPECT_EQ(known_types[i].code, + (*known_types[i].obj)().getCode()); + } +} }