]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: add several comments for DNS type table
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 29 Dec 2023 21:05:32 +0000 (06:05 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 30 Dec 2023 19:51:42 +0000 (04:51 +0900)
Also update compile time checks.

Follow-up for 818bb6f4825b57c2cd2783fbffe2b2ef82a31573.

src/resolve/dns-type.h

index b27ed130566839754acf91f59d1e712c89810b0c..404256c2f88b65388d177f0c4e3881b913361088 100644 (file)
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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 */