summaryrefslogtreecommitdiff
path: root/usr.bin/dig
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2020-02-24 12:05:38 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2020-02-24 12:05:38 +0000
commitb77b87964f094f86d8ebba3c9050912661f4daf7 (patch)
tree804cb38b24eb325ffc29e26c131c196817920ddf /usr.bin/dig
parent82bb7f8cf6f8a16b0ba4f8662a485598a821ffd1 (diff)
Stop generating DNS class and type enums.
OK jsg, jung
Diffstat (limited to 'usr.bin/dig')
-rw-r--r--usr.bin/dig/Makefile12
-rw-r--r--usr.bin/dig/lib/dns/include/dns/types.h98
-rw-r--r--usr.bin/dig/lib/dns/rdata.c8
3 files changed, 98 insertions, 20 deletions
diff --git a/usr.bin/dig/Makefile b/usr.bin/dig/Makefile
index 6e1ff9da0c9..2862dc64d4d 100644
--- a/usr.bin/dig/Makefile
+++ b/usr.bin/dig/Makefile
@@ -1,11 +1,11 @@
-# $OpenBSD: Makefile,v 1.1 2020/02/07 09:58:52 florian Exp $
+# $OpenBSD: Makefile,v 1.2 2020/02/24 12:05:37 florian Exp $
PROG= dig
SRCS= dig.c dighost.c host.c nslookup.c
MAN= dig.1 host.1 nslookup.1
LINKS= ${BINDIR}/dig ${BINDIR}/host \
${BINDIR}/dig ${BINDIR}/nslookup
-CLEANFILES+= code.h enumclass.h enumtype.h gen gen.d rdatastruct.h
+CLEANFILES+= code.h gen gen.d rdatastruct.h
.include "${.CURDIR}/lib/dns/Makefile.inc"
.include "${.CURDIR}/lib/isc/Makefile.inc"
@@ -29,17 +29,11 @@ YFLAGS=
LDADD+= -lcrypto
DPADD+= ${LIBCRYPTO}
-BUILDFIRST = enumtype.h enumclass.h rdatastruct.h code.h
+BUILDFIRST = rdatastruct.h code.h
gen: lib/dns/gen.c
${HOSTCC} ${CFLAGS} ${.CURDIR}/lib/dns/gen.c -o $@
-enumtype.h: gen
- ./gen -s ${.CURDIR}/lib/dns -t > $@
-
-enumclass.h: gen
- ./gen -s ${.CURDIR}/lib/dns -c > $@
-
rdatastruct.h: gen lib/dns/rdata/rdatastructpre.h \
lib/dns/rdata/rdatastructsuf.h
./gen -s ${.CURDIR}/lib/dns -i \
diff --git a/usr.bin/dig/lib/dns/include/dns/types.h b/usr.bin/dig/lib/dns/include/dns/types.h
index 34cbd49e8e8..53733bb4c06 100644
--- a/usr.bin/dig/lib/dns/include/dns/types.h
+++ b/usr.bin/dig/lib/dns/include/dns/types.h
@@ -75,11 +75,99 @@ typedef enum {
dns_namereln_commonancestor = 4
} dns_namereln_t;
-/*
- * These are generated by gen.c.
- */
-#include "enumtype.h" /* Provides dns_rdatatype_t. */
-#include "enumclass.h" /* Provides dns_rdataclass_t. */
+enum {
+ dns_rdataclass_reserved0 = 0,
+ dns_rdataclass_in = 1,
+ dns_rdataclass_chaos = 3,
+ dns_rdataclass_ch = 3,
+ dns_rdataclass_hs = 4,
+ dns_rdataclass_none = 254,
+ dns_rdataclass_any = 255
+};
+
+enum {
+ dns_rdatatype_none = 0,
+ dns_rdatatype_a = 1,
+ dns_rdatatype_ns = 2,
+ dns_rdatatype_md = 3,
+ dns_rdatatype_mf = 4,
+ dns_rdatatype_cname = 5,
+ dns_rdatatype_soa = 6,
+ dns_rdatatype_mb = 7,
+ dns_rdatatype_mg = 8,
+ dns_rdatatype_mr = 9,
+ dns_rdatatype_null = 10,
+ dns_rdatatype_wks = 11,
+ dns_rdatatype_ptr = 12,
+ dns_rdatatype_hinfo = 13,
+ dns_rdatatype_minfo = 14,
+ dns_rdatatype_mx = 15,
+ dns_rdatatype_txt = 16,
+ dns_rdatatype_rp = 17,
+ dns_rdatatype_afsdb = 18,
+ dns_rdatatype_x25 = 19,
+ dns_rdatatype_isdn = 20,
+ dns_rdatatype_rt = 21,
+ dns_rdatatype_nsap = 22,
+ dns_rdatatype_nsap_ptr = 23,
+ dns_rdatatype_sig = 24,
+ dns_rdatatype_key = 25,
+ dns_rdatatype_px = 26,
+ dns_rdatatype_gpos = 27,
+ dns_rdatatype_aaaa = 28,
+ dns_rdatatype_loc = 29,
+ dns_rdatatype_nxt = 30,
+ dns_rdatatype_srv = 33,
+ dns_rdatatype_naptr = 35,
+ dns_rdatatype_kx = 36,
+ dns_rdatatype_cert = 37,
+ dns_rdatatype_a6 = 38,
+ dns_rdatatype_dname = 39,
+ dns_rdatatype_sink = 40,
+ dns_rdatatype_opt = 41,
+ dns_rdatatype_apl = 42,
+ dns_rdatatype_ds = 43,
+ dns_rdatatype_sshfp = 44,
+ dns_rdatatype_ipseckey = 45,
+ dns_rdatatype_rrsig = 46,
+ dns_rdatatype_nsec = 47,
+ dns_rdatatype_dnskey = 48,
+ dns_rdatatype_dhcid = 49,
+ dns_rdatatype_nsec3 = 50,
+ dns_rdatatype_nsec3param = 51,
+ dns_rdatatype_tlsa = 52,
+ dns_rdatatype_smimea = 53,
+ dns_rdatatype_hip = 55,
+ dns_rdatatype_ninfo = 56,
+ dns_rdatatype_rkey = 57,
+ dns_rdatatype_talink = 58,
+ dns_rdatatype_cds = 59,
+ dns_rdatatype_cdnskey = 60,
+ dns_rdatatype_openpgpkey = 61,
+ dns_rdatatype_csync = 62,
+ dns_rdatatype_spf = 99,
+ dns_rdatatype_unspec = 103,
+ dns_rdatatype_nid = 104,
+ dns_rdatatype_l32 = 105,
+ dns_rdatatype_l64 = 106,
+ dns_rdatatype_lp = 107,
+ dns_rdatatype_eui48 = 108,
+ dns_rdatatype_eui64 = 109,
+ dns_rdatatype_tkey = 249,
+ dns_rdatatype_tsig = 250,
+ dns_rdatatype_uri = 256,
+ dns_rdatatype_caa = 257,
+ dns_rdatatype_avc = 258,
+ dns_rdatatype_doa = 259,
+ dns_rdatatype_ta = 32768,
+ dns_rdatatype_dlv = 32769,
+ dns_rdatatype_keydata = 65533,
+ dns_rdatatype_ixfr = 251,
+ dns_rdatatype_axfr = 252,
+ dns_rdatatype_mailb = 253,
+ dns_rdatatype_maila = 254,
+ dns_rdatatype_any = 255
+};
/*%
* rcodes.
diff --git a/usr.bin/dig/lib/dns/rdata.c b/usr.bin/dig/lib/dns/rdata.c
index d20f5ff0066..72a7a604413 100644
--- a/usr.bin/dig/lib/dns/rdata.c
+++ b/usr.bin/dig/lib/dns/rdata.c
@@ -14,27 +14,23 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdata.c,v 1.13 2020/02/23 19:54:25 jung Exp $ */
+/* $Id: rdata.c,v 1.14 2020/02/24 12:05:37 florian Exp $ */
/*! \file */
#include <ctype.h>
#include <stdlib.h>
+#include <string.h>
#include <isc/base64.h>
#include <isc/hex.h>
#include <isc/lex.h>
-
#include <isc/parseint.h>
-
-#include <string.h>
-
#include <isc/util.h>
#include <dns/cert.h>
#include <dns/compress.h>
-#include "enumtype.h"
#include <dns/keyvalues.h>
#include <dns/rcode.h>
#include <dns/rdata.h>