diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2020-09-14 08:40:45 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2020-09-14 08:40:45 +0000 |
commit | 34cca05c4ff9397afd4d16562d8d391973804ffb (patch) | |
tree | 9b956a296045b1a69f0df50b42f72c7ac5ef6e33 /usr.bin/dig | |
parent | 91273258f09702d56f03712ff5f914eecc3b3cf8 (diff) |
Mechanically replace isc_boolean_t with int.
OK deraadt
Diffstat (limited to 'usr.bin/dig')
102 files changed, 1194 insertions, 1243 deletions
diff --git a/usr.bin/dig/dig.c b/usr.bin/dig/dig.c index b5f3e195a1b..c783a51d663 100644 --- a/usr.bin/dig/dig.c +++ b/usr.bin/dig/dig.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dig.c,v 1.15 2020/09/14 08:39:12 florian Exp $ */ +/* $Id: dig.c,v 1.16 2020/09/14 08:40:43 florian Exp $ */ /*! \file */ #include <sys/cdefs.h> @@ -59,11 +59,11 @@ static int addresscount = 0; static char domainopt[DNS_NAME_MAXTEXT]; static char sitvalue[256]; -static isc_boolean_t short_form = ISC_FALSE, printcmd = ISC_TRUE, - ip6_int = ISC_FALSE, plusquest = ISC_FALSE, pluscomm = ISC_FALSE, - multiline = ISC_FALSE, nottl = ISC_FALSE, noclass = ISC_FALSE, - onesoa = ISC_FALSE, use_usec = ISC_FALSE, nocrypto = ISC_FALSE, - ipv4only = ISC_FALSE, ipv6only = ISC_FALSE; +static int short_form = 0, printcmd = 1, + ip6_int = 0, plusquest = 0, pluscomm = 0, + multiline = 0, nottl = 0, noclass = 0, + onesoa = 0, use_usec = 0, nocrypto = 0, + ipv4only = 0, ipv6only = 0; static uint32_t splitwidth = 0xffffffff; /*% rrcomments are neither explicitly enabled nor disabled by default */ @@ -334,7 +334,7 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags, return (ISC_R_SUCCESS); } -static isc_boolean_t +static int isdotlocal(dns_message_t *msg) { isc_result_t result; static unsigned char local_ndata[] = { "\005local\0" }; @@ -349,16 +349,16 @@ isdotlocal(dns_message_t *msg) { dns_name_t *name = NULL; dns_message_currentname(msg, DNS_SECTION_QUESTION, &name); if (dns_name_issubdomain(name, &local)) - return (ISC_TRUE); + return (1); } - return (ISC_FALSE); + return (0); } /* * Callback from dighost.c to print the reply from a server */ static isc_result_t -printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { +printmessage(dig_query_t *query, dns_message_t *msg, int headers) { isc_result_t result; dns_messagetextflag_t flags; isc_buffer_t *buf = NULL; @@ -596,7 +596,7 @@ cleanup: static void printgreeting(int argc, char **argv, dig_lookup_t *lookup) { int i; - static isc_boolean_t first = ISC_TRUE; + static int first = 1; char append[MXNAME]; if (printcmd) { @@ -623,7 +623,7 @@ printgreeting(int argc, char **argv, dig_lookup_t *lookup) { ";; global options:%s%s\n", short_form ? " +short" : "", printcmd ? " +cmd" : ""); - first = ISC_FALSE; + first = 0; strlcat(lookup->cmdline, append, sizeof(lookup->cmdline)); } @@ -631,7 +631,7 @@ printgreeting(int argc, char **argv, dig_lookup_t *lookup) { } static void -plus_option(const char *option, isc_boolean_t is_batchfile, +plus_option(const char *option, int is_batchfile, dig_lookup_t *lookup) { isc_result_t result; @@ -640,7 +640,7 @@ plus_option(const char *option, isc_boolean_t is_batchfile, const char *errstr; long lval; uint32_t num; - isc_boolean_t state = ISC_TRUE; + int state = 1; size_t n; strlcpy(option_store, option, sizeof(option_store)); @@ -653,7 +653,7 @@ plus_option(const char *option, isc_boolean_t is_batchfile, value = ptr; if (strncasecmp(cmd, "no", 2)==0) { cmd += 2; - state = ISC_FALSE; + state = 0; } #define FULLCHECK(A) \ @@ -751,7 +751,7 @@ plus_option(const char *option, isc_boolean_t is_batchfile, case 'l': /* class */ /* keep +cl for backwards compatibility */ FULLCHECK2("cl", "class"); - noclass = ISC_TF(!state); + noclass = !state; break; case 'm': /* cmd */ FULLCHECK("cmd"); @@ -774,7 +774,7 @@ plus_option(const char *option, isc_boolean_t is_batchfile, break; case 'r': FULLCHECK("crypto"); - nocrypto = ISC_TF(!state); + nocrypto = !state; break; default: goto invalid_option; @@ -949,17 +949,17 @@ plus_option(const char *option, isc_boolean_t is_batchfile, FULLCHECK("nssearch"); lookup->ns_search_only = state; if (state) { - lookup->trace_root = ISC_TRUE; - lookup->recurse = ISC_TRUE; - lookup->identify = ISC_TRUE; - lookup->stats = ISC_FALSE; - lookup->comments = ISC_FALSE; - lookup->section_additional = ISC_FALSE; - lookup->section_authority = ISC_FALSE; - lookup->section_question = ISC_FALSE; + lookup->trace_root = 1; + lookup->recurse = 1; + lookup->identify = 1; + lookup->stats = 0; + lookup->comments = 0; + lookup->section_additional = 0; + lookup->section_authority = 0; + lookup->section_question = 0; lookup->rdtype = dns_rdatatype_ns; - lookup->rdtypeset = ISC_TRUE; - short_form = ISC_TRUE; + lookup->rdtypeset = 1; + short_form = 1; rrcomments = 0; } break; @@ -1073,13 +1073,13 @@ plus_option(const char *option, isc_boolean_t is_batchfile, FULLCHECK("short"); short_form = state; if (state) { - printcmd = ISC_FALSE; - lookup->section_additional = ISC_FALSE; - lookup->section_answer = ISC_TRUE; - lookup->section_authority = ISC_FALSE; - lookup->section_question = ISC_FALSE; - lookup->comments = ISC_FALSE; - lookup->stats = ISC_FALSE; + printcmd = 0; + lookup->section_additional = 0; + lookup->section_answer = 1; + lookup->section_authority = 0; + lookup->section_question = 0; + lookup->comments = 0; + lookup->stats = 0; rrcomments = -1; } break; @@ -1179,7 +1179,7 @@ plus_option(const char *option, isc_boolean_t is_batchfile, FULLCHECK("tcp"); if (!is_batchfile) { lookup->tcp_mode = state; - lookup->tcp_mode_set = ISC_TRUE; + lookup->tcp_mode_set = 1; } break; case 'i': /* timeout */ @@ -1201,16 +1201,16 @@ plus_option(const char *option, isc_boolean_t is_batchfile, lookup->trace = state; lookup->trace_root = state; if (state) { - lookup->recurse = ISC_FALSE; - lookup->identify = ISC_TRUE; - lookup->comments = ISC_FALSE; + lookup->recurse = 0; + lookup->identify = 1; + lookup->comments = 0; rrcomments = 0; - lookup->stats = ISC_FALSE; - lookup->section_additional = ISC_FALSE; - lookup->section_authority = ISC_TRUE; - lookup->section_question = ISC_FALSE; - lookup->dnssec = ISC_TRUE; - usesearch = ISC_FALSE; + lookup->stats = 0; + lookup->section_additional = 0; + lookup->section_authority = 1; + lookup->section_question = 0; + lookup->dnssec = 1; + usesearch = 0; } break; case 'i': /* tries */ @@ -1233,7 +1233,7 @@ plus_option(const char *option, isc_boolean_t is_batchfile, break; case 't': /* ttlid */ FULLCHECK("ttlid"); - nottl = ISC_TF(!state); + nottl = !state; break; default: goto invalid_option; @@ -1243,7 +1243,7 @@ plus_option(const char *option, isc_boolean_t is_batchfile, FULLCHECK("vc"); if (!is_batchfile) { lookup->tcp_mode = state; - lookup->tcp_mode_set = ISC_TRUE; + lookup->tcp_mode_set = 1; } break; default: @@ -1257,19 +1257,19 @@ plus_option(const char *option, isc_boolean_t is_batchfile, } /*% - * #ISC_TRUE returned if value was used + * #1 returned if value was used */ static const char *single_dash_opts = "46dhinuv"; static const char *dash_opts = "46bcdfhikmnptvyx"; -static isc_boolean_t +static int dash_option(char *option, char *next, dig_lookup_t **lookup, - isc_boolean_t *open_type_class, isc_boolean_t *need_clone, - isc_boolean_t config_only, int argc, char **argv, - isc_boolean_t *firstarg) + int *open_type_class, int *need_clone, + int config_only, int argc, char **argv, + int *firstarg) { char opt, *value, *ptr, *ptr2, *ptr3; isc_result_t result; - isc_boolean_t value_from_next; + int value_from_next; isc_textregion_t tr; dns_rdatatype_t rdtype; dns_rdataclass_t rdclass; @@ -1291,13 +1291,13 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, switch (opt) { case '4': if (have_ipv4) - have_ipv6 = ISC_FALSE; + have_ipv6 = 0; else fatal("can't find IPv4 networking"); break; case '6': if (have_ipv6) - have_ipv4 = ISC_FALSE; + have_ipv4 = 0; else fatal("can't find IPv6 networking"); break; @@ -1306,23 +1306,23 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, if (ptr != &option[1]) { cmd = option; FULLCHECK("debug"); - debugging = ISC_TRUE; - return (ISC_FALSE); + debugging = 1; + return (0); } else - debugging = ISC_TRUE; + debugging = 1; break; case 'h': help(); exit(0); break; case 'i': - ip6_int = ISC_TRUE; + ip6_int = 1; break; case 'n': /* deprecated */ break; case 'u': - use_usec = ISC_TRUE; + use_usec = 1; break; case 'v': version(); @@ -1332,14 +1332,14 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, if (strlen(option) > 1U) option = &option[1]; else - return (ISC_FALSE); + return (0); } opt = option[0]; if (strlen(option) > 1U) { - value_from_next = ISC_FALSE; + value_from_next = 0; value = &option[1]; } else { - value_from_next = ISC_TRUE; + value_from_next = 1; value = next; } if (value == NULL) @@ -1365,20 +1365,20 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, if (hash != NULL) *hash = '#'; - specified_source = ISC_TRUE; + specified_source = 1; return (value_from_next); case 'c': if ((*lookup)->rdclassset) { fprintf(stderr, ";; Warning, extra class option\n"); } - *open_type_class = ISC_FALSE; + *open_type_class = 0; tr.base = value; tr.length = (unsigned int) strlen(value); result = dns_rdataclass_fromtext(&rdclass, (isc_textregion_t *)&tr); if (result == ISC_R_SUCCESS) { (*lookup)->rdclass = rdclass; - (*lookup)->rdclassset = ISC_TRUE; + (*lookup)->rdclassset = 1; } else fprintf(stderr, ";; Warning, ignoring " "invalid class %s\n", @@ -1400,23 +1400,23 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, if (!config_only) { if (*need_clone) (*lookup) = clone_lookup(default_lookup, - ISC_TRUE); - *need_clone = ISC_TRUE; + 1); + *need_clone = 1; strlcpy((*lookup)->textname, value, sizeof((*lookup)->textname)); - (*lookup)->trace_root = ISC_TF((*lookup)->trace || - (*lookup)->ns_search_only); - (*lookup)->new_search = ISC_TRUE; + (*lookup)->trace_root = (*lookup)->trace || + (*lookup)->ns_search_only; + (*lookup)->new_search = 1; if (*firstarg) { printgreeting(argc, argv, *lookup); - *firstarg = ISC_FALSE; + *firstarg = 0; } ISC_LIST_APPEND(lookup_list, (*lookup), link); debug("looking up %s", (*lookup)->textname); } return (value_from_next); case 't': - *open_type_class = ISC_FALSE; + *open_type_class = 0; if (strncasecmp(value, "ixfr=", 5) == 0) { rdtype = dns_rdatatype_ixfr; result = ISC_R_SUCCESS; @@ -1438,7 +1438,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, if (rdtype == dns_rdatatype_ixfr) { uint32_t serial; (*lookup)->rdtype = dns_rdatatype_ixfr; - (*lookup)->rdtypeset = ISC_TRUE; + (*lookup)->rdtypeset = 1; serial = strtonum(&value[5], 0, MAXSERIAL, &errstr); if (errstr != NULL) @@ -1448,16 +1448,16 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, (*lookup)->section_question = plusquest; (*lookup)->comments = pluscomm; if (!(*lookup)->tcp_mode_set) - (*lookup)->tcp_mode = ISC_TRUE; + (*lookup)->tcp_mode = 1; } else { (*lookup)->rdtype = rdtype; if (!config_only) - (*lookup)->rdtypeset = ISC_TRUE; + (*lookup)->rdtypeset = 1; if (rdtype == dns_rdatatype_axfr) { (*lookup)->section_question = plusquest; (*lookup)->comments = pluscomm; } - (*lookup)->ixfr_serial = ISC_FALSE; + (*lookup)->ixfr_serial = 0; } } else fprintf(stderr, ";; Warning, ignoring " @@ -1486,24 +1486,24 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, return (value_from_next); case 'x': if (*need_clone) - *lookup = clone_lookup(default_lookup, ISC_TRUE); - *need_clone = ISC_TRUE; + *lookup = clone_lookup(default_lookup, 1); + *need_clone = 1; if (get_reverse(textname, sizeof(textname), value, - ip6_int, ISC_FALSE) == ISC_R_SUCCESS) { + ip6_int, 0) == ISC_R_SUCCESS) { strlcpy((*lookup)->textname, textname, sizeof((*lookup)->textname)); debug("looking up %s", (*lookup)->textname); - (*lookup)->trace_root = ISC_TF((*lookup)->trace || - (*lookup)->ns_search_only); + (*lookup)->trace_root = (*lookup)->trace || + (*lookup)->ns_search_only; (*lookup)->ip6_int = ip6_int; if (!(*lookup)->rdtypeset) (*lookup)->rdtype = dns_rdatatype_ptr; if (!(*lookup)->rdclassset) (*lookup)->rdclass = dns_rdataclass_in; - (*lookup)->new_search = ISC_TRUE; + (*lookup)->new_search = 1; if (*firstarg) { printgreeting(argc, argv, *lookup); - *firstarg = ISC_FALSE; + *firstarg = 0; } ISC_LIST_APPEND(lookup_list, *lookup, link); } else { @@ -1517,7 +1517,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, usage(); } /* NOTREACHED */ - return (ISC_FALSE); + return (0); } /*% @@ -1546,12 +1546,12 @@ preparse_args(int argc, char **argv) { case '4': if (ipv6only) fatal("only one of -4 and -6 allowed"); - ipv4only = ISC_TRUE; + ipv4only = 1; break; case '6': if (ipv4only) fatal("only one of -4 and -6 allowed"); - ipv6only = ISC_TRUE; + ipv6only = 1; break; } option = &option[1]; @@ -1560,16 +1560,16 @@ preparse_args(int argc, char **argv) { } static void -parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only, +parse_args(int is_batchfile, int config_only, int argc, char **argv) { isc_result_t result; isc_textregion_t tr; - isc_boolean_t firstarg = ISC_TRUE; + int firstarg = 1; dig_lookup_t *lookup = NULL; dns_rdatatype_t rdtype; dns_rdataclass_t rdclass; - isc_boolean_t open_type_class = ISC_TRUE; + int open_type_class = 1; char batchline[MXNAME]; int bargc; char *bargv[64]; @@ -1577,7 +1577,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only, char **rv; char *input; int i; - isc_boolean_t need_clone = ISC_TRUE; + int need_clone = 1; const char *errstr; /* @@ -1595,14 +1595,14 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only, if (!is_batchfile) { debug("making new lookup"); default_lookup = make_empty_lookup(); - default_lookup->adflag = ISC_TRUE; + default_lookup->adflag = 1; default_lookup->edns = 0; } if (is_batchfile && !config_only) { /* Processing '-f batchfile'. */ - lookup = clone_lookup(default_lookup, ISC_TRUE); - need_clone = ISC_FALSE; + lookup = clone_lookup(default_lookup, 1); + need_clone = 0; } else lookup = default_lookup; @@ -1683,7 +1683,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only, uint32_t serial; lookup->rdtype = dns_rdatatype_ixfr; - lookup->rdtypeset = ISC_TRUE; + lookup->rdtypeset = 1; serial = strtonum(&rv[0][5], 0, MAXSERIAL, &errstr); if (errstr != NULL) @@ -1695,17 +1695,17 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only, plusquest; lookup->comments = pluscomm; if (!lookup->tcp_mode_set) - lookup->tcp_mode = ISC_TRUE; + lookup->tcp_mode = 1; } else { lookup->rdtype = rdtype; - lookup->rdtypeset = ISC_TRUE; + lookup->rdtypeset = 1; if (rdtype == dns_rdatatype_axfr) { lookup->section_question = plusquest; lookup->comments = pluscomm; } - lookup->ixfr_serial = ISC_FALSE; + lookup->ixfr_serial = 0; } continue; } @@ -1717,7 +1717,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only, "extra class option\n"); } lookup->rdclass = rdclass; - lookup->rdclassset = ISC_TRUE; + lookup->rdclassset = 1; continue; } } @@ -1725,16 +1725,16 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only, if (!config_only) { if (need_clone) lookup = clone_lookup(default_lookup, - ISC_TRUE); - need_clone = ISC_TRUE; + 1); + need_clone = 1; strlcpy(lookup->textname, rv[0], sizeof(lookup->textname)); - lookup->trace_root = ISC_TF(lookup->trace || - lookup->ns_search_only); - lookup->new_search = ISC_TRUE; + lookup->trace_root = lookup->trace || + lookup->ns_search_only; + lookup->new_search = 1; if (firstarg) { printgreeting(argc, argv, lookup); - firstarg = ISC_FALSE; + firstarg = 0; } ISC_LIST_APPEND(lookup_list, lookup, link); debug("looking up %s", lookup->textname); @@ -1779,7 +1779,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only, for(i = 0; i < bargc; i++) debug("batch argv %d: %s", i, bargv[i]); - parse_args(ISC_TRUE, ISC_FALSE, bargc, (char **)bargv); + parse_args(1, 0, bargc, (char **)bargv); return; } return; @@ -1789,17 +1789,16 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only, */ if ((lookup_list.head == NULL) && !config_only) { if (need_clone) - lookup = clone_lookup(default_lookup, ISC_TRUE); - need_clone = ISC_TRUE; - lookup->trace_root = ISC_TF(lookup->trace || - lookup->ns_search_only); - lookup->new_search = ISC_TRUE; + lookup = clone_lookup(default_lookup, 1); + need_clone = 1; + lookup->trace_root = lookup->trace || lookup->ns_search_only; + lookup->new_search = 1; strlcpy(lookup->textname, ".", sizeof(lookup->textname)); lookup->rdtype = dns_rdatatype_ns; - lookup->rdtypeset = ISC_TRUE; + lookup->rdtypeset = 1; if (firstarg) { printgreeting(argc, argv, lookup); - firstarg = ISC_FALSE; + firstarg = 0; } ISC_LIST_APPEND(lookup_list, lookup, link); } @@ -1848,7 +1847,7 @@ query_finished(void) { for(i = 0; i < bargc; i++) debug("batch argv %d: %s", i, bargv[i]); - parse_args(ISC_TRUE, ISC_FALSE, bargc, (char **)bargv); + parse_args(1, 0, bargc, (char **)bargv); start_lookup(); } else { batchname = NULL; @@ -1891,7 +1890,7 @@ void dig_setup(int argc, char **argv) setup_system(ipv4only, ipv6only); } -void dig_query_setup(isc_boolean_t is_batchfile, isc_boolean_t config_only, +void dig_query_setup(int is_batchfile, int config_only, int argc, char **argv) { debug("dig_query_setup"); @@ -1909,7 +1908,7 @@ void dig_query_setup(isc_boolean_t is_batchfile, isc_boolean_t config_only, if (domainopt[0] != '\0') { set_search_domain(domainopt); - usesearch = ISC_TRUE; + usesearch = 1; } } @@ -1947,7 +1946,7 @@ main(int argc, char **argv) { return nslookup_main(argc, argv); dig_setup(argc, argv); - dig_query_setup(ISC_FALSE, ISC_FALSE, argc, argv); + dig_query_setup(0, 0, argc, argv); dig_startup(); dig_shutdown(); diff --git a/usr.bin/dig/dig.h b/usr.bin/dig/dig.h index 34a85fb27f3..ea4af6b51ad 100644 --- a/usr.bin/dig/dig.h +++ b/usr.bin/dig/dig.h @@ -23,7 +23,6 @@ #include <dst/dst.h> -#include <isc/boolean.h> #include <isc/buffer.h> #include <isc/list.h> #include <isc/sockaddr.h> @@ -76,7 +75,7 @@ typedef struct dig_searchlist dig_searchlist_t; /*% The dig_lookup structure */ struct dig_lookup { - isc_boolean_t + int pending, /*%< Pending a successful answer */ waiting_connect, doing_xfr, @@ -118,8 +117,8 @@ struct dig_lookup { dns_rdatatype_t rdtype; dns_rdatatype_t qrdtype; dns_rdataclass_t rdclass; - isc_boolean_t rdtypeset; - isc_boolean_t rdclassset; + int rdtypeset; + int rdclassset; char name_space[BUFSIZE]; char oname_space[BUFSIZE]; isc_buffer_t namebuf; @@ -160,7 +159,7 @@ struct dig_lookup { /*% The dig_query structure */ struct dig_query { dig_lookup_t *lookup; - isc_boolean_t waiting_connect, + int waiting_connect, pending_free, waiting_senddone, first_pass, @@ -174,7 +173,7 @@ struct dig_query { uint32_t second_rr_serial; uint32_t msg_count; uint32_t rr_count; - isc_boolean_t ixfr_axfr; + int ixfr_axfr; char *servname; char *userarg; isc_bufferlist_t sendlist, @@ -221,7 +220,7 @@ extern dig_serverlist_t root_hints_server_list; extern dig_searchlistlist_t search_list; extern unsigned int extrabytes; -extern isc_boolean_t check_ra, have_ipv4, have_ipv6, specified_source, +extern int check_ra, have_ipv4, have_ipv6, specified_source, usesearch, showsearch, qr; extern in_port_t port; extern unsigned int timeout; @@ -236,12 +235,12 @@ extern char keysecret[MXNAME]; extern dns_name_t *hmacname; extern unsigned int digestbits; extern dns_tsigkey_t *tsigkey; -extern isc_boolean_t validated; +extern int validated; extern isc_taskmgr_t *taskmgr; extern isc_task_t *global_task; -extern isc_boolean_t free_now; -extern isc_boolean_t debugging, debugtiming; -extern isc_boolean_t keep_open; +extern int free_now; +extern int debugging, debugtiming; +extern int keep_open; extern char *progname; extern int tries; @@ -260,8 +259,8 @@ int getaddresses(dig_lookup_t *lookup, const char *host, isc_result_t *resultp); isc_result_t -get_reverse(char *reverse, size_t len, char *value, isc_boolean_t ip6_int, - isc_boolean_t strict); +get_reverse(char *reverse, size_t len, char *value, int ip6_int, + int strict); __dead void fatal(const char *format, ...) @@ -273,7 +272,7 @@ debug(const char *format, ...) __attribute__((__format__(__printf__, 1, 2))); void check_result(isc_result_t result, const char *msg); -isc_boolean_t +int setup_lookup(dig_lookup_t *lookup); void @@ -295,7 +294,7 @@ void setup_libs(void); void -setup_system(isc_boolean_t ipv4only, isc_boolean_t ipv6only); +setup_system(int ipv4only, int ipv6only); isc_result_t parse_netprefix(isc_sockaddr_t **sap, const char *value); @@ -304,13 +303,13 @@ void parse_hmac(const char *hmacstr); dig_lookup_t * -requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers); +requeue_lookup(dig_lookup_t *lookold, int servers); dig_lookup_t * make_empty_lookup(void); dig_lookup_t * -clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers); +clone_lookup(dig_lookup_t *lookold, int servers); dig_server_t * make_server(const char *servname, const char *userarg); @@ -346,7 +345,7 @@ uelapsed(const struct timespec *t1, const struct timespec *t2); */ extern isc_result_t -(*dighost_printmessage)(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers); +(*dighost_printmessage)(dig_query_t *query, dns_message_t *msg, int headers); /*%< * Print the final result of the lookup. */ @@ -385,7 +384,7 @@ dig_setup(int argc, char **argv); * Call to supply new parameters for the next lookup */ void -dig_query_setup(isc_boolean_t, isc_boolean_t, int argc, char **argv); +dig_query_setup(int, int, int argc, char **argv); /*%< * set the main application event cycle running diff --git a/usr.bin/dig/dighost.c b/usr.bin/dig/dighost.c index 982e6236b83..eb775a489a4 100644 --- a/usr.bin/dig/dighost.c +++ b/usr.bin/dig/dighost.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dighost.c,v 1.28 2020/09/14 08:39:12 florian Exp $ */ +/* $Id: dighost.c,v 1.29 2020/09/14 08:40:43 florian Exp $ */ /*! \file * \note @@ -78,18 +78,18 @@ dig_serverlist_t server_list; dig_serverlist_t root_hints_server_list; dig_searchlistlist_t search_list; -isc_boolean_t - check_ra = ISC_FALSE, - have_ipv4 = ISC_TRUE, - have_ipv6 = ISC_TRUE, - specified_source = ISC_FALSE, - free_now = ISC_FALSE, - cancel_now = ISC_FALSE, - usesearch = ISC_FALSE, - showsearch = ISC_FALSE, - qr = ISC_FALSE, - is_dst_up = ISC_FALSE, - keep_open = ISC_FALSE; +int + check_ra = 0, + have_ipv4 = 1, + have_ipv6 = 1, + specified_source = 0, + free_now = 0, + cancel_now = 0, + usesearch = 0, + showsearch = 0, + qr = 0, + is_dst_up = 0, + keep_open = 0; in_port_t port = 53; unsigned int timeout = 0; unsigned int extrabytes; @@ -165,9 +165,9 @@ dns_name_t *hmacname = NULL; unsigned int digestbits = 0; isc_buffer_t *namebuf = NULL; dns_tsigkey_t *tsigkey = NULL; -isc_boolean_t validated = ISC_TRUE; -isc_boolean_t debugging = ISC_FALSE; -isc_boolean_t debugtiming = ISC_FALSE; +int validated = 1; +int debugging = 0; +int debugtiming = 0; char *progname = NULL; dig_lookup_t *current_lookup = NULL; @@ -177,7 +177,7 @@ dig_lookup_t *current_lookup = NULL; isc_result_t (*dighost_printmessage)(dig_query_t *query, dns_message_t *msg, - isc_boolean_t headers); + int headers); void (*dighost_received)(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query); @@ -203,12 +203,12 @@ static void connect_timeout(isc_task_t *task, isc_event_t *event); static void -launch_next_query(dig_query_t *query, isc_boolean_t include_question); +launch_next_query(dig_query_t *query, int include_question); static void check_next_lookup(dig_lookup_t *lookup); -static isc_boolean_t +static int next_origin(dig_lookup_t *oldlookup); char * @@ -305,8 +305,8 @@ reverse_octets(const char *in, char **p, char *end) { } isc_result_t -get_reverse(char *reverse, size_t len, char *value, isc_boolean_t ip6_int, - isc_boolean_t strict) +get_reverse(char *reverse, size_t len, char *value, int ip6_int, + int strict) { int r; isc_result_t result; @@ -641,65 +641,65 @@ make_empty_lookup(void) { if (looknew == NULL) fatal("memory allocation failure in %s:%d", __FILE__, __LINE__); - looknew->pending = ISC_TRUE; + looknew->pending = 1; looknew->textname[0] = 0; looknew->cmdline[0] = 0; looknew->rdtype = dns_rdatatype_a; looknew->qrdtype = dns_rdatatype_a; looknew->rdclass = dns_rdataclass_in; - looknew->rdtypeset = ISC_FALSE; - looknew->rdclassset = ISC_FALSE; + looknew->rdtypeset = 0; + looknew->rdclassset = 0; looknew->sendspace = NULL; looknew->sendmsg = NULL; looknew->name = NULL; looknew->oname = NULL; looknew->xfr_q = NULL; looknew->current_query = NULL; - looknew->doing_xfr = ISC_FALSE; + looknew->doing_xfr = 0; looknew->ixfr_serial = 0; - looknew->trace = ISC_FALSE; - looknew->trace_root = ISC_FALSE; - looknew->identify = ISC_FALSE; - looknew->identify_previous_line = ISC_FALSE; - looknew->ignore = ISC_FALSE; - looknew->servfail_stops = ISC_TRUE; - looknew->besteffort = ISC_TRUE; - looknew->dnssec = ISC_FALSE; + looknew->trace = 0; + looknew->trace_root = 0; + looknew->identify = 0; + looknew->identify_previous_line = 0; + looknew->ignore = 0; + looknew->servfail_stops = 1; + looknew->besteffort = 1; + looknew->dnssec = 0; looknew->ednsflags = 0; looknew->opcode = dns_opcode_query; - looknew->expire = ISC_FALSE; - looknew->nsid = ISC_FALSE; - looknew->idnout = ISC_FALSE; - looknew->sit = ISC_FALSE; + looknew->expire = 0; + looknew->nsid = 0; + looknew->idnout = 0; + looknew->sit = 0; looknew->udpsize = 0; looknew->edns = -1; - looknew->recurse = ISC_TRUE; - looknew->aaonly = ISC_FALSE; - looknew->adflag = ISC_FALSE; - looknew->cdflag = ISC_FALSE; - looknew->ns_search_only = ISC_FALSE; + looknew->recurse = 1; + looknew->aaonly = 0; + looknew->adflag = 0; + looknew->cdflag = 0; + looknew->ns_search_only = 0; looknew->origin = NULL; looknew->tsigctx = NULL; looknew->querysig = NULL; looknew->retries = tries; looknew->nsfound = 0; - looknew->tcp_mode = ISC_FALSE; - looknew->tcp_mode_set = ISC_FALSE; - looknew->ip6_int = ISC_FALSE; - looknew->comments = ISC_TRUE; - looknew->stats = ISC_TRUE; - looknew->section_question = ISC_TRUE; - looknew->section_answer = ISC_TRUE; - looknew->section_authority = ISC_TRUE; - looknew->section_additional = ISC_TRUE; - looknew->new_search = ISC_FALSE; - looknew->done_as_is = ISC_FALSE; - looknew->need_search = ISC_FALSE; + looknew->tcp_mode = 0; + looknew->tcp_mode_set = 0; + looknew->ip6_int = 0; + looknew->comments = 1; + looknew->stats = 1; + looknew->section_question = 1; + looknew->section_answer = 1; + looknew->section_authority = 1; + looknew->section_additional = 1; + looknew->new_search = 0; + looknew->done_as_is = 0; + looknew->need_search = 0; looknew->ecs_addr = NULL; looknew->sitvalue = NULL; looknew->ednsopts = NULL; looknew->ednsoptscnt = 0; - looknew->ednsneg = ISC_FALSE; + looknew->ednsneg = 0; looknew->eoferr = 0; dns_fixedname_init(&looknew->fdomain); ISC_LINK_INIT(looknew, link); @@ -752,7 +752,7 @@ cloneopts(dig_lookup_t *looknew, dig_lookup_t *lookold) { * list separately from somewhere else, or construct it by hand. */ dig_lookup_t * -clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers) { +clone_lookup(dig_lookup_t *lookold, int servers) { dig_lookup_t *looknew; debug("clone_lookup()"); @@ -841,7 +841,7 @@ clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers) { * queue getting run. */ dig_lookup_t * -requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers) { +requeue_lookup(dig_lookup_t *lookold, int servers) { dig_lookup_t *looknew; debug("requeue_lookup()"); @@ -897,7 +897,7 @@ setup_text_key(void) { goto failure; result = dns_tsigkey_create(&keyname, hmacname, secretstore, - (int)secretsize, ISC_FALSE, NULL, 0, 0, + (int)secretsize, 0, NULL, 0, 0, &tsigkey); failure: if (result != ISC_R_SUCCESS) @@ -930,8 +930,8 @@ parse_netprefix(isc_sockaddr_t **sap, const char *value) { struct in6_addr in6; uint32_t prefix_length = 0xffffffff; char *slash = NULL; - isc_boolean_t parsed = ISC_FALSE; - isc_boolean_t prefix_parsed = ISC_FALSE; + int parsed = 0; + int prefix_parsed = 0; char buf[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:XXX.XXX.XXX.XXX/128")]; const char *errstr; @@ -958,16 +958,16 @@ parse_netprefix(isc_sockaddr_t **sap, const char *value) { if (errstr != NULL) { fatal("prefix length is %s: '%s'", errstr, value); } - prefix_parsed = ISC_TRUE; + prefix_parsed = 1; } if (inet_pton(AF_INET6, buf, &in6) == 1) { - parsed = ISC_TRUE; + parsed = 1; isc_sockaddr_fromin6(sa, &in6, 0); if (prefix_length > 128) prefix_length = 128; } else if (inet_pton(AF_INET, buf, &in4) == 1) { - parsed = ISC_TRUE; + parsed = 1; isc_sockaddr_fromin(sa, &in4, 0); if (prefix_length > 32) prefix_length = 32; @@ -977,7 +977,7 @@ parse_netprefix(isc_sockaddr_t **sap, const char *value) { for (i = 0; i < 3 && strlen(buf) < sizeof(buf) - 2; i++) { strlcat(buf, ".0", sizeof(buf)); if (inet_pton(AF_INET, buf, &in4) == 1) { - parsed = ISC_TRUE; + parsed = 1; isc_sockaddr_fromin(sa, &in4, 0); break; } @@ -1153,7 +1153,7 @@ create_search_list(lwres_conf_t *confdata) { * settings. */ void -setup_system(isc_boolean_t ipv4only, isc_boolean_t ipv6only) { +setup_system(int ipv4only, int ipv6only) { dig_searchlist_t *domain = NULL; lwres_result_t lwresult; int lwresflags = 0; @@ -1162,14 +1162,14 @@ setup_system(isc_boolean_t ipv4only, isc_boolean_t ipv6only) { if (ipv4only) { if (have_ipv4) - have_ipv6 = ISC_FALSE; + have_ipv6 = 0; else fatal("can't find IPv4 networking"); } if (ipv6only) { if (have_ipv6) - have_ipv4 = ISC_FALSE; + have_ipv4 = 0; else fatal("can't find IPv6 networking"); } @@ -1280,7 +1280,7 @@ setup_libs(void) { result = dst_lib_init(); check_result(result, "dst_lib_init"); - is_dst_up = ISC_TRUE; + is_dst_up = 1; } typedef struct dig_ednsoptname { @@ -1311,7 +1311,7 @@ save_opt(dig_lookup_t *lookup, char *code, char *value) { isc_result_t result; uint32_t num = 0; isc_buffer_t b; - isc_boolean_t found = ISC_FALSE; + int found = 0; unsigned int i; const char *errstr; @@ -1321,7 +1321,7 @@ save_opt(dig_lookup_t *lookup, char *code, char *value) { for (i = 0; i < N_EDNS_OPTNAMES; i++) { if (strcasecmp(code, optnames[i].name) == 0) { num = optnames[i].code; - found = ISC_TRUE; + found = 1; break; } } @@ -1460,17 +1460,17 @@ clear_query(dig_query_t *query) { isc_buffer_invalidate(&query->recvbuf); isc_buffer_invalidate(&query->lengthbuf); if (query->waiting_senddone) - query->pending_free = ISC_TRUE; + query->pending_free = 1; else free(query); } /*% - * Try and clear out a lookup if we're done with it. Return ISC_TRUE if - * the lookup was successfully cleared. If ISC_TRUE is returned, the + * Try and clear out a lookup if we're done with it. Return 1 if + * the lookup was successfully cleared. If 1 is returned, the * lookup pointer has been invalidated. */ -static isc_boolean_t +static int try_clear_lookup(dig_lookup_t *lookup) { dig_query_t *q; @@ -1495,7 +1495,7 @@ try_clear_lookup(dig_lookup_t *lookup) { q = ISC_LIST_NEXT(q, clink); } } - return (ISC_FALSE); + return (0); } /* @@ -1503,7 +1503,7 @@ try_clear_lookup(dig_lookup_t *lookup) { * so can make it go away also. */ destroy_lookup(lookup); - return (ISC_TRUE); + return (1); } void @@ -1617,13 +1617,13 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section) dns_rdata_t rdata = DNS_RDATA_INIT; dns_name_t *name = NULL; isc_result_t result; - isc_boolean_t success = ISC_FALSE; + int success = 0; int numLookups = 0; int num; isc_result_t lresult, addresses_result; char bad_namestr[DNS_NAME_FORMATSIZE]; dns_name_t *domain; - isc_boolean_t horizontal = ISC_FALSE, bad = ISC_FALSE; + int horizontal = 0, bad = 0; INSIST(!free_now); @@ -1663,11 +1663,11 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section) if (namereln == dns_namereln_equal) { if (!horizontal) printf(";; BAD (HORIZONTAL) REFERRAL\n"); - horizontal = ISC_TRUE; + horizontal = 1; } else if (namereln != dns_namereln_subdomain) { if (!bad) printf(";; BAD REFERRAL\n"); - bad = ISC_TRUE; + bad = 1; continue; } } @@ -1693,22 +1693,22 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section) /* Initialize lookup if we've not yet */ debug("found NS %s", namestr); if (!success) { - success = ISC_TRUE; + success = 1; lookup_counter++; lookup = requeue_lookup(query->lookup, - ISC_FALSE); + 0); cancel_lookup(query->lookup); - lookup->doing_xfr = ISC_FALSE; + lookup->doing_xfr = 0; if (!lookup->trace_root && section == DNS_SECTION_ANSWER) - lookup->trace = ISC_FALSE; + lookup->trace = 0; else lookup->trace = query->lookup->trace; lookup->ns_search_only = query->lookup->ns_search_only; - lookup->trace_root = ISC_FALSE; + lookup->trace_root = 0; if (lookup->ns_search_only) - lookup->recurse = ISC_FALSE; + lookup->recurse = 0; domain = dns_fixedname_name(&lookup->fdomain); dns_name_copy(name, domain, NULL); } @@ -1773,9 +1773,9 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section) * Create and queue a new lookup using the next origin from the search * list, read in setup_system(). * - * Return ISC_TRUE iff there was another searchlist entry. + * Return 1 iff there was another searchlist entry. */ -static isc_boolean_t +static int next_origin(dig_lookup_t *oldlookup) { dig_lookup_t *newlookup; dig_searchlist_t *search; @@ -1793,7 +1793,7 @@ next_origin(dig_lookup_t *oldlookup) { * We're not using a search list, so don't even think * about finding the next entry. */ - return (ISC_FALSE); + return (0); /* * Check for a absolute name or ndots being met. @@ -1804,26 +1804,26 @@ next_origin(dig_lookup_t *oldlookup) { if (result == ISC_R_SUCCESS && (dns_name_isabsolute(name) || (int)dns_name_countlabels(name) > ndots)) - return (ISC_FALSE); + return (0); if (oldlookup->origin == NULL && !oldlookup->need_search) /* * Then we just did rootorg; there's nothing left. */ - return (ISC_FALSE); + return (0); if (oldlookup->origin == NULL && oldlookup->need_search) { - newlookup = requeue_lookup(oldlookup, ISC_TRUE); + newlookup = requeue_lookup(oldlookup, 1); newlookup->origin = ISC_LIST_HEAD(search_list); - newlookup->need_search = ISC_FALSE; + newlookup->need_search = 0; } else { search = ISC_LIST_NEXT(oldlookup->origin, link); if (search == NULL && oldlookup->done_as_is) - return (ISC_FALSE); - newlookup = requeue_lookup(oldlookup, ISC_TRUE); + return (0); + newlookup = requeue_lookup(oldlookup, 1); newlookup->origin = search; } cancel_lookup(oldlookup); - return (ISC_TRUE); + return (1); } /*% @@ -1922,7 +1922,7 @@ populate_root_hints(void) * well as the query structures and buffer space for the replies. If the * server list is empty, clone it from the system default list. */ -isc_boolean_t +int setup_lookup(dig_lookup_t *lookup) { isc_result_t result; uint32_t id; @@ -1979,11 +1979,11 @@ setup_lookup(dig_lookup_t *lookup) { if (lookup->new_search) { if ((count_dots(lookup->textname) >= ndots) || !usesearch) { lookup->origin = NULL; /* Force abs lookup */ - lookup->done_as_is = ISC_TRUE; + lookup->done_as_is = 1; lookup->need_search = usesearch; } else if (lookup->origin == NULL && usesearch) { lookup->origin = ISC_LIST_HEAD(search_list); - lookup->need_search = ISC_FALSE; + lookup->need_search = 0; } } @@ -2035,7 +2035,7 @@ setup_lookup(dig_lookup_t *lookup) { dns_message_puttempname(lookup->sendmsg, &lookup->oname); if (result == DNS_R_NAMETOOLONG) - return (ISC_FALSE); + return (0); fatal("'%s' is not in legal name syntax (%s)", lookup->textname, isc_result_totext(result)); @@ -2076,7 +2076,7 @@ setup_lookup(dig_lookup_t *lookup) { * it's meaningless for traces. */ if (lookup->trace || (lookup->ns_search_only && !lookup->trace_root)) - lookup->recurse = ISC_FALSE; + lookup->recurse = 0; if (lookup->recurse && lookup->rdtype != dns_rdatatype_axfr && @@ -2115,10 +2115,10 @@ setup_lookup(dig_lookup_t *lookup) { * Force TCP mode if we're doing an axfr. */ if (lookup->rdtype == dns_rdatatype_axfr) { - lookup->doing_xfr = ISC_TRUE; - lookup->tcp_mode = ISC_TRUE; + lookup->doing_xfr = 1; + lookup->tcp_mode = 1; } else if (lookup->tcp_mode) { - lookup->doing_xfr = ISC_TRUE; + lookup->doing_xfr = 1; } } @@ -2311,9 +2311,9 @@ setup_lookup(dig_lookup_t *lookup) { * Force TCP mode if the request is larger than 512 bytes. */ if (isc_buffer_usedlength(&lookup->renderbuf) > 512) - lookup->tcp_mode = ISC_TRUE; + lookup->tcp_mode = 1; - lookup->pending = ISC_FALSE; + lookup->pending = 0; for (serv = ISC_LIST_HEAD(lookup->my_server_list); serv != NULL; @@ -2326,16 +2326,16 @@ setup_lookup(dig_lookup_t *lookup) { query, lookup); query->lookup = lookup; query->timer = NULL; - query->waiting_connect = ISC_FALSE; - query->waiting_senddone = ISC_FALSE; - query->pending_free = ISC_FALSE; - query->recv_made = ISC_FALSE; - query->first_pass = ISC_TRUE; - query->first_soa_rcvd = ISC_FALSE; - query->second_rr_rcvd = ISC_FALSE; - query->first_repeat_rcvd = ISC_FALSE; - query->warn_id = ISC_TRUE; - query->timedout = ISC_FALSE; + query->waiting_connect = 0; + query->waiting_senddone = 0; + query->pending_free = 0; + query->recv_made = 0; + query->first_pass = 1; + query->first_soa_rcvd = 0; + query->second_rr_rcvd = 0; + query->first_repeat_rcvd = 0; + query->warn_id = 1; + query->timedout = 0; query->first_rr_serial = 0; query->second_rr_serial = 0; query->servname = serv->servername; @@ -2343,7 +2343,7 @@ setup_lookup(dig_lookup_t *lookup) { query->rr_count = 0; query->msg_count = 0; query->byte_count = 0; - query->ixfr_axfr = ISC_FALSE; + query->ixfr_axfr = 0; ISC_LIST_INIT(query->recvlist); ISC_LIST_INIT(query->lengthlist); query->sock = NULL; @@ -2365,9 +2365,9 @@ setup_lookup(dig_lookup_t *lookup) { if (!ISC_LIST_EMPTY(lookup->q) && qr) { extrabytes = 0; dighost_printmessage(ISC_LIST_HEAD(lookup->q), lookup->sendmsg, - ISC_TRUE); + 1); } - return (ISC_TRUE); + return (1); } /*% @@ -2398,7 +2398,7 @@ send_done(isc_task_t *_task, isc_event_t *event) { } query = event->ev_arg; - query->waiting_senddone = ISC_FALSE; + query->waiting_senddone = 0; l = query->lookup; if (l->ns_search_only && !l->trace_root && !l->tcp_mode) { @@ -2438,7 +2438,7 @@ cancel_lookup(dig_lookup_t *lookup) { } query = next; } - lookup->pending = ISC_FALSE; + lookup->pending = 0; lookup->retries = 0; } @@ -2515,7 +2515,7 @@ send_tcp_connect(dig_query_t *query) { debug("send_tcp_connect(%p)", query); l = query->lookup; - query->waiting_connect = ISC_TRUE; + query->waiting_connect = 1; query->lookup->current_query = query; result = get_address(query->servname, port, &query->sockaddr); if (result != ISC_R_SUCCESS) { @@ -2533,7 +2533,7 @@ send_tcp_connect(dig_query_t *query) { isc_sockaddr_pf(&bind_address))) { printf(";; Skipping server %s, incompatible " "address family\n", query->servname); - query->waiting_connect = ISC_FALSE; + query->waiting_connect = 0; if (ISC_LINK_LINKED(query, link)) next = ISC_LIST_NEXT(query, link); else @@ -2554,8 +2554,8 @@ send_tcp_connect(dig_query_t *query) { if (keep != NULL && isc_sockaddr_equal(&keepaddr, &query->sockaddr)) { sockcount++; isc_socket_attach(keep, &query->sock); - query->waiting_connect = ISC_FALSE; - launch_next_query(query, ISC_TRUE); + query->waiting_connect = 0; + launch_next_query(query, 1); goto search; } @@ -2629,7 +2629,7 @@ send_udp(dig_query_t *query) { debug("working on lookup %p, query %p", query->lookup, query); if (!query->recv_made) { /* XXX Check the sense of this, need assertion? */ - query->waiting_connect = ISC_FALSE; + query->waiting_connect = 0; result = get_address(query->servname, port, &query->sockaddr); if (result != ISC_R_SUCCESS) { /* This servname doesn't have an address. */ @@ -2653,7 +2653,7 @@ send_udp(dig_query_t *query) { } check_result(result, "isc_socket_bind"); - query->recv_made = ISC_TRUE; + query->recv_made = 1; ISC_LINK_INIT(&query->recvbuf, link); ISC_LIST_ENQUEUE(query->recvlist, &query->recvbuf, link); @@ -2671,7 +2671,7 @@ send_udp(dig_query_t *query) { debug("sending a request"); clock_gettime(CLOCK_MONOTONIC, &query->time_sent); INSIST(query->sock != NULL); - query->waiting_senddone = ISC_TRUE; + query->waiting_senddone = 1; result = isc_socket_sendtov2(query->sock, &query->sendlist, global_task, send_done, query, &query->sockaddr, NULL, @@ -2718,7 +2718,7 @@ connect_timeout(isc_task_t *task, isc_event_t *event) { } if (l->tcp_mode && query->sock != NULL) { - query->timedout = ISC_TRUE; + query->timedout = 1; isc_socket_cancel(query->sock, NULL, ISC_SOCKCANCEL_ALL); } @@ -2731,7 +2731,7 @@ connect_timeout(isc_task_t *task, isc_event_t *event) { debug("making new TCP request, %d tries left", l->retries); l->retries--; - requeue_lookup(l, ISC_TRUE); + requeue_lookup(l, 1); cancel_lookup(l); check_next_lookup(l); } @@ -2799,7 +2799,7 @@ tcp_length_done(isc_task_t *task, isc_event_t *event) { debug("sockcount=%d", sockcount); INSIST(sockcount >= 0); if (sevent->result == ISC_R_EOF && l->eoferr == 0U) { - n = requeue_lookup(l, ISC_TRUE); + n = requeue_lookup(l, 1); n->eoferr++; } isc_event_free(&event); @@ -2811,7 +2811,7 @@ tcp_length_done(isc_task_t *task, isc_event_t *event) { length = isc_buffer_getuint16(b); if (length == 0) { isc_event_free(&event); - launch_next_query(query, ISC_FALSE); + launch_next_query(query, 0); return; } @@ -2839,7 +2839,7 @@ tcp_length_done(isc_task_t *task, isc_event_t *event) { * launch the next recv. */ static void -launch_next_query(dig_query_t *query, isc_boolean_t include_question) { +launch_next_query(dig_query_t *query, int include_question) { isc_result_t result; dig_lookup_t *l; isc_buffer_t *buffer; @@ -2854,7 +2854,7 @@ launch_next_query(dig_query_t *query, isc_boolean_t include_question) { sockcount--; debug("sockcount=%d", sockcount); INSIST(sockcount >= 0); - query->waiting_connect = ISC_FALSE; + query->waiting_connect = 0; l = query->lookup; clear_query(query); check_next_lookup(l); @@ -2886,14 +2886,14 @@ launch_next_query(dig_query_t *query, isc_boolean_t include_question) { if (!query->first_soa_rcvd) { debug("sending a request in launch_next_query"); clock_gettime(CLOCK_MONOTONIC, &query->time_sent); - query->waiting_senddone = ISC_TRUE; + query->waiting_senddone = 1; result = isc_socket_sendv(query->sock, &query->sendlist, global_task, send_done, query); check_result(result, "isc_socket_sendv"); sendcount++; debug("sendcount=%d", sendcount); } - query->waiting_connect = ISC_FALSE; + query->waiting_connect = 0; return; } @@ -2921,7 +2921,7 @@ connect_done(isc_task_t *task, isc_event_t *event) { INSIST(query->waiting_connect); - query->waiting_connect = ISC_FALSE; + query->waiting_connect = 0; if (sevent->result == ISC_R_CANCELED) { debug("in cancel handler"); @@ -2935,7 +2935,7 @@ connect_done(isc_task_t *task, isc_event_t *event) { INSIST(sockcount > 0); sockcount--; debug("sockcount=%d", sockcount); - query->waiting_connect = ISC_FALSE; + query->waiting_connect = 0; isc_event_free(&event); l = query->lookup; clear_query(query); @@ -2959,7 +2959,7 @@ connect_done(isc_task_t *task, isc_event_t *event) { if (exitcode < 9) exitcode = 9; debug("sockcount=%d", sockcount); - query->waiting_connect = ISC_FALSE; + query->waiting_connect = 0; isc_event_free(&event); l = query->lookup; if ((l->current_query != NULL) && @@ -2981,7 +2981,7 @@ connect_done(isc_task_t *task, isc_event_t *event) { isc_socket_attach(query->sock, &keep); keepaddr = query->sockaddr; } - launch_next_query(query, ISC_TRUE); + launch_next_query(query, 1); isc_event_free(&event); } @@ -2989,9 +2989,9 @@ connect_done(isc_task_t *task, isc_event_t *event) { * Check if the ongoing XFR needs more data before it's complete, using * the semantics of IXFR and AXFR protocols. Much of the complexity of * this routine comes from determining when an IXFR is complete. - * ISC_FALSE means more data is on the way, and the recv has been issued. + * 0 means more data is on the way, and the recv has been issued. */ -static isc_boolean_t +static int check_for_more_data(dig_query_t *query, dns_message_t *msg, isc_socketevent_t *sevent) { @@ -3000,8 +3000,8 @@ check_for_more_data(dig_query_t *query, dns_message_t *msg, dns_rdata_soa_t soa; uint32_t ixfr_serial = query->lookup->ixfr_serial, serial; isc_result_t result; - isc_boolean_t ixfr = query->lookup->rdtype == dns_rdatatype_ixfr; - isc_boolean_t axfr = query->lookup->rdtype == dns_rdatatype_axfr; + int ixfr = query->lookup->rdtype == dns_rdatatype_ixfr; + int axfr = query->lookup->rdtype == dns_rdatatype_axfr; if (ixfr) axfr = query->ixfr_axfr; @@ -3022,7 +3022,7 @@ check_for_more_data(dig_query_t *query, dns_message_t *msg, result = dns_message_firstname(msg, DNS_SECTION_ANSWER); if (result != ISC_R_SUCCESS) { puts("; Transfer failed."); - return (ISC_TRUE); + return (1); } do { dns_name_t *name; @@ -3047,14 +3047,14 @@ check_for_more_data(dig_query_t *query, dns_message_t *msg, (rdata.type != dns_rdatatype_soa)) { puts("; Transfer failed. " "Didn't start with SOA answer."); - return (ISC_TRUE); + return (1); } if ((!query->second_rr_rcvd) && (rdata.type != dns_rdatatype_soa)) { - query->second_rr_rcvd = ISC_TRUE; + query->second_rr_rcvd = 1; query->second_rr_serial = 0; debug("got the second rr as nonsoa"); - axfr = query->ixfr_axfr = ISC_TRUE; + axfr = query->ixfr_axfr = 1; goto next_rdata; } @@ -3072,7 +3072,7 @@ check_for_more_data(dig_query_t *query, dns_message_t *msg, serial = soa.serial; dns_rdata_freestruct_soa(&soa); if (!query->first_soa_rcvd) { - query->first_soa_rcvd = ISC_TRUE; + query->first_soa_rcvd = 1; query->first_rr_serial = serial; debug("this is the first serial %u", serial); @@ -3096,7 +3096,7 @@ check_for_more_data(dig_query_t *query, dns_message_t *msg, } debug("this is the second serial %u", serial); - query->second_rr_rcvd = ISC_TRUE; + query->second_rr_rcvd = 1; query->second_rr_serial = serial; goto next_rdata; } @@ -3109,7 +3109,7 @@ check_for_more_data(dig_query_t *query, dns_message_t *msg, debug("got a match for ixfr"); if (!query->first_repeat_rcvd) { query->first_repeat_rcvd = - ISC_TRUE; + 1; goto next_rdata; } debug("done with ixfr"); @@ -3122,11 +3122,11 @@ check_for_more_data(dig_query_t *query, dns_message_t *msg, } result = dns_message_nextname(msg, DNS_SECTION_ANSWER); } while (result == ISC_R_SUCCESS); - launch_next_query(query, ISC_FALSE); - return (ISC_FALSE); + launch_next_query(query, 0); + return (0); doexit: dighost_received(sevent->n, &sevent->address, query); - return (ISC_TRUE); + return (1); } static void @@ -3137,7 +3137,7 @@ process_sit(dig_lookup_t *l, dns_message_t *msg, isc_buffer_t hexbuf; size_t len; const unsigned char *sit; - isc_boolean_t copysit; + int copysit; isc_result_t result; if (l->sitvalue != NULL) { @@ -3146,11 +3146,11 @@ process_sit(dig_lookup_t *l, dns_message_t *msg, check_result(result, "isc_hex_decodestring"); sit = isc_buffer_base(&hexbuf); len = isc_buffer_usedlength(&hexbuf); - copysit = ISC_FALSE; + copysit = 0; } else { sit = cookie; len = sizeof(cookie); - copysit = ISC_TRUE; + copysit = 1; } INSIST(msg->sitok == 0 && msg->sitbad == 0); @@ -3160,12 +3160,12 @@ process_sit(dig_lookup_t *l, dns_message_t *msg, } else { printf(";; Warning: SIT client cookie mismatch\n"); msg->sitbad = 1; - copysit = ISC_FALSE; + copysit = 0; } } else { printf(";; Warning: SIT bad token (too short)\n"); msg->sitbad = 1; - copysit = ISC_FALSE; + copysit = 0; } if (copysit) { isc_region_t r; @@ -3190,7 +3190,7 @@ process_opt(dig_lookup_t *l, dns_message_t *msg) { isc_buffer_t optbuf; uint16_t optcode, optlen; dns_rdataset_t *opt = msg->opt; - isc_boolean_t seen_cookie = ISC_FALSE; + int seen_cookie = 0; result = dns_rdataset_first(opt); if (result == ISC_R_SUCCESS) { @@ -3211,7 +3211,7 @@ process_opt(dig_lookup_t *l, dns_message_t *msg) { break; } process_sit(l, msg, &optbuf, optlen); - seen_cookie = ISC_TRUE; + seen_cookie = 1; break; default: isc_buffer_forward(&optbuf, optlen); @@ -3238,8 +3238,8 @@ recv_done(isc_task_t *task, isc_event_t *event) { dns_message_t *msg = NULL; isc_result_t result; dig_lookup_t *n, *l; - isc_boolean_t docancel = ISC_FALSE; - isc_boolean_t match = ISC_TRUE; + int docancel = 0; + int match = 1; unsigned int parseflags; dns_messageid_t id; unsigned int msgflags; @@ -3272,7 +3272,7 @@ recv_done(isc_task_t *task, isc_event_t *event) { if ((!l->pending && !l->ns_search_only) || cancel_now) { debug("no longer pending. Got %s", isc_result_totext(sevent->result)); - query->waiting_connect = ISC_FALSE; + query->waiting_connect = 0; isc_event_free(&event); clear_query(query); @@ -3283,7 +3283,7 @@ recv_done(isc_task_t *task, isc_event_t *event) { if (sevent->result != ISC_R_SUCCESS) { if (sevent->result == ISC_R_CANCELED) { debug("in recv cancel handler"); - query->waiting_connect = ISC_FALSE; + query->waiting_connect = 0; } else { printf(";; communications error: %s\n", isc_result_totext(sevent->result)); @@ -3295,7 +3295,7 @@ recv_done(isc_task_t *task, isc_event_t *event) { INSIST(sockcount >= 0); } if (sevent->result == ISC_R_EOF && l->eoferr == 0U) { - n = requeue_lookup(l, ISC_TRUE); + n = requeue_lookup(l, 1); n->eoferr++; } isc_event_free(&event); @@ -3335,15 +3335,15 @@ recv_done(isc_task_t *task, isc_event_t *event) { sizeof(buf2)); printf(";; reply from unexpected source: %s," " expected %s\n", buf1, buf2); - match = ISC_FALSE; + match = 0; } } result = dns_message_peekheader(b, &id, &msgflags); if (result != ISC_R_SUCCESS || l->sendmsg->id != id) { - match = ISC_FALSE; + match = 0; if (l->tcp_mode) { - isc_boolean_t fail = ISC_TRUE; + int fail = 1; if (result == ISC_R_SUCCESS) { if (!query->first_soa_rcvd || query->warn_id) @@ -3353,8 +3353,8 @@ recv_done(isc_task_t *task, isc_event_t *event) { "WARNING" : "ERROR", l->sendmsg->id, id); if (query->first_soa_rcvd) - fail = ISC_FALSE; - query->warn_id = ISC_FALSE; + fail = 0; + query->warn_id = 0; } else printf(";; ERROR: short " "(< header size) message\n"); @@ -3365,7 +3365,7 @@ recv_done(isc_task_t *task, isc_event_t *event) { check_next_lookup(l); return; } - match = ISC_TRUE; + match = 1; } else if (result == ISC_R_SUCCESS) printf(";; Warning: ID mismatch: " "expected ID %u, got %u\n", l->sendmsg->id, id); @@ -3416,7 +3416,7 @@ recv_done(isc_task_t *task, isc_event_t *event) { if (result != ISC_R_SUCCESS) { printf(";; Got bad packet: %s\n", isc_result_totext(result)); hex_dump(b); - query->waiting_connect = ISC_FALSE; + query->waiting_connect = 0; dns_message_destroy(&msg); isc_event_free(&event); clear_query(query); @@ -3425,7 +3425,7 @@ recv_done(isc_task_t *task, isc_event_t *event) { return; } if (msg->counts[DNS_SECTION_QUESTION] != 0) { - match = ISC_TRUE; + match = 1; for (result = dns_message_firstname(msg, DNS_SECTION_QUESTION); result == ISC_R_SUCCESS && match; result = dns_message_nextname(msg, DNS_SECTION_QUESTION)) { @@ -3454,7 +3454,7 @@ recv_done(isc_task_t *task, isc_event_t *event) { printf(";; Question section mismatch: " "got %s/%s/%s\n", namestr, typebuf, classbuf); - match = ISC_FALSE; + match = 0; } } } @@ -3479,7 +3479,7 @@ recv_done(isc_task_t *task, isc_event_t *event) { printf(";; BADVERS, retrying with EDNS version %u.\n", (unsigned int)newedns); l->edns = newedns; - n = requeue_lookup(l, ISC_TRUE); + n = requeue_lookup(l, 1); if (l->trace && l->trace_root) n->rdtype = l->qrdtype; dns_message_destroy(&msg); @@ -3495,8 +3495,8 @@ recv_done(isc_task_t *task, isc_event_t *event) { process_opt(l, msg); if (l->comments) printf(";; Truncated, retrying in TCP mode.\n"); - n = requeue_lookup(l, ISC_TRUE); - n->tcp_mode = ISC_TRUE; + n = requeue_lookup(l, 1); + n->tcp_mode = 1; if (l->trace && l->trace_root) n->rdtype = l->qrdtype; dns_message_destroy(&msg); @@ -3546,7 +3546,7 @@ recv_done(isc_task_t *task, isc_event_t *event) { if (result != ISC_R_SUCCESS) { printf(";; Couldn't verify signature: %s\n", isc_result_totext(result)); - validated = ISC_FALSE; + validated = 0; } l->tsigctx = msg->tsigctx; msg->tsigctx = NULL; @@ -3587,7 +3587,7 @@ recv_done(isc_task_t *task, isc_event_t *event) { l->interval.tv_nsec = 0; result = isc_timer_reset(query->timer, &l->interval, - ISC_FALSE); + 0); check_result(result, "isc_timer_reset"); } } @@ -3604,18 +3604,18 @@ recv_done(isc_task_t *task, isc_event_t *event) { if (msg->rcode == dns_rcode_nxdomain && (l->origin != NULL || l->need_search)) { if (!next_origin(query->lookup) || showsearch) { - dighost_printmessage(query, msg, ISC_TRUE); + dighost_printmessage(query, msg, 1); dighost_received(b->used, &sevent->address, query); } } else if (!l->trace && !l->ns_search_only) { - dighost_printmessage(query, msg, ISC_TRUE); + dighost_printmessage(query, msg, 1); } else if (l->trace) { int nl = 0; int count = msg->counts[DNS_SECTION_ANSWER]; debug("in TRACE code"); if (!l->ns_search_only) - dighost_printmessage(query, msg, ISC_TRUE); + dighost_printmessage(query, msg, 1); l->rdtype = l->qrdtype; if (l->trace_root || (l->ns_search_only && count > 0)) { @@ -3623,12 +3623,12 @@ recv_done(isc_task_t *task, isc_event_t *event) { l->rdtype = dns_rdatatype_soa; nl = followup_lookup(msg, query, DNS_SECTION_ANSWER); - l->trace_root = ISC_FALSE; + l->trace_root = 0; } else if (count == 0) nl = followup_lookup(msg, query, DNS_SECTION_AUTHORITY); if (nl == 0) - docancel = ISC_TRUE; + docancel = 1; } else { debug("in NSSEARCH code"); @@ -3642,11 +3642,11 @@ recv_done(isc_task_t *task, isc_event_t *event) { nl = followup_lookup(msg, query, DNS_SECTION_ANSWER); if (nl == 0) - docancel = ISC_TRUE; - l->trace_root = ISC_FALSE; - usesearch = ISC_FALSE; + docancel = 1; + l->trace_root = 0; + usesearch = 0; } else - dighost_printmessage(query, msg, ISC_TRUE); + dighost_printmessage(query, msg, 1); } } @@ -3656,7 +3656,7 @@ recv_done(isc_task_t *task, isc_event_t *event) { if (query != l->xfr_q) { dns_message_destroy(&msg); isc_event_free(&event); - query->waiting_connect = ISC_FALSE; + query->waiting_connect = 0; return; } if (!docancel) @@ -3675,7 +3675,7 @@ recv_done(isc_task_t *task, isc_event_t *event) { } if (!query->lookup->ns_search_only) - query->lookup->pending = ISC_FALSE; + query->lookup->pending = 0; if (!query->lookup->ns_search_only || query->lookup->trace_root || docancel) { dns_message_destroy(&msg); @@ -3762,7 +3762,7 @@ do_lookup(dig_lookup_t *lookup) { REQUIRE(lookup != NULL); debug("do_lookup()"); - lookup->pending = ISC_TRUE; + lookup->pending = 1; query = ISC_LIST_HEAD(lookup->q); if (query != NULL) { if (lookup->tcp_mode) @@ -3797,7 +3797,7 @@ cancel_all(void) { if (free_now) { return; } - cancel_now = ISC_TRUE; + cancel_now = 1; if (current_lookup != NULL) { for (q = ISC_LIST_HEAD(current_lookup->q); q != NULL; @@ -3865,7 +3865,7 @@ destroy_libs(void) { INSIST(current_lookup == NULL); INSIST(!free_now); - free_now = ISC_TRUE; + free_now = 1; lwres_conf_clear(lwconf); @@ -3891,7 +3891,7 @@ destroy_libs(void) { if (is_dst_up) { debug("destroy DST lib"); dst_lib_destroy(); - is_dst_up = ISC_FALSE; + is_dst_up = 0; } debug("Removing log context"); diff --git a/usr.bin/dig/host.c b/usr.bin/dig/host.c index 374ed4607a3..d5eeb404410 100644 --- a/usr.bin/dig/host.c +++ b/usr.bin/dig/host.c @@ -39,13 +39,13 @@ #include "dig.h" -static isc_boolean_t short_form = ISC_TRUE, listed_server = ISC_FALSE; -static isc_boolean_t default_lookups = ISC_TRUE; +static int short_form = 1, listed_server = 0; +static int default_lookups = 1; static int seen_error = -1; -static isc_boolean_t list_addresses = ISC_TRUE; +static int list_addresses = 1; static dns_rdatatype_t list_type = dns_rdatatype_a; -static isc_boolean_t printed_server = ISC_FALSE; -static isc_boolean_t ipv4only = ISC_FALSE, ipv6only = ISC_FALSE; +static int printed_server = 0; +static int ipv4only = 0, ipv6only = 0; static const char *opcodetext[] = { "QUERY", @@ -199,7 +199,7 @@ say_message(dns_name_t *name, const char *msg, dns_rdata_t *rdata, } static isc_result_t printsection(dns_message_t *msg, dns_section_t sectionid, - const char *section_name, isc_boolean_t headers, + const char *section_name, int headers, dig_query_t *query) { dns_name_t *name, *print_name; @@ -210,13 +210,13 @@ printsection(dns_message_t *msg, dns_section_t sectionid, isc_region_t r; dns_name_t empty_name; char tbuf[4096]; - isc_boolean_t first; - isc_boolean_t no_rdata; + int first; + int no_rdata; if (sectionid == DNS_SECTION_QUESTION) - no_rdata = ISC_TRUE; + no_rdata = 1; else - no_rdata = ISC_FALSE; + no_rdata = 0; if (headers) printf(";; %s SECTION:\n", section_name); @@ -234,7 +234,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid, dns_message_currentname(msg, sectionid, &name); isc_buffer_init(&target, tbuf, sizeof(tbuf)); - first = ISC_TRUE; + first = 1; print_name = name; for (rdataset = ISC_LIST_HEAD(name->list); @@ -253,7 +253,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid, if (!short_form) { result = dns_rdataset_totext(rdataset, print_name, - ISC_FALSE, + 0, no_rdata, &target); if (result != ISC_R_SUCCESS) @@ -312,7 +312,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid, static isc_result_t printrdata(dns_message_t *msg, dns_rdataset_t *rdataset, dns_name_t *owner, - const char *set_name, isc_boolean_t headers) + const char *set_name, int headers) { isc_buffer_t target; isc_result_t result; @@ -325,7 +325,7 @@ printrdata(dns_message_t *msg, dns_rdataset_t *rdataset, dns_name_t *owner, isc_buffer_init(&target, tbuf, sizeof(tbuf)); - result = dns_rdataset_totext(rdataset, owner, ISC_FALSE, ISC_FALSE, + result = dns_rdataset_totext(rdataset, owner, 0, 0, &target); if (result != ISC_R_SUCCESS) return (result); @@ -362,8 +362,8 @@ chase_cnamechain(dns_message_t *msg, dns_name_t *qname) { } static isc_result_t -printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { - isc_boolean_t did_flag = ISC_FALSE; +printmessage(dig_query_t *query, dns_message_t *msg, int headers) { + int did_flag = 0; dns_rdataset_t *opt, *tsig = NULL; dns_name_t *tsigname; isc_result_t result = ISC_R_SUCCESS; @@ -386,7 +386,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { sizeof(sockstr)); printf("Address: %s\n", sockstr); printf("Aliases: \n\n"); - printed_server = ISC_TRUE; + printed_server = 1; } if (msg->rcode != 0) { @@ -419,22 +419,22 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { dns_name_copy(query->lookup->name, name, NULL); chase_cnamechain(msg, name); dns_name_format(name, namestr, sizeof(namestr)); - lookup = clone_lookup(query->lookup, ISC_FALSE); + lookup = clone_lookup(query->lookup, 0); if (lookup != NULL) { strlcpy(lookup->textname, namestr, sizeof(lookup->textname)); lookup->rdtype = dns_rdatatype_aaaa; - lookup->rdtypeset = ISC_TRUE; + lookup->rdtypeset = 1; lookup->origin = NULL; lookup->retries = tries; ISC_LIST_APPEND(lookup_list, lookup, link); } - lookup = clone_lookup(query->lookup, ISC_FALSE); + lookup = clone_lookup(query->lookup, 0); if (lookup != NULL) { strlcpy(lookup->textname, namestr, sizeof(lookup->textname)); lookup->rdtype = dns_rdatatype_mx; - lookup->rdtypeset = ISC_TRUE; + lookup->rdtypeset = 1; lookup->origin = NULL; lookup->retries = tries; ISC_LIST_APPEND(lookup_list, lookup, link); @@ -448,31 +448,31 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { printf(";; flags: "); if ((msg->flags & DNS_MESSAGEFLAG_QR) != 0) { printf("qr"); - did_flag = ISC_TRUE; + did_flag = 1; } if ((msg->flags & DNS_MESSAGEFLAG_AA) != 0) { printf("%saa", did_flag ? " " : ""); - did_flag = ISC_TRUE; + did_flag = 1; } if ((msg->flags & DNS_MESSAGEFLAG_TC) != 0) { printf("%stc", did_flag ? " " : ""); - did_flag = ISC_TRUE; + did_flag = 1; } if ((msg->flags & DNS_MESSAGEFLAG_RD) != 0) { printf("%srd", did_flag ? " " : ""); - did_flag = ISC_TRUE; + did_flag = 1; } if ((msg->flags & DNS_MESSAGEFLAG_RA) != 0) { printf("%sra", did_flag ? " " : ""); - did_flag = ISC_TRUE; + did_flag = 1; } if ((msg->flags & DNS_MESSAGEFLAG_AD) != 0) { printf("%sad", did_flag ? " " : ""); - did_flag = ISC_TRUE; + did_flag = 1; } if ((msg->flags & DNS_MESSAGEFLAG_CD) != 0) { printf("%scd", did_flag ? " " : ""); - did_flag = ISC_TRUE; + did_flag = 1; POST(did_flag); } printf("; QUERY: %u, ANSWER: %u, " @@ -495,7 +495,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { !short_form) { printf("\n"); result = printsection(msg, DNS_SECTION_QUESTION, "QUESTION", - ISC_TRUE, query); + 1, query); if (result != ISC_R_SUCCESS) return (result); } @@ -503,7 +503,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { if (!short_form) printf("\n"); result = printsection(msg, DNS_SECTION_ANSWER, "ANSWER", - ISC_TF(!short_form), query); + !short_form, query); if (result != ISC_R_SUCCESS) return (result); } @@ -512,7 +512,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { !short_form) { printf("\n"); result = printsection(msg, DNS_SECTION_AUTHORITY, "AUTHORITY", - ISC_TRUE, query); + 1, query); if (result != ISC_R_SUCCESS) return (result); } @@ -520,14 +520,14 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { !short_form) { printf("\n"); result = printsection(msg, DNS_SECTION_ADDITIONAL, - "ADDITIONAL", ISC_TRUE, query); + "ADDITIONAL", 1, query); if (result != ISC_R_SUCCESS) return (result); } if ((tsig != NULL) && !short_form) { printf("\n"); result = printrdata(msg, tsig, tsigname, - "PSEUDOSECTION TSIG", ISC_TRUE); + "PSEUDOSECTION TSIG", 1); if (result != ISC_R_SUCCESS) return (result); } @@ -564,12 +564,12 @@ pre_parse_args(int argc, char **argv) { case '4': if (ipv6only) fatal("only one of -4 and -6 allowed"); - ipv4only = ISC_TRUE; + ipv4only = 1; break; case '6': if (ipv4only) fatal("only one of -4 and -6 allowed"); - ipv6only = ISC_TRUE; + ipv6only = 1; break; case 'a': break; case 'c': break; @@ -589,8 +589,8 @@ pre_parse_args(int argc, char **argv) { case 'C': break; case 'D': if (debugging) - debugtiming = ISC_TRUE; - debugging = ISC_TRUE; + debugtiming = 1; + debugging = 1; break; case 'N': break; case 'R': break; @@ -619,23 +619,23 @@ parse_args(int argc, char **argv) { lookup = make_empty_lookup(); - lookup->servfail_stops = ISC_FALSE; - lookup->comments = ISC_FALSE; + lookup->servfail_stops = 0; + lookup->comments = 0; while ((c = getopt(argc, argv, optstring)) != -1) { switch (c) { case 'l': - lookup->tcp_mode = ISC_TRUE; + lookup->tcp_mode = 1; lookup->rdtype = dns_rdatatype_axfr; - lookup->rdtypeset = ISC_TRUE; + lookup->rdtypeset = 1; fatalexit = 3; break; case 'v': case 'd': - short_form = ISC_FALSE; + short_form = 0; break; case 'r': - lookup->recurse = ISC_FALSE; + lookup->recurse = 0; break; case 't': if (strncasecmp(optarg, "ixfr=", 5) == 0) { @@ -658,20 +658,20 @@ parse_args(int argc, char **argv) { if (!lookup->rdtypeset || lookup->rdtype != dns_rdatatype_axfr) lookup->rdtype = rdtype; - lookup->rdtypeset = ISC_TRUE; + lookup->rdtypeset = 1; if (rdtype == dns_rdatatype_axfr) { /* -l -t any -v */ list_type = dns_rdatatype_any; - short_form = ISC_FALSE; - lookup->tcp_mode = ISC_TRUE; + short_form = 0; + lookup->tcp_mode = 1; } else if (rdtype == dns_rdatatype_ixfr) { lookup->ixfr_serial = serial; - lookup->tcp_mode = ISC_TRUE; + lookup->tcp_mode = 1; list_type = rdtype; } else list_type = rdtype; - list_addresses = ISC_FALSE; - default_lookups = ISC_FALSE; + list_addresses = 0; + default_lookups = 0; break; case 'c': tr.base = optarg; @@ -684,22 +684,22 @@ parse_args(int argc, char **argv) { fatal("invalid class: %s\n", optarg); } else { lookup->rdclass = rdclass; - lookup->rdclassset = ISC_TRUE; + lookup->rdclassset = 1; } - default_lookups = ISC_FALSE; + default_lookups = 0; break; case 'a': if (!lookup->rdtypeset || lookup->rdtype != dns_rdatatype_axfr) lookup->rdtype = dns_rdatatype_any; list_type = dns_rdatatype_any; - list_addresses = ISC_FALSE; - lookup->rdtypeset = ISC_TRUE; - short_form = ISC_FALSE; - default_lookups = ISC_FALSE; + list_addresses = 0; + lookup->rdtypeset = 1; + short_form = 0; + default_lookups = 0; break; case 'i': - lookup->ip6_int = ISC_TRUE; + lookup->ip6_int = 1; break; case 'n': /* deprecated */ @@ -730,18 +730,18 @@ parse_args(int argc, char **argv) { tries = 2; break; case 'T': - lookup->tcp_mode = ISC_TRUE; + lookup->tcp_mode = 1; break; case 'C': debug("showing all SOAs"); lookup->rdtype = dns_rdatatype_ns; - lookup->rdtypeset = ISC_TRUE; + lookup->rdtypeset = 1; lookup->rdclass = dns_rdataclass_in; - lookup->rdclassset = ISC_TRUE; - lookup->ns_search_only = ISC_TRUE; - lookup->trace_root = ISC_TRUE; - lookup->identify_previous_line = ISC_TRUE; - default_lookups = ISC_FALSE; + lookup->rdclassset = 1; + lookup->ns_search_only = 1; + lookup->trace_root = 1; + lookup->identify_previous_line = 1; + default_lookups = 0; break; case 'N': debug("setting NDOTS to %s", optarg); @@ -759,7 +759,7 @@ parse_args(int argc, char **argv) { /* Handled by pre_parse_args(). */ break; case 's': - lookup->servfail_stops = ISC_TRUE; + lookup->servfail_stops = 1; break; default: show_usage(); @@ -783,22 +783,22 @@ parse_args(int argc, char **argv) { fatal("couldn't get address for '%s': %s", argv[1], isc_result_totext(res)); debug("server is %s", *argv + 1); - listed_server = ISC_TRUE; + listed_server = 1; } else - check_ra = ISC_TRUE; + check_ra = 1; - lookup->pending = ISC_FALSE; + lookup->pending = 0; if (get_reverse(store, sizeof(store), hostname, - lookup->ip6_int, ISC_TRUE) == ISC_R_SUCCESS) { + lookup->ip6_int, 1) == ISC_R_SUCCESS) { strlcpy(lookup->textname, store, sizeof(lookup->textname)); lookup->rdtype = dns_rdatatype_ptr; - lookup->rdtypeset = ISC_TRUE; - default_lookups = ISC_FALSE; + lookup->rdtypeset = 1; + default_lookups = 0; } else { strlcpy(lookup->textname, hostname, sizeof(lookup->textname)); - usesearch = ISC_TRUE; + usesearch = 1; } - lookup->new_search = ISC_TRUE; + lookup->new_search = 1; ISC_LIST_APPEND(lookup_list, lookup, link); } diff --git a/usr.bin/dig/lib/dns/compress.c b/usr.bin/dig/lib/dns/compress.c index 9d1f154f45b..d52d7300262 100644 --- a/usr.bin/dig/lib/dns/compress.c +++ b/usr.bin/dig/lib/dns/compress.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: compress.c,v 1.5 2020/02/18 18:11:27 florian Exp $ */ +/* $Id: compress.c,v 1.6 2020/09/14 08:40:43 florian Exp $ */ /*! \file */ @@ -82,10 +82,10 @@ do { \ /* * Find the longest match of name in the table. - * If match is found return ISC_TRUE. prefix, suffix and offset are updated. - * If no match is found return ISC_FALSE. + * If match is found return 1. prefix, suffix and offset are updated. + * If no match is found return 0. */ -isc_boolean_t +int dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name, dns_name_t *prefix, uint16_t *offset) { @@ -93,11 +93,11 @@ dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name, dns_compressnode_t *node = NULL; unsigned int labels, hash, n; - REQUIRE(dns_name_isabsolute(name) == ISC_TRUE); + REQUIRE(dns_name_isabsolute(name)); REQUIRE(offset != NULL); if (cctx->count == 0) - return (ISC_FALSE); + return (0); labels = dns_name_countlabels(name); INSIST(labels > 0); @@ -107,7 +107,7 @@ dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name, for (n = 0; n < labels - 1; n++) { dns_name_getlabelsequence(name, n, labels - n, &tname); - hash = dns_name_hash(&tname, ISC_FALSE) % + hash = dns_name_hash(&tname, 0) % DNS_COMPRESS_TABLESIZE; for (node = cctx->table[hash]; node != NULL; node = node->next) { @@ -128,7 +128,7 @@ dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name, * If node == NULL, we found no match at all. */ if (node == NULL) - return (ISC_FALSE); + return (0); if (n == 0) dns_name_reset(prefix); @@ -136,7 +136,7 @@ dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name, dns_name_getlabelsequence(name, 0, n, prefix); *offset = node->offset; - return (ISC_TRUE); + return (1); } void @@ -167,7 +167,7 @@ dns_compress_add(dns_compress_t *cctx, const dns_name_t *name, if (offset >= 0x4000) break; dns_name_getlabelsequence(name, start, n, &tname); - hash = dns_name_hash(&tname, ISC_FALSE) % + hash = dns_name_hash(&tname, 0) % DNS_COMPRESS_TABLESIZE; tlength = tname.length; toffset = (uint16_t)(offset + (length - tlength)); diff --git a/usr.bin/dig/lib/dns/dns_result.c b/usr.bin/dig/lib/dns/dns_result.c index 7d8d46982a7..05ec805b4c3 100644 --- a/usr.bin/dig/lib/dns/dns_result.c +++ b/usr.bin/dig/lib/dns/dns_result.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dns_result.c,v 1.4 2020/02/23 19:54:25 jung Exp $ */ +/* $Id: dns_result.c,v 1.5 2020/09/14 08:40:43 florian Exp $ */ /*! \file */ #include <isc/util.h> @@ -195,7 +195,7 @@ static const char *rcode_text[DNS_R_NRCODERESULTS] = { #define DNS_RESULT_RESULTSET 2 #define DNS_RESULT_RCODERESULTSET 3 -static isc_boolean_t once = ISC_FALSE; +static int once = 0; static void initialize_action(void) { @@ -216,7 +216,7 @@ initialize_action(void) { static void initialize(void) { if (!once) { - once = ISC_TRUE; + once = 1; initialize_action(); } } diff --git a/usr.bin/dig/lib/dns/dst_api.c b/usr.bin/dig/lib/dns/dst_api.c index fcce2293afd..6d2301a69cb 100644 --- a/usr.bin/dig/lib/dns/dst_api.c +++ b/usr.bin/dig/lib/dns/dst_api.c @@ -33,7 +33,7 @@ /* * Principal Author: Brian Wellington - * $Id: dst_api.c,v 1.15 2020/02/25 18:10:17 florian Exp $ + * $Id: dst_api.c,v 1.16 2020/09/14 08:40:43 florian Exp $ */ /*! \file */ @@ -51,7 +51,7 @@ #include "dst_internal.h" static dst_func_t *dst_t_func[DST_MAX_ALGS]; -static isc_boolean_t dst_initialized = ISC_FALSE; +static int dst_initialized = 0; /* * Static functions. @@ -88,7 +88,7 @@ isc_result_t dst_lib_init(void) { isc_result_t result; - REQUIRE(dst_initialized == ISC_FALSE); + REQUIRE(!dst_initialized); dst_result_register(); @@ -99,42 +99,42 @@ dst_lib_init(void) { RETERR(dst__hmacsha384_init(&dst_t_func[DST_ALG_HMACSHA384])); RETERR(dst__hmacsha512_init(&dst_t_func[DST_ALG_HMACSHA512])); RETERR(dst__openssl_init()); - dst_initialized = ISC_TRUE; + dst_initialized = 1; return (ISC_R_SUCCESS); out: /* avoid immediate crash! */ - dst_initialized = ISC_TRUE; + dst_initialized = 1; dst_lib_destroy(); return (result); } void dst_lib_destroy(void) { - RUNTIME_CHECK(dst_initialized == ISC_TRUE); - dst_initialized = ISC_FALSE; + RUNTIME_CHECK(dst_initialized); + dst_initialized = 0; dst__openssl_destroy(); } -isc_boolean_t +int dst_algorithm_supported(unsigned int alg) { - REQUIRE(dst_initialized == ISC_TRUE); + REQUIRE(dst_initialized); if (alg >= DST_MAX_ALGS || dst_t_func[alg] == NULL) - return (ISC_FALSE); - return (ISC_TRUE); + return (0); + return (1); } isc_result_t dst_context_create3(dst_key_t *key, - isc_logcategory_t *category, isc_boolean_t useforsigning, + isc_logcategory_t *category, int useforsigning, dst_context_t **dctxp) { dst_context_t *dctx; isc_result_t result; - REQUIRE(dst_initialized == ISC_TRUE); + REQUIRE(dst_initialized); REQUIRE(dctxp != NULL && *dctxp == NULL); dctx = malloc(sizeof(dst_context_t)); @@ -201,7 +201,7 @@ dst_context_verify(dst_context_t *dctx, isc_region_t *sig) { isc_result_t dst_key_todns(const dst_key_t *key, isc_buffer_t *target) { - REQUIRE(dst_initialized == ISC_TRUE); + REQUIRE(dst_initialized); REQUIRE(target != NULL); CHECKALG(key->key_alg); @@ -249,7 +249,7 @@ dst_key_frombuffer(unsigned int alg, unsigned int flags, unsigned int protocol, void dst_key_attach(dst_key_t *source, dst_key_t **target) { - REQUIRE(dst_initialized == ISC_TRUE); + REQUIRE(dst_initialized); REQUIRE(target != NULL && *target == NULL); isc_refcount_increment(&source->refs, NULL); @@ -261,7 +261,7 @@ dst_key_free(dst_key_t **keyp) { dst_key_t *key; unsigned int refs; - REQUIRE(dst_initialized == ISC_TRUE); + REQUIRE(dst_initialized); REQUIRE(keyp != NULL); key = *keyp; @@ -278,7 +278,7 @@ dst_key_free(dst_key_t **keyp) { isc_result_t dst_key_sigsize(const dst_key_t *key, unsigned int *n) { - REQUIRE(dst_initialized == ISC_TRUE); + REQUIRE(dst_initialized); REQUIRE(n != NULL); /* XXXVIX this switch statement is too sparse to gen a jump table. */ @@ -388,7 +388,7 @@ frombuffer(unsigned int alg, unsigned int flags, static isc_result_t algorithm_status(unsigned int alg) { - REQUIRE(dst_initialized == ISC_TRUE); + REQUIRE(dst_initialized); if (dst_algorithm_supported(alg)) return (ISC_R_SUCCESS); diff --git a/usr.bin/dig/lib/dns/dst_result.c b/usr.bin/dig/lib/dns/dst_result.c index 9a23cc2b1de..c8bdda4b9b2 100644 --- a/usr.bin/dig/lib/dns/dst_result.c +++ b/usr.bin/dig/lib/dns/dst_result.c @@ -16,7 +16,7 @@ /*% * Principal Author: Brian Wellington - * $Id: dst_result.c,v 1.2 2020/02/12 13:05:03 jsg Exp $ + * $Id: dst_result.c,v 1.3 2020/09/14 08:40:43 florian Exp $ */ #include <isc/util.h> @@ -50,7 +50,7 @@ static const char *text[DST_R_NRESULTS] = { #define DST_RESULT_RESULTSET 2 -static isc_boolean_t once = ISC_FALSE; +static int once = 0; static void initialize_action(void) { @@ -66,7 +66,7 @@ initialize_action(void) { static void initialize(void) { if (!once) { - once = ISC_TRUE; + once = 1; initialize_action(); } } diff --git a/usr.bin/dig/lib/dns/gen.c b/usr.bin/dig/lib/dns/gen.c index c0a66120cd9..d0720fde0a0 100644 --- a/usr.bin/dig/lib/dns/gen.c +++ b/usr.bin/dig/lib/dns/gen.c @@ -37,17 +37,17 @@ #define TOTEXTARGS "rdata, tctx, target" #define TOTEXTCLASS "rdata->rdclass" #define TOTEXTTYPE "rdata->type" -#define TOTEXTDEF "use_default = ISC_TRUE" +#define TOTEXTDEF "use_default = 1" #define FROMWIREARGS "rdclass, type, source, dctx, options, target" #define FROMWIRECLASS "rdclass" #define FROMWIRETYPE "type" -#define FROMWIREDEF "use_default = ISC_TRUE" +#define FROMWIREDEF "use_default = 1" #define TOWIREARGS "rdata, cctx, target" #define TOWIRECLASS "rdata->rdclass" #define TOWIRETYPE "rdata->type" -#define TOWIREDEF "use_default = ISC_TRUE" +#define TOWIREDEF "use_default = 1" static const char copyright[] = "/*\n" @@ -445,7 +445,6 @@ main(int argc, char **argv) { fputs("#ifndef DNS_CODE_H\n", stdout); fputs("#define DNS_CODE_H 1\n\n", stdout); - fputs("#include <isc/boolean.h>\n", stdout); fputs("#include <isc/result.h>\n\n", stdout); fputs("#include <dns/name.h>\n\n", stdout); diff --git a/usr.bin/dig/lib/dns/include/dns/compress.h b/usr.bin/dig/lib/dns/include/dns/compress.h index 41f1c6bc3c0..bb00c251e43 100644 --- a/usr.bin/dig/lib/dns/include/dns/compress.h +++ b/usr.bin/dig/lib/dns/include/dns/compress.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: compress.h,v 1.4 2020/02/18 18:11:27 florian Exp $ */ +/* $Id: compress.h,v 1.5 2020/09/14 08:40:43 florian Exp $ */ #ifndef DNS_COMPRESS_H #define DNS_COMPRESS_H 1 @@ -115,7 +115,7 @@ dns_compress_getmethods(dns_compress_t *cctx); *\li allowed compression bitmap. */ -isc_boolean_t +int dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name, dns_name_t *prefix, uint16_t *offset); /*%< @@ -128,10 +128,10 @@ dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name, *\li 'offset' to point to an uint16_t. * * Ensures: - *\li 'prefix' and 'offset' are valid if ISC_TRUE is returned. + *\li 'prefix' and 'offset' are valid if 1 is returned. * * Returns: - *\li #ISC_TRUE / #ISC_FALSE + *\li #1 / #0 */ void diff --git a/usr.bin/dig/lib/dns/include/dns/name.h b/usr.bin/dig/lib/dns/include/dns/name.h index e634972920f..aeb22252464 100644 --- a/usr.bin/dig/lib/dns/include/dns/name.h +++ b/usr.bin/dig/lib/dns/include/dns/name.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: name.h,v 1.11 2020/02/25 05:00:42 jsg Exp $ */ +/* $Id: name.h,v 1.12 2020/09/14 08:40:43 florian Exp $ */ #ifndef DNS_NAME_H #define DNS_NAME_H 1 @@ -72,7 +72,6 @@ #include <stdio.h> -#include <isc/boolean.h> #include <isc/region.h> /* Required for storage size of dns_label_t. */ #include <dns/types.h> @@ -170,7 +169,7 @@ dns_name_init(dns_name_t *name, unsigned char *offsets); * Ensures: * \li 'name' is a valid name. * \li dns_name_countlabels(name) == 0 - * \li dns_name_isabsolute(name) == ISC_FALSE + * \li dns_name_isabsolute(name) == 0 */ void @@ -195,7 +194,7 @@ dns_name_reset(dns_name_t *name); * Ensures: * \li 'name' is a valid name. * \li dns_name_countlabels(name) == 0 - * \li dns_name_isabsolute(name) == ISC_FALSE + * \li dns_name_isabsolute(name) == 0 */ void @@ -246,7 +245,7 @@ dns_name_setbuffer(dns_name_t *name, isc_buffer_t *buffer); *** Properties ***/ -isc_boolean_t +int dns_name_isabsolute(const dns_name_t *name); /*%< * Does 'name' end in the root label? @@ -260,11 +259,11 @@ dns_name_isabsolute(const dns_name_t *name); */ unsigned int -dns_name_hash(dns_name_t *name, isc_boolean_t case_sensitive); +dns_name_hash(dns_name_t *name, int case_sensitive); /*%< * Provide a hash value for 'name'. * - * Note: if 'case_sensitive' is ISC_FALSE, then names which differ only in + * Note: if 'case_sensitive' is 0, then names which differ only in * case will have the same hash value. * * Requires: @@ -346,7 +345,7 @@ dns_name_compare(const dns_name_t *name1, const dns_name_t *name2); * \li > 0 'name1' is greater than 'name2' */ -isc_boolean_t +int dns_name_equal(const dns_name_t *name1, const dns_name_t *name2); /*%< * Are 'name1' and 'name2' equal? @@ -370,17 +369,17 @@ dns_name_equal(const dns_name_t *name1, const dns_name_t *name2); * \li Either name1 is absolute and name2 is absolute, or neither is. * * Returns: - * \li ISC_TRUE 'name1' and 'name2' are equal - * \li ISC_FALSE 'name1' and 'name2' are not equal + * \li 1 'name1' and 'name2' are equal + * \li 0 'name1' and 'name2' are not equal */ -isc_boolean_t +int dns_name_caseequal(const dns_name_t *name1, const dns_name_t *name2); /*%< * Case sensitive version of dns_name_equal(). */ -isc_boolean_t +int dns_name_issubdomain(const dns_name_t *name1, const dns_name_t *name2); /*%< * Is 'name1' a subdomain of 'name2'? @@ -670,7 +669,7 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source, #define DNS_NAME_MASTERFILE 0x02U /* escape $ and @ */ isc_result_t -dns_name_totext(dns_name_t *name, isc_boolean_t omit_final_dot, +dns_name_totext(dns_name_t *name, int omit_final_dot, isc_buffer_t *target); isc_result_t @@ -840,7 +839,7 @@ dns_name_free(dns_name_t *name); * invalidated. */ -isc_boolean_t +int dns_name_dynamic(dns_name_t *name); /*%< * Returns whether there is dynamic memory associated with this name. @@ -851,7 +850,7 @@ dns_name_dynamic(dns_name_t *name); * * Returns: * - *\li 'ISC_TRUE' if the name is dynamic otherwise 'ISC_FALSE'. + *\li '1' if the name is dynamic otherwise '0'. */ void diff --git a/usr.bin/dig/lib/dns/include/dns/rdata.h b/usr.bin/dig/lib/dns/include/dns/rdata.h index 229424ec0a4..26de94d6396 100644 --- a/usr.bin/dig/lib/dns/include/dns/rdata.h +++ b/usr.bin/dig/lib/dns/include/dns/rdata.h @@ -605,9 +605,9 @@ dns_rdata_covers(dns_rdata_t *rdata); *\li The type covered. */ -isc_boolean_t +int dns_rdata_checkowner_nsec3(dns_name_t* name, dns_rdataclass_t rdclass, - dns_rdatatype_t type, isc_boolean_t wildcard); + dns_rdatatype_t type, int wildcard); /* * Returns whether this is a valid ownername for this <type,class>. * If wildcard is true allow the first label to be a wildcard if diff --git a/usr.bin/dig/lib/dns/include/dns/rdataset.h b/usr.bin/dig/lib/dns/include/dns/rdataset.h index eecd4b2c645..418c9b5284f 100644 --- a/usr.bin/dig/lib/dns/include/dns/rdataset.h +++ b/usr.bin/dig/lib/dns/include/dns/rdataset.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rdataset.h,v 1.9 2020/02/24 17:57:54 florian Exp $ */ +/* $Id: rdataset.h,v 1.10 2020/09/14 08:40:43 florian Exp $ */ #ifndef DNS_RDATASET_H #define DNS_RDATASET_H 1 @@ -228,7 +228,7 @@ dns_rdataset_disassociate(dns_rdataset_t *rdataset); *\li 'rdataset' is a valid, disassociated rdataset. */ -isc_boolean_t +int dns_rdataset_isassociated(dns_rdataset_t *rdataset); /*%< * Is 'rdataset' associated? @@ -237,8 +237,8 @@ dns_rdataset_isassociated(dns_rdataset_t *rdataset); *\li 'rdataset' is a valid rdataset. * * Returns: - *\li #ISC_TRUE 'rdataset' is associated. - *\li #ISC_FALSE 'rdataset' is not associated. + *\li #1 'rdataset' is associated. + *\li #0 'rdataset' is not associated. */ void @@ -323,8 +323,8 @@ dns_rdataset_current(dns_rdataset_t *rdataset, dns_rdata_t *rdata); isc_result_t dns_rdataset_totext(dns_rdataset_t *rdataset, dns_name_t *owner_name, - isc_boolean_t omit_final_dot, - isc_boolean_t question, + int omit_final_dot, + int question, isc_buffer_t *target); /*%< * Convert 'rdataset' to text format, storing the result in 'target'. @@ -332,8 +332,8 @@ dns_rdataset_totext(dns_rdataset_t *rdataset, * Notes: *\li The rdata cursor position will be changed. * - *\li The 'question' flag should normally be #ISC_FALSE. If it is - * #ISC_TRUE, the TTL and rdata fields are not printed. This is + *\li The 'question' flag should normally be #0. If it is + * #1, the TTL and rdata fields are not printed. This is * for use when printing an rdata representing a question section. * *\li This interface is deprecated; use dns_master_rdatasettottext() diff --git a/usr.bin/dig/lib/dns/include/dns/tsig.h b/usr.bin/dig/lib/dns/include/dns/tsig.h index 5fd3e945cdd..889fcac81d8 100644 --- a/usr.bin/dig/lib/dns/include/dns/tsig.h +++ b/usr.bin/dig/lib/dns/include/dns/tsig.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: tsig.h,v 1.5 2020/02/18 18:11:27 florian Exp $ */ +/* $Id: tsig.h,v 1.6 2020/09/14 08:40:43 florian Exp $ */ #ifndef DNS_TSIG_H #define DNS_TSIG_H 1 @@ -53,7 +53,7 @@ struct dns_tsigkey { dns_name_t name; /*%< Key name */ dns_name_t *algorithm; /*%< Algorithm name */ dns_name_t *creator; /*%< name that created secret */ - isc_boolean_t generated; /*%< was this generated? */ + int generated; /*%< was this generated? */ time_t inception; /*%< start of validity period */ time_t expire; /*%< end of validity period */ isc_refcount_t refs; /*%< reference counter */ @@ -67,14 +67,14 @@ struct dns_tsigkey { isc_result_t dns_tsigkey_create(dns_name_t *name, dns_name_t *algorithm, - unsigned char *secret, int length, isc_boolean_t generated, + unsigned char *secret, int length, int generated, dns_name_t *creator, time_t inception, time_t expire, dns_tsigkey_t **key); isc_result_t dns_tsigkey_createfromkey(dns_name_t *name, dns_name_t *algorithm, - dst_key_t *dstkey, isc_boolean_t generated, + dst_key_t *dstkey, int generated, dns_name_t *creator, time_t inception, time_t expire, dns_tsigkey_t **key); diff --git a/usr.bin/dig/lib/dns/include/dns/ttl.h b/usr.bin/dig/lib/dns/include/dns/ttl.h index 53cb67a1863..e698fffa9e0 100644 --- a/usr.bin/dig/lib/dns/include/dns/ttl.h +++ b/usr.bin/dig/lib/dns/include/dns/ttl.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ttl.h,v 1.3 2020/02/22 19:47:06 jung Exp $ */ +/* $Id: ttl.h,v 1.4 2020/09/14 08:40:43 florian Exp $ */ #ifndef DNS_TTL_H #define DNS_TTL_H 1 @@ -32,16 +32,16 @@ ***/ isc_result_t -dns_ttl_totext(uint32_t src, isc_boolean_t verbose, +dns_ttl_totext(uint32_t src, int verbose, isc_buffer_t *target); /*%< * Output a TTL or other time interval in a human-readable form. * The time interval is given as a count of seconds in 'src'. * The text representation is appended to 'target'. * - * If 'verbose' is ISC_FALSE, use the terse BIND 8 style, like "1w2d3h4m5s". + * If 'verbose' is 0, use the terse BIND 8 style, like "1w2d3h4m5s". * - * If 'verbose' is ISC_TRUE, use a verbose style like the SOA comments + * If 'verbose' is 1, use a verbose style like the SOA comments * in "dig", like "1 week 2 days 3 hours 4 minutes 5 seconds". * * Returns: diff --git a/usr.bin/dig/lib/dns/include/dst/dst.h b/usr.bin/dig/lib/dns/include/dst/dst.h index 9d7c9bb985d..11097509831 100644 --- a/usr.bin/dig/lib/dns/include/dst/dst.h +++ b/usr.bin/dig/lib/dns/include/dst/dst.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dst.h,v 1.10 2020/02/23 23:40:21 jsg Exp $ */ +/* $Id: dst.h,v 1.11 2020/09/14 08:40:43 florian Exp $ */ #ifndef DST_DST_H #define DST_DST_H 1 @@ -130,19 +130,19 @@ dst_lib_destroy(void); * Releases all resources allocated by DST. */ -isc_boolean_t +int dst_algorithm_supported(unsigned int alg); /*%< * Checks that a given algorithm is supported by DST. * * Returns: - * \li ISC_TRUE - * \li ISC_FALSE + * \li 1 + * \li 0 */ isc_result_t dst_context_create3(dst_key_t *key, - isc_logcategory_t *category, isc_boolean_t useforsigning, + isc_logcategory_t *category, int useforsigning, dst_context_t **dctxp); /*%< diff --git a/usr.bin/dig/lib/dns/masterdump.c b/usr.bin/dig/lib/dns/masterdump.c index 771720bb09b..272315fcfbc 100644 --- a/usr.bin/dig/lib/dns/masterdump.c +++ b/usr.bin/dig/lib/dns/masterdump.c @@ -61,14 +61,14 @@ struct dns_master_style { */ typedef struct dns_totext_ctx { dns_master_style_t style; - isc_boolean_t class_printed; + int class_printed; char * linebreak; char linebreak_buf[DNS_TOTEXT_LINEBREAK_MAXLEN]; dns_name_t * origin; dns_name_t * neworigin; dns_fixedname_t origin_fixname; uint32_t current_ttl; - isc_boolean_t current_ttl_valid; + int current_ttl_valid; } dns_totext_ctx_t; /*% @@ -158,7 +158,7 @@ totext_ctx_init(const dns_master_style_t *style, dns_totext_ctx_t *ctx) { REQUIRE(style->tab_width != 0); ctx->style = *style; - ctx->class_printed = ISC_FALSE; + ctx->class_printed = 0; dns_fixedname_init(&ctx->origin_fixname); @@ -214,7 +214,7 @@ totext_ctx_init(const dns_master_style_t *style, dns_totext_ctx_t *ctx) { ctx->origin = NULL; ctx->neworigin = NULL; ctx->current_ttl = 0; - ctx->current_ttl_valid = ISC_FALSE; + ctx->current_ttl_valid = 0; return (ISC_R_SUCCESS); } @@ -238,14 +238,14 @@ static isc_result_t rdataset_totext(dns_rdataset_t *rdataset, dns_name_t *owner_name, dns_totext_ctx_t *ctx, - isc_boolean_t omit_final_dot, + int omit_final_dot, isc_buffer_t *target) { isc_result_t result; unsigned int column; - isc_boolean_t first = ISC_TRUE; + int first = 1; uint32_t current_ttl; - isc_boolean_t current_ttl_valid; + int current_ttl_valid; dns_rdatatype_t type; unsigned int type_start; @@ -307,7 +307,7 @@ rdataset_totext(dns_rdataset_t *rdataset, */ if ((ctx->style.flags & DNS_STYLEFLAG_TTL) == 0) { current_ttl = rdataset->ttl; - current_ttl_valid = ISC_TRUE; + current_ttl_valid = 1; } } @@ -316,7 +316,7 @@ rdataset_totext(dns_rdataset_t *rdataset, */ if ((ctx->style.flags & DNS_STYLEFLAG_NO_CLASS) == 0 && ((ctx->style.flags & DNS_STYLEFLAG_OMIT_CLASS) == 0 || - ctx->class_printed == ISC_FALSE)) + !ctx->class_printed)) { unsigned int class_start; INDENT_TO(class_column); @@ -381,7 +381,7 @@ rdataset_totext(dns_rdataset_t *rdataset, isc_buffer_add(target, 1); } - first = ISC_FALSE; + first = 0; result = dns_rdataset_next(rdataset); } @@ -395,7 +395,7 @@ rdataset_totext(dns_rdataset_t *rdataset, * times with increasing buffer sizes until it succeeds, * and failed attempts must not update the state prematurely. */ - ctx->class_printed = ISC_TRUE; + ctx->class_printed = 1; ctx->current_ttl= current_ttl; ctx->current_ttl_valid = current_ttl_valid; @@ -411,7 +411,7 @@ static isc_result_t question_totext(dns_rdataset_t *rdataset, dns_name_t *owner_name, dns_totext_ctx_t *ctx, - isc_boolean_t omit_final_dot, + int omit_final_dot, isc_buffer_t *target) { unsigned int column; @@ -466,8 +466,8 @@ question_totext(dns_rdataset_t *rdataset, isc_result_t dns_rdataset_totext(dns_rdataset_t *rdataset, dns_name_t *owner_name, - isc_boolean_t omit_final_dot, - isc_boolean_t question, + int omit_final_dot, + int question, isc_buffer_t *target) { dns_totext_ctx_t ctx; @@ -512,7 +512,7 @@ dns_master_rdatasettotext(dns_name_t *owner_name, } return (rdataset_totext(rdataset, owner_name, &ctx, - ISC_FALSE, target)); + 0, target)); } isc_result_t @@ -531,7 +531,7 @@ dns_master_questiontotext(dns_name_t *owner_name, } return (question_totext(rdataset, owner_name, &ctx, - ISC_FALSE, target)); + 0, target)); } isc_result_t diff --git a/usr.bin/dig/lib/dns/message.c b/usr.bin/dig/lib/dns/message.c index 6c622c96bf6..5e0fb167382 100644 --- a/usr.bin/dig/lib/dns/message.c +++ b/usr.bin/dig/lib/dns/message.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: message.c,v 1.16 2020/02/24 17:57:54 florian Exp $ */ +/* $Id: message.c,v 1.17 2020/09/14 08:40:43 florian Exp $ */ /*! \file */ @@ -399,7 +399,7 @@ msgresetopt(dns_message_t *msg) } static void -msgresetsigs(dns_message_t *msg, isc_boolean_t replying) { +msgresetsigs(dns_message_t *msg, int replying) { if (msg->sig_reserved > 0) { dns_message_renderrelease(msg, msg->sig_reserved); msg->sig_reserved = 0; @@ -446,7 +446,7 @@ msgresetsigs(dns_message_t *msg, isc_boolean_t replying) { * both dns_message_reset() and dns_message_destroy(). */ static void -msgreset(dns_message_t *msg, isc_boolean_t everything) { +msgreset(dns_message_t *msg, int everything) { dns_msgblock_t *msgblock, *next_msgblock; isc_buffer_t *dynbuf, *next_dynbuf; dns_rdata_t *rdata; @@ -454,7 +454,7 @@ msgreset(dns_message_t *msg, isc_boolean_t everything) { msgresetnames(msg, 0); msgresetopt(msg); - msgresetsigs(msg, ISC_FALSE); + msgresetsigs(msg, 0); /* * Clean up linked lists. @@ -682,7 +682,7 @@ dns_message_destroy(dns_message_t **msgp) { msg = *msgp; *msgp = NULL; - msgreset(msg, ISC_TRUE); + msgreset(msg, 1); free(msg); } @@ -770,7 +770,7 @@ getname(dns_name_t *name, isc_buffer_t *source, dns_message_t *msg, */ tries = 0; while (tries < 2) { - result = dns_name_fromwire(name, source, dctx, ISC_FALSE, + result = dns_name_fromwire(name, source, dctx, 0, scratch); if (result == ISC_R_NOSPACE) { @@ -847,7 +847,7 @@ getrdata(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, #define DO_FORMERR \ do { \ if (best_effort) \ - seen_problem = ISC_TRUE; \ + seen_problem = 1; \ else { \ result = DNS_R_FORMERR; \ goto cleanup; \ @@ -869,14 +869,14 @@ getquestions(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, dns_rdatatype_t rdtype; dns_rdataclass_t rdclass; dns_namelist_t *section; - isc_boolean_t free_name; - isc_boolean_t best_effort; - isc_boolean_t seen_problem; + int free_name; + int best_effort; + int seen_problem; section = &msg->sections[DNS_SECTION_QUESTION]; - best_effort = ISC_TF(options & DNS_MESSAGEPARSE_BESTEFFORT); - seen_problem = ISC_FALSE; + best_effort = options & DNS_MESSAGEPARSE_BESTEFFORT; + seen_problem = 0; name = NULL; rdataset = NULL; @@ -886,7 +886,7 @@ getquestions(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, name = malloc(sizeof(dns_name_t)); if (name == NULL) return (ISC_R_NOMEMORY); - free_name = ISC_TRUE; + free_name = 1; offsets = newoffsets(msg); if (offsets == NULL) { @@ -926,12 +926,12 @@ getquestions(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, if (!ISC_LIST_EMPTY(*section)) DO_FORMERR; ISC_LIST_APPEND(*section, name, link); - free_name = ISC_FALSE; + free_name = 0; } else { free(name); name = name2; name2 = NULL; - free_name = ISC_FALSE; + free_name = 0; } /* @@ -1018,14 +1018,14 @@ getquestions(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, return (result); } -static isc_boolean_t +static int update(dns_section_t section, dns_rdataclass_t rdclass) { if (section == DNS_SECTION_PREREQUISITE) - return (ISC_TF(rdclass == dns_rdataclass_any || - rdclass == dns_rdataclass_none)); + return (rdclass == dns_rdataclass_any || + rdclass == dns_rdataclass_none); if (section == DNS_SECTION_UPDATE) - return (ISC_TF(rdclass == dns_rdataclass_any)); - return (ISC_FALSE); + return (rdclass == dns_rdataclass_any); + return (0); } static isc_result_t @@ -1044,23 +1044,23 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, dns_rdata_t *rdata; dns_ttl_t ttl; dns_namelist_t *section; - isc_boolean_t free_name = ISC_FALSE, free_rdataset = ISC_FALSE; - isc_boolean_t best_effort, seen_problem; - isc_boolean_t issigzero; + int free_name = 0, free_rdataset = 0; + int best_effort, seen_problem; + int issigzero; - best_effort = ISC_TF(options & DNS_MESSAGEPARSE_BESTEFFORT); - seen_problem = ISC_FALSE; + best_effort = options & DNS_MESSAGEPARSE_BESTEFFORT; + seen_problem = 0; section = &msg->sections[sectionid]; for (count = 0; count < msg->counts[sectionid]; count++) { int recstart = source->current; - free_rdataset = ISC_FALSE; + free_rdataset = 0; name = malloc(sizeof(dns_name_t)); if (name == NULL) return (ISC_R_NOMEMORY); - free_name = ISC_TRUE; + free_name = 1; offsets = newoffsets(msg); if (offsets == NULL) { @@ -1221,7 +1221,7 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, if (result != ISC_R_SUCCESS) goto cleanup; rdata->rdclass = rdclass; - issigzero = ISC_FALSE; + issigzero = 0; if (rdtype == dns_rdatatype_rrsig && rdata->flags == 0) { covers = dns_rdata_covers(rdata); @@ -1235,7 +1235,7 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, count != msg->counts[sectionid] - 1) DO_FORMERR; msg->sigstart = recstart; - issigzero = ISC_TRUE; + issigzero = 1; } else { if (msg->rdclass != dns_rdataclass_any && msg->rdclass != rdclass) @@ -1249,7 +1249,7 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, */ if (rdtype == dns_rdatatype_nsec3 && !dns_rdata_checkowner_nsec3(name, msg->rdclass, rdtype, - ISC_FALSE)) { + 0)) { result = DNS_R_BADOWNERNAME; goto cleanup; } @@ -1257,7 +1257,7 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, if (rdtype != dns_rdatatype_opt && rdtype != dns_rdatatype_tsig && !issigzero) { ISC_LIST_APPEND(*section, name, link); - free_name = ISC_FALSE; + free_name = 0; } rdataset = malloc(sizeof(dns_rdataset_t)); @@ -1265,7 +1265,7 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, result = ISC_R_NOMEMORY; goto cleanup; } - free_rdataset = ISC_TRUE; + free_rdataset = 1; rdatalist = newrdatalist(msg); if (rdatalist == NULL) { @@ -1289,7 +1289,7 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, !issigzero) { ISC_LIST_APPEND(name->list, rdataset, link); - free_rdataset = ISC_FALSE; + free_rdataset = 0; } /* @@ -1323,27 +1323,27 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, msg->opt = rdataset; rdataset = NULL; - free_rdataset = ISC_FALSE; + free_rdataset = 0; ercode = (dns_rcode_t) ((msg->opt->ttl & DNS_MESSAGE_EDNSRCODE_MASK) >> 20); msg->rcode |= ercode; free(name); - free_name = ISC_FALSE; + free_name = 0; } else if (issigzero && msg->sig0 == NULL) { msg->sig0 = rdataset; msg->sig0name = name; rdataset = NULL; - free_rdataset = ISC_FALSE; - free_name = ISC_FALSE; + free_rdataset = 0; + free_name = 0; } else if (rdtype == dns_rdatatype_tsig && msg->tsig == NULL) { msg->tsig = rdataset; msg->tsigname = name; /* Windows doesn't like TSIG names to be compressed. */ msg->tsigname->attributes |= DNS_NAMEATTR_NOCOMPRESS; rdataset = NULL; - free_rdataset = ISC_FALSE; - free_name = ISC_FALSE; + free_rdataset = 0; + free_name = 0; } if (seen_problem) { @@ -1351,10 +1351,10 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, free(name); if (free_rdataset) free(rdataset); - free_name = free_rdataset = ISC_FALSE; + free_name = free_rdataset = 0; } - INSIST(free_name == ISC_FALSE); - INSIST(free_rdataset == ISC_FALSE); + INSIST(!free_name); + INSIST(!free_rdataset); } if (seen_problem) @@ -1379,14 +1379,14 @@ dns_message_parse(dns_message_t *msg, isc_buffer_t *source, isc_result_t ret; uint16_t tmpflags; isc_buffer_t origsource; - isc_boolean_t seen_problem; - isc_boolean_t ignore_tc; + int seen_problem; + int ignore_tc; REQUIRE(source != NULL); REQUIRE(msg->from_to_wire == DNS_MESSAGE_INTENTPARSE); - seen_problem = ISC_FALSE; - ignore_tc = ISC_TF(options & DNS_MESSAGEPARSE_IGNORETRUNCATION); + seen_problem = 0; + ignore_tc = options & DNS_MESSAGEPARSE_IGNORETRUNCATION; origsource = *source; @@ -1422,7 +1422,7 @@ dns_message_parse(dns_message_t *msg, isc_buffer_t *source, if (ret == ISC_R_UNEXPECTEDEND && ignore_tc) goto truncated; if (ret == DNS_R_RECOVERABLE) { - seen_problem = ISC_TRUE; + seen_problem = 1; ret = ISC_R_SUCCESS; } if (ret != ISC_R_SUCCESS) @@ -1433,7 +1433,7 @@ dns_message_parse(dns_message_t *msg, isc_buffer_t *source, if (ret == ISC_R_UNEXPECTEDEND && ignore_tc) goto truncated; if (ret == DNS_R_RECOVERABLE) { - seen_problem = ISC_TRUE; + seen_problem = 1; ret = ISC_R_SUCCESS; } if (ret != ISC_R_SUCCESS) @@ -1443,7 +1443,7 @@ dns_message_parse(dns_message_t *msg, isc_buffer_t *source, if (ret == ISC_R_UNEXPECTEDEND && ignore_tc) goto truncated; if (ret == DNS_R_RECOVERABLE) { - seen_problem = ISC_TRUE; + seen_problem = 1; ret = ISC_R_SUCCESS; } if (ret != ISC_R_SUCCESS) @@ -1453,7 +1453,7 @@ dns_message_parse(dns_message_t *msg, isc_buffer_t *source, if (ret == ISC_R_UNEXPECTEDEND && ignore_tc) goto truncated; if (ret == DNS_R_RECOVERABLE) { - seen_problem = ISC_TRUE; + seen_problem = 1; ret = ISC_R_SUCCESS; } if (ret != ISC_R_SUCCESS) @@ -1472,7 +1472,7 @@ dns_message_parse(dns_message_t *msg, isc_buffer_t *source, if (ret == ISC_R_UNEXPECTEDEND && ignore_tc) return (DNS_R_RECOVERABLE); - if (seen_problem == ISC_TRUE) + if (seen_problem) return (DNS_R_RECOVERABLE); return (ISC_R_SUCCESS); } @@ -1537,7 +1537,7 @@ dns_message_renderreserve(dns_message_t *msg, unsigned int space) { return (ISC_R_SUCCESS); } -static inline isc_boolean_t +static inline int wrong_priority(dns_rdataset_t *rds, int pass) { int pass_needed; @@ -1545,7 +1545,7 @@ wrong_priority(dns_rdataset_t *rds, int pass) { * If we are not rendering class IN, this ordering is bogus. */ if (rds->rdclass != dns_rdataclass_in) - return (ISC_FALSE); + return (0); switch (rds->type) { case dns_rdatatype_a: @@ -1561,9 +1561,9 @@ wrong_priority(dns_rdataset_t *rds, int pass) { } if (pass_needed >= pass) - return (ISC_FALSE); + return (0); - return (ISC_TRUE); + return (1); } static isc_result_t @@ -2316,7 +2316,7 @@ dns_message_sectiontotext(dns_message_t *msg, dns_section_t section, dns_name_t *name, empty_name; dns_rdataset_t *rdataset; isc_result_t result; - isc_boolean_t seensoa = ISC_FALSE; + int seensoa = 0; REQUIRE(target != NULL); REQUIRE(VALID_SECTION(section)); @@ -2352,7 +2352,7 @@ dns_message_sectiontotext(dns_message_t *msg, dns_section_t section, if (seensoa && (flags & DNS_MESSAGETEXTFLAG_ONESOA) != 0) continue; - seensoa = ISC_TRUE; + seensoa = 1; } if (section == DNS_SECTION_QUESTION) { ADD_STRING(target, ";"); @@ -2531,7 +2531,7 @@ dns_message_pseudosectiontotext(dns_message_t *msg, ADD_STRING(target, buf); ADD_STRING(target, " ("); result = dns_ttl_totext(secs, - ISC_TRUE, + 1, target); if (result != ISC_R_SUCCESS) return (result); diff --git a/usr.bin/dig/lib/dns/name.c b/usr.bin/dig/lib/dns/name.c index b271d42c0e2..d401e2a3478 100644 --- a/usr.bin/dig/lib/dns/name.c +++ b/usr.bin/dig/lib/dns/name.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: name.c,v 1.13 2020/02/25 05:00:42 jsg Exp $ */ +/* $Id: name.c,v 1.14 2020/09/14 08:40:43 florian Exp $ */ /*! \file */ #include <ctype.h> @@ -209,7 +209,7 @@ dns_name_setbuffer(dns_name_t *name, isc_buffer_t *buffer) { name->buffer = buffer; } -isc_boolean_t +int dns_name_isabsolute(const dns_name_t *name) { /* @@ -217,12 +217,12 @@ dns_name_isabsolute(const dns_name_t *name) { */ if ((name->attributes & DNS_NAMEATTR_ABSOLUTE) != 0) - return (ISC_TRUE); - return (ISC_FALSE); + return (1); + return (0); } unsigned int -dns_name_hash(dns_name_t *name, isc_boolean_t case_sensitive) { +dns_name_hash(dns_name_t *name, int case_sensitive) { unsigned int length; /* @@ -397,7 +397,7 @@ dns_name_compare(const dns_name_t *name1, const dns_name_t *name2) { return (order); } -isc_boolean_t +int dns_name_equal(const dns_name_t *name1, const dns_name_t *name2) { unsigned int l, count; unsigned char c; @@ -419,22 +419,22 @@ dns_name_equal(const dns_name_t *name1, const dns_name_t *name2) { (name2->attributes & DNS_NAMEATTR_ABSOLUTE)); if (name1 == name2) - return (ISC_TRUE); + return (1); if (name1->length != name2->length) - return (ISC_FALSE); + return (0); l = name1->labels; if (l != name2->labels) - return (ISC_FALSE); + return (0); label1 = name1->ndata; label2 = name2->ndata; while (l-- > 0) { count = *label1++; if (count != *label2++) - return (ISC_FALSE); + return (0); INSIST(count <= 63); /* no bitstring support */ @@ -442,16 +442,16 @@ dns_name_equal(const dns_name_t *name1, const dns_name_t *name2) { while (count > 3) { c = maptolower[label1[0]]; if (c != maptolower[label2[0]]) - return (ISC_FALSE); + return (0); c = maptolower[label1[1]]; if (c != maptolower[label2[1]]) - return (ISC_FALSE); + return (0); c = maptolower[label1[2]]; if (c != maptolower[label2[2]]) - return (ISC_FALSE); + return (0); c = maptolower[label1[3]]; if (c != maptolower[label2[3]]) - return (ISC_FALSE); + return (0); count -= 4; label1 += 4; label2 += 4; @@ -459,14 +459,14 @@ dns_name_equal(const dns_name_t *name1, const dns_name_t *name2) { while (count-- > 0) { c = maptolower[*label1++]; if (c != maptolower[*label2++]) - return (ISC_FALSE); + return (0); } } - return (ISC_TRUE); + return (1); } -isc_boolean_t +int dns_name_caseequal(const dns_name_t *name1, const dns_name_t *name2) { /* @@ -485,15 +485,15 @@ dns_name_caseequal(const dns_name_t *name1, const dns_name_t *name2) { (name2->attributes & DNS_NAMEATTR_ABSOLUTE)); if (name1->length != name2->length) - return (ISC_FALSE); + return (0); if (memcmp(name1->ndata, name2->ndata, name1->length) != 0) - return (ISC_FALSE); + return (0); - return (ISC_TRUE); + return (1); } -isc_boolean_t +int dns_name_issubdomain(const dns_name_t *name1, const dns_name_t *name2) { int order; unsigned int nlabels; @@ -511,9 +511,9 @@ dns_name_issubdomain(const dns_name_t *name1, const dns_name_t *name2) { namereln = dns_name_fullcompare(name1, name2, &order, &nlabels); if (namereln == dns_namereln_subdomain || namereln == dns_namereln_equal) - return (ISC_TRUE); + return (1); - return (ISC_FALSE); + return (0); } unsigned int @@ -691,10 +691,10 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source, unsigned int value = 0, count = 0; unsigned int n1 = 0, n2 = 0; unsigned int tlen, nrem, nused, digits = 0, labels, tused; - isc_boolean_t done; + int done; unsigned char *offsets; dns_offsets_t odata; - isc_boolean_t downcase; + int downcase; /* * Convert the textual representation of a DNS name at source @@ -706,7 +706,7 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source, * will remain relative. */ - downcase = ISC_TF((options & DNS_NAME_DOWNCASE) != 0); + downcase = (options & DNS_NAME_DOWNCASE) != 0; if (target == NULL && name->buffer != NULL) { target = name->buffer; @@ -735,7 +735,7 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source, nrem = 255; nused = 0; labels = 0; - done = ISC_FALSE; + done = 0; state = ft_init; while (nrem > 0 && tlen > 0 && !done) { @@ -755,7 +755,7 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source, *ndata++ = 0; nrem--; nused++; - done = ISC_TRUE; + done = 1; break; } if (c == '@' && tlen == 0) { @@ -791,7 +791,7 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source, *ndata++ = 0; nrem--; nused++; - done = ISC_TRUE; + done = 1; } state = ft_start; } else if (c == '\\') { @@ -920,7 +920,7 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source, } isc_result_t -dns_name_totext(dns_name_t *name, isc_boolean_t omit_final_dot, +dns_name_totext(dns_name_t *name, int omit_final_dot, isc_buffer_t *target) { unsigned int options = DNS_NAME_MASTERFILE; @@ -939,9 +939,8 @@ dns_name_totext2(dns_name_t *name, unsigned int options, isc_buffer_t *target) unsigned char c; unsigned int trem, count; unsigned int labels; - isc_boolean_t saw_root = ISC_FALSE; - isc_boolean_t omit_final_dot = - ISC_TF(options & DNS_NAME_OMITFINALDOT); + int saw_root = 0; + int omit_final_dot = options & DNS_NAME_OMITFINALDOT; /* * This function assumes the name is in proper uncompressed @@ -970,8 +969,8 @@ dns_name_totext2(dns_name_t *name, unsigned int options, isc_buffer_t *target) * They need to be set this way, though, to keep the "@" * from being trounced. */ - saw_root = ISC_TRUE; - omit_final_dot = ISC_FALSE; + saw_root = 1; + omit_final_dot = 0; *tdata++ = '@'; trem--; @@ -986,8 +985,8 @@ dns_name_totext2(dns_name_t *name, unsigned int options, isc_buffer_t *target) if (trem == 0) return (ISC_R_NOSPACE); - saw_root = ISC_TRUE; - omit_final_dot = ISC_FALSE; + saw_root = 1; + omit_final_dot = 0; *tdata++ = '.'; trem--; @@ -1002,7 +1001,7 @@ dns_name_totext2(dns_name_t *name, unsigned int options, isc_buffer_t *target) count = *ndata++; nlen--; if (count == 0) { - saw_root = ISC_TRUE; + saw_root = 1; break; } if (count < 64) { @@ -1161,13 +1160,13 @@ set_offsets(const dns_name_t *name, unsigned char *offsets, { unsigned int offset, count, length, nlabels; unsigned char *ndata; - isc_boolean_t absolute; + int absolute; ndata = name->ndata; length = name->length; offset = 0; nlabels = 0; - absolute = ISC_FALSE; + absolute = 0; while (offset != length) { INSIST(nlabels < 128); offsets[nlabels++] = offset; @@ -1178,7 +1177,7 @@ set_offsets(const dns_name_t *name, unsigned char *offsets, ndata += count; INSIST(offset <= length); if (count == 0) { - absolute = ISC_TRUE; + absolute = 1; break; } } @@ -1205,13 +1204,13 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source, unsigned int cused; /* Bytes of compressed name data used */ unsigned int nused, labels, n, nmax; unsigned int current, new_current, biggest_pointer; - isc_boolean_t done; + int done; fw_state state = fw_start; unsigned int c; unsigned char *offsets; dns_offsets_t odata; - isc_boolean_t downcase; - isc_boolean_t seen_pointer; + int downcase; + int seen_pointer; /* * Copy the possibly-compressed name at source into target, @@ -1219,7 +1218,7 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source, * the new pointer against biggest_pointer. */ - downcase = ISC_TF((options & DNS_NAME_DOWNCASE) != 0); + downcase = (options & DNS_NAME_DOWNCASE) != 0; if (target == NULL && name->buffer != NULL) { target = name->buffer; @@ -1246,11 +1245,11 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source, * Set up. */ labels = 0; - done = ISC_FALSE; + done = 0; ndata = isc_buffer_used(target); nused = 0; - seen_pointer = ISC_FALSE; + seen_pointer = 0; /* * Find the maximum number of uncompressed target name @@ -1289,7 +1288,7 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source, nused += c + 1; *ndata++ = c; if (c == 0) - done = ISC_TRUE; + done = 1; n = c; state = fw_ordinary; } else if (c >= 128 && c < 192) { @@ -1327,7 +1326,7 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source, biggest_pointer = new_current; current = new_current; cdata = (unsigned char *)source->base + current; - seen_pointer = ISC_TRUE; + seen_pointer = 1; state = fw_start; break; default: @@ -1372,7 +1371,7 @@ dns_name_towire(const dns_name_t *name, dns_compress_t *cctx, unsigned int methods; uint16_t offset; dns_name_t gp; /* Global compression prefix */ - isc_boolean_t gf; /* Global compression target found */ + int gf; /* Global compression target found */ uint16_t go; /* Global compression offset */ dns_offsets_t clo; dns_name_t clname; @@ -1403,20 +1402,20 @@ dns_name_towire(const dns_name_t *name, dns_compress_t *cctx, (methods & DNS_COMPRESS_GLOBAL14) != 0) gf = dns_compress_findglobal(cctx, name, &gp, &go); else - gf = ISC_FALSE; + gf = 0; /* * If the offset is too high for 14 bit global compression, we're * out of luck. */ if (gf && go >= 0x4000) - gf = ISC_FALSE; + gf = 0; /* * Will the compression pointer reduce the message size? */ if (gf && (gp.length + 2) >= name->length) - gf = ISC_FALSE; + gf = 0; if (gf) { if (target->length - target->used < gp.length) @@ -1453,9 +1452,9 @@ dns_name_concatenate(dns_name_t *prefix, dns_name_t *suffix, dns_name_t *name, { unsigned char *ndata, *offsets; unsigned int nrem, labels, prefix_length, length; - isc_boolean_t copy_prefix = ISC_TRUE; - isc_boolean_t copy_suffix = ISC_TRUE; - isc_boolean_t absolute = ISC_FALSE; + int copy_prefix = 1; + int copy_suffix = 1; + int absolute = 0; dns_name_t tmp_name; dns_offsets_t odata; @@ -1464,12 +1463,12 @@ dns_name_concatenate(dns_name_t *prefix, dns_name_t *suffix, dns_name_t *name, */ if (prefix == NULL || prefix->labels == 0) - copy_prefix = ISC_FALSE; + copy_prefix = 0; if (suffix == NULL || suffix->labels == 0) - copy_suffix = ISC_FALSE; + copy_suffix = 0; if (copy_prefix && (prefix->attributes & DNS_NAMEATTR_ABSOLUTE) != 0) { - absolute = ISC_TRUE; + absolute = 1; REQUIRE(!copy_suffix); } if (name == NULL) { @@ -1514,7 +1513,7 @@ dns_name_concatenate(dns_name_t *prefix, dns_name_t *suffix, dns_name_t *name, if (copy_suffix) { if ((suffix->attributes & DNS_NAMEATTR_ABSOLUTE) != 0) - absolute = ISC_TRUE; + absolute = 1; memmove(ndata + prefix_length, suffix->ndata, suffix->length); } @@ -1633,7 +1632,7 @@ dns_name_free(dns_name_t *name) { dns_name_invalidate(name); } -isc_boolean_t +int dns_name_dynamic(dns_name_t *name) { /* @@ -1641,7 +1640,7 @@ dns_name_dynamic(dns_name_t *name) { */ return ((name->attributes & DNS_NAMEATTR_DYNAMIC) != 0 ? - ISC_TRUE : ISC_FALSE); + 1 : 0); } void @@ -1655,7 +1654,7 @@ dns_name_format(dns_name_t *name, char *cp, unsigned int size) { * Leave room for null termination after buffer. */ isc_buffer_init(&buf, cp, size - 1); - result = dns_name_totext(name, ISC_TRUE, &buf); + result = dns_name_totext(name, 1, &buf); if (result == ISC_R_SUCCESS) { /* * Null terminate. diff --git a/usr.bin/dig/lib/dns/rdata.c b/usr.bin/dig/lib/dns/rdata.c index 98cd5212f55..22d8f9c824b 100644 --- a/usr.bin/dig/lib/dns/rdata.c +++ b/usr.bin/dig/lib/dns/rdata.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rdata.c,v 1.31 2020/09/14 08:39:12 florian Exp $ */ +/* $Id: rdata.c,v 1.32 2020/09/14 08:40:43 florian Exp $ */ /*! \file */ @@ -64,7 +64,7 @@ #define ARGS_FREESTRUCT void *source #define ARGS_CHECKOWNER dns_name_t *name, dns_rdataclass_t rdclass, \ - dns_rdatatype_t type, isc_boolean_t wildcard + dns_rdatatype_t type, int wildcard /*% * Context structure for the totext_ functions. @@ -84,7 +84,7 @@ typedef struct dns_rdata_type_lookup { } dns_rdata_type_lookup_t; static isc_result_t -txt_totext(isc_region_t *source, isc_boolean_t quote, isc_buffer_t *target); +txt_totext(isc_region_t *source, int quote, isc_buffer_t *target); static isc_result_t txt_fromwire(isc_buffer_t *source, isc_buffer_t *target); @@ -92,7 +92,7 @@ txt_fromwire(isc_buffer_t *source, isc_buffer_t *target); static isc_result_t multitxt_totext(isc_region_t *source, isc_buffer_t *target); -static isc_boolean_t +static int name_prefix(dns_name_t *name, dns_name_t *origin, dns_name_t *target); static unsigned int @@ -101,7 +101,7 @@ name_length(dns_name_t *name); static isc_result_t inet_totext(int af, isc_region_t *src, isc_buffer_t *target); -static isc_boolean_t +static int buffer_empty(isc_buffer_t *source); static isc_result_t @@ -183,13 +183,13 @@ typemap_totext(isc_region_t *sr, dns_rdata_textctx_t *tctx, { unsigned int i, j, k; unsigned int window, len; - isc_boolean_t first = ISC_TRUE; + int first = 1; for (i = 0; i < sr->length; i += len) { if (tctx != NULL && (tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) { RETERR(isc_str_tobuffer(tctx->linebreak, target)); - first = ISC_TRUE; + first = 1; } INSIST(i + 2 <= sr->length); window = sr->base[i]; @@ -207,7 +207,7 @@ typemap_totext(isc_region_t *sr, dns_rdata_textctx_t *tctx, t = window * 256 + j * 8 + k; if (!first) RETERR(isc_str_tobuffer(" ", target)); - first = ISC_FALSE; + first = 0; RETERR(dns_rdatatype_totext(t, target)); } } @@ -216,10 +216,10 @@ typemap_totext(isc_region_t *sr, dns_rdata_textctx_t *tctx, } static isc_result_t -typemap_test(isc_region_t *sr, isc_boolean_t allow_empty) { +typemap_test(isc_region_t *sr, int allow_empty) { unsigned int window, lastwindow = 0; unsigned int len; - isc_boolean_t first = ISC_TRUE; + int first = 1; unsigned int i; for (i = 0; i < sr->length; i += len) { @@ -252,7 +252,7 @@ typemap_test(isc_region_t *sr, isc_boolean_t allow_empty) { if (sr->base[i + len - 1] == 0) return (DNS_R_FORMERR); lastwindow = window; - first = ISC_FALSE; + first = 0; } if (i != sr->length) return (DNS_R_EXTRADATA); @@ -363,7 +363,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, dns_rdataclass_t rdclass, isc_region_t region; isc_buffer_t ss; isc_buffer_t st; - isc_boolean_t use_default = ISC_FALSE; + int use_default = 0; uint32_t activelength; unsigned int length; @@ -429,7 +429,7 @@ dns_rdata_towire(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) { isc_result_t result = ISC_R_NOTIMPLEMENTED; - isc_boolean_t use_default = ISC_FALSE; + int use_default = 0; isc_region_t tr; isc_buffer_t st; @@ -511,12 +511,11 @@ rdata_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx, isc_buffer_t *target) { isc_result_t result = ISC_R_NOTIMPLEMENTED; - isc_boolean_t use_default = ISC_FALSE; + int use_default = 0; unsigned int cur; REQUIRE(rdata != NULL); - REQUIRE(tctx->origin == NULL || - dns_name_isabsolute(tctx->origin) == ISC_TRUE); + REQUIRE(tctx->origin == NULL || dns_name_isabsolute(tctx->origin)); /* * Some DynDNS meta-RRs have empty rdata. @@ -714,9 +713,9 @@ dns_rdata_freestruct_tsig(dns_rdata_any_tsig_t *tsig) { freestruct_any_tsig(tsig); } -isc_boolean_t +int dns_rdata_checkowner_nsec3(dns_name_t *name, dns_rdataclass_t rdclass, - dns_rdatatype_t type, isc_boolean_t wildcard) + dns_rdatatype_t type, int wildcard) { return checkowner_nsec3(name, rdclass, type, wildcard); } @@ -1093,7 +1092,7 @@ name_length(dns_name_t *name) { } static isc_result_t -txt_totext(isc_region_t *source, isc_boolean_t quote, isc_buffer_t *target) { +txt_totext(isc_region_t *source, int quote, isc_buffer_t *target) { unsigned int tl; unsigned int n; unsigned char *sp; @@ -1109,7 +1108,7 @@ txt_totext(isc_region_t *source, isc_boolean_t quote, isc_buffer_t *target) { REQUIRE(n + 1 <= source->length); if (n == 0U) - REQUIRE(quote == ISC_TRUE); + REQUIRE(quote); if (quote) { if (tl < 1) @@ -1244,7 +1243,7 @@ multitxt_totext(isc_region_t *source, isc_buffer_t *target) { return (ISC_R_SUCCESS); } -static isc_boolean_t +static int name_prefix(dns_name_t *name, dns_name_t *origin, dns_name_t *target) { int l1, l2; @@ -1269,11 +1268,11 @@ name_prefix(dns_name_t *name, dns_name_t *origin, dns_name_t *target) { goto return_false; dns_name_getlabelsequence(name, 0, l1 - l2, target); - return (ISC_TRUE); + return (1); return_false: *target = *name; - return (ISC_FALSE); + return (0); } static isc_result_t @@ -1289,9 +1288,9 @@ inet_totext(int af, isc_region_t *src, isc_buffer_t *target) { return (ISC_R_SUCCESS); } -static isc_boolean_t +static int buffer_empty(isc_buffer_t *source) { - return((source->current == source->active) ? ISC_TRUE : ISC_FALSE); + return((source->current == source->active) ? 1 : 0); } static isc_result_t diff --git a/usr.bin/dig/lib/dns/rdata/any_255/tsig_250.c b/usr.bin/dig/lib/dns/rdata/any_255/tsig_250.c index 7e3abb03fa3..b4ce36e4779 100644 --- a/usr.bin/dig/lib/dns/rdata/any_255/tsig_250.c +++ b/usr.bin/dig/lib/dns/rdata/any_255/tsig_250.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: tsig_250.c,v 1.9 2020/02/26 18:47:58 florian Exp $ */ +/* $Id: tsig_250.c,v 1.10 2020/09/14 08:40:43 florian Exp $ */ /* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */ @@ -29,7 +29,7 @@ totext_any_tsig(ARGS_TOTEXT) { char *bufp; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; uint64_t sigtime; unsigned short n; diff --git a/usr.bin/dig/lib/dns/rdata/ch_3/a_1.c b/usr.bin/dig/lib/dns/rdata/ch_3/a_1.c index 97f9cca441b..caf18ac57ec 100644 --- a/usr.bin/dig/lib/dns/rdata/ch_3/a_1.c +++ b/usr.bin/dig/lib/dns/rdata/ch_3/a_1.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: a_1.c,v 1.12 2020/09/14 08:39:12 florian Exp $ */ +/* $Id: a_1.c,v 1.13 2020/09/14 08:40:43 florian Exp $ */ /* by Bjorn.Victor@it.uu.se, 2005-05-07 */ /* Based on generic/soa_6.c and generic/mx_15.c */ @@ -27,7 +27,7 @@ totext_ch_a(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; char buf[sizeof("0177777")]; uint16_t addr; diff --git a/usr.bin/dig/lib/dns/rdata/generic/afsdb_18.c b/usr.bin/dig/lib/dns/rdata/generic/afsdb_18.c index 2371cde16bd..f11c11727c0 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/afsdb_18.c +++ b/usr.bin/dig/lib/dns/rdata/generic/afsdb_18.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: afsdb_18.c,v 1.11 2020/02/26 18:47:58 florian Exp $ */ +/* $Id: afsdb_18.c,v 1.12 2020/09/14 08:40:43 florian Exp $ */ /* Reviewed: Wed Mar 15 14:59:00 PST 2000 by explorer */ @@ -29,7 +29,7 @@ totext_afsdb(ARGS_TOTEXT) { dns_name_t prefix; isc_region_t region; char buf[sizeof("64000 ")]; - isc_boolean_t sub; + int sub; unsigned int num; REQUIRE(rdata->type == dns_rdatatype_afsdb); diff --git a/usr.bin/dig/lib/dns/rdata/generic/caa_257.c b/usr.bin/dig/lib/dns/rdata/generic/caa_257.c index 45a7714d028..685f4a47189 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/caa_257.c +++ b/usr.bin/dig/lib/dns/rdata/generic/caa_257.c @@ -60,7 +60,7 @@ totext_caa(ARGS_TOTEXT) { /* * Tag */ - RETERR(txt_totext(®ion, ISC_FALSE, target)); + RETERR(txt_totext(®ion, 0, target)); RETERR(isc_str_tobuffer(" ", target)); /* diff --git a/usr.bin/dig/lib/dns/rdata/generic/cname_5.c b/usr.bin/dig/lib/dns/rdata/generic/cname_5.c index 54229cc4387..8f93657315f 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/cname_5.c +++ b/usr.bin/dig/lib/dns/rdata/generic/cname_5.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: cname_5.c,v 1.8 2020/02/26 18:38:15 florian Exp $ */ +/* $Id: cname_5.c,v 1.9 2020/09/14 08:40:43 florian Exp $ */ /* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */ @@ -26,7 +26,7 @@ totext_cname(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_cname); REQUIRE(rdata->length != 0); diff --git a/usr.bin/dig/lib/dns/rdata/generic/csync_62.c b/usr.bin/dig/lib/dns/rdata/generic/csync_62.c index 4ba91bd411f..834e3c354c2 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/csync_62.c +++ b/usr.bin/dig/lib/dns/rdata/generic/csync_62.c @@ -75,7 +75,7 @@ fromwire_csync(ARGS_FROMWIRE) { isc_buffer_forward(source, 6); isc_region_consume(&sr, 6); - RETERR(typemap_test(&sr, ISC_TRUE)); + RETERR(typemap_test(&sr, 1)); RETERR(isc_mem_tobuffer(target, sr.base, sr.length)); isc_buffer_forward(source, sr.length); diff --git a/usr.bin/dig/lib/dns/rdata/generic/dname_39.c b/usr.bin/dig/lib/dns/rdata/generic/dname_39.c index 7a0a3f20957..f71fac02ed4 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/dname_39.c +++ b/usr.bin/dig/lib/dns/rdata/generic/dname_39.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dname_39.c,v 1.10 2020/02/26 18:38:15 florian Exp $ */ +/* $Id: dname_39.c,v 1.11 2020/09/14 08:40:43 florian Exp $ */ /* Reviewed: Wed Mar 15 16:52:38 PST 2000 by explorer */ @@ -28,7 +28,7 @@ totext_dname(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_dname); REQUIRE(rdata->length != 0); diff --git a/usr.bin/dig/lib/dns/rdata/generic/doa_259.c b/usr.bin/dig/lib/dns/rdata/generic/doa_259.c index 1cb641c6435..0c6b304d9ea 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/doa_259.c +++ b/usr.bin/dig/lib/dns/rdata/generic/doa_259.c @@ -58,7 +58,7 @@ totext_doa(ARGS_TOTEXT) { /* * DOA-MEDIA-TYPE */ - RETERR(txt_totext(®ion, ISC_TRUE, target)); + RETERR(txt_totext(®ion, 1, target)); RETERR(isc_str_tobuffer(" ", target)); /* diff --git a/usr.bin/dig/lib/dns/rdata/generic/gpos_27.c b/usr.bin/dig/lib/dns/rdata/generic/gpos_27.c index c1dc67c80fb..37c156520a0 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/gpos_27.c +++ b/usr.bin/dig/lib/dns/rdata/generic/gpos_27.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: gpos_27.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: gpos_27.c,v 1.13 2020/09/14 08:40:43 florian Exp $ */ /* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */ @@ -36,7 +36,7 @@ totext_gpos(ARGS_TOTEXT) { dns_rdata_toregion(rdata, ®ion); for (i = 0; i < 3; i++) { - RETERR(txt_totext(®ion, ISC_TRUE, target)); + RETERR(txt_totext(®ion, 1, target)); if (i != 2) RETERR(isc_str_tobuffer(" ", target)); } diff --git a/usr.bin/dig/lib/dns/rdata/generic/hinfo_13.c b/usr.bin/dig/lib/dns/rdata/generic/hinfo_13.c index 8e0acea36c4..080e11e1687 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/hinfo_13.c +++ b/usr.bin/dig/lib/dns/rdata/generic/hinfo_13.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: hinfo_13.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: hinfo_13.c,v 1.13 2020/09/14 08:40:43 florian Exp $ */ /* * Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley. @@ -33,9 +33,9 @@ totext_hinfo(ARGS_TOTEXT) { REQUIRE(rdata->length != 0); dns_rdata_toregion(rdata, ®ion); - RETERR(txt_totext(®ion, ISC_TRUE, target)); + RETERR(txt_totext(®ion, 1, target)); RETERR(isc_str_tobuffer(" ", target)); - return (txt_totext(®ion, ISC_TRUE, target)); + return (txt_totext(®ion, 1, target)); } static inline isc_result_t diff --git a/usr.bin/dig/lib/dns/rdata/generic/hip_55.c b/usr.bin/dig/lib/dns/rdata/generic/hip_55.c index f09b1b6133a..8641fe8186e 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/hip_55.c +++ b/usr.bin/dig/lib/dns/rdata/generic/hip_55.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: hip_55.c,v 1.14 2020/02/26 18:49:02 florian Exp $ */ +/* $Id: hip_55.c,v 1.15 2020/09/14 08:40:43 florian Exp $ */ /* reviewed: TBC */ @@ -81,7 +81,7 @@ totext_hip(ARGS_TOTEXT) { while (region.length > 0) { dns_name_fromregion(&name, ®ion); - RETERR(dns_name_totext(&name, ISC_FALSE, target)); + RETERR(dns_name_totext(&name, 0, target)); isc_region_consume(®ion, name.length); if (region.length > 0) RETERR(isc_str_tobuffer(tctx->linebreak, target)); diff --git a/usr.bin/dig/lib/dns/rdata/generic/ipseckey_45.c b/usr.bin/dig/lib/dns/rdata/generic/ipseckey_45.c index 7d4554da1ae..3f5d68d742a 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/ipseckey_45.c +++ b/usr.bin/dig/lib/dns/rdata/generic/ipseckey_45.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ipseckey_45.c,v 1.13 2020/09/14 08:39:12 florian Exp $ */ +/* $Id: ipseckey_45.c,v 1.14 2020/09/14 08:40:43 florian Exp $ */ #ifndef RDATA_GENERIC_IPSECKEY_45_C #define RDATA_GENERIC_IPSECKEY_45_C @@ -85,7 +85,7 @@ totext_ipseckey(ARGS_TOTEXT) { case 3: dns_name_fromregion(&name, ®ion); - RETERR(dns_name_totext(&name, ISC_FALSE, target)); + RETERR(dns_name_totext(&name, 0, target)); isc_region_consume(®ion, name_length(&name)); break; } diff --git a/usr.bin/dig/lib/dns/rdata/generic/isdn_20.c b/usr.bin/dig/lib/dns/rdata/generic/isdn_20.c index ebcb2f4aabe..5bdae5d4def 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/isdn_20.c +++ b/usr.bin/dig/lib/dns/rdata/generic/isdn_20.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: isdn_20.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: isdn_20.c,v 1.13 2020/09/14 08:40:43 florian Exp $ */ /* Reviewed: Wed Mar 15 16:53:11 PST 2000 by bwelling */ @@ -33,11 +33,11 @@ totext_isdn(ARGS_TOTEXT) { UNUSED(tctx); dns_rdata_toregion(rdata, ®ion); - RETERR(txt_totext(®ion, ISC_TRUE, target)); + RETERR(txt_totext(®ion, 1, target)); if (region.length == 0) return (ISC_R_SUCCESS); RETERR(isc_str_tobuffer(" ", target)); - return (txt_totext(®ion, ISC_TRUE, target)); + return (txt_totext(®ion, 1, target)); } static inline isc_result_t diff --git a/usr.bin/dig/lib/dns/rdata/generic/loc_29.c b/usr.bin/dig/lib/dns/rdata/generic/loc_29.c index 2dc998589a9..77469e49b8f 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/loc_29.c +++ b/usr.bin/dig/lib/dns/rdata/generic/loc_29.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: loc_29.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: loc_29.c,v 1.13 2020/09/14 08:40:43 florian Exp $ */ /* Reviewed: Wed Mar 15 18:13:09 PST 2000 by explorer */ @@ -30,9 +30,9 @@ totext_loc(ARGS_TOTEXT) { unsigned long latitude; unsigned long longitude; unsigned long altitude; - isc_boolean_t north; - isc_boolean_t east; - isc_boolean_t below; + int north; + int east; + int below; isc_region_t sr; char buf[sizeof("89 59 59.999 N 179 59 59.999 E " "42849672.95m 90000000m 90000000m 90000000m")]; @@ -87,10 +87,10 @@ totext_loc(ARGS_TOTEXT) { latitude = uint32_fromregion(&sr); isc_region_consume(&sr, 4); if (latitude >= 0x80000000) { - north = ISC_TRUE; + north = 1; latitude -= 0x80000000; } else { - north = ISC_FALSE; + north = 0; latitude = 0x80000000 - latitude; } fs1 = (int)(latitude % 1000); @@ -105,10 +105,10 @@ totext_loc(ARGS_TOTEXT) { longitude = uint32_fromregion(&sr); isc_region_consume(&sr, 4); if (longitude >= 0x80000000) { - east = ISC_TRUE; + east = 1; longitude -= 0x80000000; } else { - east = ISC_FALSE; + east = 0; longitude = 0x80000000 - longitude; } fs2 = (int)(longitude % 1000); @@ -123,10 +123,10 @@ totext_loc(ARGS_TOTEXT) { altitude = uint32_fromregion(&sr); isc_region_consume(&sr, 4); if (altitude < 10000000U) { - below = ISC_TRUE; + below = 1; altitude = 10000000 - altitude; } else { - below =ISC_FALSE; + below =0; altitude -= 10000000; } diff --git a/usr.bin/dig/lib/dns/rdata/generic/lp_107.c b/usr.bin/dig/lib/dns/rdata/generic/lp_107.c index faf719f403c..0e0e38431e4 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/lp_107.c +++ b/usr.bin/dig/lib/dns/rdata/generic/lp_107.c @@ -24,7 +24,7 @@ totext_lp(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; char buf[sizeof("64000")]; unsigned short num; diff --git a/usr.bin/dig/lib/dns/rdata/generic/mb_7.c b/usr.bin/dig/lib/dns/rdata/generic/mb_7.c index 16183e8a244..644d46af038 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/mb_7.c +++ b/usr.bin/dig/lib/dns/rdata/generic/mb_7.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mb_7.c,v 1.10 2020/02/26 18:38:15 florian Exp $ */ +/* $Id: mb_7.c,v 1.11 2020/09/14 08:40:43 florian Exp $ */ /* Reviewed: Wed Mar 15 17:31:26 PST 2000 by bwelling */ @@ -26,7 +26,7 @@ totext_mb(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_mb); REQUIRE(rdata->length != 0); diff --git a/usr.bin/dig/lib/dns/rdata/generic/md_3.c b/usr.bin/dig/lib/dns/rdata/generic/md_3.c index f1de44fd689..272a7f22e99 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/md_3.c +++ b/usr.bin/dig/lib/dns/rdata/generic/md_3.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: md_3.c,v 1.10 2020/02/26 18:38:15 florian Exp $ */ +/* $Id: md_3.c,v 1.11 2020/09/14 08:40:43 florian Exp $ */ /* Reviewed: Wed Mar 15 17:48:20 PST 2000 by bwelling */ @@ -26,7 +26,7 @@ totext_md(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_md); REQUIRE(rdata->length != 0); diff --git a/usr.bin/dig/lib/dns/rdata/generic/mf_4.c b/usr.bin/dig/lib/dns/rdata/generic/mf_4.c index 805862a497a..b39c7d0542c 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/mf_4.c +++ b/usr.bin/dig/lib/dns/rdata/generic/mf_4.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mf_4.c,v 1.10 2020/02/26 18:38:15 florian Exp $ */ +/* $Id: mf_4.c,v 1.11 2020/09/14 08:40:43 florian Exp $ */ /* reviewed: Wed Mar 15 17:47:33 PST 2000 by brister */ @@ -26,7 +26,7 @@ totext_mf(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_mf); REQUIRE(rdata->length != 0); diff --git a/usr.bin/dig/lib/dns/rdata/generic/mg_8.c b/usr.bin/dig/lib/dns/rdata/generic/mg_8.c index 5b802cf5364..90a68b3bc08 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/mg_8.c +++ b/usr.bin/dig/lib/dns/rdata/generic/mg_8.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mg_8.c,v 1.10 2020/02/26 18:38:15 florian Exp $ */ +/* $Id: mg_8.c,v 1.11 2020/09/14 08:40:43 florian Exp $ */ /* reviewed: Wed Mar 15 17:49:21 PST 2000 by brister */ @@ -26,7 +26,7 @@ totext_mg(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_mg); REQUIRE(rdata->length != 0); diff --git a/usr.bin/dig/lib/dns/rdata/generic/minfo_14.c b/usr.bin/dig/lib/dns/rdata/generic/minfo_14.c index 1b87778eadd..ba8e0acefcb 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/minfo_14.c +++ b/usr.bin/dig/lib/dns/rdata/generic/minfo_14.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: minfo_14.c,v 1.11 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: minfo_14.c,v 1.12 2020/09/14 08:40:43 florian Exp $ */ /* reviewed: Wed Mar 15 17:45:32 PST 2000 by brister */ @@ -27,7 +27,7 @@ totext_minfo(ARGS_TOTEXT) { dns_name_t rmail; dns_name_t email; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_minfo); REQUIRE(rdata->length != 0); diff --git a/usr.bin/dig/lib/dns/rdata/generic/mr_9.c b/usr.bin/dig/lib/dns/rdata/generic/mr_9.c index cf86f669886..06a7c8d4a0d 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/mr_9.c +++ b/usr.bin/dig/lib/dns/rdata/generic/mr_9.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mr_9.c,v 1.10 2020/02/26 18:38:15 florian Exp $ */ +/* $Id: mr_9.c,v 1.11 2020/09/14 08:40:43 florian Exp $ */ /* Reviewed: Wed Mar 15 21:30:35 EST 2000 by tale */ @@ -26,7 +26,7 @@ totext_mr(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_mr); REQUIRE(rdata->length != 0); diff --git a/usr.bin/dig/lib/dns/rdata/generic/mx_15.c b/usr.bin/dig/lib/dns/rdata/generic/mx_15.c index 4d96aef1f19..30665fd5bcb 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/mx_15.c +++ b/usr.bin/dig/lib/dns/rdata/generic/mx_15.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mx_15.c,v 1.13 2020/09/14 08:39:12 florian Exp $ */ +/* $Id: mx_15.c,v 1.14 2020/09/14 08:40:43 florian Exp $ */ /* reviewed: Wed Mar 15 18:05:46 PST 2000 by brister */ @@ -28,7 +28,7 @@ totext_mx(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; char buf[sizeof("64000")]; unsigned short num; diff --git a/usr.bin/dig/lib/dns/rdata/generic/naptr_35.c b/usr.bin/dig/lib/dns/rdata/generic/naptr_35.c index 2f34a272e36..13064b48e39 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/naptr_35.c +++ b/usr.bin/dig/lib/dns/rdata/generic/naptr_35.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: naptr_35.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: naptr_35.c,v 1.13 2020/09/14 08:40:43 florian Exp $ */ /* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */ @@ -34,8 +34,8 @@ txt_valid_regex(const unsigned char *txt) { unsigned int nsub = 0; char regex[256]; char *cp; - isc_boolean_t flags = ISC_FALSE; - isc_boolean_t replace = ISC_FALSE; + int flags = 0; + int replace = 0; unsigned char c; unsigned char delim; unsigned int len; @@ -64,10 +64,10 @@ txt_valid_regex(const unsigned char *txt) { if (c == 0) return (DNS_R_SYNTAX); if (c == delim && !replace) { - replace = ISC_TRUE; + replace = 1; continue; } else if (c == delim && !flags) { - flags = ISC_TRUE; + flags = 1; continue; } else if (c == delim) return (DNS_R_SYNTAX); @@ -122,7 +122,7 @@ totext_naptr(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; char buf[sizeof("64000")]; unsigned short num; @@ -155,19 +155,19 @@ totext_naptr(ARGS_TOTEXT) { /* * Flags. */ - RETERR(txt_totext(®ion, ISC_TRUE, target)); + RETERR(txt_totext(®ion, 1, target)); RETERR(isc_str_tobuffer(" ", target)); /* * Service. */ - RETERR(txt_totext(®ion, ISC_TRUE, target)); + RETERR(txt_totext(®ion, 1, target)); RETERR(isc_str_tobuffer(" ", target)); /* * Regexp. */ - RETERR(txt_totext(®ion, ISC_TRUE, target)); + RETERR(txt_totext(®ion, 1, target)); RETERR(isc_str_tobuffer(" ", target)); /* diff --git a/usr.bin/dig/lib/dns/rdata/generic/ns_2.c b/usr.bin/dig/lib/dns/rdata/generic/ns_2.c index 0690aa544ca..6664174b5c0 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/ns_2.c +++ b/usr.bin/dig/lib/dns/rdata/generic/ns_2.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ns_2.c,v 1.8 2020/02/26 18:38:15 florian Exp $ */ +/* $Id: ns_2.c,v 1.9 2020/09/14 08:40:43 florian Exp $ */ /* Reviewed: Wed Mar 15 18:15:00 PST 2000 by bwelling */ @@ -26,7 +26,7 @@ totext_ns(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_ns); REQUIRE(rdata->length != 0); diff --git a/usr.bin/dig/lib/dns/rdata/generic/nsec3_50.c b/usr.bin/dig/lib/dns/rdata/generic/nsec3_50.c index 5d898975c95..5a63382703f 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/nsec3_50.c +++ b/usr.bin/dig/lib/dns/rdata/generic/nsec3_50.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nsec3_50.c,v 1.12 2020/02/26 18:49:02 florian Exp $ */ +/* $Id: nsec3_50.c,v 1.13 2020/09/14 08:40:43 florian Exp $ */ /* * Copyright (C) 2004 Nominet, Ltd. @@ -146,7 +146,7 @@ fromwire_nsec3(ARGS_FROMWIRE) { return (DNS_R_FORMERR); isc_region_consume(&sr, hashlen); - RETERR(typemap_test(&sr, ISC_TRUE)); + RETERR(typemap_test(&sr, 1)); RETERR(isc_mem_tobuffer(target, rr.base, rr.length)); isc_buffer_forward(source, rr.length); @@ -167,7 +167,7 @@ towire_nsec3(ARGS_TOWIRE) { } #define NSEC3_MAX_HASH_LENGTH 155 -static inline isc_boolean_t +static inline int checkowner_nsec3(ARGS_CHECKOWNER) { unsigned char owner[NSEC3_MAX_HASH_LENGTH]; isc_buffer_t buffer; @@ -186,9 +186,9 @@ checkowner_nsec3(ARGS_CHECKOWNER) { isc_region_consume(&label, 1); isc_buffer_init(&buffer, owner, sizeof(owner)); if (isc_base32hexnp_decoderegion(&label, &buffer) == ISC_R_SUCCESS) - return (ISC_TRUE); + return (1); - return (ISC_FALSE); + return (0); } #endif /* RDATA_GENERIC_NSEC3_50_C */ diff --git a/usr.bin/dig/lib/dns/rdata/generic/nsec_47.c b/usr.bin/dig/lib/dns/rdata/generic/nsec_47.c index b666dd16898..9f1d0995632 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/nsec_47.c +++ b/usr.bin/dig/lib/dns/rdata/generic/nsec_47.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nsec_47.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: nsec_47.c,v 1.13 2020/09/14 08:40:43 florian Exp $ */ /* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */ @@ -42,7 +42,7 @@ totext_nsec(ARGS_TOTEXT) { dns_rdata_toregion(rdata, &sr); dns_name_fromregion(&name, &sr); isc_region_consume(&sr, name_length(&name)); - RETERR(dns_name_totext(&name, ISC_FALSE, target)); + RETERR(dns_name_totext(&name, 0, target)); /* * Don't leave a trailing space when there's no typemap present. */ @@ -68,7 +68,7 @@ fromwire_nsec(ARGS_FROMWIRE) { RETERR(dns_name_fromwire(&name, source, dctx, options, target)); isc_buffer_activeregion(source, &sr); - RETERR(typemap_test(&sr, ISC_FALSE)); + RETERR(typemap_test(&sr, 0)); RETERR(isc_mem_tobuffer(target, sr.base, sr.length)); isc_buffer_forward(source, sr.length); return (ISC_R_SUCCESS); diff --git a/usr.bin/dig/lib/dns/rdata/generic/nxt_30.c b/usr.bin/dig/lib/dns/rdata/generic/nxt_30.c index dde232d087c..6a60d9be12e 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/nxt_30.c +++ b/usr.bin/dig/lib/dns/rdata/generic/nxt_30.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nxt_30.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: nxt_30.c,v 1.13 2020/09/14 08:40:43 florian Exp $ */ /* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */ @@ -34,7 +34,7 @@ totext_nxt(ARGS_TOTEXT) { unsigned int i, j; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_nxt); REQUIRE(rdata->length != 0); diff --git a/usr.bin/dig/lib/dns/rdata/generic/ptr_12.c b/usr.bin/dig/lib/dns/rdata/generic/ptr_12.c index 36e7e47b2e9..2a2bd2605ad 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/ptr_12.c +++ b/usr.bin/dig/lib/dns/rdata/generic/ptr_12.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ptr_12.c,v 1.11 2020/03/27 10:19:36 florian Exp $ */ +/* $Id: ptr_12.c,v 1.12 2020/09/14 08:40:43 florian Exp $ */ /* Reviewed: Thu Mar 16 14:05:12 PST 2000 by explorer */ @@ -26,7 +26,7 @@ totext_ptr(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_ptr); REQUIRE(rdata->length != 0); diff --git a/usr.bin/dig/lib/dns/rdata/generic/rp_17.c b/usr.bin/dig/lib/dns/rdata/generic/rp_17.c index bf726107fec..8a7cd04e408 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/rp_17.c +++ b/usr.bin/dig/lib/dns/rdata/generic/rp_17.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rp_17.c,v 1.11 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: rp_17.c,v 1.12 2020/09/14 08:40:43 florian Exp $ */ /* RFC1183 */ @@ -27,7 +27,7 @@ totext_rp(ARGS_TOTEXT) { dns_name_t rmail; dns_name_t email; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_rp); REQUIRE(rdata->length != 0); diff --git a/usr.bin/dig/lib/dns/rdata/generic/rrsig_46.c b/usr.bin/dig/lib/dns/rdata/generic/rrsig_46.c index eb0b64d20b9..55768e36be6 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/rrsig_46.c +++ b/usr.bin/dig/lib/dns/rdata/generic/rrsig_46.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rrsig_46.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: rrsig_46.c,v 1.13 2020/09/14 08:40:43 florian Exp $ */ /* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */ @@ -107,7 +107,7 @@ totext_rrsig(ARGS_TOTEXT) { dns_name_init(&name, NULL); dns_name_fromregion(&name, &sr); isc_region_consume(&sr, name_length(&name)); - RETERR(dns_name_totext(&name, ISC_FALSE, target)); + RETERR(dns_name_totext(&name, 0, target)); /* * Sig. diff --git a/usr.bin/dig/lib/dns/rdata/generic/rt_21.c b/usr.bin/dig/lib/dns/rdata/generic/rt_21.c index fd506e530b0..d13b1b65f1a 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/rt_21.c +++ b/usr.bin/dig/lib/dns/rdata/generic/rt_21.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rt_21.c,v 1.11 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: rt_21.c,v 1.12 2020/09/14 08:40:43 florian Exp $ */ /* reviewed: Thu Mar 16 15:02:31 PST 2000 by brister */ @@ -28,7 +28,7 @@ totext_rt(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; char buf[sizeof("64000")]; unsigned short num; diff --git a/usr.bin/dig/lib/dns/rdata/generic/sig_24.c b/usr.bin/dig/lib/dns/rdata/generic/sig_24.c index e26cd63831a..0d32c6c5737 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/sig_24.c +++ b/usr.bin/dig/lib/dns/rdata/generic/sig_24.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: sig_24.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: sig_24.c,v 1.13 2020/09/14 08:40:43 florian Exp $ */ /* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */ @@ -34,7 +34,7 @@ totext_sig(ARGS_TOTEXT) { unsigned long foot; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_sig); REQUIRE(rdata->length != 0); diff --git a/usr.bin/dig/lib/dns/rdata/generic/soa_6.c b/usr.bin/dig/lib/dns/rdata/generic/soa_6.c index 307f660d10c..a3293e460cd 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/soa_6.c +++ b/usr.bin/dig/lib/dns/rdata/generic/soa_6.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: soa_6.c,v 1.8 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: soa_6.c,v 1.9 2020/09/14 08:40:43 florian Exp $ */ /* Reviewed: Thu Mar 16 15:18:32 PST 2000 by explorer */ @@ -31,19 +31,19 @@ totext_soa(ARGS_TOTEXT) { dns_name_t mname; dns_name_t rname; dns_name_t prefix; - isc_boolean_t sub; + int sub; int i; - isc_boolean_t multiline; - isc_boolean_t comm; + int multiline; + int comm; REQUIRE(rdata->type == dns_rdatatype_soa); REQUIRE(rdata->length != 0); - multiline = ISC_TF((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0); + multiline = (tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0; if (multiline) - comm = ISC_TF((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0); + comm = (tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0; else - comm = ISC_FALSE; + comm = 0; dns_name_init(&mname, NULL); dns_name_init(&rname, NULL); @@ -81,7 +81,7 @@ totext_soa(ARGS_TOTEXT) { /* Print times in week/day/hour/minute/second form */ if (i >= 1) { RETERR(isc_str_tobuffer(" (", target)); - RETERR(dns_ttl_totext(num, ISC_TRUE, target)); + RETERR(dns_ttl_totext(num, 1, target)); RETERR(isc_str_tobuffer(")", target)); } RETERR(isc_str_tobuffer(tctx->linebreak, target)); diff --git a/usr.bin/dig/lib/dns/rdata/generic/talink_58.c b/usr.bin/dig/lib/dns/rdata/generic/talink_58.c index 433906c026d..c4a989df95d 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/talink_58.c +++ b/usr.bin/dig/lib/dns/rdata/generic/talink_58.c @@ -23,7 +23,7 @@ totext_talink(ARGS_TOTEXT) { dns_name_t prev; dns_name_t next; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_talink); REQUIRE(rdata->length != 0); diff --git a/usr.bin/dig/lib/dns/rdata/generic/tkey_249.c b/usr.bin/dig/lib/dns/rdata/generic/tkey_249.c index 73f4691e35f..97fab1f5f0d 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/tkey_249.c +++ b/usr.bin/dig/lib/dns/rdata/generic/tkey_249.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: tkey_249.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: tkey_249.c,v 1.13 2020/09/14 08:40:43 florian Exp $ */ /* * Reviewed: Thu Mar 16 17:35:30 PST 2000 by halley. @@ -32,7 +32,7 @@ totext_tkey(ARGS_TOTEXT) { unsigned long n; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_tkey); REQUIRE(rdata->length != 0); diff --git a/usr.bin/dig/lib/dns/rdata/generic/txt_16.c b/usr.bin/dig/lib/dns/rdata/generic/txt_16.c index 1da4fe293c6..28546b6e816 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/txt_16.c +++ b/usr.bin/dig/lib/dns/rdata/generic/txt_16.c @@ -28,7 +28,7 @@ generic_totext_txt(ARGS_TOTEXT) { dns_rdata_toregion(rdata, ®ion); while (region.length > 0) { - RETERR(txt_totext(®ion, ISC_TRUE, target)); + RETERR(txt_totext(®ion, 1, target)); if (region.length > 0) RETERR(isc_str_tobuffer(" ", target)); } diff --git a/usr.bin/dig/lib/dns/rdata/generic/x25_19.c b/usr.bin/dig/lib/dns/rdata/generic/x25_19.c index 2da9bf8ecaa..54f8bb8aae7 100644 --- a/usr.bin/dig/lib/dns/rdata/generic/x25_19.c +++ b/usr.bin/dig/lib/dns/rdata/generic/x25_19.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: x25_19.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */ +/* $Id: x25_19.c,v 1.12 2020/09/14 08:40:43 florian Exp $ */ /* Reviewed: Thu Mar 16 16:15:57 PST 2000 by bwelling */ @@ -33,7 +33,7 @@ totext_x25(ARGS_TOTEXT) { REQUIRE(rdata->length != 0); dns_rdata_toregion(rdata, ®ion); - return (txt_totext(®ion, ISC_TRUE, target)); + return (txt_totext(®ion, 1, target)); } static inline isc_result_t diff --git a/usr.bin/dig/lib/dns/rdata/in_1/a6_38.c b/usr.bin/dig/lib/dns/rdata/in_1/a6_38.c index d7ca82fc235..49582c0c8de 100644 --- a/usr.bin/dig/lib/dns/rdata/in_1/a6_38.c +++ b/usr.bin/dig/lib/dns/rdata/in_1/a6_38.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: a6_38.c,v 1.13 2020/09/14 08:39:12 florian Exp $ */ +/* $Id: a6_38.c,v 1.14 2020/09/14 08:40:44 florian Exp $ */ /* RFC2874 */ @@ -31,7 +31,7 @@ totext_in_a6(ARGS_TOTEXT) { char buf[sizeof("128")]; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_a6); REQUIRE(rdata->rdclass == dns_rdataclass_in); diff --git a/usr.bin/dig/lib/dns/rdata/in_1/apl_42.c b/usr.bin/dig/lib/dns/rdata/in_1/apl_42.c index b1990fd3748..d599cdc85bd 100644 --- a/usr.bin/dig/lib/dns/rdata/in_1/apl_42.c +++ b/usr.bin/dig/lib/dns/rdata/in_1/apl_42.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: apl_42.c,v 1.13 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: apl_42.c,v 1.14 2020/09/14 08:40:44 florian Exp $ */ /* RFC3123 */ @@ -28,7 +28,7 @@ totext_in_apl(ARGS_TOTEXT) { uint16_t afi; uint8_t prefix; uint8_t len; - isc_boolean_t neg; + int neg; unsigned char buf[16]; char txt[sizeof(" !64000:")]; const char *sep = ""; @@ -50,7 +50,7 @@ totext_in_apl(ARGS_TOTEXT) { prefix = *sr.base; isc_region_consume(&sr, 1); len = (*sr.base & 0x7f); - neg = ISC_TF((*sr.base & 0x80) != 0); + neg = (*sr.base & 0x80) != 0; isc_region_consume(&sr, 1); INSIST(len <= sr.length); n = snprintf(txt, sizeof(txt), "%s%s%u:", sep, diff --git a/usr.bin/dig/lib/dns/rdata/in_1/kx_36.c b/usr.bin/dig/lib/dns/rdata/in_1/kx_36.c index a88b18e6fe5..989a574e49e 100644 --- a/usr.bin/dig/lib/dns/rdata/in_1/kx_36.c +++ b/usr.bin/dig/lib/dns/rdata/in_1/kx_36.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: kx_36.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: kx_36.c,v 1.13 2020/09/14 08:40:44 florian Exp $ */ /* Reviewed: Thu Mar 16 17:24:54 PST 2000 by explorer */ @@ -28,7 +28,7 @@ totext_in_kx(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; char buf[sizeof("64000")]; unsigned short num; diff --git a/usr.bin/dig/lib/dns/rdata/in_1/nsap-ptr_23.c b/usr.bin/dig/lib/dns/rdata/in_1/nsap-ptr_23.c index 0962177c677..3860d16f30e 100644 --- a/usr.bin/dig/lib/dns/rdata/in_1/nsap-ptr_23.c +++ b/usr.bin/dig/lib/dns/rdata/in_1/nsap-ptr_23.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nsap-ptr_23.c,v 1.10 2020/02/26 18:38:15 florian Exp $ */ +/* $Id: nsap-ptr_23.c,v 1.11 2020/09/14 08:40:44 florian Exp $ */ /* Reviewed: Fri Mar 17 10:16:02 PST 2000 by gson */ @@ -28,7 +28,7 @@ totext_in_nsap_ptr(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; REQUIRE(rdata->type == dns_rdatatype_nsap_ptr); REQUIRE(rdata->rdclass == dns_rdataclass_in); diff --git a/usr.bin/dig/lib/dns/rdata/in_1/px_26.c b/usr.bin/dig/lib/dns/rdata/in_1/px_26.c index 426b5daea6f..0ae993231b3 100644 --- a/usr.bin/dig/lib/dns/rdata/in_1/px_26.c +++ b/usr.bin/dig/lib/dns/rdata/in_1/px_26.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: px_26.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: px_26.c,v 1.13 2020/09/14 08:40:44 florian Exp $ */ /* Reviewed: Mon Mar 20 10:44:27 PST 2000 */ @@ -28,7 +28,7 @@ totext_in_px(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; char buf[sizeof("64000")]; unsigned short num; diff --git a/usr.bin/dig/lib/dns/rdata/in_1/srv_33.c b/usr.bin/dig/lib/dns/rdata/in_1/srv_33.c index f7ded8556e6..830bbc49236 100644 --- a/usr.bin/dig/lib/dns/rdata/in_1/srv_33.c +++ b/usr.bin/dig/lib/dns/rdata/in_1/srv_33.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: srv_33.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: srv_33.c,v 1.13 2020/09/14 08:40:44 florian Exp $ */ /* Reviewed: Fri Mar 17 13:01:00 PST 2000 by bwelling */ @@ -28,7 +28,7 @@ totext_in_srv(ARGS_TOTEXT) { isc_region_t region; dns_name_t name; dns_name_t prefix; - isc_boolean_t sub; + int sub; char buf[sizeof("64000")]; unsigned short num; diff --git a/usr.bin/dig/lib/dns/rdataset.c b/usr.bin/dig/lib/dns/rdataset.c index be37939199a..610b3c42229 100644 --- a/usr.bin/dig/lib/dns/rdataset.c +++ b/usr.bin/dig/lib/dns/rdataset.c @@ -82,16 +82,16 @@ dns_rdataset_disassociate(dns_rdataset_t *rdataset) { rdataset->private6 = NULL; } -isc_boolean_t +int dns_rdataset_isassociated(dns_rdataset_t *rdataset) { /* * Is 'rdataset' associated? */ if (rdataset->methods != NULL) - return (ISC_TRUE); + return (1); - return (ISC_FALSE); + return (0); } static void @@ -239,7 +239,7 @@ static isc_result_t towiresorted(dns_rdataset_t *rdataset, const dns_name_t *owner_name, dns_compress_t *cctx, isc_buffer_t *target, dns_rdatasetorderfunc_t order, const void *order_arg, - isc_boolean_t partial, unsigned int *countp) + int partial, unsigned int *countp) { dns_rdata_t rdata = DNS_RDATA_INIT; isc_region_t r; @@ -247,8 +247,8 @@ towiresorted(dns_rdataset_t *rdataset, const dns_name_t *owner_name, unsigned int i, count = 0, added, choice; isc_buffer_t savedbuffer, rdlen, rrbuffer; unsigned int headlen; - isc_boolean_t question = ISC_FALSE; - isc_boolean_t shuffle = ISC_FALSE; + int question = 0; + int shuffle = 0; dns_rdata_t *in = NULL, in_fixed[MAX_SHUFFLE]; struct towire_sort *out = NULL, out_fixed[MAX_SHUFFLE]; @@ -263,7 +263,7 @@ towiresorted(dns_rdataset_t *rdataset, const dns_name_t *owner_name, REQUIRE(cctx != NULL); if ((rdataset->attributes & DNS_RDATASETATTR_QUESTION) != 0) { - question = ISC_TRUE; + question = 1; count = 1; result = dns_rdataset_first(rdataset); INSIST(result == ISC_R_NOMORE); @@ -282,13 +282,13 @@ towiresorted(dns_rdataset_t *rdataset, const dns_name_t *owner_name, if (!question && count > 1 && (!WANT_FIXED(rdataset) || order != NULL) && rdataset->type != dns_rdatatype_rrsig) - shuffle = ISC_TRUE; + shuffle = 1; if (shuffle && count > MAX_SHUFFLE) { in = reallocarray(NULL, count, sizeof(*in)); out = reallocarray(NULL, count, sizeof(*out)); if (in == NULL || out == NULL) - shuffle = ISC_FALSE; + shuffle = 0; } else { in = in_fixed; out = out_fixed; @@ -473,7 +473,7 @@ dns_rdataset_towiresorted(dns_rdataset_t *rdataset, unsigned int *countp) { return (towiresorted(rdataset, owner_name, cctx, target, - order, order_arg, ISC_FALSE, countp)); + order, order_arg, 0, countp)); } isc_result_t @@ -484,5 +484,5 @@ dns_rdataset_towire(dns_rdataset_t *rdataset, unsigned int *countp) { return (towiresorted(rdataset, owner_name, cctx, target, - NULL, NULL, ISC_FALSE, countp)); + NULL, NULL, 0, countp)); } diff --git a/usr.bin/dig/lib/dns/tsig.c b/usr.bin/dig/lib/dns/tsig.c index 51b6b31f795..795944c0647 100644 --- a/usr.bin/dig/lib/dns/tsig.c +++ b/usr.bin/dig/lib/dns/tsig.c @@ -15,7 +15,7 @@ */ /* - * $Id: tsig.c,v 1.13 2020/02/24 17:57:54 florian Exp $ + * $Id: tsig.c,v 1.14 2020/09/14 08:40:43 florian Exp $ */ /*! \file */ @@ -95,7 +95,7 @@ tsig_log(dns_tsigkey_t *key, int level, const char *fmt, ...) { char namestr[DNS_NAME_FORMATSIZE]; char creatorstr[DNS_NAME_FORMATSIZE]; - if (isc_log_wouldlog(dns_lctx, level) == ISC_FALSE) + if (!isc_log_wouldlog(dns_lctx, level)) return; if (key != NULL) { dns_name_format(&key->name, namestr, sizeof(namestr)); @@ -126,7 +126,7 @@ tsig_log(dns_tsigkey_t *key, int level, const char *fmt, ...) { isc_result_t dns_tsigkey_createfromkey(dns_name_t *name, dns_name_t *algorithm, - dst_key_t *dstkey, isc_boolean_t generated, + dst_key_t *dstkey, int generated, dns_name_t *creator, time_t inception, time_t expire, dns_tsigkey_t **key) @@ -273,7 +273,7 @@ dns_tsigkey_createfromkey(dns_name_t *name, dns_name_t *algorithm, isc_result_t dns_tsigkey_create(dns_name_t *name, dns_name_t *algorithm, - unsigned char *secret, int length, isc_boolean_t generated, + unsigned char *secret, int length, int generated, dns_name_t *creator, time_t inception, time_t expire, dns_tsigkey_t **key) @@ -419,7 +419,7 @@ dns_tsig_sign(dns_message_t *msg) { isc_result_t ret; unsigned char badtimedata[BADTIMELEN]; unsigned int sigsize = 0; - isc_boolean_t response; + int response; REQUIRE(msg != NULL); key = dns_message_gettsigkey(msg); @@ -479,7 +479,7 @@ dns_tsig_sign(dns_message_t *msg) { */ ret = dst_context_create3(key->key, DNS_LOGCATEGORY_DNSSEC, - ISC_TRUE, &ctx); + 1, &ctx); if (ret != ISC_R_SUCCESS) return (ret); @@ -717,7 +717,7 @@ dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg) uint16_t addcount, id; unsigned int siglen; unsigned int alg; - isc_boolean_t response; + int response; REQUIRE(source != NULL); tsigkey = dns_message_gettsigkey(msg); @@ -794,7 +794,7 @@ dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg) if (ret != ISC_R_SUCCESS) { msg->tsigstatus = dns_tsigerror_badkey; ret = dns_tsigkey_create(keyname, &tsig.algorithm, - NULL, 0, ISC_FALSE, NULL, + NULL, 0, 0, NULL, now, now, &msg->tsigkey); if (ret != ISC_R_SUCCESS) @@ -840,7 +840,7 @@ dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg) ret = dst_context_create3(key, DNS_LOGCATEGORY_DNSSEC, - ISC_FALSE, &ctx); + 0, &ctx); if (ret != ISC_R_SUCCESS) return (ret); @@ -1050,7 +1050,7 @@ tsig_verify_tcp(isc_buffer_t *source, dns_message_t *msg) { dst_key_t *key = NULL; unsigned char header[DNS_MESSAGE_HEADERLEN]; uint16_t addcount, id; - isc_boolean_t has_tsig = ISC_FALSE; + int has_tsig = 0; unsigned int siglen; unsigned int alg; @@ -1085,7 +1085,7 @@ tsig_verify_tcp(isc_buffer_t *source, dns_message_t *msg) { * If there is a TSIG in this message, do some checks. */ if (msg->tsig != NULL) { - has_tsig = ISC_TRUE; + has_tsig = 1; keyname = msg->tsigname; ret = dns_rdataset_first(msg->tsig); @@ -1144,7 +1144,7 @@ tsig_verify_tcp(isc_buffer_t *source, dns_message_t *msg) { if (msg->tsigctx == NULL) { ret = dst_context_create3(key, DNS_LOGCATEGORY_DNSSEC, - ISC_FALSE, &msg->tsigctx); + 0, &msg->tsigctx); if (ret != ISC_R_SUCCESS) goto cleanup_querystruct; diff --git a/usr.bin/dig/lib/dns/ttl.c b/usr.bin/dig/lib/dns/ttl.c index e565b0ee251..a52f964b694 100644 --- a/usr.bin/dig/lib/dns/ttl.c +++ b/usr.bin/dig/lib/dns/ttl.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ttl.c,v 1.5 2020/02/25 05:00:42 jsg Exp $ */ +/* $Id: ttl.c,v 1.6 2020/09/14 08:40:43 florian Exp $ */ /*! \file */ @@ -38,8 +38,8 @@ * Helper for dns_ttl_totext(). */ static isc_result_t -ttlfmt(unsigned int t, const char *s, isc_boolean_t verbose, - isc_boolean_t space, isc_buffer_t *target) +ttlfmt(unsigned int t, const char *s, int verbose, + int space, isc_buffer_t *target) { char tmp[60]; unsigned int len; @@ -67,7 +67,7 @@ ttlfmt(unsigned int t, const char *s, isc_boolean_t verbose, * Derived from bind8 ns_format_ttl(). */ isc_result_t -dns_ttl_totext(uint32_t src, isc_boolean_t verbose, isc_buffer_t *target) { +dns_ttl_totext(uint32_t src, int verbose, isc_buffer_t *target) { unsigned secs, mins, hours, days, weeks, x; secs = src % 60; src /= 60; @@ -79,24 +79,24 @@ dns_ttl_totext(uint32_t src, isc_boolean_t verbose, isc_buffer_t *target) { x = 0; if (weeks != 0) { - RETERR(ttlfmt(weeks, "week", verbose, ISC_TF(x > 0), target)); + RETERR(ttlfmt(weeks, "week", verbose, (x > 0), target)); x++; } if (days != 0) { - RETERR(ttlfmt(days, "day", verbose, ISC_TF(x > 0), target)); + RETERR(ttlfmt(days, "day", verbose, (x > 0), target)); x++; } if (hours != 0) { - RETERR(ttlfmt(hours, "hour", verbose, ISC_TF(x > 0), target)); + RETERR(ttlfmt(hours, "hour", verbose, (x > 0), target)); x++; } if (mins != 0) { - RETERR(ttlfmt(mins, "minute", verbose, ISC_TF(x > 0), target)); + RETERR(ttlfmt(mins, "minute", verbose, (x > 0), target)); x++; } if (secs != 0 || (weeks == 0 && days == 0 && hours == 0 && mins == 0)) { - RETERR(ttlfmt(secs, "second", verbose, ISC_TF(x > 0), target)); + RETERR(ttlfmt(secs, "second", verbose, (x > 0), target)); x++; } INSIST (x > 0); diff --git a/usr.bin/dig/lib/isc/base32.c b/usr.bin/dig/lib/isc/base32.c index becc95c42cb..817ea392703 100644 --- a/usr.bin/dig/lib/isc/base32.c +++ b/usr.bin/dig/lib/isc/base32.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: base32.c,v 1.7 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: base32.c,v 1.8 2020/09/14 08:40:44 florian Exp $ */ /*! \file */ @@ -115,19 +115,19 @@ typedef struct { int length; /*%< Desired length of binary data or -1 */ isc_buffer_t *target; /*%< Buffer for resulting binary data */ int digits; /*%< Number of buffered base32 digits */ - isc_boolean_t seen_end; /*%< True if "=" end marker seen */ + int seen_end; /*%< True if "=" end marker seen */ int val[8]; const char *base; /*%< Which encoding we are using */ int seen_32; /*%< Number of significant bytes if non zero */ - isc_boolean_t pad; /*%< Expect padding */ + int pad; /*%< Expect padding */ } base32_decode_ctx_t; static inline void base32_decode_init(base32_decode_ctx_t *ctx, int length, const char base[], - isc_boolean_t pad, isc_buffer_t *target) + int pad, isc_buffer_t *target) { ctx->digits = 0; - ctx->seen_end = ISC_FALSE; + ctx->seen_end = 0; ctx->seen_32 = 0; ctx->length = length; ctx->target = target; @@ -210,7 +210,7 @@ base32_decode_char(base32_decode_ctx_t *ctx, int c) { unsigned char buf[5]; if (ctx->seen_32 != 0) { - ctx->seen_end = ISC_TRUE; + ctx->seen_end = 1; n = ctx->seen_32; } buf[0] = (ctx->val[0]<<3)|(ctx->val[1]>>2); @@ -239,7 +239,7 @@ base32_decode_finish(base32_decode_ctx_t *ctx) { * Add missing padding if required. */ if (!ctx->pad && ctx->digits != 0) { - ctx->pad = ISC_TRUE; + ctx->pad = 1; do { RETERR(base32_decode_char(ctx, '=')); } while (ctx->digits != 0); @@ -251,7 +251,7 @@ base32_decode_finish(base32_decode_ctx_t *ctx) { static isc_result_t base32_decoderegion(isc_region_t *source, const char base[], - isc_boolean_t pad, isc_buffer_t *target) + int pad, isc_buffer_t *target) { base32_decode_ctx_t ctx; @@ -267,5 +267,5 @@ base32_decoderegion(isc_region_t *source, const char base[], isc_result_t isc_base32hexnp_decoderegion(isc_region_t *source, isc_buffer_t *target) { - return (base32_decoderegion(source, base32hex, ISC_FALSE, target)); + return (base32_decoderegion(source, base32hex, 0, target)); } diff --git a/usr.bin/dig/lib/isc/base64.c b/usr.bin/dig/lib/isc/base64.c index df6aef7cab1..b4b591244da 100644 --- a/usr.bin/dig/lib/isc/base64.c +++ b/usr.bin/dig/lib/isc/base64.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: base64.c,v 1.6 2020/02/26 18:47:59 florian Exp $ */ +/* $Id: base64.c,v 1.7 2020/09/14 08:40:44 florian Exp $ */ /*! \file */ @@ -91,7 +91,7 @@ typedef struct { int length; /*%< Desired length of binary data or -1 */ isc_buffer_t *target; /*%< Buffer for resulting binary data */ int digits; /*%< Number of buffered base64 digits */ - isc_boolean_t seen_end; /*%< True if "=" end marker seen */ + int seen_end; /*%< True if "=" end marker seen */ int val[4]; } base64_decode_ctx_t; @@ -99,7 +99,7 @@ static inline void base64_decode_init(base64_decode_ctx_t *ctx, int length, isc_buffer_t *target) { ctx->digits = 0; - ctx->seen_end = ISC_FALSE; + ctx->seen_end = 0; ctx->length = length; ctx->target = target; } @@ -134,7 +134,7 @@ base64_decode_char(base64_decode_ctx_t *ctx, int c) { n = (ctx->val[2] == 64) ? 1 : (ctx->val[3] == 64) ? 2 : 3; if (n != 3) { - ctx->seen_end = ISC_TRUE; + ctx->seen_end = 1; if (ctx->val[2] == 64) ctx->val[2] = 0; if (ctx->val[3] == 64) diff --git a/usr.bin/dig/lib/isc/hash.c b/usr.bin/dig/lib/isc/hash.c index d14e1541641..3bfa7818115 100644 --- a/usr.bin/dig/lib/isc/hash.c +++ b/usr.bin/dig/lib/isc/hash.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: hash.c,v 1.6 2020/02/25 05:00:43 jsg Exp $ */ +/* $Id: hash.c,v 1.7 2020/09/14 08:40:44 florian Exp $ */ /*! \file * Some portion of this code was derived from universal hash function @@ -95,7 +95,7 @@ static unsigned char maptolower[] = { }; static uint32_t fnv_offset_basis; -static isc_boolean_t fnv_once = ISC_FALSE; +static int fnv_once = 0; static void fnv_initialize(void) { @@ -111,7 +111,7 @@ fnv_initialize(void) { uint32_t isc_hash_function_reverse(const void *data, size_t length, - isc_boolean_t case_sensitive, + int case_sensitive, const uint32_t *previous_hashp) { uint32_t hval; @@ -120,7 +120,7 @@ isc_hash_function_reverse(const void *data, size_t length, REQUIRE(length == 0 || data != NULL); if (!fnv_once) { - fnv_once = ISC_TRUE; + fnv_once = 1; fnv_initialize(); } diff --git a/usr.bin/dig/lib/isc/heap.c b/usr.bin/dig/lib/isc/heap.c index c50de97d59a..2401ce7c986 100644 --- a/usr.bin/dig/lib/isc/heap.c +++ b/usr.bin/dig/lib/isc/heap.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: heap.c,v 1.6 2020/02/25 16:54:24 deraadt Exp $ */ +/* $Id: heap.c,v 1.7 2020/09/14 08:40:44 florian Exp $ */ /*! \file * Heap implementation of priority queues adapted from the following: @@ -104,7 +104,7 @@ isc_heap_destroy(isc_heap_t **heapp) { *heapp = NULL; } -static isc_boolean_t +static int resize(isc_heap_t *heap) { void **new_array; unsigned int new_size; @@ -112,7 +112,7 @@ resize(isc_heap_t *heap) { new_size = heap->size + heap->size_increment; new_array = reallocarray(NULL, new_size, sizeof(void *)); if (new_array == NULL) - return (ISC_FALSE); + return (0); if (heap->array != NULL) { memmove(new_array, heap->array, heap->size * sizeof(void *)); free(heap->array); @@ -120,7 +120,7 @@ resize(isc_heap_t *heap) { heap->size = new_size; heap->array = new_array; - return (ISC_TRUE); + return (1); } static void @@ -184,7 +184,7 @@ isc_heap_insert(isc_heap_t *heap, void *elt) { void isc_heap_delete(isc_heap_t *heap, unsigned int idx) { void *elt; - isc_boolean_t less; + int less; REQUIRE(idx >= 1 && idx <= heap->last); diff --git a/usr.bin/dig/lib/isc/hmacsha.c b/usr.bin/dig/lib/isc/hmacsha.c index 0229c4d2278..4d9592acdd3 100644 --- a/usr.bin/dig/lib/isc/hmacsha.c +++ b/usr.bin/dig/lib/isc/hmacsha.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: hmacsha.c,v 1.6 2020/02/25 18:10:17 florian Exp $ */ +/* $Id: hmacsha.c,v 1.7 2020/09/14 08:40:44 florian Exp $ */ /* * This code implements the HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, HMAC-SHA384 @@ -223,63 +223,63 @@ isc_hmacsha512_sign(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len) { * Verify signature - finalize SHA1 operation and reapply SHA1, then * compare to the supplied digest. */ -isc_boolean_t +int isc_hmacsha1_verify(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len) { unsigned char newdigest[ISC_SHA1_DIGESTLENGTH]; REQUIRE(len <= ISC_SHA1_DIGESTLENGTH); isc_hmacsha1_sign(ctx, newdigest, ISC_SHA1_DIGESTLENGTH); - return (ISC_TF(timingsafe_bcmp(digest, newdigest, len) == 0)); + return (timingsafe_bcmp(digest, newdigest, len) == 0); } /* * Verify signature - finalize SHA224 operation and reapply SHA224, then * compare to the supplied digest. */ -isc_boolean_t +int isc_hmacsha224_verify(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len) { unsigned char newdigest[ISC_SHA224_DIGESTLENGTH]; REQUIRE(len <= ISC_SHA224_DIGESTLENGTH); isc_hmacsha224_sign(ctx, newdigest, ISC_SHA224_DIGESTLENGTH); - return (ISC_TF(timingsafe_bcmp(digest, newdigest, len) == 0)); + return (timingsafe_bcmp(digest, newdigest, len) == 0); } /* * Verify signature - finalize SHA256 operation and reapply SHA256, then * compare to the supplied digest. */ -isc_boolean_t +int isc_hmacsha256_verify(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len) { unsigned char newdigest[ISC_SHA256_DIGESTLENGTH]; REQUIRE(len <= ISC_SHA256_DIGESTLENGTH); isc_hmacsha256_sign(ctx, newdigest, ISC_SHA256_DIGESTLENGTH); - return (ISC_TF(timingsafe_bcmp(digest, newdigest, len) == 0)); + return (timingsafe_bcmp(digest, newdigest, len) == 0); } /* * Verify signature - finalize SHA384 operation and reapply SHA384, then * compare to the supplied digest. */ -isc_boolean_t +int isc_hmacsha384_verify(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len) { unsigned char newdigest[ISC_SHA384_DIGESTLENGTH]; REQUIRE(len <= ISC_SHA384_DIGESTLENGTH); isc_hmacsha384_sign(ctx, newdigest, ISC_SHA384_DIGESTLENGTH); - return (ISC_TF(timingsafe_bcmp(digest, newdigest, len) == 0)); + return (timingsafe_bcmp(digest, newdigest, len) == 0); } /* * Verify signature - finalize SHA512 operation and reapply SHA512, then * compare to the supplied digest. */ -isc_boolean_t +int isc_hmacsha512_verify(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len) { unsigned char newdigest[ISC_SHA512_DIGESTLENGTH]; REQUIRE(len <= ISC_SHA512_DIGESTLENGTH); isc_hmacsha512_sign(ctx, newdigest, ISC_SHA512_DIGESTLENGTH); - return (ISC_TF(timingsafe_bcmp(digest, newdigest, len) == 0)); + return (timingsafe_bcmp(digest, newdigest, len) == 0); } diff --git a/usr.bin/dig/lib/isc/include/isc/boolean.h b/usr.bin/dig/lib/isc/include/isc/boolean.h deleted file mode 100644 index 3b71b47a0a5..00000000000 --- a/usr.bin/dig/lib/isc/include/isc/boolean.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) Internet Systems Consortium, Inc. ("ISC") - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id: boolean.h,v 1.1 2020/02/07 09:58:54 florian Exp $ */ - -#ifndef ISC_BOOLEAN_H -#define ISC_BOOLEAN_H 1 - -/*! \file isc/boolean.h */ - -typedef enum { isc_boolean_false = 0, isc_boolean_true = 1 } isc_boolean_t; - -#define ISC_FALSE isc_boolean_false -#define ISC_TRUE isc_boolean_true -#define ISC_TF(x) ((x) ? ISC_TRUE : ISC_FALSE) - -#endif /* ISC_BOOLEAN_H */ diff --git a/usr.bin/dig/lib/isc/include/isc/hash.h b/usr.bin/dig/lib/isc/include/isc/hash.h index 99cf707c83a..fbc103b1b22 100644 --- a/usr.bin/dig/lib/isc/include/isc/hash.h +++ b/usr.bin/dig/lib/isc/include/isc/hash.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: hash.h,v 1.3 2020/02/17 18:58:39 jung Exp $ */ +/* $Id: hash.h,v 1.4 2020/09/14 08:40:44 florian Exp $ */ #ifndef ISC_HASH_H #define ISC_HASH_H 1 @@ -98,7 +98,7 @@ uint32_t isc_hash_function_reverse(const void *data, size_t length, - isc_boolean_t case_sensitive, + int case_sensitive, const uint32_t *previous_hashp); /*!< * \brief Calculate a hash over data. @@ -119,7 +119,7 @@ isc_hash_function_reverse(const void *data, size_t length, * 'length' is the size of the data to be hashed. * * 'case_sensitive' specifies whether the hash key should be treated as - * case_sensitive values. It should typically be ISC_FALSE if the hash key + * case_sensitive values. It should typically be 0 if the hash key * is a DNS name. * * 'previous_hashp' is a pointer to a previous hash value returned by diff --git a/usr.bin/dig/lib/isc/include/isc/heap.h b/usr.bin/dig/lib/isc/include/isc/heap.h index 014ec656596..a94a2a8e9fd 100644 --- a/usr.bin/dig/lib/isc/include/isc/heap.h +++ b/usr.bin/dig/lib/isc/include/isc/heap.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: heap.h,v 1.3 2020/02/13 13:53:01 jsg Exp $ */ +/* $Id: heap.h,v 1.4 2020/09/14 08:40:44 florian Exp $ */ #ifndef ISC_HEAP_H #define ISC_HEAP_H 1 @@ -24,10 +24,10 @@ #include <isc/types.h> /*% - * The comparison function returns ISC_TRUE if the first argument has - * higher priority than the second argument, and ISC_FALSE otherwise. + * The comparison function returns 1 if the first argument has + * higher priority than the second argument, and 0 otherwise. */ -typedef isc_boolean_t (*isc_heapcompare_t)(void *, void *); +typedef int (*isc_heapcompare_t)(void *, void *); /*% * The index function allows the client of the heap to receive a callback @@ -61,8 +61,8 @@ isc_heap_create(isc_heapcompare_t compare, * Requires: *\li "mctx" is valid. *\li "compare" is a function which takes two void * arguments and - * returns ISC_TRUE if the first argument has a higher priority than - * the second, and ISC_FALSE otherwise. + * returns 1 if the first argument has a higher priority than + * the second, and 0 otherwise. *\li "index" is a function which takes a void *, and an unsigned int * argument. This function will be called whenever an element's * index value changes, so it may continue to delete itself from the diff --git a/usr.bin/dig/lib/isc/include/isc/hmacsha.h b/usr.bin/dig/lib/isc/include/isc/hmacsha.h index 5ac88fcb6f2..a91d08301e2 100644 --- a/usr.bin/dig/lib/isc/include/isc/hmacsha.h +++ b/usr.bin/dig/lib/isc/include/isc/hmacsha.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: hmacsha.h,v 1.5 2020/02/25 05:00:43 jsg Exp $ */ +/* $Id: hmacsha.h,v 1.6 2020/09/14 08:40:44 florian Exp $ */ /*! \file isc/hmacsha.h * This is the header file for the HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, @@ -59,7 +59,7 @@ isc_hmacsha1_update(isc_hmacsha1_t *ctx, const unsigned char *buf, void isc_hmacsha1_sign(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len); -isc_boolean_t +int isc_hmacsha1_verify(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len); void @@ -76,7 +76,7 @@ isc_hmacsha224_update(isc_hmacsha224_t *ctx, const unsigned char *buf, void isc_hmacsha224_sign(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len); -isc_boolean_t +int isc_hmacsha224_verify(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len); void @@ -93,7 +93,7 @@ isc_hmacsha256_update(isc_hmacsha256_t *ctx, const unsigned char *buf, void isc_hmacsha256_sign(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len); -isc_boolean_t +int isc_hmacsha256_verify(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len); void @@ -110,7 +110,7 @@ isc_hmacsha384_update(isc_hmacsha384_t *ctx, const unsigned char *buf, void isc_hmacsha384_sign(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len); -isc_boolean_t +int isc_hmacsha384_verify(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len); void @@ -127,7 +127,7 @@ isc_hmacsha512_update(isc_hmacsha512_t *ctx, const unsigned char *buf, void isc_hmacsha512_sign(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len); -isc_boolean_t +int isc_hmacsha512_verify(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len); #endif /* ISC_HMACSHA_H */ diff --git a/usr.bin/dig/lib/isc/include/isc/list.h b/usr.bin/dig/lib/isc/include/isc/list.h index 9007e371c3b..1c0758041ce 100644 --- a/usr.bin/dig/lib/isc/include/isc/list.h +++ b/usr.bin/dig/lib/isc/include/isc/list.h @@ -14,11 +14,10 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: list.h,v 1.2 2020/02/13 16:56:09 florian Exp $ */ +/* $Id: list.h,v 1.3 2020/09/14 08:40:44 florian Exp $ */ #ifndef ISC_LIST_H #define ISC_LIST_H 1 -#include <isc/boolean.h> #include <isc/assertions.h> #define ISC_LIST(type) struct { type *head, *tail; } @@ -37,7 +36,7 @@ #define ISC_LIST_HEAD(list) ((list).head) #define ISC_LIST_TAIL(list) ((list).tail) -#define ISC_LIST_EMPTY(list) ISC_TF((list).head == NULL) +#define ISC_LIST_EMPTY(list) ((list).head == NULL) #define __ISC_LIST_PREPENDUNSAFE(list, elt, link) \ do { \ diff --git a/usr.bin/dig/lib/isc/include/isc/log.h b/usr.bin/dig/lib/isc/include/isc/log.h index 792cb542786..44214d9bf4f 100644 --- a/usr.bin/dig/lib/isc/include/isc/log.h +++ b/usr.bin/dig/lib/isc/include/isc/log.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: log.h,v 1.7 2020/02/25 05:00:43 jsg Exp $ */ +/* $Id: log.h,v 1.8 2020/09/14 08:40:44 florian Exp $ */ #ifndef ISC_LOG_H #define ISC_LOG_H 1 @@ -123,7 +123,7 @@ typedef struct isc_logfile { * to a size large enough for the largest possible file on a system. */ off_t maximum_size; - isc_boolean_t maximum_reached; /*%< Private. */ + int maximum_reached; /*%< Private. */ } isc_logfile_t; /*% @@ -540,13 +540,13 @@ isc_log_setdebuglevel(isc_log_t *lctx, unsigned int level); *\li The debugging level is set to the requested value. */ -isc_boolean_t +int isc_log_wouldlog(isc_log_t *lctx, int level); /*%< * Determine whether logging something to 'lctx' at 'level' would * actually cause something to be logged somewhere. * - * If #ISC_FALSE is returned, it is guaranteed that nothing would + * If #0 is returned, it is guaranteed that nothing would * be logged, allowing the caller to omit unnecessary * isc_log_write() calls and possible message preformatting. */ diff --git a/usr.bin/dig/lib/isc/include/isc/netaddr.h b/usr.bin/dig/lib/isc/include/isc/netaddr.h index 120b8825faa..44b75b73672 100644 --- a/usr.bin/dig/lib/isc/include/isc/netaddr.h +++ b/usr.bin/dig/lib/isc/include/isc/netaddr.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: netaddr.h,v 1.5 2020/09/14 08:39:12 florian Exp $ */ +/* $Id: netaddr.h,v 1.6 2020/09/14 08:40:44 florian Exp $ */ #ifndef ISC_NETADDR_H #define ISC_NETADDR_H 1 @@ -42,7 +42,7 @@ struct isc_netaddr { /*%< * Compare the 'prefixlen' most significant bits of the network * addresses 'a' and 'b'. If 'b''s scope is zero then 'a''s scope is - * ignored. Return #ISC_TRUE if they are equal, #ISC_FALSE if not. + * ignored. Return #1 if they are equal, #0 if not. */ isc_result_t @@ -74,22 +74,22 @@ isc_netaddr_format(const isc_netaddr_t *na, char *array, unsigned int size); void isc_netaddr_fromsockaddr(isc_netaddr_t *netaddr, const isc_sockaddr_t *source); -isc_boolean_t +int isc_netaddr_ismulticast(isc_netaddr_t *na); /*%< - * Returns ISC_TRUE if the address is a multicast address. + * Returns 1 if the address is a multicast address. */ -isc_boolean_t +int isc_netaddr_islinklocal(isc_netaddr_t *na); /*%< - * Returns #ISC_TRUE if the address is a link local address. + * Returns #1 if the address is a link local address. */ -isc_boolean_t +int isc_netaddr_issitelocal(isc_netaddr_t *na); /*%< - * Returns #ISC_TRUE if the address is a site local address. + * Returns #1 if the address is a site local address. */ #endif /* ISC_NETADDR_H */ diff --git a/usr.bin/dig/lib/isc/include/isc/serial.h b/usr.bin/dig/lib/isc/include/isc/serial.h index 032b6a79937..a32eb645d9a 100644 --- a/usr.bin/dig/lib/isc/include/isc/serial.h +++ b/usr.bin/dig/lib/isc/include/isc/serial.h @@ -14,31 +14,29 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: serial.h,v 1.4 2020/02/17 18:58:39 jung Exp $ */ +/* $Id: serial.h,v 1.5 2020/09/14 08:40:44 florian Exp $ */ #ifndef ISC_SERIAL_H #define ISC_SERIAL_H 1 #include <inttypes.h> -#include <isc/boolean.h> - /*! \file isc/serial.h * \brief Implement 32 bit serial space arithmetic comparison functions. - * Note: Undefined results are returned as ISC_FALSE. + * Note: Undefined results are returned as 0. */ /*** *** Functions ***/ -isc_boolean_t +int isc_serial_gt(uint32_t a, uint32_t b); /*%< * Return true if 'a' > 'b' otherwise false. */ -isc_boolean_t +int isc_serial_ge(uint32_t a, uint32_t b); /*%< * Return true if 'a' >= 'b' otherwise false. diff --git a/usr.bin/dig/lib/isc/include/isc/sockaddr.h b/usr.bin/dig/lib/isc/include/isc/sockaddr.h index 45165ffe91d..5563af090fc 100644 --- a/usr.bin/dig/lib/isc/include/isc/sockaddr.h +++ b/usr.bin/dig/lib/isc/include/isc/sockaddr.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: sockaddr.h,v 1.4 2020/09/14 08:39:12 florian Exp $ */ +/* $Id: sockaddr.h,v 1.5 2020/09/14 08:40:44 florian Exp $ */ #ifndef ISC_SOCKADDR_H #define ISC_SOCKADDR_H 1 @@ -48,7 +48,7 @@ struct isc_sockaddr { #define ISC_SOCKADDR_CMPSCOPEZERO 0x0008 /*%< when comparing scopes * zero scopes always match */ -isc_boolean_t +int isc_sockaddr_compare(const isc_sockaddr_t *a, const isc_sockaddr_t *b, unsigned int flags); /*%< @@ -58,16 +58,16 @@ isc_sockaddr_compare(const isc_sockaddr_t *a, const isc_sockaddr_t *b, * 'flags' is set from ISC_SOCKADDR_CMP*. */ -isc_boolean_t +int isc_sockaddr_equal(const isc_sockaddr_t *a, const isc_sockaddr_t *b); /*%< - * Return ISC_TRUE iff the socket addresses 'a' and 'b' are equal. + * Return 1 iff the socket addresses 'a' and 'b' are equal. */ -isc_boolean_t +int isc_sockaddr_eqaddr(const isc_sockaddr_t *a, const isc_sockaddr_t *b); /*%< - * Return ISC_TRUE iff the address parts of the socket addresses + * Return 1 iff the address parts of the socket addresses * 'a' and 'b' are equal, ignoring the ports. */ @@ -149,22 +149,22 @@ isc_sockaddr_format(const isc_sockaddr_t *sa, char *array, unsigned int size); * The resulting string is guaranteed to be null-terminated. */ -isc_boolean_t +int isc_sockaddr_ismulticast(const isc_sockaddr_t *sa); /*%< - * Returns #ISC_TRUE if the address is a multicast address. + * Returns #1 if the address is a multicast address. */ -isc_boolean_t +int isc_sockaddr_islinklocal(const isc_sockaddr_t *sa); /*%< - * Returns ISC_TRUE if the address is a link local address. + * Returns 1 if the address is a link local address. */ -isc_boolean_t +int isc_sockaddr_issitelocal(const isc_sockaddr_t *sa); /*%< - * Returns ISC_TRUE if the address is a sitelocal address. + * Returns 1 if the address is a sitelocal address. */ #define ISC_SOCKADDR_FORMATSIZE \ diff --git a/usr.bin/dig/lib/isc/include/isc/symtab.h b/usr.bin/dig/lib/isc/include/isc/symtab.h index 7d628000424..d92fd7e9d5c 100644 --- a/usr.bin/dig/lib/isc/include/isc/symtab.h +++ b/usr.bin/dig/lib/isc/include/isc/symtab.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: symtab.h,v 1.3 2020/02/17 18:58:39 jung Exp $ */ +/* $Id: symtab.h,v 1.4 2020/09/14 08:40:44 florian Exp $ */ #ifndef ISC_SYMTAB_H #define ISC_SYMTAB_H 1 @@ -110,7 +110,7 @@ typedef enum { isc_result_t isc_symtab_create(unsigned int size, isc_symtabaction_t undefine_action, void *undefine_arg, - isc_boolean_t case_sensitive, isc_symtab_t **symtabp); + int case_sensitive, isc_symtab_t **symtabp); /*% Destroy a symbol table. */ void diff --git a/usr.bin/dig/lib/isc/include/isc/timer.h b/usr.bin/dig/lib/isc/include/isc/timer.h index a32996fb0d6..1fd5ca41b5d 100644 --- a/usr.bin/dig/lib/isc/include/isc/timer.h +++ b/usr.bin/dig/lib/isc/include/isc/timer.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: timer.h,v 1.12 2020/02/25 05:00:43 jsg Exp $ */ +/* $Id: timer.h,v 1.13 2020/09/14 08:40:44 florian Exp $ */ #ifndef ISC_TIMER_H #define ISC_TIMER_H 1 @@ -165,7 +165,7 @@ isc_timer_create(isc_timermgr_t *manager, isc_result_t isc_timer_reset(isc_timer_t *timer, const struct timespec *interval, - isc_boolean_t purge); + int purge); /*%< * Change the timer's type, expires, and interval values to the given * values. If 'purge' is TRUE, any pending events from this timer diff --git a/usr.bin/dig/lib/isc/include/isc/types.h b/usr.bin/dig/lib/isc/include/isc/types.h index 7feaaa58b50..0352aee05fa 100644 --- a/usr.bin/dig/lib/isc/include/isc/types.h +++ b/usr.bin/dig/lib/isc/include/isc/types.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: types.h,v 1.4 2020/02/25 13:18:31 jsg Exp $ */ +/* $Id: types.h,v 1.5 2020/09/14 08:40:44 florian Exp $ */ #ifndef ISC_TYPES_H #define ISC_TYPES_H 1 @@ -25,11 +25,6 @@ */ /* - * XXXDCL should isc_boolean_t be moved here, requiring an explicit include - * of <isc/boolean.h> when ISC_TRUE/ISC_FALSE/ISC_TF() are desired? - */ -#include <isc/boolean.h> -/* * XXXDCL This is just for ISC_LIST and ISC_LINK, but gets all of the other * list macros too. */ diff --git a/usr.bin/dig/lib/isc/lex.c b/usr.bin/dig/lib/isc/lex.c index 4fc0e3f8422..5276af014a5 100644 --- a/usr.bin/dig/lib/isc/lex.c +++ b/usr.bin/dig/lib/isc/lex.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: lex.c,v 1.11 2020/09/13 09:33:39 florian Exp $ */ +/* $Id: lex.c,v 1.12 2020/09/14 08:40:44 florian Exp $ */ /*! \file */ @@ -33,10 +33,10 @@ typedef struct inputsource { isc_result_t result; - isc_boolean_t is_file; - isc_boolean_t need_close; - isc_boolean_t at_eof; - isc_boolean_t last_was_eol; + int is_file; + int need_close; + int at_eof; + int last_was_eol; isc_buffer_t * pushback; unsigned int ignored; void * input; @@ -51,8 +51,8 @@ struct isc_lex { size_t max_token; char * data; unsigned int comments; - isc_boolean_t comment_ok; - isc_boolean_t last_was_eol; + int comment_ok; + int last_was_eol; unsigned int paren_count; unsigned int saved_paren_count; isc_lexspecials_t specials; @@ -99,8 +99,8 @@ isc_lex_create(size_t max_token, isc_lex_t **lexp) { } lex->max_token = max_token; lex->comments = 0; - lex->comment_ok = ISC_TRUE; - lex->last_was_eol = ISC_TRUE; + lex->comment_ok = 1; + lex->last_was_eol = 1; lex->paren_count = 0; lex->saved_paren_count = 0; memset(lex->specials, 0, 256); @@ -151,7 +151,7 @@ isc_lex_setspecials(isc_lex_t *lex, isc_lexspecials_t specials) { } static inline isc_result_t -new_source(isc_lex_t *lex, isc_boolean_t is_file, isc_boolean_t need_close, +new_source(isc_lex_t *lex, int is_file, int need_close, void *input, const char *name) { inputsource *source; @@ -163,7 +163,7 @@ new_source(isc_lex_t *lex, isc_boolean_t is_file, isc_boolean_t need_close, source->result = ISC_R_SUCCESS; source->is_file = is_file; source->need_close = need_close; - source->at_eof = ISC_FALSE; + source->at_eof = 0; source->last_was_eol = lex->last_was_eol; source->input = input; source->name = strdup(name); @@ -198,7 +198,7 @@ isc_lex_openfile(isc_lex_t *lex, const char *filename) { if ((stream = fopen(filename, "r")) == NULL) return (isc__errno2result(errno)); - result = new_source(lex, ISC_TRUE, ISC_TRUE, stream, filename); + result = new_source(lex, 1, 1, stream, filename); if (result != ISC_R_SUCCESS) (void)fclose(stream); return (result); @@ -245,7 +245,7 @@ static void pushback(inputsource *source, int c) { REQUIRE(source->pushback->current > 0); if (c == EOF) { - source->at_eof = ISC_FALSE; + source->at_eof = 0; return; } source->pushback->current--; @@ -280,9 +280,9 @@ isc_result_t isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { inputsource *source; int c; - isc_boolean_t done = ISC_FALSE; - isc_boolean_t no_comments = ISC_FALSE; - isc_boolean_t escaped = ISC_FALSE; + int done = 0; + int no_comments = 0; + int escaped = 0; lexstate state = lexstate_start; lexstate saved_state = lexstate_start; isc_buffer_t *buffer; @@ -348,14 +348,14 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { result = source->result; goto done; } - source->at_eof = ISC_TRUE; + source->at_eof = 1; } } else { buffer = source->input; if (buffer->current == buffer->used) { c = EOF; - source->at_eof = ISC_TRUE; + source->at_eof = 1; } else { c = *((unsigned char *)buffer->base + buffer->current); @@ -391,14 +391,14 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { ISC_LEXCOMMENT_CPLUSPLUS)) != 0) { saved_state = state; state = lexstate_maybecomment; - no_comments = ISC_TRUE; + no_comments = 1; continue; } else if (c == '#' && ((lex->comments & ISC_LEXCOMMENT_SHELL) != 0)) { saved_state = state; state = lexstate_eatline; - no_comments = ISC_TRUE; + no_comments = 1; continue; } } @@ -408,27 +408,27 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { switch (state) { case lexstate_start: if (c == EOF) { - lex->last_was_eol = ISC_FALSE; + lex->last_was_eol = 0; if ((options & ISC_LEXOPT_EOF) == 0) { result = ISC_R_EOF; goto done; } tokenp->type = isc_tokentype_eof; - done = ISC_TRUE; + done = 1; } else if (c == '\n') { - lex->last_was_eol = ISC_TRUE; + lex->last_was_eol = 1; } else if (c == '"' && (options & ISC_LEXOPT_QSTRING) != 0) { - lex->last_was_eol = ISC_FALSE; - no_comments = ISC_TRUE; + lex->last_was_eol = 0; + no_comments = 1; state = lexstate_qstring; } else if (lex->specials[c]) { - lex->last_was_eol = ISC_FALSE; + lex->last_was_eol = 0; tokenp->type = isc_tokentype_special; tokenp->value.as_char = c; - done = ISC_TRUE; + done = 1; } else { - lex->last_was_eol = ISC_FALSE; + lex->last_was_eol = 0; state = lexstate_string; goto no_read; } @@ -451,7 +451,7 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { tokenp->value.as_textregion.length = (unsigned int) (lex->max_token - remaining); - done = ISC_TRUE; + done = 1; continue; } if (remaining == 0U) { @@ -477,7 +477,7 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { } pushback(source, c); c = '/'; - no_comments = ISC_FALSE; + no_comments = 0; state = saved_state; goto no_read; case lexstate_ccomment: @@ -501,7 +501,7 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { * numbers. */ c = ' '; - no_comments = ISC_FALSE; + no_comments = 0; state = saved_state; goto no_read; } else if (c != '*') @@ -509,7 +509,7 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { break; case lexstate_eatline: if ((c == '\n') || (c == EOF)) { - no_comments = ISC_FALSE; + no_comments = 0; state = saved_state; goto no_read; } @@ -521,7 +521,7 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { } if (c == '"') { if (escaped) { - escaped = ISC_FALSE; + escaped = 0; /* * Overwrite the preceding backslash. */ @@ -534,8 +534,8 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { tokenp->value.as_textregion.length = (unsigned int) (lex->max_token - remaining); - no_comments = ISC_FALSE; - done = ISC_TRUE; + no_comments = 0; + done = 1; } } else { if (c == '\n' && !escaped && @@ -545,9 +545,9 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { goto done; } if (c == '\\' && !escaped) - escaped = ISC_TRUE; + escaped = 1; else - escaped = ISC_FALSE; + escaped = 0; if (remaining == 0U) { result = grow_data(lex, &remaining, &curr, &prev); @@ -594,7 +594,7 @@ isc_lex_ungettoken(isc_lex_t *lex, isc_token_t *tokenp) { isc_buffer_first(source->pushback); lex->paren_count = lex->saved_paren_count; source->line = source->saved_line; - source->at_eof = ISC_FALSE; + source->at_eof = 0; } void diff --git a/usr.bin/dig/lib/isc/log.c b/usr.bin/dig/lib/isc/log.c index 2bc3c503d38..0feb1c322ed 100644 --- a/usr.bin/dig/lib/isc/log.c +++ b/usr.bin/dig/lib/isc/log.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: log.c,v 1.17 2020/02/24 13:49:38 jsg Exp $ */ +/* $Id: log.c,v 1.18 2020/09/14 08:40:44 florian Exp $ */ /*! \file * \author Principal Authors: DCL */ @@ -97,7 +97,7 @@ struct isc_logconfig { unsigned int duplicate_interval; int highest_level; char * tag; - isc_boolean_t dynamic; + int dynamic; }; /*! @@ -206,7 +206,7 @@ sync_channellist(isc_logconfig_t *lcfg); static void isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category, - isc_logmodule_t *module, int level, isc_boolean_t write_once, + isc_logmodule_t *module, int level, int write_once, const char *format, va_list args) __attribute__((__format__(__printf__, 6, 0))); @@ -293,7 +293,7 @@ isc_logconfig_create(isc_log_t *lctx, isc_logconfig_t **lcfgp) { lcfg->duplicate_interval = 0; lcfg->highest_level = level; lcfg->tag = NULL; - lcfg->dynamic = ISC_FALSE; + lcfg->dynamic = 0; ISC_LIST_INIT(lcfg->channels); @@ -422,7 +422,7 @@ isc_logconfig_destroy(isc_logconfig_t **lcfgp) { if (lcfg->channellist_count > 0) free(lcfg->channellists); - lcfg->dynamic = ISC_FALSE; + lcfg->dynamic = 0; if (lcfg->tag != NULL) free(lcfg->tag); lcfg->tag = NULL; @@ -638,7 +638,7 @@ isc_log_write(isc_log_t *lctx, isc_logcategory_t *category, */ va_start(args, format); - isc_log_doit(lctx, category, module, level, ISC_FALSE, format, args); + isc_log_doit(lctx, category, module, level, 0, format, args); va_end(args); } @@ -696,7 +696,7 @@ assignchannel(isc_logconfig_t *lcfg, unsigned int category_id, if (lcfg->highest_level < channel->level) lcfg->highest_level = channel->level; if (channel->level == ISC_LOG_DYNAMIC) - lcfg->dynamic = ISC_TRUE; + lcfg->dynamic = 1; } return (ISC_R_SUCCESS); @@ -741,7 +741,7 @@ sync_channellist(isc_logconfig_t *lcfg) { return (ISC_R_SUCCESS); } -isc_boolean_t +int isc_log_wouldlog(isc_log_t *lctx, int level) { /* * If the level is (mathematically) less than or equal to the @@ -757,25 +757,25 @@ isc_log_wouldlog(isc_log_t *lctx, int level) { */ if (lctx == NULL || lctx->logconfig == NULL) - return (ISC_FALSE); + return (0); - return (ISC_TF(level <= lctx->logconfig->highest_level || + return (level <= lctx->logconfig->highest_level || (lctx->logconfig->dynamic && - level <= lctx->debug_level))); + level <= lctx->debug_level)); } static void isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category, - isc_logmodule_t *module, int level, isc_boolean_t write_once, + isc_logmodule_t *module, int level, int write_once, const char *format, va_list args) { int syslog_level; char time_string[64]; char level_string[24]; const char *iformat; - isc_boolean_t matched = ISC_FALSE; - isc_boolean_t printtime, printtag, printcolon; - isc_boolean_t printcategory, printmodule, printlevel; + int matched = 0; + int printtime, printtag, printcolon; + int printcategory, printmodule, printlevel; isc_logconfig_t *lcfg; isc_logchannel_t *channel; isc_logchannellist_t *category_channels; @@ -846,7 +846,7 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category, continue; } - matched = ISC_TRUE; + matched = 1; channel = category_channels->channel; category_channels = ISC_LIST_NEXT(category_channels, link); @@ -979,19 +979,15 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category, } } - printtime = ISC_TF((channel->flags & ISC_LOG_PRINTTIME) - != 0); - printtag = ISC_TF((channel->flags & + printtime = (channel->flags & ISC_LOG_PRINTTIME) != 0; + printtag = (channel->flags & (ISC_LOG_PRINTTAG|ISC_LOG_PRINTPREFIX)) - != 0 && lcfg->tag != NULL); - printcolon = ISC_TF((channel->flags & ISC_LOG_PRINTTAG) - != 0 && lcfg->tag != NULL); - printcategory = ISC_TF((channel->flags & ISC_LOG_PRINTCATEGORY) - != 0); - printmodule = ISC_TF((channel->flags & ISC_LOG_PRINTMODULE) - != 0); - printlevel = ISC_TF((channel->flags & ISC_LOG_PRINTLEVEL) - != 0); + != 0 && lcfg->tag != NULL; + printcolon = (channel->flags & ISC_LOG_PRINTTAG) + != 0 && lcfg->tag != NULL; + printcategory = (channel->flags & ISC_LOG_PRINTCATEGORY) != 0; + printmodule = (channel->flags & ISC_LOG_PRINTMODULE) != 0; + printlevel = (channel->flags & ISC_LOG_PRINTLEVEL) != 0; switch (channel->type) { case ISC_LOG_TOFILEDESC: diff --git a/usr.bin/dig/lib/isc/netaddr.c b/usr.bin/dig/lib/isc/netaddr.c index a55c81688cf..eff6c2f5688 100644 --- a/usr.bin/dig/lib/isc/netaddr.c +++ b/usr.bin/dig/lib/isc/netaddr.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: netaddr.c,v 1.8 2020/09/14 08:39:12 florian Exp $ */ +/* $Id: netaddr.c,v 1.9 2020/09/14 08:40:44 florian Exp $ */ /*! \file */ @@ -118,38 +118,38 @@ isc_netaddr_fromsockaddr(isc_netaddr_t *t, const isc_sockaddr_t *s) { } } -isc_boolean_t +int isc_netaddr_ismulticast(isc_netaddr_t *na) { switch (na->family) { case AF_INET: - return (ISC_TF(IN_MULTICAST(na->type.in.s_addr))); + return (IN_MULTICAST(na->type.in.s_addr)); case AF_INET6: - return (ISC_TF(IN6_IS_ADDR_MULTICAST(&na->type.in6))); + return (IN6_IS_ADDR_MULTICAST(&na->type.in6)); default: - return (ISC_FALSE); /* XXXMLG ? */ + return (0); /* XXXMLG ? */ } } -isc_boolean_t +int isc_netaddr_islinklocal(isc_netaddr_t *na) { switch (na->family) { case AF_INET: - return (ISC_FALSE); + return (0); case AF_INET6: - return (ISC_TF(IN6_IS_ADDR_LINKLOCAL(&na->type.in6))); + return (IN6_IS_ADDR_LINKLOCAL(&na->type.in6)); default: - return (ISC_FALSE); + return (0); } } -isc_boolean_t +int isc_netaddr_issitelocal(isc_netaddr_t *na) { switch (na->family) { case AF_INET: - return (ISC_FALSE); + return (0); case AF_INET6: - return (ISC_TF(IN6_IS_ADDR_SITELOCAL(&na->type.in6))); + return (IN6_IS_ADDR_SITELOCAL(&na->type.in6)); default: - return (ISC_FALSE); + return (0); } } diff --git a/usr.bin/dig/lib/isc/regex.c b/usr.bin/dig/lib/isc/regex.c index 3b5e05a04c0..9ff572460e8 100644 --- a/usr.bin/dig/lib/isc/regex.c +++ b/usr.bin/dig/lib/isc/regex.c @@ -33,18 +33,18 @@ isc_regex_validate(const char *c) { ":space:", ":blank:", ":lower:", ":upper:", ":cntrl:", ":print:", ":xdigit:" }; - isc_boolean_t seen_comma = ISC_FALSE; - isc_boolean_t seen_high = ISC_FALSE; - isc_boolean_t seen_char = ISC_FALSE; - isc_boolean_t seen_ec = ISC_FALSE; - isc_boolean_t seen_ce = ISC_FALSE; - isc_boolean_t have_atom = ISC_FALSE; + int seen_comma = 0; + int seen_high = 0; + int seen_char = 0; + int seen_ec = 0; + int seen_ce = 0; + int have_atom = 0; int group = 0; int range = 0; int sub = 0; - isc_boolean_t empty_ok = ISC_FALSE; - isc_boolean_t neg = ISC_FALSE; - isc_boolean_t was_multiple = ISC_FALSE; + int empty_ok = 0; + int neg = 0; + int was_multiple = 0; unsigned int low = 0; unsigned int high = 0; const char *ccname = NULL; @@ -65,8 +65,8 @@ isc_regex_validate(const char *c) { case '7': case '8': case '9': if ((*c - '0') > sub) return(-1); - have_atom = ISC_TRUE; - was_multiple = ISC_FALSE; + have_atom = 1; + was_multiple = 0; break; case 0: return(-1); @@ -77,9 +77,9 @@ isc_regex_validate(const char *c) { break; case '[': /* bracket start */ ++c; - neg = ISC_FALSE; - was_multiple = ISC_FALSE; - seen_char = ISC_FALSE; + neg = 0; + was_multiple = 0; + seen_char = 0; state = parse_bracket; break; case '{': /* bound start */ @@ -91,8 +91,8 @@ isc_regex_validate(const char *c) { return(-1); if (was_multiple) return(-1); - seen_comma = ISC_FALSE; - seen_high = ISC_FALSE; + seen_comma = 0; + seen_high = 0; low = high = 0; state = parse_bound; break; @@ -100,15 +100,15 @@ isc_regex_validate(const char *c) { goto literal; } ++c; - have_atom = ISC_TRUE; - was_multiple = ISC_TRUE; + have_atom = 1; + was_multiple = 1; break; case '}': goto literal; case '(': /* group start */ - have_atom = ISC_FALSE; - was_multiple = ISC_FALSE; - empty_ok = ISC_TRUE; + have_atom = 0; + was_multiple = 0; + empty_ok = 1; ++group; ++sub; ++c; @@ -116,8 +116,8 @@ isc_regex_validate(const char *c) { case ')': /* group end */ if (group && !have_atom && !empty_ok) return(-1); - have_atom = ISC_TRUE; - was_multiple = ISC_FALSE; + have_atom = 1; + was_multiple = 0; if (group != 0) --group; ++c; @@ -125,15 +125,15 @@ isc_regex_validate(const char *c) { case '|': /* alternative seperator */ if (!have_atom) return(-1); - have_atom = ISC_FALSE; - empty_ok = ISC_FALSE; - was_multiple = ISC_FALSE; + have_atom = 0; + empty_ok = 0; + was_multiple = 0; ++c; break; case '^': case '$': - have_atom = ISC_TRUE; - was_multiple = ISC_TRUE; + have_atom = 1; + was_multiple = 1; ++c; break; case '+': @@ -143,15 +143,15 @@ isc_regex_validate(const char *c) { return(-1); if (!have_atom) return(-1); - have_atom = ISC_TRUE; - was_multiple = ISC_TRUE; + have_atom = 1; + was_multiple = 1; ++c; break; case '.': default: literal: - have_atom = ISC_TRUE; - was_multiple = ISC_FALSE; + have_atom = 1; + was_multiple = 0; ++c; break; } @@ -165,7 +165,7 @@ isc_regex_validate(const char *c) { if (low > 255) return(-1); } else { - seen_high = ISC_TRUE; + seen_high = 1; high = high * 10 + *c - '0'; if (high > 255) return(-1); @@ -175,7 +175,7 @@ isc_regex_validate(const char *c) { case ',': if (seen_comma) return(-1); - seen_comma = ISC_TRUE; + seen_comma = 1; ++c; break; default: @@ -184,7 +184,7 @@ isc_regex_validate(const char *c) { case '}': if (seen_high && low > high) return(-1); - seen_comma = ISC_FALSE; + seen_comma = 0; state = none; ++c; break; @@ -194,7 +194,7 @@ isc_regex_validate(const char *c) { switch (*c) { case '^': if (seen_char || neg) goto inside; - neg = ISC_TRUE; + neg = 1; ++c; break; case '-': @@ -212,14 +212,14 @@ isc_regex_validate(const char *c) { if (range != 0) --range; ++c; state = parse_ce; - seen_ce = ISC_FALSE; + seen_ce = 0; break; case '=': /* equivalence class */ if (range == 2) return(-1); ++c; state = parse_ec; - seen_ec = ISC_FALSE; + seen_ec = 0; break; case ':': /* character class */ if (range == 2) @@ -229,7 +229,7 @@ isc_regex_validate(const char *c) { state = parse_cc; break; } - seen_char = ISC_TRUE; + seen_char = 1; break; case ']': if (!c[1] && !seen_char) @@ -238,12 +238,12 @@ isc_regex_validate(const char *c) { goto inside; ++c; range = 0; - have_atom = ISC_TRUE; + have_atom = 1; state = none; break; default: inside: - seen_char = ISC_TRUE; + seen_char = 1; if (range == 2 && (*c & 0xff) < range_start) return(-1); if (range != 0) @@ -269,7 +269,7 @@ isc_regex_validate(const char *c) { range_start = 256; else range_start = '.'; - seen_ce = ISC_TRUE; + seen_ce = 1; break; } break; @@ -278,7 +278,7 @@ isc_regex_validate(const char *c) { range_start = 256; else range_start = *c; - seen_ce = ISC_TRUE; + seen_ce = 1; ++c; break; } @@ -295,12 +295,12 @@ isc_regex_validate(const char *c) { state = parse_bracket; break; default: - seen_ec = ISC_TRUE; + seen_ec = 1; break; } break; default: - seen_ec = ISC_TRUE; + seen_ec = 1; ++c; break; } @@ -312,7 +312,7 @@ isc_regex_validate(const char *c) { switch (*c) { case ']': { unsigned int i; - isc_boolean_t found = ISC_FALSE; + int found = 0; for (i = 0; i < sizeof(cc)/sizeof(*cc); i++) @@ -324,7 +324,7 @@ isc_regex_validate(const char *c) { continue; if (strncmp(cc[i], ccname, len)) continue; - found = ISC_TRUE; + found = 1; } if (!found) return(-1); diff --git a/usr.bin/dig/lib/isc/result.c b/usr.bin/dig/lib/isc/result.c index 1d3b8da7b00..5a375b4e2fc 100644 --- a/usr.bin/dig/lib/isc/result.c +++ b/usr.bin/dig/lib/isc/result.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.c,v 1.4 2020/02/25 05:00:43 jsg Exp $ */ +/* $Id: result.c,v 1.5 2020/09/14 08:40:44 florian Exp $ */ /*! \file */ @@ -101,7 +101,7 @@ static const char *description[ISC_R_NRESULTS] = { #define ISC_RESULT_RESULTSET 2 -static isc_boolean_t once = ISC_FALSE; +static int once = 0; static ISC_LIST(resulttable) tables; static isc_result_t @@ -149,7 +149,7 @@ initialize_action(void) { static void initialize(void) { if (!once) { - once = ISC_TRUE; + once = 1; initialize_action(); } } diff --git a/usr.bin/dig/lib/isc/serial.c b/usr.bin/dig/lib/isc/serial.c index 6c9e61236c9..9735b6271cb 100644 --- a/usr.bin/dig/lib/isc/serial.c +++ b/usr.bin/dig/lib/isc/serial.c @@ -14,18 +14,18 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: serial.c,v 1.3 2020/02/25 05:00:43 jsg Exp $ */ +/* $Id: serial.c,v 1.4 2020/09/14 08:40:44 florian Exp $ */ /*! \file */ #include <isc/serial.h> -isc_boolean_t +int isc_serial_gt(uint32_t a, uint32_t b) { - return (((int32_t)(a - b) > 0) ? ISC_TRUE : ISC_FALSE); + return (((int32_t)(a - b) > 0) ? 1 : 0); } -isc_boolean_t +int isc_serial_ge(uint32_t a, uint32_t b) { - return ((a == b) ? ISC_TRUE : isc_serial_gt(a, b)); + return ((a == b) ? 1 : isc_serial_gt(a, b)); } diff --git a/usr.bin/dig/lib/isc/sockaddr.c b/usr.bin/dig/lib/isc/sockaddr.c index c53c5473c23..f0dffff3c42 100644 --- a/usr.bin/dig/lib/isc/sockaddr.c +++ b/usr.bin/dig/lib/isc/sockaddr.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: sockaddr.c,v 1.8 2020/09/14 08:39:12 florian Exp $ */ +/* $Id: sockaddr.c,v 1.9 2020/09/14 08:40:44 florian Exp $ */ /*! \file */ @@ -28,27 +28,27 @@ #include <string.h> #include <isc/util.h> -isc_boolean_t +int isc_sockaddr_equal(const isc_sockaddr_t *a, const isc_sockaddr_t *b) { return (isc_sockaddr_compare(a, b, ISC_SOCKADDR_CMPADDR| ISC_SOCKADDR_CMPPORT| ISC_SOCKADDR_CMPSCOPE)); } -isc_boolean_t +int isc_sockaddr_eqaddr(const isc_sockaddr_t *a, const isc_sockaddr_t *b) { return (isc_sockaddr_compare(a, b, ISC_SOCKADDR_CMPADDR| ISC_SOCKADDR_CMPSCOPE)); } -isc_boolean_t +int isc_sockaddr_compare(const isc_sockaddr_t *a, const isc_sockaddr_t *b, unsigned int flags) { REQUIRE(a != NULL && b != NULL); if (a->length != b->length) - return (ISC_FALSE); + return (0); /* * We don't just memcmp because the sin_zero field isn't always @@ -56,41 +56,41 @@ isc_sockaddr_compare(const isc_sockaddr_t *a, const isc_sockaddr_t *b, */ if (a->type.sa.sa_family != b->type.sa.sa_family) - return (ISC_FALSE); + return (0); switch (a->type.sa.sa_family) { case AF_INET: if ((flags & ISC_SOCKADDR_CMPADDR) != 0 && memcmp(&a->type.sin.sin_addr, &b->type.sin.sin_addr, sizeof(a->type.sin.sin_addr)) != 0) - return (ISC_FALSE); + return (0); if ((flags & ISC_SOCKADDR_CMPPORT) != 0 && a->type.sin.sin_port != b->type.sin.sin_port) - return (ISC_FALSE); + return (0); break; case AF_INET6: if ((flags & ISC_SOCKADDR_CMPADDR) != 0 && memcmp(&a->type.sin6.sin6_addr, &b->type.sin6.sin6_addr, sizeof(a->type.sin6.sin6_addr)) != 0) - return (ISC_FALSE); + return (0); /* * If ISC_SOCKADDR_CMPSCOPEZERO is set then don't return - * ISC_FALSE if one of the scopes in zero. + * 0 if one of the scopes in zero. */ if ((flags & ISC_SOCKADDR_CMPSCOPE) != 0 && a->type.sin6.sin6_scope_id != b->type.sin6.sin6_scope_id && ((flags & ISC_SOCKADDR_CMPSCOPEZERO) == 0 || (a->type.sin6.sin6_scope_id != 0 && b->type.sin6.sin6_scope_id != 0))) - return (ISC_FALSE); + return (0); if ((flags & ISC_SOCKADDR_CMPPORT) != 0 && a->type.sin6.sin6_port != b->type.sin6.sin6_port) - return (ISC_FALSE); + return (0); break; default: if (memcmp(&a->type, &b->type, a->length) != 0) - return (ISC_FALSE); + return (0); } - return (ISC_TRUE); + return (1); } isc_result_t @@ -253,7 +253,7 @@ isc_sockaddr_getport(const isc_sockaddr_t *sockaddr) { return (port); } -isc_boolean_t +int isc_sockaddr_ismulticast(const isc_sockaddr_t *sockaddr) { isc_netaddr_t netaddr; @@ -262,10 +262,10 @@ isc_sockaddr_ismulticast(const isc_sockaddr_t *sockaddr) { isc_netaddr_fromsockaddr(&netaddr, sockaddr); return (isc_netaddr_ismulticast(&netaddr)); } - return (ISC_FALSE); + return (0); } -isc_boolean_t +int isc_sockaddr_issitelocal(const isc_sockaddr_t *sockaddr) { isc_netaddr_t netaddr; @@ -273,10 +273,10 @@ isc_sockaddr_issitelocal(const isc_sockaddr_t *sockaddr) { isc_netaddr_fromsockaddr(&netaddr, sockaddr); return (isc_netaddr_issitelocal(&netaddr)); } - return (ISC_FALSE); + return (0); } -isc_boolean_t +int isc_sockaddr_islinklocal(const isc_sockaddr_t *sockaddr) { isc_netaddr_t netaddr; @@ -284,5 +284,5 @@ isc_sockaddr_islinklocal(const isc_sockaddr_t *sockaddr) { isc_netaddr_fromsockaddr(&netaddr, sockaddr); return (isc_netaddr_islinklocal(&netaddr)); } - return (ISC_FALSE); + return (0); } diff --git a/usr.bin/dig/lib/isc/symtab.c b/usr.bin/dig/lib/isc/symtab.c index 948b52a3738..06551f69dbe 100644 --- a/usr.bin/dig/lib/isc/symtab.c +++ b/usr.bin/dig/lib/isc/symtab.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: symtab.c,v 1.5 2020/02/25 16:54:24 deraadt Exp $ */ +/* $Id: symtab.c,v 1.6 2020/09/14 08:40:44 florian Exp $ */ /*! \file */ @@ -41,14 +41,14 @@ struct isc_symtab { eltlist_t * table; isc_symtabaction_t undefine_action; void * undefine_arg; - isc_boolean_t case_sensitive; + int case_sensitive; }; isc_result_t isc_symtab_create(unsigned int size, isc_symtabaction_t undefine_action, void *undefine_arg, - isc_boolean_t case_sensitive, + int case_sensitive, isc_symtab_t **symtabp) { isc_symtab_t *symtab; @@ -104,7 +104,7 @@ isc_symtab_destroy(isc_symtab_t **symtabp) { } static inline unsigned int -hash(const char *key, isc_boolean_t case_sensitive) { +hash(const char *key, int case_sensitive) { const char *s; unsigned int h = 0; int c; diff --git a/usr.bin/dig/lib/isc/task.c b/usr.bin/dig/lib/isc/task.c index 4614a94f74b..bf8e2978350 100644 --- a/usr.bin/dig/lib/isc/task.c +++ b/usr.bin/dig/lib/isc/task.c @@ -80,9 +80,9 @@ struct isc_taskmgr { isc_taskmgrmode_t mode; unsigned int tasks_running; unsigned int tasks_ready; - isc_boolean_t pause_requested; - isc_boolean_t exclusive_requested; - isc_boolean_t exiting; + int pause_requested; + int exclusive_requested; + int exiting; /* * Multiple threads can read/write 'excl' at the same time, so we need @@ -99,7 +99,7 @@ struct isc_taskmgr { static isc_taskmgr_t *taskmgr = NULL; -static inline isc_boolean_t +static inline int empty_readyq(isc_taskmgr_t *manager); static inline isc_task_t * @@ -132,7 +132,7 @@ isc_task_create(isc_taskmgr_t *manager, unsigned int quantum, isc_task_t **taskp) { isc_task_t *task; - isc_boolean_t exiting; + int exiting; REQUIRE(taskp != NULL && *taskp == NULL); @@ -154,13 +154,13 @@ isc_task_create(isc_taskmgr_t *manager, unsigned int quantum, INIT_LINK(task, ready_link); INIT_LINK(task, ready_priority_link); - exiting = ISC_FALSE; + exiting = 0; if (!manager->exiting) { if (task->quantum == 0) task->quantum = manager->default_quantum; APPEND(manager->tasks, task, link); } else - exiting = ISC_TRUE; + exiting = 1; if (exiting) { free(task); @@ -186,9 +186,9 @@ isc_task_attach(isc_task_t *source0, isc_task_t **targetp) { *targetp = (isc_task_t *)source; } -static inline isc_boolean_t +static inline int task_shutdown(isc_task_t *task) { - isc_boolean_t was_idle = ISC_FALSE; + int was_idle = 0; isc_event_t *event, *prev; /* @@ -200,7 +200,7 @@ task_shutdown(isc_task_t *task) { if (task->state == task_state_idle) { INSIST(EMPTY(task->events)); task->state = task_state_ready; - was_idle = ISC_TRUE; + was_idle = 1; } INSIST(task->state == task_state_ready || task->state == task_state_running); @@ -235,7 +235,7 @@ task_ready(isc_task_t *task) { push_readyq(manager, task); } -static inline isc_boolean_t +static inline int task_detach(isc_task_t *task) { /* @@ -256,16 +256,16 @@ task_detach(isc_task_t *task) { * loop to deal with shutting down and termination. */ task->state = task_state_ready; - return (ISC_TRUE); + return (1); } - return (ISC_FALSE); + return (0); } void isc_task_detach(isc_task_t **taskp) { isc_task_t *task; - isc_boolean_t was_idle; + int was_idle; /* * Detach *taskp from its task. @@ -282,9 +282,9 @@ isc_task_detach(isc_task_t **taskp) { *taskp = NULL; } -static inline isc_boolean_t +static inline int task_send(isc_task_t *task, isc_event_t **eventp) { - isc_boolean_t was_idle = ISC_FALSE; + int was_idle = 0; isc_event_t *event; /* @@ -299,7 +299,7 @@ task_send(isc_task_t *task, isc_event_t **eventp) { REQUIRE(!ISC_LINK_LINKED(event, ev_ratelink)); if (task->state == task_state_idle) { - was_idle = ISC_TRUE; + was_idle = 1; INSIST(EMPTY(task->events)); task->state = task_state_ready; } @@ -314,7 +314,7 @@ task_send(isc_task_t *task, isc_event_t **eventp) { void isc_task_send(isc_task_t *task, isc_event_t **eventp) { - isc_boolean_t was_idle; + int was_idle; /* * Send '*event' to 'task'. @@ -349,7 +349,7 @@ isc_task_send(isc_task_t *task, isc_event_t **eventp) { void isc_task_sendanddetach(isc_task_t **taskp, isc_event_t **eventp) { - isc_boolean_t idle1, idle2; + int idle1, idle2; isc_task_t *task; /* @@ -381,7 +381,7 @@ isc_task_sendanddetach(isc_task_t **taskp, isc_event_t **eventp) { static unsigned int dequeue_events(isc_task_t *task, void *sender, isc_eventtype_t first, isc_eventtype_t last, void *tag, - isc_eventlist_t *events, isc_boolean_t purging) + isc_eventlist_t *events, int purging) { isc_event_t *event, *next_event; unsigned int count = 0; @@ -427,7 +427,7 @@ isc_task_purgerange(isc_task_t *task, void *sender, isc_eventtype_t first, ISC_LIST_INIT(events); count = dequeue_events(task, sender, first, last, tag, &events, - ISC_TRUE); + 1); for (event = HEAD(events); event != NULL; event = next_event) { next_event = NEXT(event, ev_link); @@ -457,13 +457,13 @@ isc_task_setname(isc_task_t *task, const char *name, void *tag) { ***/ /* - * Return ISC_TRUE if the current ready list for the manager, which is + * Return 1 if the current ready list for the manager, which is * either ready_tasks or the ready_priority_tasks, depending on whether * the manager is currently in normal or privileged execution mode. * * Caller must hold the task manager lock. */ -static inline isc_boolean_t +static inline int empty_readyq(isc_taskmgr_t *manager) { isc_tasklist_t queue; @@ -472,7 +472,7 @@ empty_readyq(isc_taskmgr_t *manager) { else queue = manager->ready_priority_tasks; - return (ISC_TF(EMPTY(queue))); + return (EMPTY(queue)); } /* @@ -536,9 +536,9 @@ dispatch(isc_taskmgr_t *manager) { task = pop_readyq(manager); if (task != NULL) { unsigned int dispatch_count = 0; - isc_boolean_t done = ISC_FALSE; - isc_boolean_t requeue = ISC_FALSE; - isc_boolean_t finished = ISC_FALSE; + int done = 0; + int requeue = 0; + int finished = 0; isc_event_t *event; /* @@ -573,7 +573,7 @@ dispatch(isc_taskmgr_t *manager) { if (task->references == 0 && EMPTY(task->events) && !TASK_SHUTTINGDOWN(task)) { - isc_boolean_t was_idle; + int was_idle; /* * There are no references and no @@ -611,11 +611,11 @@ dispatch(isc_taskmgr_t *manager) { /* * The task is done. */ - finished = ISC_TRUE; + finished = 1; task->state = task_state_done; } else task->state = task_state_idle; - done = ISC_TRUE; + done = 1; } else if (dispatch_count >= task->quantum) { /* * Our quantum has expired, but @@ -628,8 +628,8 @@ dispatch(isc_taskmgr_t *manager) { * so the minimum quantum is one. */ task->state = task_state_ready; - requeue = ISC_TRUE; - done = ISC_TRUE; + requeue = 1; + done = 1; } } while (!done); @@ -720,9 +720,9 @@ isc_taskmgr_create(unsigned int workers, INIT_LIST(manager->ready_priority_tasks); manager->tasks_running = 0; manager->tasks_ready = 0; - manager->exclusive_requested = ISC_FALSE; - manager->pause_requested = ISC_FALSE; - manager->exiting = ISC_FALSE; + manager->exclusive_requested = 0; + manager->pause_requested = 0; + manager->exiting = 0; manager->excl = NULL; manager->refs = 1; @@ -772,7 +772,7 @@ isc_taskmgr_destroy(isc_taskmgr_t **managerp) { * Make sure we only get called once. */ INSIST(!manager->exiting); - manager->exiting = ISC_TRUE; + manager->exiting = 1; /* * If privileged mode was on, turn it off. @@ -802,14 +802,14 @@ isc_taskmgr_destroy(isc_taskmgr_t **managerp) { *managerp = NULL; } -isc_boolean_t +int isc_taskmgr_ready(isc_taskmgr_t *manager) { - isc_boolean_t is_ready; + int is_ready; if (manager == NULL) manager = taskmgr; if (manager == NULL) - return (ISC_FALSE); + return (0); is_ready = !empty_readyq(manager); diff --git a/usr.bin/dig/lib/isc/task_p.h b/usr.bin/dig/lib/isc/task_p.h index a0163a10cb3..31ab5725ef7 100644 --- a/usr.bin/dig/lib/isc/task_p.h +++ b/usr.bin/dig/lib/isc/task_p.h @@ -14,14 +14,14 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: task_p.h,v 1.2 2020/02/18 18:11:27 florian Exp $ */ +/* $Id: task_p.h,v 1.3 2020/09/14 08:40:44 florian Exp $ */ #ifndef ISC_TASK_P_H #define ISC_TASK_P_H /*! \file */ -isc_boolean_t +int isc_taskmgr_ready(isc_taskmgr_t *taskmgr); isc_result_t diff --git a/usr.bin/dig/lib/isc/timer.c b/usr.bin/dig/lib/isc/timer.c index 15fc781f3a5..7253ad8a0f4 100644 --- a/usr.bin/dig/lib/isc/timer.c +++ b/usr.bin/dig/lib/isc/timer.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: timer.c,v 1.24 2020/02/25 05:00:43 jsg Exp $ */ +/* $Id: timer.c,v 1.25 2020/09/14 08:40:44 florian Exp $ */ /*! \file */ @@ -47,7 +47,7 @@ struct isc_timer { struct isc_timermgr { /* Not locked. */ /* Locked by manager lock. */ - isc_boolean_t done; + int done; LIST(isc_timer_t) timers; unsigned int nscheduled; struct timespec due; @@ -230,14 +230,14 @@ isc_timer_create(isc_timermgr_t *manager0, const struct timespec *interval, isc_result_t isc_timer_reset(isc_timer_t *timer, const struct timespec *interval, - isc_boolean_t purge) + int purge) { struct timespec now; isc_result_t result; /* * Change the timer's type, expires, and interval values to the given - * values. If 'purge' is ISC_TRUE, any pending events from this timer + * values. If 'purge' is 1, any pending events from this timer * are purged from its task's event queue. */ @@ -282,7 +282,7 @@ isc_timer_touch(isc_timer_t *timer) { void isc_timer_detach(isc_timer_t **timerp) { isc_timer_t *timer; - isc_boolean_t free_timer = ISC_FALSE; + int free_timer = 0; /* * Detach *timerp from its timer. @@ -294,7 +294,7 @@ isc_timer_detach(isc_timer_t **timerp) { REQUIRE(timer->references > 0); timer->references--; if (timer->references == 0) - free_timer = ISC_TRUE; + free_timer = 1; if (free_timer) destroy(timer); @@ -304,12 +304,12 @@ isc_timer_detach(isc_timer_t **timerp) { static void dispatch(isc_timermgr_t *manager, struct timespec *now) { - isc_boolean_t done = ISC_FALSE, post_event, need_schedule; + int done = 0, post_event, need_schedule; isc_timerevent_t *event; isc_eventtype_t type = 0; isc_timer_t *timer; isc_result_t result; - isc_boolean_t idle; + int idle; /*! * The caller must be holding the manager lock. @@ -319,23 +319,23 @@ dispatch(isc_timermgr_t *manager, struct timespec *now) { timer = isc_heap_element(manager->heap, 1); INSIST(timer != NULL); if (timespeccmp(now, &timer->due, >=)) { - idle = ISC_FALSE; + idle = 0; if (timespecisset(&timer->idle) && timespeccmp(now, &timer->idle, >=)) { - idle = ISC_TRUE; + idle = 1; } if (idle) { type = ISC_TIMEREVENT_IDLE; - post_event = ISC_TRUE; - need_schedule = ISC_FALSE; + post_event = 1; + need_schedule = 0; } else { /* * Idle timer has been touched; * reschedule. */ - post_event = ISC_FALSE; - need_schedule = ISC_TRUE; + post_event = 0; + need_schedule = 1; } if (post_event) { @@ -372,12 +372,12 @@ dispatch(isc_timermgr_t *manager, struct timespec *now) { } } else { manager->due = timer->due; - done = ISC_TRUE; + done = 1; } } } -static isc_boolean_t +static int sooner(void *v1, void *v2) { isc_timer_t *t1, *t2; @@ -385,8 +385,8 @@ sooner(void *v1, void *v2) { t2 = v2; if (timespeccmp(&t1->due, &t2->due, <)) - return (ISC_TRUE); - return (ISC_FALSE); + return (1); + return (0); } static void @@ -419,7 +419,7 @@ isc_timermgr_create(isc_timermgr_t **managerp) { if (manager == NULL) return (ISC_R_NOMEMORY); - manager->done = ISC_FALSE; + manager->done = 0; INIT_LIST(manager->timers); manager->nscheduled = 0; timespecclear(&manager->due); @@ -459,7 +459,7 @@ isc_timermgr_destroy(isc_timermgr_t **managerp) { isc_timermgr_dispatch((isc_timermgr_t *)manager); REQUIRE(EMPTY(manager->timers)); - manager->done = ISC_TRUE; + manager->done = 1; /* * Clean up. diff --git a/usr.bin/dig/lib/isc/unix/app.c b/usr.bin/dig/lib/isc/unix/app.c index 62535523261..f9a98b11642 100644 --- a/usr.bin/dig/lib/isc/unix/app.c +++ b/usr.bin/dig/lib/isc/unix/app.c @@ -23,7 +23,6 @@ #include <time.h> #include <isc/app.h> -#include <isc/boolean.h> #include <isc/event.h> #include <string.h> @@ -47,13 +46,13 @@ typedef struct isc_appctx { isc_eventlist_t on_run; - isc_boolean_t shutdown_requested; - isc_boolean_t running; + int shutdown_requested; + int running; /*! * We assume that 'want_shutdown' can be read and written atomically. */ - isc_boolean_t want_shutdown; + int want_shutdown; isc_taskmgr_t *taskmgr; isc_socketmgr_t *socketmgr; @@ -73,9 +72,9 @@ isc_app_ctxstart(isc_appctx_t *ctx) { ISC_LIST_INIT(ctx->on_run); - ctx->shutdown_requested = ISC_FALSE; - ctx->running = ISC_FALSE; - ctx->want_shutdown = ISC_FALSE; + ctx->shutdown_requested = 0; + ctx->running = 0; + ctx->want_shutdown = 0; if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { UNEXPECTED_ERROR(__FILE__, __LINE__, @@ -147,15 +146,15 @@ evloop(isc_appctx_t *ctx) { struct timespec when, now, diff, zero ={0, 0}; struct timeval tv, *tvp; isc_socketwait_t *swait; - isc_boolean_t readytasks; - isc_boolean_t call_timer_dispatch = ISC_FALSE; + int readytasks; + int call_timer_dispatch = 0; readytasks = isc_taskmgr_ready(ctx->taskmgr); if (readytasks) { tv.tv_sec = 0; tv.tv_usec = 0; tvp = &tv; - call_timer_dispatch = ISC_TRUE; + call_timer_dispatch = 1; } else { result = isc_timermgr_nextevent(ctx->timermgr, &when); if (result != ISC_R_SUCCESS) @@ -164,7 +163,7 @@ evloop(isc_appctx_t *ctx) { clock_gettime(CLOCK_MONOTONIC, &now); timespecsub(&when, &now, &diff); if (timespeccmp(&diff, &zero, <=)) { - call_timer_dispatch = ISC_TRUE; + call_timer_dispatch = 1; memset(&tv, 0, sizeof(tv)); } else TIMESPEC_TO_TIMEVAL(&tv, &diff); @@ -206,7 +205,7 @@ isc_app_ctxrun(isc_appctx_t *ctx) { isc_task_t *task; if (!ctx->running) { - ctx->running = ISC_TRUE; + ctx->running = 1; /* * Post any on-run events (in FIFO order). @@ -235,21 +234,21 @@ isc_app_run(void) { static isc_result_t isc_app_ctxshutdown(isc_appctx_t *ctx) { - isc_boolean_t want_kill = ISC_TRUE; + int want_kill = 1; REQUIRE(ctx->running); if (ctx->shutdown_requested) - want_kill = ISC_FALSE; + want_kill = 0; else - ctx->shutdown_requested = ISC_TRUE; + ctx->shutdown_requested = 1; if (want_kill) { if (ctx != &isc_g_appctx) /* BIND9 internal, but using multiple contexts */ - ctx->want_shutdown = ISC_TRUE; + ctx->want_shutdown = 1; else { - ctx->want_shutdown = ISC_TRUE; + ctx->want_shutdown = 1; } } diff --git a/usr.bin/dig/lib/isc/unix/errno2result.c b/usr.bin/dig/lib/isc/unix/errno2result.c index 8675d9b4bb6..32b5aec1ce6 100644 --- a/usr.bin/dig/lib/isc/unix/errno2result.c +++ b/usr.bin/dig/lib/isc/unix/errno2result.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: errno2result.c,v 1.4 2020/02/13 21:34:06 jung Exp $ */ +/* $Id: errno2result.c,v 1.5 2020/09/14 08:40:44 florian Exp $ */ /*! \file */ @@ -33,7 +33,7 @@ * not already there. */ isc_result_t -isc___errno2result(int posixerrno, isc_boolean_t dolog, +isc___errno2result(int posixerrno, int dolog, const char *file, unsigned int line) { switch (posixerrno) { diff --git a/usr.bin/dig/lib/isc/unix/errno2result.h b/usr.bin/dig/lib/isc/unix/errno2result.h index c650e3db7be..0b821af649b 100644 --- a/usr.bin/dig/lib/isc/unix/errno2result.h +++ b/usr.bin/dig/lib/isc/unix/errno2result.h @@ -23,10 +23,10 @@ #include <isc/types.h> -#define isc__errno2result(x) isc___errno2result(x, ISC_TRUE, __FILE__, __LINE__) +#define isc__errno2result(x) isc___errno2result(x, 1, __FILE__, __LINE__) isc_result_t -isc___errno2result(int posixerrno, isc_boolean_t dolog, +isc___errno2result(int posixerrno, int dolog, const char *file, unsigned int line); #endif /* UNIX_ERRNO2RESULT_H */ diff --git a/usr.bin/dig/lib/isc/unix/socket.c b/usr.bin/dig/lib/isc/unix/socket.c index 56851275b90..42aad2efae6 100644 --- a/usr.bin/dig/lib/isc/unix/socket.c +++ b/usr.bin/dig/lib/isc/unix/socket.c @@ -1417,7 +1417,7 @@ isc_socket_attach(isc_socket_t *sock0, isc_socket_t **socketp) { void isc_socket_detach(isc_socket_t **socketp) { isc_socket_t *sock; - isc_boolean_t kill_socket = ISC_FALSE; + int kill_socket = 0; REQUIRE(socketp != NULL); sock = (isc_socket_t *)*socketp; @@ -1425,7 +1425,7 @@ isc_socket_detach(isc_socket_t **socketp) { REQUIRE(sock->references > 0); sock->references--; if (sock->references == 0) - kill_socket = ISC_TRUE; + kill_socket = 1; if (kill_socket) destroy(&sock); @@ -1679,11 +1679,11 @@ internal_send(isc_task_t *me, isc_event_t *ev) { * and unlocking twice if both reads and writes are possible. */ static void -process_fd(isc_socketmgr_t *manager, int fd, isc_boolean_t readable, - isc_boolean_t writeable) +process_fd(isc_socketmgr_t *manager, int fd, int readable, + int writeable) { isc_socket_t *sock; - isc_boolean_t unwatch_read = ISC_FALSE, unwatch_write = ISC_FALSE; + int unwatch_read = 0, unwatch_write = 0; /* * If the socket is going to be closed, don't do more I/O. @@ -1697,18 +1697,18 @@ process_fd(isc_socketmgr_t *manager, int fd, isc_boolean_t readable, sock = manager->fds[fd]; if (readable) { if (sock == NULL) { - unwatch_read = ISC_TRUE; + unwatch_read = 1; goto check_write; } if (!SOCK_DEAD(sock)) { dispatch_recv(sock); } - unwatch_read = ISC_TRUE; + unwatch_read = 1; } check_write: if (writeable) { if (sock == NULL) { - unwatch_write = ISC_TRUE; + unwatch_write = 1; goto unlock_fd; } if (!SOCK_DEAD(sock)) { @@ -1717,7 +1717,7 @@ check_write: else dispatch_send(sock); } - unwatch_write = ISC_TRUE; + unwatch_write = 1; } unlock_fd: diff --git a/usr.bin/dig/lib/isccfg/include/isccfg/cfg.h b/usr.bin/dig/lib/isccfg/include/isccfg/cfg.h index 97d73a77a5d..1ed3c620ea6 100644 --- a/usr.bin/dig/lib/isccfg/include/isccfg/cfg.h +++ b/usr.bin/dig/lib/isccfg/include/isccfg/cfg.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: cfg.h,v 1.5 2020/02/25 05:00:43 jsg Exp $ */ +/* $Id: cfg.h,v 1.6 2020/09/14 08:40:44 florian Exp $ */ #ifndef ISCCFG_CFG_H #define ISCCFG_CFG_H 1 @@ -157,7 +157,7 @@ cfg_obj_asstring(const cfg_obj_t *obj); * \li A pointer to a null terminated string. */ -isc_boolean_t +int cfg_obj_islist(const cfg_obj_t *obj); /*%< * Return true iff 'obj' is of list type. @@ -191,7 +191,7 @@ cfg_list_next(const cfg_listelt_t *elt); */ unsigned int -cfg_list_length(const cfg_obj_t *obj, isc_boolean_t recurse); +cfg_list_length(const cfg_obj_t *obj, int recurse); /*%< * Returns the length of a list of configure objects. If obj is * not a list, returns 0. If recurse is true, add in the length of diff --git a/usr.bin/dig/lib/isccfg/include/isccfg/grammar.h b/usr.bin/dig/lib/isccfg/include/isccfg/grammar.h index 5adc1817ca1..d37b57bf4e2 100644 --- a/usr.bin/dig/lib/isccfg/include/isccfg/grammar.h +++ b/usr.bin/dig/lib/isccfg/include/isccfg/grammar.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: grammar.h,v 1.4 2020/09/13 09:31:07 florian Exp $ */ +/* $Id: grammar.h,v 1.5 2020/09/14 08:40:44 florian Exp $ */ #ifndef ISCCFG_GRAMMAR_H #define ISCCFG_GRAMMAR_H 1 @@ -112,10 +112,10 @@ struct cfg_parser { isc_token_t token; /*% We are at the end of all input. */ - isc_boolean_t seen_eof; + int seen_eof; /*% The current token has been pushed back. */ - isc_boolean_t ungotten; + int ungotten; /*% * The stack of currently active files, represented diff --git a/usr.bin/dig/lib/isccfg/parser.c b/usr.bin/dig/lib/isccfg/parser.c index 141d2ee4b4c..6da5e1ae12e 100644 --- a/usr.bin/dig/lib/isccfg/parser.c +++ b/usr.bin/dig/lib/isccfg/parser.c @@ -141,7 +141,7 @@ static isc_result_t cfg_getstringtoken(cfg_parser_t *pctx); static void -parser_complain(cfg_parser_t *pctx, isc_boolean_t is_warning, +parser_complain(cfg_parser_t *pctx, int is_warning, unsigned int flags, const char *format, va_list args); /* @@ -253,8 +253,8 @@ cfg_parser_create(isc_log_t *lctx, cfg_parser_t **ret) { pctx->lctx = lctx; pctx->lexer = NULL; - pctx->seen_eof = ISC_FALSE; - pctx->ungotten = ISC_FALSE; + pctx->seen_eof = 0; + pctx->ungotten = 0; pctx->errors = 0; pctx->open_files = NULL; pctx->closed_files = NULL; @@ -590,10 +590,10 @@ cfg_parse_listelt(cfg_parser_t *pctx, const cfg_type_t *elttype, return (result); } -isc_boolean_t +int cfg_obj_islist(const cfg_obj_t *obj) { REQUIRE(obj != NULL); - return (ISC_TF(obj->type->rep == &cfg_rep_list)); + return (obj->type->rep == &cfg_rep_list); } const cfg_listelt_t * @@ -615,7 +615,7 @@ cfg_list_next(const cfg_listelt_t *elt) { * a list, return 0. */ unsigned int -cfg_list_length(const cfg_obj_t *obj, isc_boolean_t recurse) { +cfg_list_length(const cfg_obj_t *obj, int recurse) { const cfg_listelt_t *elt; unsigned int count = 0; @@ -960,7 +960,7 @@ cfg_gettoken(cfg_parser_t *pctx, int options) { redo: pctx->token.type = isc_tokentype_unknown; result = isc_lex_gettoken(pctx->lexer, options, &pctx->token); - pctx->ungotten = ISC_FALSE; + pctx->ungotten = 0; pctx->line = isc_lex_getsourceline(pctx->lexer); switch (result) { @@ -984,7 +984,7 @@ cfg_gettoken(cfg_parser_t *pctx, int options) { value.list, elt, link); goto redo; } - pctx->seen_eof = ISC_TRUE; + pctx->seen_eof = 1; } break; @@ -1013,7 +1013,7 @@ cfg_ungettoken(cfg_parser_t *pctx) { if (pctx->seen_eof) return; isc_lex_ungettoken(pctx->lexer, &pctx->token); - pctx->ungotten = ISC_TRUE; + pctx->ungotten = 1; } static isc_result_t @@ -1056,24 +1056,24 @@ cfg_parser_error(cfg_parser_t *pctx, unsigned int flags, const char *fmt, ...) { REQUIRE(fmt != NULL); va_start(args, fmt); - parser_complain(pctx, ISC_FALSE, flags, fmt, args); + parser_complain(pctx, 0, flags, fmt, args); va_end(args); pctx->errors++; } #define MAX_LOG_TOKEN 30 /* How much of a token to quote in log messages. */ -static isc_boolean_t +static int have_current_file(cfg_parser_t *pctx) { cfg_listelt_t *elt; if (pctx->open_files == NULL) - return (ISC_FALSE); + return (0); elt = ISC_LIST_TAIL(pctx->open_files->value.list); if (elt == NULL) - return (ISC_FALSE); + return (0); - return (ISC_TRUE); + return (1); } static char * @@ -1095,7 +1095,7 @@ current_file(cfg_parser_t *pctx) { } static void -parser_complain(cfg_parser_t *pctx, isc_boolean_t is_warning, +parser_complain(cfg_parser_t *pctx, int is_warning, unsigned int flags, const char *format, va_list args) { @@ -1197,7 +1197,7 @@ create_map(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) { CHECK(cfg_create_obj(pctx, type, &obj)); CHECK(isc_symtab_create(5, /* XXX */ map_symtabitem_destroy, - pctx, ISC_FALSE, &symtab)); + pctx, 0, &symtab)); obj->value.map.symtab = symtab; obj->value.map.id = NULL; diff --git a/usr.bin/dig/nslookup.c b/usr.bin/dig/nslookup.c index 2776fc585ae..b4b6943dcf2 100644 --- a/usr.bin/dig/nslookup.c +++ b/usr.bin/dig/nslookup.c @@ -35,17 +35,17 @@ #include "dig.h" -static isc_boolean_t short_form = ISC_TRUE, - tcpmode = ISC_FALSE, - identify = ISC_FALSE, stats = ISC_TRUE, - comments = ISC_TRUE, section_question = ISC_TRUE, - section_answer = ISC_TRUE, section_authority = ISC_TRUE, - section_additional = ISC_TRUE, recurse = ISC_TRUE, - aaonly = ISC_FALSE, nofail = ISC_TRUE; +static int short_form = 1, + tcpmode = 0, + identify = 0, stats = 1, + comments = 1, section_question = 1, + section_answer = 1, section_authority = 1, + section_additional = 1, recurse = 1, + aaonly = 0, nofail = 1; -static isc_boolean_t interactive; +static int interactive; -static isc_boolean_t in_use = ISC_FALSE; +static int in_use = 0; static char defclass[MXRD] = "IN"; static char deftype[MXRD] = "A"; static isc_event_t *global_event = NULL; @@ -193,7 +193,7 @@ printrdata(dns_rdata_t *rdata) { isc_result_t result; isc_buffer_t *b = NULL; unsigned int size = 1024; - isc_boolean_t done = ISC_FALSE; + int done = 0; if (rdata->type < N_KNOWN_RRTYPES) printf("%s", rtypetext[rdata->type]); @@ -208,7 +208,7 @@ printrdata(dns_rdata_t *rdata) { if (result == ISC_R_SUCCESS) { printf("%.*s\n", (int)isc_buffer_usedlength(b), (char *)isc_buffer_base(b)); - done = ISC_TRUE; + done = 1; } else if (result != ISC_R_NOSPACE) check_result(result, "dns_rdata_totext"); isc_buffer_free(&b); @@ -217,7 +217,7 @@ printrdata(dns_rdata_t *rdata) { } static isc_result_t -printsection(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers, +printsection(dig_query_t *query, dns_message_t *msg, int headers, dns_section_t section) { isc_result_t result, loopresult; dns_name_t *name; @@ -283,7 +283,7 @@ printsection(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers, } static isc_result_t -detailsection(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers, +detailsection(dig_query_t *query, dns_message_t *msg, int headers, dns_section_t section) { isc_result_t result, loopresult; dns_name_t *name; @@ -383,7 +383,7 @@ trying(char *frm, dig_lookup_t *lookup) { } static isc_result_t -printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { +printmessage(dig_query_t *query, dns_message_t *msg, int headers) { char servtext[ISC_SOCKADDR_FORMATSIZE]; /* I've we've gotten this far, we've reached a server. */ @@ -400,10 +400,10 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { if (!short_form) { puts("------------"); /* detailheader(query, msg);*/ - detailsection(query, msg, ISC_TRUE, DNS_SECTION_QUESTION); - detailsection(query, msg, ISC_TRUE, DNS_SECTION_ANSWER); - detailsection(query, msg, ISC_TRUE, DNS_SECTION_AUTHORITY); - detailsection(query, msg, ISC_TRUE, DNS_SECTION_ADDITIONAL); + detailsection(query, msg, 1, DNS_SECTION_QUESTION); + detailsection(query, msg, 1, DNS_SECTION_ANSWER); + detailsection(query, msg, 1, DNS_SECTION_AUTHORITY); + detailsection(query, msg, 1, DNS_SECTION_ADDITIONAL); puts("------------"); } @@ -440,7 +440,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { } static void -show_settings(isc_boolean_t full, isc_boolean_t serv_only) { +show_settings(int full, int serv_only) { dig_server_t *srv; isc_sockaddr_t sockaddr; dig_searchlist_t *listent; @@ -485,7 +485,7 @@ show_settings(isc_boolean_t full, isc_boolean_t serv_only) { printf("\n"); } -static isc_boolean_t +static int testtype(char *typetext) { isc_result_t result; isc_textregion_t tr; @@ -495,14 +495,14 @@ testtype(char *typetext) { tr.length = strlen(typetext); result = dns_rdatatype_fromtext(&rdtype, &tr); if (result == ISC_R_SUCCESS) - return (ISC_TRUE); + return (1); else { printf("unknown query type: %s\n", typetext); - return (ISC_FALSE); + return (0); } } -static isc_boolean_t +static int testclass(char *typetext) { isc_result_t result; isc_textregion_t tr; @@ -512,10 +512,10 @@ testclass(char *typetext) { tr.length = strlen(typetext); result = dns_rdataclass_fromtext(&rdclass, &tr); if (result == ISC_R_SUCCESS) - return (ISC_TRUE); + return (1); else { printf("unknown query class: %s\n", typetext); - return (ISC_FALSE); + return (0); } } @@ -580,7 +580,7 @@ setoption(char *opt) { ((l >= N) && (l < sizeof(A)) && (strncasecmp(opt, A, l) == 0)) if (CHECKOPT("all", 3)) { - show_settings(ISC_TRUE, ISC_FALSE); + show_settings(1, 0); } else if (strncasecmp(opt, "class=", 6) == 0) { if (testclass(&opt[6])) strlcpy(defclass, &opt[6], sizeof(defclass)); @@ -608,11 +608,11 @@ setoption(char *opt) { } else if (strncasecmp(opt, "domain=", 7) == 0) { strlcpy(domainopt, &opt[7], sizeof(domainopt)); set_search_domain(domainopt); - usesearch = ISC_TRUE; + usesearch = 1; } else if (strncasecmp(opt, "do=", 3) == 0) { strlcpy(domainopt, &opt[3], sizeof(domainopt)); set_search_domain(domainopt); - usesearch = ISC_TRUE; + usesearch = 1; } else if (strncasecmp(opt, "port=", 5) == 0) { set_port(&opt[5]); } else if (strncasecmp(opt, "po=", 3) == 0) { @@ -622,41 +622,41 @@ setoption(char *opt) { } else if (strncasecmp(opt, "t=", 2) == 0) { set_timeout(&opt[2]); } else if (CHECKOPT("recurse", 3)) { - recurse = ISC_TRUE; + recurse = 1; } else if (CHECKOPT("norecurse", 5)) { - recurse = ISC_FALSE; + recurse = 0; } else if (strncasecmp(opt, "retry=", 6) == 0) { set_tries(&opt[6]); } else if (strncasecmp(opt, "ret=", 4) == 0) { set_tries(&opt[4]); } else if (CHECKOPT("defname", 3)) { - usesearch = ISC_TRUE; + usesearch = 1; } else if (CHECKOPT("nodefname", 5)) { - usesearch = ISC_FALSE; + usesearch = 0; } else if (CHECKOPT("vc", 2) == 0) { - tcpmode = ISC_TRUE; + tcpmode = 1; } else if (CHECKOPT("novc", 4) == 0) { - tcpmode = ISC_FALSE; + tcpmode = 0; } else if (CHECKOPT("debug", 3) == 0) { - short_form = ISC_FALSE; - showsearch = ISC_TRUE; + short_form = 0; + showsearch = 1; } else if (CHECKOPT("nodebug", 5) == 0) { - short_form = ISC_TRUE; - showsearch = ISC_FALSE; + short_form = 1; + showsearch = 0; } else if (CHECKOPT("d2", 2) == 0) { - debugging = ISC_TRUE; + debugging = 1; } else if (CHECKOPT("nod2", 4) == 0) { - debugging = ISC_FALSE; + debugging = 0; } else if (CHECKOPT("search", 3) == 0) { - usesearch = ISC_TRUE; + usesearch = 1; } else if (CHECKOPT("nosearch", 5) == 0) { - usesearch = ISC_FALSE; + usesearch = 0; } else if (CHECKOPT("sil", 3) == 0) { - /* deprecation_msg = ISC_FALSE; */ + /* deprecation_msg = 0; */ } else if (CHECKOPT("fail", 3) == 0) { - nofail=ISC_FALSE; + nofail=0; } else if (CHECKOPT("nofail", 5) == 0) { - nofail=ISC_TRUE; + nofail=1; } else if (strncasecmp(opt, "ndots=", 6) == 0) { set_ndots(&opt[6]); } else { @@ -689,21 +689,21 @@ addlookup(char *opt) { rdclass = dns_rdataclass_in; } lookup = make_empty_lookup(); - if (get_reverse(store, sizeof(store), opt, lookup->ip6_int, ISC_TRUE) + if (get_reverse(store, sizeof(store), opt, lookup->ip6_int, 1) == ISC_R_SUCCESS) { strlcpy(lookup->textname, store, sizeof(lookup->textname)); lookup->rdtype = dns_rdatatype_ptr; - lookup->rdtypeset = ISC_TRUE; + lookup->rdtypeset = 1; } else { strlcpy(lookup->textname, opt, sizeof(lookup->textname)); lookup->rdtype = rdtype; - lookup->rdtypeset = ISC_TRUE; + lookup->rdtypeset = 1; } lookup->rdclass = rdclass; - lookup->rdclassset = ISC_TRUE; - lookup->trace = ISC_FALSE; + lookup->rdclassset = 1; + lookup->trace = 0; lookup->trace_root = lookup->trace; - lookup->ns_search_only = ISC_FALSE; + lookup->ns_search_only = 0; lookup->identify = identify; lookup->recurse = recurse; lookup->aaonly = aaonly; @@ -716,9 +716,9 @@ addlookup(char *opt) { lookup->section_answer = section_answer; lookup->section_authority = section_authority; lookup->section_additional = section_additional; - lookup->new_search = ISC_TRUE; + lookup->new_search = 1; if (nofail) - lookup->servfail_stops = ISC_FALSE; + lookup->servfail_stops = 0; ISC_LIST_INIT(lookup->q); ISC_LINK_INIT(lookup, link); ISC_LIST_APPEND(lookup_list, lookup, link); @@ -750,11 +750,11 @@ do_next_command(char *input) { printf("couldn't get address for '%s': %s\n", arg, isc_result_totext(res)); } else { - check_ra = ISC_FALSE; - show_settings(ISC_TRUE, ISC_TRUE); + check_ra = 0; + show_settings(1, 1); } } else if (strcasecmp(ptr, "exit") == 0) { - in_use = ISC_FALSE; + in_use = 0; } else if (strcasecmp(ptr, "help") == 0 || strcasecmp(ptr, "?") == 0) { printf("The '%s' command is not yet implemented.\n", ptr); @@ -783,7 +783,7 @@ get_next_command(void) { } else ptr = fgets(buf, COMMSIZE, stdin); if (ptr == NULL) { - in_use = ISC_FALSE; + in_use = 0; } else do_next_command(ptr); free(buf); @@ -791,9 +791,9 @@ get_next_command(void) { static void parse_args(int argc, char **argv) { - isc_boolean_t have_lookup = ISC_FALSE; + int have_lookup = 0; - usesearch = ISC_TRUE; + usesearch = 1; for (argc--, argv++; argc > 0; argc--, argv++) { debug("main parsing %s", argv[0]); if (argv[0][0] == '-') { @@ -803,11 +803,11 @@ parse_args(int argc, char **argv) { } else if (argv[0][1] != 0) { setoption(&argv[0][1]); } else - have_lookup = ISC_TRUE; + have_lookup = 1; } else { if (!have_lookup) { - have_lookup = ISC_TRUE; - in_use = ISC_TRUE; + have_lookup = 1; + in_use = 1; addlookup(argv[0]); } else { isc_result_t res; @@ -815,7 +815,7 @@ parse_args(int argc, char **argv) { if ((res = set_nameserver(argv[0]))) fatal("couldn't get address for '%s': %s", argv[0], isc_result_totext(res)); - check_ra = ISC_FALSE; + check_ra = 0; } } } @@ -886,14 +886,14 @@ int nslookup_main(int argc, char **argv) { isc_result_t result; - interactive = ISC_TF(isatty(0)); + interactive = isatty(0); ISC_LIST_INIT(lookup_list); ISC_LIST_INIT(server_list); ISC_LIST_INIT(root_hints_server_list); ISC_LIST_INIT(search_list); - check_ra = ISC_TRUE; + check_ra = 1; /* setup dighost callbacks */ dighost_printmessage = printmessage; @@ -919,7 +919,7 @@ nslookup_main(int argc, char **argv) { parse_args(argc, argv); - setup_system(ISC_FALSE, ISC_FALSE); + setup_system(0, 0); if (domainopt[0] != '\0') set_search_domain(domainopt); if (in_use) @@ -928,7 +928,7 @@ nslookup_main(int argc, char **argv) { else result = isc_app_onrun(global_task, getinput, NULL); check_result(result, "isc_app_onrun"); - in_use = ISC_TF(!in_use); + in_use = !in_use; (void)isc_app_run(); |