Skip to content

Commit

Permalink
resolve: add several comments for DNS type table
Browse files Browse the repository at this point in the history
Also update compile time checks.

Follow-up for 818bb6f.
  • Loading branch information
yuwata committed Dec 30, 2023
1 parent e6bca18 commit d05649c
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/resolve/dns-type.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml.
*/
enum {
/* Normal records */
/* 0 is reserved */
DNS_TYPE_A = 0x01,
DNS_TYPE_NS,
DNS_TYPE_MD,
Expand Down Expand Up @@ -61,7 +61,7 @@ enum {
DNS_TYPE_NSEC3PARAM,
DNS_TYPE_TLSA,
DNS_TYPE_SMIMEA, /* RFC 8162 */

/* 0x36 (54) is not assigned */
DNS_TYPE_HIP = 0x37,
DNS_TYPE_NINFO,
DNS_TYPE_RKEY,
Expand All @@ -73,7 +73,7 @@ enum {
DNS_TYPE_ZONEMD,
DNS_TYPE_SVCB, /* RFC 9460 */
DNS_TYPE_HTTPS, /* RFC 9460 */

/* 0x42…0x62 (66…98) are not assigned */
DNS_TYPE_SPF = 0x63,
DNS_TYPE_UINFO,
DNS_TYPE_UID,
Expand All @@ -85,7 +85,7 @@ enum {
DNS_TYPE_LP,
DNS_TYPE_EUI48,
DNS_TYPE_EUI64,

/* 0x6e…0xf8 (110…248) are not assigned */
DNS_TYPE_TKEY = 0xF9,
DNS_TYPE_TSIG,
DNS_TYPE_IXFR,
Expand All @@ -99,15 +99,20 @@ enum {
DNS_TYPE_DOA,
DNS_TYPE_AMTRELAY,
DNS_TYPE_RESINFO,
/* 0x106…0x7fff (262…32767) are not assigned */
DNS_TYPE_TA = 0x8000,
DNS_TYPE_DLV,

/* 32770…65279 are not assigned */
/* 65280…65534 are for private use */
/* 65535 is reserved */
_DNS_TYPE_MAX,
_DNS_TYPE_INVALID = -EINVAL,
};

assert_cc(DNS_TYPE_SSHFP == 44);
assert_cc(DNS_TYPE_TLSA == 52);
assert_cc(DNS_TYPE_SMIMEA == 53);
assert_cc(DNS_TYPE_HTTPS == 65);
assert_cc(DNS_TYPE_EUI64 == 109);
assert_cc(DNS_TYPE_RESINFO == 261);
assert_cc(DNS_TYPE_ANY == 255);

/* DNS record classes, see RFC 1035 */
Expand Down

0 comments on commit d05649c

Please sign in to comment.