Skip to content

Commit 4f15774

Browse files
committed
Update DNS RR type definitions [BZ #20593]
This commit includes a new script which allows generating parts of the header files from IANA DNS parameters protocol registry.
1 parent fc82b0a commit 4f15774

File tree

5 files changed

+270
-101
lines changed

5 files changed

+270
-101
lines changed

ChangeLog

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
2016-12-31 Florian Weimer <[email protected]>
2+
3+
[BZ #20593]
4+
Update DNS RR type definitions.
5+
* scripts/gen-rrtypes.py: New file.
6+
* resolv/arpa/nameser.h (ns_type): Remove ns_t_zxfr, a
7+
BIND-internal RR type not used on the Internet. Add ns_t_ds,
8+
ns_t_sshfp, ns_t_ipseckey, ns_t_rrsig, ns_t_nsec, ns_t_dnskey,
9+
ns_t_dhcid, ns_t_nsec3, ns_t_nsec3param, ns_t_tlsa, ns_t_smimea,
10+
ns_t_hip, ns_t_ninfo, ns_t_rkey, ns_t_talink, ns_t_cds,
11+
ns_t_cdnskey, ns_t_openpgpkey, ns_t_csync, ns_t_spf, ns_t_uinfo,
12+
ns_t_uid, ns_t_gid, ns_t_unspec, ns_t_nid, ns_t_l32, ns_t_l64,
13+
ns_t_lp, ns_t_eui48, ns_t_eui64, ns_t_uri, ns_t_caa, ns_t_avc,
14+
ns_t_ta, ns_t_dlv.
15+
* resolv/arpa/nameser_compat.h (T_KX, T_CERT, T_SINK, T_OPT)
16+
(T_APL, T_DS, T_SSHFP, T_IPSECKEY, T_RRSIG, T_NSEC, T_DNSKEY)
17+
(T_DHCID, T_NSEC3, T_NSEC3PARAM, T_TLSA, T_SMIMEA, T_HIP, T_NINFO)
18+
(T_RKEY, T_TALINK, T_CDS, T_CDNSKEY, T_OPENPGPKEY, T_CSYNC, T_SPF)
19+
(T_UINFO, T_UID, T_GID, T_UNSPEC, T_NID, T_L32, T_L64, T_LP)
20+
(T_EUI48, T_EUI64, T_TKEY, T_URI, T_CAA, T_AVC, T_TA, T_DLV):
21+
Define.
22+
* resolv/res_debug.c (__p_type_syms): Update comment. Remove
23+
entry for ns_t_zxfr.
24+
125
2016-12-31 Florian Weimer <[email protected]>
226

327
[BZ #18784]

resolv/arpa/nameser.h

Lines changed: 91 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -228,60 +228,97 @@ typedef struct ns_tcp_tsig_state ns_tcp_tsig_state;
228228
/*%
229229
* Currently defined type values for resources and queries.
230230
*/
231-
typedef enum __ns_type {
232-
ns_t_invalid = 0, /*%< Cookie. */
233-
ns_t_a = 1, /*%< Host address. */
234-
ns_t_ns = 2, /*%< Authoritative server. */
235-
ns_t_md = 3, /*%< Mail destination. */
236-
ns_t_mf = 4, /*%< Mail forwarder. */
237-
ns_t_cname = 5, /*%< Canonical name. */
238-
ns_t_soa = 6, /*%< Start of authority zone. */
239-
ns_t_mb = 7, /*%< Mailbox domain name. */
240-
ns_t_mg = 8, /*%< Mail group member. */
241-
ns_t_mr = 9, /*%< Mail rename name. */
242-
ns_t_null = 10, /*%< Null resource record. */
243-
ns_t_wks = 11, /*%< Well known service. */
244-
ns_t_ptr = 12, /*%< Domain name pointer. */
245-
ns_t_hinfo = 13, /*%< Host information. */
246-
ns_t_minfo = 14, /*%< Mailbox information. */
247-
ns_t_mx = 15, /*%< Mail routing information. */
248-
ns_t_txt = 16, /*%< Text strings. */
249-
ns_t_rp = 17, /*%< Responsible person. */
250-
ns_t_afsdb = 18, /*%< AFS cell database. */
251-
ns_t_x25 = 19, /*%< X_25 calling address. */
252-
ns_t_isdn = 20, /*%< ISDN calling address. */
253-
ns_t_rt = 21, /*%< Router. */
254-
ns_t_nsap = 22, /*%< NSAP address. */
255-
ns_t_nsap_ptr = 23, /*%< Reverse NSAP lookup (deprecated). */
256-
ns_t_sig = 24, /*%< Security signature. */
257-
ns_t_key = 25, /*%< Security key. */
258-
ns_t_px = 26, /*%< X.400 mail mapping. */
259-
ns_t_gpos = 27, /*%< Geographical position (withdrawn). */
260-
ns_t_aaaa = 28, /*%< Ip6 Address. */
261-
ns_t_loc = 29, /*%< Location Information. */
262-
ns_t_nxt = 30, /*%< Next domain (security). */
263-
ns_t_eid = 31, /*%< Endpoint identifier. */
264-
ns_t_nimloc = 32, /*%< Nimrod Locator. */
265-
ns_t_srv = 33, /*%< Server Selection. */
266-
ns_t_atma = 34, /*%< ATM Address */
267-
ns_t_naptr = 35, /*%< Naming Authority PoinTeR */
268-
ns_t_kx = 36, /*%< Key Exchange */
269-
ns_t_cert = 37, /*%< Certification record */
270-
ns_t_a6 = 38, /*%< IPv6 address (deprecated, use ns_t_aaaa) */
271-
ns_t_dname = 39, /*%< Non-terminal DNAME (for IPv6) */
272-
ns_t_sink = 40, /*%< Kitchen sink (experimentatl) */
273-
ns_t_opt = 41, /*%< EDNS0 option (meta-RR) */
274-
ns_t_apl = 42, /*%< Address prefix list (RFC3123) */
275-
ns_t_tkey = 249, /*%< Transaction key */
276-
ns_t_tsig = 250, /*%< Transaction signature. */
277-
ns_t_ixfr = 251, /*%< Incremental zone transfer. */
278-
ns_t_axfr = 252, /*%< Transfer zone of authority. */
279-
ns_t_mailb = 253, /*%< Transfer mailbox records. */
280-
ns_t_maila = 254, /*%< Transfer mail agent records. */
281-
ns_t_any = 255, /*%< Wildcard match. */
282-
ns_t_zxfr = 256, /*%< BIND-specific, nonstandard. */
283-
ns_t_max = 65536
284-
} ns_type;
231+
typedef enum __ns_type
232+
{
233+
ns_t_invalid = 0,
234+
235+
ns_t_a = 1,
236+
ns_t_ns = 2,
237+
ns_t_md = 3,
238+
ns_t_mf = 4,
239+
ns_t_cname = 5,
240+
ns_t_soa = 6,
241+
ns_t_mb = 7,
242+
ns_t_mg = 8,
243+
ns_t_mr = 9,
244+
ns_t_null = 10,
245+
ns_t_wks = 11,
246+
ns_t_ptr = 12,
247+
ns_t_hinfo = 13,
248+
ns_t_minfo = 14,
249+
ns_t_mx = 15,
250+
ns_t_txt = 16,
251+
ns_t_rp = 17,
252+
ns_t_afsdb = 18,
253+
ns_t_x25 = 19,
254+
ns_t_isdn = 20,
255+
ns_t_rt = 21,
256+
ns_t_nsap = 22,
257+
ns_t_nsap_ptr = 23,
258+
ns_t_sig = 24,
259+
ns_t_key = 25,
260+
ns_t_px = 26,
261+
ns_t_gpos = 27,
262+
ns_t_aaaa = 28,
263+
ns_t_loc = 29,
264+
ns_t_nxt = 30,
265+
ns_t_eid = 31,
266+
ns_t_nimloc = 32,
267+
ns_t_srv = 33,
268+
ns_t_atma = 34,
269+
ns_t_naptr = 35,
270+
ns_t_kx = 36,
271+
ns_t_cert = 37,
272+
ns_t_a6 = 38,
273+
ns_t_dname = 39,
274+
ns_t_sink = 40,
275+
ns_t_opt = 41,
276+
ns_t_apl = 42,
277+
ns_t_ds = 43,
278+
ns_t_sshfp = 44,
279+
ns_t_ipseckey = 45,
280+
ns_t_rrsig = 46,
281+
ns_t_nsec = 47,
282+
ns_t_dnskey = 48,
283+
ns_t_dhcid = 49,
284+
ns_t_nsec3 = 50,
285+
ns_t_nsec3param = 51,
286+
ns_t_tlsa = 52,
287+
ns_t_smimea = 53,
288+
ns_t_hip = 55,
289+
ns_t_ninfo = 56,
290+
ns_t_rkey = 57,
291+
ns_t_talink = 58,
292+
ns_t_cds = 59,
293+
ns_t_cdnskey = 60,
294+
ns_t_openpgpkey = 61,
295+
ns_t_csync = 62,
296+
ns_t_spf = 99,
297+
ns_t_uinfo = 100,
298+
ns_t_uid = 101,
299+
ns_t_gid = 102,
300+
ns_t_unspec = 103,
301+
ns_t_nid = 104,
302+
ns_t_l32 = 105,
303+
ns_t_l64 = 106,
304+
ns_t_lp = 107,
305+
ns_t_eui48 = 108,
306+
ns_t_eui64 = 109,
307+
ns_t_tkey = 249,
308+
ns_t_tsig = 250,
309+
ns_t_ixfr = 251,
310+
ns_t_axfr = 252,
311+
ns_t_mailb = 253,
312+
ns_t_maila = 254,
313+
ns_t_any = 255,
314+
ns_t_uri = 256,
315+
ns_t_caa = 257,
316+
ns_t_avc = 258,
317+
ns_t_ta = 32768,
318+
ns_t_dlv = 32769,
319+
320+
ns_t_max = 65536
321+
} ns_type;
285322

286323
/*%
287324
* Values for class field

resolv/arpa/nameser_compat.h

Lines changed: 84 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -120,49 +120,90 @@ typedef struct {
120120
#define DELETE ns_uop_delete
121121
#define ADD ns_uop_add
122122

123-
#define T_A ns_t_a
124-
#define T_NS ns_t_ns
125-
#define T_MD ns_t_md
126-
#define T_MF ns_t_mf
127-
#define T_CNAME ns_t_cname
128-
#define T_SOA ns_t_soa
129-
#define T_MB ns_t_mb
130-
#define T_MG ns_t_mg
131-
#define T_MR ns_t_mr
132-
#define T_NULL ns_t_null
133-
#define T_WKS ns_t_wks
134-
#define T_PTR ns_t_ptr
135-
#define T_HINFO ns_t_hinfo
136-
#define T_MINFO ns_t_minfo
137-
#define T_MX ns_t_mx
138-
#define T_TXT ns_t_txt
139-
#define T_RP ns_t_rp
140-
#define T_AFSDB ns_t_afsdb
141-
#define T_X25 ns_t_x25
142-
#define T_ISDN ns_t_isdn
143-
#define T_RT ns_t_rt
144-
#define T_NSAP ns_t_nsap
145-
#define T_NSAP_PTR ns_t_nsap_ptr
146-
#define T_SIG ns_t_sig
147-
#define T_KEY ns_t_key
148-
#define T_PX ns_t_px
149-
#define T_GPOS ns_t_gpos
150-
#define T_AAAA ns_t_aaaa
151-
#define T_LOC ns_t_loc
152-
#define T_NXT ns_t_nxt
153-
#define T_EID ns_t_eid
154-
#define T_NIMLOC ns_t_nimloc
155-
#define T_SRV ns_t_srv
156-
#define T_ATMA ns_t_atma
157-
#define T_NAPTR ns_t_naptr
158-
#define T_A6 ns_t_a6
159-
#define T_DNAME ns_t_dname
160-
#define T_TSIG ns_t_tsig
161-
#define T_IXFR ns_t_ixfr
162-
#define T_AXFR ns_t_axfr
163-
#define T_MAILB ns_t_mailb
164-
#define T_MAILA ns_t_maila
165-
#define T_ANY ns_t_any
123+
#define T_A ns_t_a
124+
#define T_NS ns_t_ns
125+
#define T_MD ns_t_md
126+
#define T_MF ns_t_mf
127+
#define T_CNAME ns_t_cname
128+
#define T_SOA ns_t_soa
129+
#define T_MB ns_t_mb
130+
#define T_MG ns_t_mg
131+
#define T_MR ns_t_mr
132+
#define T_NULL ns_t_null
133+
#define T_WKS ns_t_wks
134+
#define T_PTR ns_t_ptr
135+
#define T_HINFO ns_t_hinfo
136+
#define T_MINFO ns_t_minfo
137+
#define T_MX ns_t_mx
138+
#define T_TXT ns_t_txt
139+
#define T_RP ns_t_rp
140+
#define T_AFSDB ns_t_afsdb
141+
#define T_X25 ns_t_x25
142+
#define T_ISDN ns_t_isdn
143+
#define T_RT ns_t_rt
144+
#define T_NSAP ns_t_nsap
145+
#define T_NSAP_PTR ns_t_nsap_ptr
146+
#define T_SIG ns_t_sig
147+
#define T_KEY ns_t_key
148+
#define T_PX ns_t_px
149+
#define T_GPOS ns_t_gpos
150+
#define T_AAAA ns_t_aaaa
151+
#define T_LOC ns_t_loc
152+
#define T_NXT ns_t_nxt
153+
#define T_EID ns_t_eid
154+
#define T_NIMLOC ns_t_nimloc
155+
#define T_SRV ns_t_srv
156+
#define T_ATMA ns_t_atma
157+
#define T_NAPTR ns_t_naptr
158+
#define T_KX ns_t_kx
159+
#define T_CERT ns_t_cert
160+
#define T_A6 ns_t_a6
161+
#define T_DNAME ns_t_dname
162+
#define T_SINK ns_t_sink
163+
#define T_OPT ns_t_opt
164+
#define T_APL ns_t_apl
165+
#define T_DS ns_t_ds
166+
#define T_SSHFP ns_t_sshfp
167+
#define T_IPSECKEY ns_t_ipseckey
168+
#define T_RRSIG ns_t_rrsig
169+
#define T_NSEC ns_t_nsec
170+
#define T_DNSKEY ns_t_dnskey
171+
#define T_DHCID ns_t_dhcid
172+
#define T_NSEC3 ns_t_nsec3
173+
#define T_NSEC3PARAM ns_t_nsec3param
174+
#define T_TLSA ns_t_tlsa
175+
#define T_SMIMEA ns_t_smimea
176+
#define T_HIP ns_t_hip
177+
#define T_NINFO ns_t_ninfo
178+
#define T_RKEY ns_t_rkey
179+
#define T_TALINK ns_t_talink
180+
#define T_CDS ns_t_cds
181+
#define T_CDNSKEY ns_t_cdnskey
182+
#define T_OPENPGPKEY ns_t_openpgpkey
183+
#define T_CSYNC ns_t_csync
184+
#define T_SPF ns_t_spf
185+
#define T_UINFO ns_t_uinfo
186+
#define T_UID ns_t_uid
187+
#define T_GID ns_t_gid
188+
#define T_UNSPEC ns_t_unspec
189+
#define T_NID ns_t_nid
190+
#define T_L32 ns_t_l32
191+
#define T_L64 ns_t_l64
192+
#define T_LP ns_t_lp
193+
#define T_EUI48 ns_t_eui48
194+
#define T_EUI64 ns_t_eui64
195+
#define T_TKEY ns_t_tkey
196+
#define T_TSIG ns_t_tsig
197+
#define T_IXFR ns_t_ixfr
198+
#define T_AXFR ns_t_axfr
199+
#define T_MAILB ns_t_mailb
200+
#define T_MAILA ns_t_maila
201+
#define T_ANY ns_t_any
202+
#define T_URI ns_t_uri
203+
#define T_CAA ns_t_caa
204+
#define T_AVC ns_t_avc
205+
#define T_TA ns_t_ta
206+
#define T_DLV ns_t_dlv
166207

167208
#define C_IN ns_c_in
168209
#define C_CHAOS ns_c_chaos

resolv/res_debug.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,8 @@ const struct res_sym __p_update_section_syms[] attribute_hidden = {
372372
};
373373

374374
/*
375-
* Names of RR types and qtypes. Types and qtypes are the same, except
376-
* that T_ANY is a qtype but not a type. (You can ask for records of type
377-
* T_ANY, but you can't have any records of that type in the database.)
375+
* Names of RR types and qtypes. The list is incomplete because its
376+
* size is part of the ABI.
378377
*/
379378
extern const struct res_sym __p_type_syms[];
380379
libresolv_hidden_proto (__p_type_syms)
@@ -418,13 +417,13 @@ const struct res_sym __p_type_syms[] = {
418417
{ns_t_tsig, (char *) "TSIG", (char *) "transaction signature"},
419418
{ns_t_ixfr, (char *) "IXFR", (char *) "incremental zone transfer"},
420419
{ns_t_axfr, (char *) "AXFR", (char *) "zone transfer"},
421-
{ns_t_zxfr, (char *) "ZXFR", (char *) "compressed zone transfer"},
422420
{ns_t_mailb, (char *) "MAILB", (char *) "mailbox-related data (deprecated)"},
423421
{ns_t_maila, (char *) "MAILA", (char *) "mail agent (deprecated)"},
424422
{ns_t_naptr, (char *) "NAPTR", (char *) "URN Naming Authority"},
425423
{ns_t_kx, (char *) "KX", (char *) "Key Exchange"},
426424
{ns_t_cert, (char *) "CERT", (char *) "Certificate"},
427425
{ns_t_any, (char *) "ANY", (char *) "\"any\""},
426+
{0, NULL, NULL}, /* Padding to preserve ABI. */
428427
{0, NULL, NULL}
429428
};
430429
libresolv_hidden_data_def (__p_type_syms)

0 commit comments

Comments
 (0)