On Wed, May 19, 2021 at 08:01:00AM +0100, Stuart Henderson wrote:
> For the love of $deity if we're updating this file can we please change
> these T_XXX to the ns_t_xxx used by everything else so we don't have to
> patch everything in ports using them?

In that case judging from a quick look at the patches in the ports tree
the C_ constants should get renamed to ns_c_ as well. The below patch
works for tcpdump, but I presume broader testing will now be needed.


diff --git nameser.h nameser.h
index ddb5e065c4a..f766989ab92 100644
--- nameser.h
+++ nameser.h
@@ -109,84 +109,113 @@
 /*
  * Type values for resources and queries
  */
-#define T_A            1               /* host address */
-#define T_NS           2               /* authoritative server */
-#define T_MD           3               /* mail destination */
-#define T_MF           4               /* mail forwarder */
-#define T_CNAME                5               /* connonical name */
-#define T_SOA          6               /* start of authority zone */
-#define T_MB           7               /* mailbox domain name */
-#define T_MG           8               /* mail group member */
-#define T_MR           9               /* mail rename name */
-#define T_NULL         10              /* null resource record */
-#define T_WKS          11              /* well known service */
-#define T_PTR          12              /* domain name pointer */
-#define T_HINFO                13              /* host information */
-#define T_MINFO                14              /* mailbox information */
-#define T_MX           15              /* mail routing information */
-#define T_TXT          16              /* text strings */
-#define        T_RP            17              /* responsible person */
-#define        T_AFSDB         18              /* AFS cell database */
-#define T_X25          19              /* X_25 calling address */
-#define T_ISDN         20              /* ISDN calling address */
-#define T_RT           21              /* router */
-#define        T_NSAP          22              /* NSAP address */
-#define        T_NSAP_PTR      23              /* reverse lookup for NSAP */
-#define T_SIG          24              /* security signature */
-#define T_KEY          25              /* security key */
-#define T_PX           26              /* X.400 mail mapping */
-#define T_GPOS         27              /* geographical position (withdrawn) */
-#define T_AAAA         28              /* IP6 Address */
-#define T_LOC          29              /* Location Information */
-#define T_NXT          30              /* Next Valid Name in Zone */
-#define T_EID          31              /* Endpoint identifier */
-#define T_NIMLOC       32              /* Nimrod locator */
-#define T_SRV          33              /* Server selection */
-#define T_ATMA         34              /* ATM Address */
-#define T_NAPTR                35              /* Naming Authority PoinTeR */
-#define T_KX           36              /* Key Exchanger */
-#define T_CERT         37              /* certificate */
-#define T_A6           38              /* IP6 address */
-#define T_DNAME                39              /* non-terminal redirection */
-#define T_SINK         40              /* SINK */
-#define T_OPT          41              /* EDNS0 option (meta-RR) */
-#define T_APL          42              /* APL */
-#define T_DS           43              /* Delegation Signer */
-#define T_SSHFP                44              /* SSH Key Fingerprint */
-#define T_IPSECKEY     45              /* IPsec keying material */
-#define T_RRSIG                46              /* RRSIG */
-#define T_NSEC         47              /* NSEC */
-#define T_DNSKEY       48              /* DNSKEY */
+#define ns_t_a         1               /* host address */
+#define ns_t_ns                2               /* authoritative server */
+#define ns_t_md                3               /* mail destination */
+#define ns_t_mf                4               /* mail forwarder */
+#define ns_t_cname     5               /* connonical name */
+#define ns_t_soa       6               /* start of authority zone */
+#define ns_t_mb                7               /* mailbox domain name */
+#define ns_t_mg                8               /* mail group member */
+#define ns_t_mr                9               /* mail rename name */
+#define ns_t_null      10              /* null resource record */
+#define ns_t_wks       11              /* well known service */
+#define ns_t_ptr       12              /* domain name pointer */
+#define ns_t_hinfo     13              /* host information */
+#define ns_t_minfo     14              /* mailbox information */
+#define ns_t_mx                15              /* mail routing information */
+#define ns_t_txt       16              /* text strings */
+#define        ns_t_rp         17              /* responsible person */
+#define        ns_t_afsdb      18              /* AFS cell database */
+#define ns_t_x25       19              /* X_25 calling address */
+#define ns_t_isdn      20              /* ISDN calling address */
+#define ns_t_rt                21              /* router */
+#define        ns_t_nsap       22              /* NSAP address */
+#define        ns_t_nsap_ptr   23              /* reverse lookup for NSAP */
+#define ns_t_sig       24              /* security signature */
+#define ns_t_key       25              /* security key */
+#define ns_t_px                26              /* X.400 mail mapping */
+#define ns_t_gpos      27              /* geographical position (withdrawn) */
+#define ns_t_aaaa      28              /* IP6 Address */
+#define ns_t_loc       29              /* Location Information */
+#define ns_t_nxt       30              /* Next Valid Name in Zone */
+#define ns_t_eid       31              /* Endpoint identifier */
+#define ns_t_nimloc    32              /* Nimrod locator */
+#define ns_t_srv       33              /* Server selection */
+#define ns_t_atma      34              /* ATM Address */
+#define ns_t_naptr     35              /* Naming Authority PoinTeR */
+#define ns_t_kx                36              /* Key Exchanger */
+#define ns_t_cert      37              /* Certificates in the DNS */
+#define ns_t_a6                38              /* IP6 address */
+#define ns_t_dname     39              /* non-terminal redirection */
+#define ns_t_sink      40              /* unknown */
+#define ns_t_opt       41              /* EDNS0 option (meta-RR) */
+#define ns_t_apl       42              /* lists of address prefixes */
+#define ns_t_ds                43              /* Delegation Signer */
+#define ns_t_sshfp     44              /* SSH Fingerprint */
+#define ns_t_ipseckey  45              /* IPsec keying material */
+#define ns_t_rrsig     46              /* new security signature */
+#define ns_t_nsec      47              /* provable insecure information */
+#define ns_t_dnskey    48              /* new security key */
+#define ns_t_dhcid     49              /* DHCP IDentifier */
+#define ns_t_nsec3     50              /* Next SECure record v3 */
+#define ns_t_nsec3param        51              /* NSEC3 PARAMeter */
+#define ns_t_tlsa      52              /* TLS Authentication */
+#define ns_t_smimea    53              /* S/MIME Authentication */
+/* Unassigned */
+#define ns_t_hip       55              /* Host Identity Protocol */
+#define ns_t_ninfo     56              /* zone status information */
+#define ns_t_rkey      57              /* Record encryption KEY */
+#define ns_t_talink    58              /* Trust Anchor LINK */
+#define ns_t_cds       59              /* Child Delegation Signer */
+#define ns_t_cdnskey   60              /* Child DNSKEY */
+#define ns_t_openpgpkey        61              /* OpenPGP KEY */
+#define ns_t_csync     62              /* Child to parent SYNCronization */
+#define ns_t_zonemd    63              /* ZONE data Message Digest */
+#define ns_t_svcb      64              /* SerViCe Binding */
+#define ns_t_https     65              /* HTTPS binding */
        /* non standard */
-#define T_SPF          99              /* sender policy framework */
-#define T_UINFO                100             /* user (finger) information */
-#define T_UID          101             /* user ID */
-#define T_GID          102             /* group ID */
-#define T_UNSPEC       103             /* Unspecified format (binary data) */
-#define T_UNSPECA      104             /* "unspecified ascii". Ugly MIT hack */
+#define ns_t_spf       99              /* sender policy framework */
+#define ns_t_uinfo     100             /* user (finger) information */
+#define ns_t_uid       101             /* user ID */
+#define ns_t_gid       102             /* group ID */
+#define ns_t_unspec    103             /* Unspecified format (binary data) */
+#define ns_t_nid       104             /* Node IDentifier */
+#define ns_t_l32       105             /* Locator 32-bit */
+#define ns_t_l64       106             /* Locator 64-bit */
+#define ns_t_lp                107             /* Locator Pointer */
+#define ns_t_eui48     108             /* an EUI-48 address */
+#define ns_t_eui64     109             /* an EUI-64 address */
        /* Query type values which do not appear in resource records */
-#define T_TKEY         249             /* Transaction Key [RFC2930] */
-#define T_TSIG         250             /* Transaction Signature [RFC2845] */
-#define T_IXFR         251             /* incremental transfer [RFC1995] */
-#define T_AXFR         252             /* transfer zone of authority */
-#define T_MAILB                253             /* transfer mailbox records */
-#define T_MAILA                254             /* transfer mail agent records 
*/
-#define T_ANY          255             /* wildcard match */
+#define ns_t_tkey      249             /* Transaction Key [RFC2930] */
+#define ns_t_tsig      250             /* Transaction Signature [RFC2845] */
+#define ns_t_ixfr      251             /* incremental transfer [RFC1995] */
+#define ns_t_axfr      252             /* transfer zone of authority */
+#define ns_t_mailb     253             /* transfer mailbox records */
+#define ns_t_maila     254             /* transfer mail agent records */
+#define ns_t_any       255             /* wildcard match */
+#define ns_t_uri       256             /* uri records [RFC7553] */
+#define ns_t_caa       257             /* Certification Authority 
Authorization */
+#define ns_t_avc       258             /* Application Visibility and Control */
+#define ns_t_doa       259             /* Digital Object Architecture */
+#define ns_t_amtrelay  260             /* Automatic Multicast Tunneling RELAY 
*/
+#define ns_t_ta                32768           /* DNSSEC Trust Authorities */
+#define ns_t_dlv       32769           /* DNSSEC Lookaside Validation */
 
 /*
  * Values for class field
  */
 
-#define C_IN           1               /* the arpa internet */
-#define C_CHAOS                3               /* for chaos net (MIT) */
-#define C_HS           4               /* for Hesiod name server (MIT) (XXX) */
+#define ns_c_in                        1               /* the arpa internet */
+#define ns_c_chaos             3               /* for chaos net (MIT) */
+#define ns_c_hs                        4               /* for Hesiod name 
server (MIT) (XXX) */
        /* Query class values which do not appear in resource records */
-#define C_ANY          255             /* wildcard match */
-#define C_QU           0x8000          /* mDNS QU flag in queries */
-#define C_CACHE_FLUSH  0x8000          /* mDNS cache flush flag in replies */
+#define ns_c_any               255             /* wildcard match */
+#define ns_c_qu                        0x8000          /* mDNS QU flag in 
queries */
+#define ns_c_cache_flush       0x8000          /* mDNS cache flush flag in 
replies */
 
 /*
- * Status return codes for T_UNSPEC conversion routines
+ * Status return codes for ns_t_unspec conversion routines
  */
 #define CONV_SUCCESS 0
 #define CONV_OVERFLOW -1
diff --git print-domain.c print-domain.c
index f5d74e8227c..a64143f22f5 100644
--- print-domain.c
+++ print-domain.c
@@ -38,7 +38,7 @@
 #undef NOERROR                                 /* Solaris sucks */
 #endif
 #ifdef NOERROR
-#undef T_UNSPEC                                        /* SINIX does too */
+#undef ns_t_unspec                                     /* SINIX does too */
 #endif
 #include "nameser.h"
 
@@ -252,76 +252,104 @@ ns_cprint(const u_char *cp)
 }
 
 /* https://www.iana.org/assignments/dns-parameters */
-struct tok ns_type2str[] = {
-       { T_A,          "A" },                  /* RFC 1035 */
-       { T_NS,         "NS" },                 /* RFC 1035 */
-       { T_MD,         "MD" },                 /* RFC 1035 */
-       { T_MF,         "MF" },                 /* RFC 1035 */
-       { T_CNAME,      "CNAME" },              /* RFC 1035 */
-       { T_SOA,        "SOA" },                /* RFC 1035 */
-       { T_MB,         "MB" },                 /* RFC 1035 */
-       { T_MG,         "MG" },                 /* RFC 1035 */
-       { T_MR,         "MR" },                 /* RFC 1035 */
-       { T_NULL,       "NULL" },               /* RFC 1035 */
-       { T_WKS,        "WKS" },                /* RFC 1035 */
-       { T_PTR,        "PTR" },                /* RFC 1035 */
-       { T_HINFO,      "HINFO" },              /* RFC 1035 */
-       { T_MINFO,      "MINFO" },              /* RFC 1035 */
-       { T_MX,         "MX" },                 /* RFC 1035 */
-       { T_TXT,        "TXT" },                /* RFC 1035 */
-       { T_RP,         "RP" },                 /* RFC 1183 */
-       { T_AFSDB,      "AFSDB" },              /* RFC 1183 */
-       { T_X25,        "X25" },                /* RFC 1183 */
-       { T_ISDN,       "ISDN" },               /* RFC 1183 */
-       { T_RT,         "RT" },                 /* RFC 1183 */
-       { T_NSAP,       "NSAP" },               /* RFC 1706 */
-       { T_NSAP_PTR,   "NSAP_PTR" },
-       { T_SIG,        "SIG" },                /* RFC 2535 */
-       { T_KEY,        "KEY" },                /* RFC 2535 */
-       { T_PX,         "PX" },                 /* RFC 2163 */
-       { T_GPOS,       "GPOS" },               /* RFC 1712 */
-       { T_AAAA,       "AAAA" },               /* RFC 1886 */
-       { T_LOC,        "LOC" },                /* RFC 1876 */
-       { T_NXT,        "NXT" },                /* RFC 2535 */
-       { T_EID,        "EID" },                /* Nimrod */
-       { T_NIMLOC,     "NIMLOC" },             /* Nimrod */
-       { T_SRV,        "SRV" },                /* RFC 2782 */
-       { T_ATMA,       "ATMA" },               /* ATM Forum */
-       { T_NAPTR,      "NAPTR" },              /* RFC 2168, RFC 2915 */
-       { T_KX,         "KX" },                 /* RFC 2230 */
-       { T_CERT,       "CERT" },               /* RFC 2538 */
-       { T_A6,         "A6" },                 /* RFC 2874 */
-       { T_DNAME,      "DNAME" },              /* RFC 2672 */
-       { T_SINK,       "SINK" },
-       { T_OPT,        "OPT" },                /* RFC 2671 */
-       { T_APL,        "APL" },                /* RFC 3123 */
-       { T_DS,         "DS" },                 /* RFC 4034 */
-       { T_SSHFP,      "SSHFP" },              /* RFC 4255 */
-       { T_IPSECKEY,   "IPSECKEY" },           /* RFC 4025 */
-       { T_RRSIG,      "RRSIG" },              /* RFC 4034 */
-       { T_NSEC,       "NSEC" },               /* RFC 4034 */
-       { T_DNSKEY,     "DNSKEY" },             /* RFC 4034 */
-       { T_SPF,        "SPF" },                /* 
RFC-schlitt-spf-classic-02.txt */
-       { T_UINFO,      "UINFO" },
-       { T_UID,        "UID" },
-       { T_GID,        "GID" },
-       { T_UNSPEC,     "UNSPEC" },
-       { T_UNSPECA,    "UNSPECA" },
-       { T_TKEY,       "TKEY" },               /* RFC 2930 */
-       { T_TSIG,       "TSIG" },               /* RFC 2845 */
-       { T_IXFR,       "IXFR" },               /* RFC 1995 */
-       { T_AXFR,       "AXFR" },               /* RFC 1035 */
-       { T_MAILB,      "MAILB" },              /* RFC 1035 */
-       { T_MAILA,      "MAILA" },              /* RFC 1035 */
-       { T_ANY,        "ANY" },
-       { 0,            NULL }
+const struct tok ns_type2str[] = {
+       { ns_t_a,               "A" },                  /* RFC 1035 */
+       { ns_t_ns,              "NS" },                 /* RFC 1035 */
+       { ns_t_md,              "MD" },                 /* RFC 1035 */
+       { ns_t_mf,              "MF" },                 /* RFC 1035 */
+       { ns_t_cname,           "CNAME" },              /* RFC 1035 */
+       { ns_t_soa,             "SOA" },                /* RFC 1035 */
+       { ns_t_mb,              "MB" },                 /* RFC 1035 */
+       { ns_t_mg,              "MG" },                 /* RFC 1035 */
+       { ns_t_mr,              "MR" },                 /* RFC 1035 */
+       { ns_t_null,            "NULL" },               /* RFC 1035 */
+       { ns_t_wks,             "WKS" },                /* RFC 1035 */
+       { ns_t_ptr,             "PTR" },                /* RFC 1035 */
+       { ns_t_hinfo,           "HINFO" },              /* RFC 1035 */
+       { ns_t_minfo,           "MINFO" },              /* RFC 1035 */
+       { ns_t_mx,              "MX" },                 /* RFC 1035 */
+       { ns_t_txt,             "TXT" },                /* RFC 1035 */
+       { ns_t_rp,              "RP" },                 /* RFC 1183 */
+       { ns_t_afsdb,           "AFSDB" },              /* RFC 5864 */
+       { ns_t_x25,             "X25" },                /* RFC 1183 */
+       { ns_t_isdn,            "ISDN" },               /* RFC 1183 */
+       { ns_t_rt,              "RT" },                 /* RFC 1183 */
+       { ns_t_nsap,            "NSAP" },               /* RFC 1706 */
+       { ns_t_nsap_ptr,        "NSAP_PTR" },           /* RFC 1706 */
+       { ns_t_sig,             "SIG" },                /* RFC 3008 */
+       { ns_t_key,             "KEY" },                /* RFC 3110 */
+       { ns_t_px,              "PX" },                 /* RFC 2163 */
+       { ns_t_gpos,            "GPOS" },               /* RFC 1712 */
+       { ns_t_aaaa,            "AAAA" },               /* RFC 3596 */
+       { ns_t_loc,             "LOC" },                /* RFC 1876 */
+       { ns_t_nxt,             "NXT" },                /* RFC 3755 */
+       { ns_t_eid,             "EID" },                /* Nimrod */
+       { ns_t_nimloc,          "NIMLOC" },             /* Nimrod */
+       { ns_t_srv,             "SRV" },                /* RFC 2782 */
+       { ns_t_atma,            "ATMA" },               /* ATM Forum */
+       { ns_t_naptr,           "NAPTR" },              /* RFC 3403 */
+       { ns_t_kx,              "KX" },                 /* RFC 2230 */
+       { ns_t_cert,            "CERT" },               /* RFC 4398 */
+       { ns_t_a6,              "A6" },                 /* RFC 6563 */
+       { ns_t_dname,           "DNAME" },              /* RFC 6672 */
+       { ns_t_sink,            "SINK" },
+       { ns_t_opt,             "OPT" },                /* RFC 6891 */
+       { ns_t_apl,             "APL" },                /* RFC 3123 */
+       { ns_t_ds,              "DS" },                 /* RFC 4034 */
+       { ns_t_sshfp,           "SSHFP" },              /* RFC 4255 */
+       { ns_t_ipseckey,        "IPSECKEY" },           /* RFC 4025 */
+       { ns_t_rrsig,           "RRSIG" },              /* RFC 4034 */
+       { ns_t_nsec,            "NSEC" },               /* RFC 4034 */
+       { ns_t_dnskey,          "DNSKEY" },             /* RFC 4034 */
+       { ns_t_dhcid,           "DHCID" },              /* RFC 4071 */
+       { ns_t_nsec3,           "NSEC3" },              /* RFC 5155 */
+       { ns_t_nsec3param,      "NSEC3PARAM" },         /* RFC 5155 */
+       { ns_t_tlsa,            "TLSA" },               /* RFC 6698 */
+       { ns_t_smimea,          "SMIMEA" },             /* RFC 8162 */
+       { ns_t_hip,             "HIP" },                /* RFC 8005 */
+       { ns_t_ninfo,           "NINFO" },
+       { ns_t_rkey,            "RKEY" },
+       { ns_t_talink,          "TALINK" },
+       { ns_t_cds,             "CDS" },                /* RFC 7344 */
+       { ns_t_cdnskey,         "CDNSKEY" },            /* RFC 7344 */
+       { ns_t_openpgpkey,      "OPENPGPKEY" },         /* RFC 7929 */
+       { ns_t_csync,           "CSYNC" },              /* RFC 7477 */
+       { ns_t_zonemd,          "ZONEMD" },             /* RFC 8976 */
+       { ns_t_svcb,            "SVCB" },
+       { ns_t_https,           "HTTPS" },
+       { ns_t_spf,             "SPF" },                /* RFC 7208 */
+       { ns_t_uinfo,           "UINFO" },
+       { ns_t_uid,             "UID" },
+       { ns_t_gid,             "GID" },
+       { ns_t_unspec,          "UNSPEC" },
+       { ns_t_nid,             "NID" },                /* RFC 6742 */
+       { ns_t_l32,             "L32" },                /* RFC 6742 */
+       { ns_t_l64,             "L64" },                /* RFC 6742 */
+       { ns_t_lp,              "LP" },                 /* RFC 6742 */
+       { ns_t_eui48,           "EUI48" },              /* RFC 7043 */
+       { ns_t_eui64,           "EUI64" },              /* RFC 7043 */
+       { ns_t_tkey,            "TKEY" },               /* RFC 2930 */
+       { ns_t_tsig,            "TSIG" },               /* RFC 8945 */
+       { ns_t_ixfr,            "IXFR" },               /* RFC 1995 */
+       { ns_t_axfr,            "AXFR" },               /* RFC 5936 */
+       { ns_t_mailb,           "MAILB" },              /* RFC 1035 */
+       { ns_t_maila,           "MAILA" },              /* RFC 1035 */
+       { ns_t_any,             "ANY" },                /* RFC 8482 */
+       { ns_t_uri,             "URI" },                /* RFC 7553 */
+       { ns_t_caa,             "CAA" },                /* RFC 8659 */
+       { ns_t_avc,             "AVC" },
+       { ns_t_doa,             "DOA" },
+       { ns_t_amtrelay,        "AMTRELAY" },           /* RFC 8777 */
+       { ns_t_ta,              "TA" },
+       { ns_t_dlv,             "DLV" },                /* RFC 8749 */
+       { 0,                    NULL }
 };
 
-struct tok ns_class2str[] = {
-       { C_IN,         "IN" },         /* Not used */
-       { C_CHAOS,      "CHAOS" },
-       { C_HS,         "HS" },
-       { C_ANY,        "ANY" },
+const struct tok ns_class2str[] = {
+       { ns_c_in,              "IN" },         /* Not used */
+       { ns_c_chaos,   "CHAOS" },
+       { ns_c_hs,              "HS" },
+       { ns_c_any,     "ANY" },
        { 0,            NULL }
 };
 
@@ -345,12 +373,12 @@ ns_qprint(const u_char *cp, const u_char *bp, int is_mdns)
        i = EXTRACT_16BITS(cp);
        cp += 2;
        if (is_mdns)
-               class = (i & ~C_QU);
+               class = (i & ~ns_c_qu);
        else
                class = i;
-       if (class != C_IN)
+       if (class != ns_c_in)
                printf(" %s", tok2str(ns_class2str, "(Class %d)", class));
-       if (is_mdns && (i & C_QU))
+       if (is_mdns && (i & ns_c_qu))
                printf(" (QU)");
 
        printf("? ");
@@ -383,17 +411,17 @@ ns_rprint(const u_char *cp, const u_char *bp, int is_mdns)
        i = EXTRACT_16BITS(cp);
        cp += 2;
        if (is_mdns)
-               class = (i & ~C_CACHE_FLUSH);
+               class = (i & ~ns_c_cache_flush);
        else
                class = i;
-       if (class != C_IN && typ != T_OPT)
+       if (class != ns_c_in && typ != ns_t_opt)
                printf(" %s", tok2str(ns_class2str, "(Class %d)", class));
        if (is_mdns) {
-               if (i & C_CACHE_FLUSH)
+               if (i & ns_c_cache_flush)
                        printf(" (Cache flush)");
        }
 
-       if (typ == T_OPT) {
+       if (typ == ns_t_opt) {
                /* get opt flags */
                cp += 2;
                opt_flags = EXTRACT_16BITS(cp);
@@ -420,24 +448,24 @@ ns_rprint(const u_char *cp, const u_char *bp, int is_mdns)
                return(NULL);
 
        switch (typ) {
-       case T_A:
+       case ns_t_a:
                if (!TTEST2(*cp, sizeof(struct in_addr)))
                        return(NULL);
                printf(" %s", ipaddr_string(cp));
                break;
 
-       case T_NS:
-       case T_CNAME:
-       case T_PTR:
-#ifdef T_DNAME
-       case T_DNAME:
+       case ns_t_ns:
+       case ns_t_cname:
+       case ns_t_ptr:
+#ifdef ns_t_dname
+       case ns_t_dname:
 #endif
                putchar(' ');
                if (ns_nprint(cp, bp) == NULL)
                        return(NULL);
                break;
 
-       case T_SOA:
+       case ns_t_soa:
                if (!vflag)
                        break;
                putchar(' ');
@@ -459,7 +487,7 @@ ns_rprint(const u_char *cp, const u_char *bp, int is_mdns)
                printf(" %u", EXTRACT_32BITS(cp));
                cp += 4;
                break;
-       case T_MX:
+       case ns_t_mx:
                putchar(' ');
                if (!TTEST2(*cp, 2))
                        return(NULL);
@@ -468,7 +496,7 @@ ns_rprint(const u_char *cp, const u_char *bp, int is_mdns)
                printf(" %d", EXTRACT_16BITS(cp));
                break;
 
-       case T_TXT:
+       case ns_t_txt:
                while (cp < rp) {
                        printf(" \"");
                        cp = ns_cprint(cp);
@@ -478,7 +506,7 @@ ns_rprint(const u_char *cp, const u_char *bp, int is_mdns)
                }
                break;
 
-       case T_SRV:
+       case ns_t_srv:
                putchar(' ');
                if (!TTEST2(*cp, 6))
                        return(NULL);
@@ -488,13 +516,13 @@ ns_rprint(const u_char *cp, const u_char *bp, int is_mdns)
                        EXTRACT_16BITS(cp), EXTRACT_16BITS(cp + 2));
                break;
 
-       case T_AAAA:
+       case ns_t_aaaa:
                if (!TTEST2(*cp, sizeof(struct in6_addr)))
                        return(NULL);
                printf(" %s", ip6addr_string(cp));
                break;
 
-       case T_A6:
+       case ns_t_a6:
            {
                struct in6_addr a;
                int pbit, pbyte;
@@ -521,20 +549,13 @@ ns_rprint(const u_char *cp, const u_char *bp, int is_mdns)
                break;
            }
 
-       case T_OPT:
+       case ns_t_opt:
                printf(" UDPsize=%u", class);
                if (opt_flags & 0x8000)
                        printf(" DO");
                break;
 
-       case T_UNSPECA:         /* One long string */
-               if (!TTEST2(*cp, len))
-                       return(NULL);
-               if (fn_printn(cp, len, snapend))
-                       return(NULL);
-               break;
-
-       case T_TSIG:
+       case ns_t_tsig:
            {
                if (cp + len > snapend)
                        return(NULL);
diff --git print-lwres.c print-lwres.c
index 441009e3792..afcbfed3d54 100644
--- print-lwres.c
+++ print-lwres.c
@@ -559,7 +559,7 @@ lwres_print(const u_char *bp, u_int length)
 
                        printf(" %s", tok2str(ns_type2str, "Type%d",
                            ntohs(grbn->rdtype)));
-                       if (ntohs(grbn->rdclass) != C_IN)
+                       if (ntohs(grbn->rdclass) != ns_c_in)
                                printf(" %s", tok2str(ns_class2str, "Class%d",
                                    ntohs(grbn->rdclass)));
                        printf(" TTL ");

Reply via email to