Commit 463700b3 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[1866] auto-generate RRType defs for all (yet fully) unsupported types.

added some tests to check the definitions are complete and correct.
parent f575d8fc
......@@ -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
......
......@@ -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 + ''');
......
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment