diff options
Diffstat (limited to 'usr.bin/dig/lib')
97 files changed, 727 insertions, 774 deletions
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; |
