summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2020-02-26 18:47:58 +0000
committerflorian <florian@openbsd.org>2020-02-26 18:47:58 +0000
commit873f12b9e6aaf39ba104db6af3d0dc687cd95f7e (patch)
tree80081a71df3f42a8248c43286fef79e79ede9a40
parentIn preparation of compiling lib/dns/rdata/ files individually we need (diff)
downloadwireguard-openbsd-873f12b9e6aaf39ba104db6af3d0dc687cd95f7e.tar.xz
wireguard-openbsd-873f12b9e6aaf39ba104db6af3d0dc687cd95f7e.zip
In preparation of compiling lib/dns/rdata/ files individually we need
global visibility of str_totext. Rename it to isc_str_tobuffer, put it into buffer.c and delete duplicate implementations.
-rw-r--r--usr.bin/dig/lib/dns/masterdump.c18
-rw-r--r--usr.bin/dig/lib/dns/rcode.c36
-rw-r--r--usr.bin/dig/lib/dns/rdata.c211
-rw-r--r--usr.bin/dig/lib/dns/rdata/any_255/tsig_250.c22
-rw-r--r--usr.bin/dig/lib/dns/rdata/ch_3/a_1.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/afsdb_18.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/caa_257.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/cert_37.c12
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/csync_62.c8
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/doa_259.c10
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/ds_43.c16
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/eui48_108.c2
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/eui64_109.c2
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/gpos_27.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/hinfo_13.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/hip_55.c14
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/ipseckey_45.c16
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/isdn_20.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/key_25.c36
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/keydata_65533.c62
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/l32_105.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/l64_106.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/loc_29.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/lp_107.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/minfo_14.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/mx_15.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/naptr_35.c16
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/nid_104.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/nsec3_50.c18
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/nsec3param_51.c10
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/nsec_47.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/nxt_30.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/openpgpkey_61.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/opt_41.c10
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/rp_17.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/rrsig_46.c32
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/rt_21.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/sig_24.c30
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/sink_40.c8
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/soa_6.c22
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/sshfp_44.c12
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/talink_58.c2
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/tkey_249.c32
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/tlsa_52.c12
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/txt_16.c2
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/uri_256.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/in_1/a6_38.c8
-rw-r--r--usr.bin/dig/lib/dns/rdata/in_1/apl_42.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/in_1/dhcid_49.c8
-rw-r--r--usr.bin/dig/lib/dns/rdata/in_1/kx_36.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/in_1/nsap_22.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/in_1/px_26.c8
-rw-r--r--usr.bin/dig/lib/dns/rdata/in_1/srv_33.c14
-rw-r--r--usr.bin/dig/lib/dns/rdata/in_1/wks_11.c10
-rw-r--r--usr.bin/dig/lib/isc/base32.c38
-rw-r--r--usr.bin/dig/lib/isc/base64.c32
-rw-r--r--usr.bin/dig/lib/isc/buffer.c19
-rw-r--r--usr.bin/dig/lib/isc/hex.c28
-rw-r--r--usr.bin/dig/lib/isc/include/isc/buffer.h6
59 files changed, 426 insertions, 524 deletions
diff --git a/usr.bin/dig/lib/dns/masterdump.c b/usr.bin/dig/lib/dns/masterdump.c
index ac2396456e4..771720bb09b 100644
--- a/usr.bin/dig/lib/dns/masterdump.c
+++ b/usr.bin/dig/lib/dns/masterdump.c
@@ -227,22 +227,6 @@ totext_ctx_init(const dns_master_style_t *style, dns_totext_ctx_t *ctx) {
return (result); \
} while (0)
-static isc_result_t
-str_totext(const char *source, isc_buffer_t *target) {
- unsigned int l;
- isc_region_t region;
-
- isc_buffer_availableregion(target, &region);
- l = strlen(source);
-
- if (l > region.length)
- return (ISC_R_NOSPACE);
-
- memmove(region.base, source, l);
- isc_buffer_add(target, l);
- return (ISC_R_SUCCESS);
-}
-
/*
* Convert 'rdataset' to master file text format according to 'ctx',
* storing the result in 'target'. If 'owner_name' is NULL, it
@@ -278,7 +262,7 @@ rdataset_totext(dns_rdataset_t *rdataset,
* Comment?
*/
if ((ctx->style.flags & DNS_STYLEFLAG_COMMENTDATA) != 0)
- RETERR(str_totext(";", target));
+ RETERR(isc_str_tobuffer(";", target));
/*
* Owner name.
diff --git a/usr.bin/dig/lib/dns/rcode.c b/usr.bin/dig/lib/dns/rcode.c
index 950b0265c10..98e5a61c199 100644
--- a/usr.bin/dig/lib/dns/rcode.c
+++ b/usr.bin/dig/lib/dns/rcode.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rcode.c,v 1.8 2020/02/24 13:49:38 jsg Exp $ */
+/* $Id: rcode.c,v 1.9 2020/02/26 18:47:58 florian Exp $ */
#include <ctype.h>
#include <stdlib.h>
@@ -118,22 +118,6 @@ static struct tbl certs[] = { CERTNAMES };
static struct tbl secalgs[] = { SECALGNAMES };
static isc_result_t
-str_totext(const char *source, isc_buffer_t *target) {
- unsigned int l;
- isc_region_t region;
-
- isc_buffer_availableregion(target, &region);
- l = strlen(source);
-
- if (l > region.length)
- return (ISC_R_NOSPACE);
-
- memmove(region.base, source, l);
- isc_buffer_add(target, l);
- return (ISC_R_SUCCESS);
-}
-
-static isc_result_t
dns_mnemonic_totext(unsigned int value, isc_buffer_t *target,
struct tbl *table)
{
@@ -141,12 +125,12 @@ dns_mnemonic_totext(unsigned int value, isc_buffer_t *target,
char buf[sizeof("4294967296")];
while (table[i].name != NULL) {
if (table[i].value == value) {
- return (str_totext(table[i].name, target));
+ return (isc_str_tobuffer(table[i].name, target));
}
i++;
}
snprintf(buf, sizeof(buf), "%u", value);
- return (str_totext(buf, target));
+ return (isc_str_tobuffer(buf, target));
}
isc_result_t
@@ -251,20 +235,20 @@ dns_rdataclass_totext(dns_rdataclass_t rdclass, isc_buffer_t *target) {
switch (rdclass) {
case dns_rdataclass_any:
- return (str_totext("ANY", target));
+ return (isc_str_tobuffer("ANY", target));
case dns_rdataclass_chaos:
- return (str_totext("CH", target));
+ return (isc_str_tobuffer("CH", target));
case dns_rdataclass_hs:
- return (str_totext("HS", target));
+ return (isc_str_tobuffer("HS", target));
case dns_rdataclass_in:
- return (str_totext("IN", target));
+ return (isc_str_tobuffer("IN", target));
case dns_rdataclass_none:
- return (str_totext("NONE", target));
+ return (isc_str_tobuffer("NONE", target));
case dns_rdataclass_reserved0:
- return (str_totext("RESERVED0", target));
+ return (isc_str_tobuffer("RESERVED0", target));
default:
snprintf(buf, sizeof(buf), "CLASS%u", rdclass);
- return (str_totext(buf, target));
+ return (isc_str_tobuffer(buf, target));
}
}
diff --git a/usr.bin/dig/lib/dns/rdata.c b/usr.bin/dig/lib/dns/rdata.c
index 108f5c2f546..bb1509d7d8f 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.28 2020/02/26 18:47:24 florian Exp $ */
+/* $Id: rdata.c,v 1.29 2020/02/26 18:47:58 florian Exp $ */
/*! \file */
@@ -97,9 +97,6 @@ static unsigned int
name_length(dns_name_t *name);
static isc_result_t
-str_totext(const char *source, isc_buffer_t *target);
-
-static isc_result_t
inet_totext(int af, isc_region_t *src, isc_buffer_t *target);
static isc_boolean_t
@@ -189,7 +186,7 @@ typemap_totext(isc_region_t *sr, dns_rdata_textctx_t *tctx,
for (i = 0; i < sr->length; i += len) {
if (tctx != NULL &&
(tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) {
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
first = ISC_TRUE;
}
INSIST(i + 2 <= sr->length);
@@ -207,7 +204,7 @@ typemap_totext(isc_region_t *sr, dns_rdata_textctx_t *tctx,
continue;
t = window * 256 + j * 8 + k;
if (!first)
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
first = ISC_FALSE;
RETERR(dns_rdatatype_totext(t, target));
}
@@ -474,22 +471,22 @@ unknown_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
isc_region_t sr;
strlcpy(buf, "\\# ", sizeof(buf));
- result = str_totext(buf, target);
+ result = isc_str_tobuffer(buf, target);
if (result != ISC_R_SUCCESS)
return (result);
dns_rdata_toregion(rdata, &sr);
INSIST(sr.length < 65536);
snprintf(buf, sizeof(buf), "%u", sr.length);
- result = str_totext(buf, target);
+ result = isc_str_tobuffer(buf, target);
if (result != ISC_R_SUCCESS)
return (result);
if (sr.length != 0U) {
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- result = str_totext(" ( ", target);
+ result = isc_str_tobuffer(" ( ", target);
else
- result = str_totext(" ", target);
+ result = isc_str_tobuffer(" ", target);
if (result != ISC_R_SUCCESS)
return (result);
@@ -502,7 +499,7 @@ unknown_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
target);
if (result == ISC_R_SUCCESS &&
(tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- result = str_totext(" )", target);
+ result = isc_str_tobuffer(" )", target);
}
return (result);
}
@@ -882,180 +879,180 @@ dns_rdatatype_totext(dns_rdatatype_t type, isc_buffer_t *target) {
switch (type) {
case 0:
- return (str_totext("RESERVED0", target));
+ return (isc_str_tobuffer("RESERVED0", target));
case 1:
- return (str_totext("A", target));
+ return (isc_str_tobuffer("A", target));
case 2:
- return (str_totext("NS", target));
+ return (isc_str_tobuffer("NS", target));
case 3:
- return (str_totext("MD", target));
+ return (isc_str_tobuffer("MD", target));
case 4:
- return (str_totext("MF", target));
+ return (isc_str_tobuffer("MF", target));
case 5:
- return (str_totext("CNAME", target));
+ return (isc_str_tobuffer("CNAME", target));
case 6:
- return (str_totext("SOA", target));
+ return (isc_str_tobuffer("SOA", target));
case 7:
- return (str_totext("MB", target));
+ return (isc_str_tobuffer("MB", target));
case 8:
- return (str_totext("MG", target));
+ return (isc_str_tobuffer("MG", target));
case 9:
- return (str_totext("MR", target));
+ return (isc_str_tobuffer("MR", target));
case 10:
- return (str_totext("NULL", target));
+ return (isc_str_tobuffer("NULL", target));
case 11:
- return (str_totext("WKS", target));
+ return (isc_str_tobuffer("WKS", target));
case 12:
- return (str_totext("PTR", target));
+ return (isc_str_tobuffer("PTR", target));
case 13:
- return (str_totext("HINFO", target));
+ return (isc_str_tobuffer("HINFO", target));
case 14:
- return (str_totext("MINFO", target));
+ return (isc_str_tobuffer("MINFO", target));
case 15:
- return (str_totext("MX", target));
+ return (isc_str_tobuffer("MX", target));
case 16:
- return (str_totext("TXT", target));
+ return (isc_str_tobuffer("TXT", target));
case 17:
- return (str_totext("RP", target));
+ return (isc_str_tobuffer("RP", target));
case 18:
- return (str_totext("AFSDB", target));
+ return (isc_str_tobuffer("AFSDB", target));
case 19:
- return (str_totext("X25", target));
+ return (isc_str_tobuffer("X25", target));
case 20:
- return (str_totext("ISDN", target));
+ return (isc_str_tobuffer("ISDN", target));
case 21:
- return (str_totext("RT", target));
+ return (isc_str_tobuffer("RT", target));
case 22:
- return (str_totext("NSAP", target));
+ return (isc_str_tobuffer("NSAP", target));
case 23:
- return (str_totext("NSAP-PTR", target));
+ return (isc_str_tobuffer("NSAP-PTR", target));
case 24:
- return (str_totext("SIG", target));
+ return (isc_str_tobuffer("SIG", target));
case 25:
- return (str_totext("KEY", target));
+ return (isc_str_tobuffer("KEY", target));
case 26:
- return (str_totext("PX", target));
+ return (isc_str_tobuffer("PX", target));
case 27:
- return (str_totext("GPOS", target));
+ return (isc_str_tobuffer("GPOS", target));
case 28:
- return (str_totext("AAAA", target));
+ return (isc_str_tobuffer("AAAA", target));
case 29:
- return (str_totext("LOC", target));
+ return (isc_str_tobuffer("LOC", target));
case 30:
- return (str_totext("NXT", target));
+ return (isc_str_tobuffer("NXT", target));
case 31:
- return (str_totext("EID", target));
+ return (isc_str_tobuffer("EID", target));
case 32:
- return (str_totext("NIMLOC", target));
+ return (isc_str_tobuffer("NIMLOC", target));
case 33:
- return (str_totext("SRV", target));
+ return (isc_str_tobuffer("SRV", target));
case 34:
- return (str_totext("ATMA", target));
+ return (isc_str_tobuffer("ATMA", target));
case 35:
- return (str_totext("NAPTR", target));
+ return (isc_str_tobuffer("NAPTR", target));
case 36:
- return (str_totext("KX", target));
+ return (isc_str_tobuffer("KX", target));
case 37:
- return (str_totext("CERT", target));
+ return (isc_str_tobuffer("CERT", target));
case 38:
- return (str_totext("A6", target));
+ return (isc_str_tobuffer("A6", target));
case 39:
- return (str_totext("DNAME", target));
+ return (isc_str_tobuffer("DNAME", target));
case 40:
- return (str_totext("SINK", target));
+ return (isc_str_tobuffer("SINK", target));
case 41:
- return (str_totext("OPT", target));
+ return (isc_str_tobuffer("OPT", target));
case 42:
- return (str_totext("APL", target));
+ return (isc_str_tobuffer("APL", target));
case 43:
- return (str_totext("DS", target));
+ return (isc_str_tobuffer("DS", target));
case 44:
- return (str_totext("SSHFP", target));
+ return (isc_str_tobuffer("SSHFP", target));
case 45:
- return (str_totext("IPSECKEY", target));
+ return (isc_str_tobuffer("IPSECKEY", target));
case 46:
- return (str_totext("RRSIG", target));
+ return (isc_str_tobuffer("RRSIG", target));
case 47:
- return (str_totext("NSEC", target));
+ return (isc_str_tobuffer("NSEC", target));
case 48:
- return (str_totext("DNSKEY", target));
+ return (isc_str_tobuffer("DNSKEY", target));
case 49:
- return (str_totext("DHCID", target));
+ return (isc_str_tobuffer("DHCID", target));
case 50:
- return (str_totext("NSEC3", target));
+ return (isc_str_tobuffer("NSEC3", target));
case 51:
- return (str_totext("NSEC3PARAM", target));
+ return (isc_str_tobuffer("NSEC3PARAM", target));
case 52:
- return (str_totext("TLSA", target));
+ return (isc_str_tobuffer("TLSA", target));
case 53:
- return (str_totext("SMIMEA", target));
+ return (isc_str_tobuffer("SMIMEA", target));
case 55:
- return (str_totext("HIP", target));
+ return (isc_str_tobuffer("HIP", target));
case 56:
- return (str_totext("NINFO", target));
+ return (isc_str_tobuffer("NINFO", target));
case 57:
- return (str_totext("RKEY", target));
+ return (isc_str_tobuffer("RKEY", target));
case 58:
- return (str_totext("TALINK", target));
+ return (isc_str_tobuffer("TALINK", target));
case 59:
- return (str_totext("CDS", target));
+ return (isc_str_tobuffer("CDS", target));
case 60:
- return (str_totext("CDNSKEY", target));
+ return (isc_str_tobuffer("CDNSKEY", target));
case 61:
- return (str_totext("OPENPGPKEY", target));
+ return (isc_str_tobuffer("OPENPGPKEY", target));
case 62:
- return (str_totext("CSYNC", target));
+ return (isc_str_tobuffer("CSYNC", target));
case 99:
- return (str_totext("SPF", target));
+ return (isc_str_tobuffer("SPF", target));
case 100:
- return (str_totext("UINFO", target));
+ return (isc_str_tobuffer("UINFO", target));
case 101:
- return (str_totext("UID", target));
+ return (isc_str_tobuffer("UID", target));
case 102:
- return (str_totext("GID", target));
+ return (isc_str_tobuffer("GID", target));
case 103:
- return (str_totext("UNSPEC", target));
+ return (isc_str_tobuffer("UNSPEC", target));
case 104:
- return (str_totext("NID", target));
+ return (isc_str_tobuffer("NID", target));
case 105:
- return (str_totext("L32", target));
+ return (isc_str_tobuffer("L32", target));
case 106:
- return (str_totext("L64", target));
+ return (isc_str_tobuffer("L64", target));
case 107:
- return (str_totext("LP", target));
+ return (isc_str_tobuffer("LP", target));
case 108:
- return (str_totext("EUI48", target));
+ return (isc_str_tobuffer("EUI48", target));
case 109:
- return (str_totext("EUI64", target));
+ return (isc_str_tobuffer("EUI64", target));
case 249:
- return (str_totext("TKEY", target));
+ return (isc_str_tobuffer("TKEY", target));
case 250:
- return (str_totext("TSIG", target));
+ return (isc_str_tobuffer("TSIG", target));
case 251:
- return (str_totext("IXFR", target));
+ return (isc_str_tobuffer("IXFR", target));
case 252:
- return (str_totext("AXFR", target));
+ return (isc_str_tobuffer("AXFR", target));
case 253:
- return (str_totext("MAILB", target));
+ return (isc_str_tobuffer("MAILB", target));
case 254:
- return (str_totext("MAILA", target));
+ return (isc_str_tobuffer("MAILA", target));
case 255:
- return (str_totext("ANY", target));
+ return (isc_str_tobuffer("ANY", target));
case 256:
- return (str_totext("URI", target));
+ return (isc_str_tobuffer("URI", target));
case 257:
- return (str_totext("CAA", target));
+ return (isc_str_tobuffer("CAA", target));
case 258:
- return (str_totext("AVC", target));
+ return (isc_str_tobuffer("AVC", target));
case 259:
- return (str_totext("DOA", target));
+ return (isc_str_tobuffer("DOA", target));
case 32768:
- return (str_totext("TA", target));
+ return (isc_str_tobuffer("TA", target));
case 32769:
- return (str_totext("DLV", target));
+ return (isc_str_tobuffer("DLV", target));
default:
snprintf(buf, sizeof(buf), "TYPE%u", type);
- return (str_totext(buf, target));
+ return (isc_str_tobuffer(buf, target));
}
}
@@ -1278,22 +1275,6 @@ return_false:
}
static isc_result_t
-str_totext(const char *source, isc_buffer_t *target) {
- unsigned int l;
- isc_region_t region;
-
- isc_buffer_availableregion(target, &region);
- l = strlen(source);
-
- if (l > region.length)
- return (ISC_R_NOSPACE);
-
- memmove(region.base, source, l);
- isc_buffer_add(target, l);
- return (ISC_R_SUCCESS);
-}
-
-static isc_result_t
inet_totext(int af, isc_region_t *src, isc_buffer_t *target) {
char tmpbuf[64];
@@ -1498,7 +1479,7 @@ btoa_totext(unsigned char *inbuf, int inbuflen, isc_buffer_t *target) {
* delimited by 'x'
*/
snprintf(buf, sizeof(buf), "x %d %x %x %x", inbuflen, Ceor, Csum, Crot);
- return (str_totext(buf, target));
+ return (isc_str_tobuffer(buf, target));
}
dns_rdatatype_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 43b23384954..7e3abb03fa3 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.8 2020/02/26 18:47:24 florian Exp $ */
+/* $Id: tsig_250.c,v 1.9 2020/02/26 18:47:58 florian Exp $ */
/* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */
@@ -46,7 +46,7 @@ totext_any_tsig(ARGS_TOTEXT) {
dns_name_fromregion(&name, &sr);
sub = name_prefix(&name, tctx->origin, &prefix);
RETERR(dns_name_totext(&prefix, sub, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
isc_region_consume(&sr, name_length(&name));
/*
@@ -67,7 +67,7 @@ totext_any_tsig(ARGS_TOTEXT) {
sigtime /= 10;
} while (sigtime != 0);
bufp++;
- RETERR(str_totext(bufp, target));
+ RETERR(isc_str_tobuffer(bufp, target));
/*
* Fudge.
@@ -75,7 +75,7 @@ totext_any_tsig(ARGS_TOTEXT) {
n = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
snprintf(buf, sizeof(buf), "%u ", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Signature Size.
@@ -83,7 +83,7 @@ totext_any_tsig(ARGS_TOTEXT) {
n = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
snprintf(buf, sizeof(buf), "%u", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Signature.
@@ -92,17 +92,17 @@ totext_any_tsig(ARGS_TOTEXT) {
sigr = sr;
sigr.length = n;
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" (", target));
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(" (", target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&sigr, 60, "", target));
else
RETERR(isc_base64_totext(&sigr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" ) ", target));
+ RETERR(isc_str_tobuffer(" ) ", target));
else
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
isc_region_consume(&sr, n);
/*
@@ -111,7 +111,7 @@ totext_any_tsig(ARGS_TOTEXT) {
n = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
snprintf(buf, sizeof(buf), "%u ", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Error.
@@ -126,7 +126,7 @@ totext_any_tsig(ARGS_TOTEXT) {
n = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
snprintf(buf, sizeof(buf), " %u ", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Other.
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 c63dab7337f..e52e506efc5 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: a_1.c,v 1.11 2020/02/26 18:47:58 florian Exp $ */
/* by Bjorn.Victor@it.uu.se, 2005-05-07 */
/* Based on generic/soa_6.c and generic/mx_15.c */
@@ -49,8 +49,8 @@ totext_ch_a(ARGS_TOTEXT) {
RETERR(dns_name_totext(&prefix, sub, target));
snprintf(buf, sizeof(buf), "%o", addr); /* note octal */
- RETERR(str_totext(" ", target));
- return (str_totext(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
+ return (isc_str_tobuffer(buf, target));
}
static inline isc_result_t
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 2930af68b2c..2371cde16bd 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: afsdb_18.c,v 1.11 2020/02/26 18:47:58 florian Exp $ */
/* Reviewed: Wed Mar 15 14:59:00 PST 2000 by explorer */
@@ -42,7 +42,7 @@ totext_afsdb(ARGS_TOTEXT) {
num = uint16_fromregion(&region);
isc_region_consume(&region, 2);
snprintf(buf, sizeof(buf), "%u ", num);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
dns_name_fromregion(&name, &region);
sub = name_prefix(&name, tctx->origin, &prefix);
return (dns_name_totext(&prefix, sub, target));
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 a604d719e3d..946be520397 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/caa_257.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/caa_257.c
@@ -55,13 +55,13 @@ totext_caa(ARGS_TOTEXT) {
*/
flags = uint8_consume_fromregion(&region);
snprintf(buf, sizeof(buf), "%u ", flags);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Tag
*/
RETERR(txt_totext(&region, ISC_FALSE, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Value
diff --git a/usr.bin/dig/lib/dns/rdata/generic/cert_37.c b/usr.bin/dig/lib/dns/rdata/generic/cert_37.c
index a9daa0f8da5..b7ec7131a59 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/cert_37.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/cert_37.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: cert_37.c,v 1.11 2020/02/26 18:47:24 florian Exp $ */
+/* $Id: cert_37.c,v 1.12 2020/02/26 18:47:58 florian Exp $ */
/* Reviewed: Wed Mar 15 21:14:32 EST 2000 by tale */
@@ -42,7 +42,7 @@ totext_cert(ARGS_TOTEXT) {
n = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
RETERR(dns_cert_totext((dns_cert_t)n, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Key tag.
@@ -50,7 +50,7 @@ totext_cert(ARGS_TOTEXT) {
n = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
snprintf(buf, sizeof(buf), "%u ", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Algorithm.
@@ -62,15 +62,15 @@ totext_cert(ARGS_TOTEXT) {
* Cert.
*/
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" (", target));
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(" (", target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&sr, 60, "", target));
else
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" )", target));
+ RETERR(isc_str_tobuffer(" )", target));
return (ISC_R_SUCCESS);
}
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 f58c2f35dc4..4ba91bd411f 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/csync_62.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/csync_62.c
@@ -35,20 +35,20 @@ totext_csync(ARGS_TOTEXT) {
num = uint32_fromregion(&sr);
isc_region_consume(&sr, 4);
snprintf(buf, sizeof(buf), "%lu", num);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
num = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
snprintf(buf, sizeof(buf), "%lu", num);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Don't leave a trailing space when there's no typemap present.
*/
if (sr.length > 0) {
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
}
return (typemap_totext(&sr, NULL, target));
}
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 b3c4be7ac54..1cb641c6435 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/doa_259.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/doa_259.c
@@ -37,7 +37,7 @@ totext_doa(ARGS_TOTEXT) {
n = uint32_fromregion(&region);
isc_region_consume(&region, 4);
snprintf(buf, sizeof(buf), "%u ", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* DOA-TYPE
@@ -45,7 +45,7 @@ totext_doa(ARGS_TOTEXT) {
n = uint32_fromregion(&region);
isc_region_consume(&region, 4);
snprintf(buf, sizeof(buf), "%u ", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* DOA-LOCATION
@@ -53,19 +53,19 @@ totext_doa(ARGS_TOTEXT) {
n = uint8_fromregion(&region);
isc_region_consume(&region, 1);
snprintf(buf, sizeof(buf), "%u ", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* DOA-MEDIA-TYPE
*/
RETERR(txt_totext(&region, ISC_TRUE, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* DOA-DATA
*/
if (region.length == 0) {
- return (str_totext("-", target));
+ return (isc_str_tobuffer("-", target));
} else {
return (isc_base64_totext(&region, 60, "", target));
}
diff --git a/usr.bin/dig/lib/dns/rdata/generic/ds_43.c b/usr.bin/dig/lib/dns/rdata/generic/ds_43.c
index df37bbd790e..d0e22e298e5 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/ds_43.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/ds_43.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ds_43.c,v 1.12 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: ds_43.c,v 1.13 2020/02/26 18:47:59 florian Exp $ */
/* RFC3658 */
@@ -44,7 +44,7 @@ generic_totext_ds(ARGS_TOTEXT) {
n = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
snprintf(buf, sizeof(buf), "%u ", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Algorithm.
@@ -52,7 +52,7 @@ generic_totext_ds(ARGS_TOTEXT) {
n = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
snprintf(buf, sizeof(buf), "%u ", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Digest type.
@@ -60,14 +60,14 @@ generic_totext_ds(ARGS_TOTEXT) {
n = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
snprintf(buf, sizeof(buf), "%u", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Digest.
*/
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" (", target));
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(" (", target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_NOCRYPTO) == 0) {
if (tctx->width == 0) /* No splitting */
RETERR(isc_hex_totext(&sr, 0, "", target));
@@ -75,9 +75,9 @@ generic_totext_ds(ARGS_TOTEXT) {
RETERR(isc_hex_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
} else
- RETERR(str_totext("[omitted]", target));
+ RETERR(isc_str_tobuffer("[omitted]", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" )", target));
+ RETERR(isc_str_tobuffer(" )", target));
return (ISC_R_SUCCESS);
}
diff --git a/usr.bin/dig/lib/dns/rdata/generic/eui48_108.c b/usr.bin/dig/lib/dns/rdata/generic/eui48_108.c
index 0db08faa3b7..daeb50003f0 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/eui48_108.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/eui48_108.c
@@ -31,7 +31,7 @@ totext_eui48(ARGS_TOTEXT) {
(void)snprintf(buf, sizeof(buf), "%02x-%02x-%02x-%02x-%02x-%02x",
rdata->data[0], rdata->data[1], rdata->data[2],
rdata->data[3], rdata->data[4], rdata->data[5]);
- return (str_totext(buf, target));
+ return (isc_str_tobuffer(buf, target));
}
static inline isc_result_t
diff --git a/usr.bin/dig/lib/dns/rdata/generic/eui64_109.c b/usr.bin/dig/lib/dns/rdata/generic/eui64_109.c
index a8424118e99..2dab0b4128f 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/eui64_109.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/eui64_109.c
@@ -34,7 +34,7 @@ totext_eui64(ARGS_TOTEXT) {
rdata->data[2], rdata->data[3],
rdata->data[4], rdata->data[5],
rdata->data[6], rdata->data[7]);
- return (str_totext(buf, target));
+ return (isc_str_tobuffer(buf, target));
}
static inline isc_result_t
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 974e70096bd..c1dc67c80fb 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.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: gpos_27.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */
@@ -38,7 +38,7 @@ totext_gpos(ARGS_TOTEXT) {
for (i = 0; i < 3; i++) {
RETERR(txt_totext(&region, ISC_TRUE, target));
if (i != 2)
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
}
return (ISC_R_SUCCESS);
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 06fea0ec1b3..8e0acea36c4 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.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: hinfo_13.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
@@ -34,7 +34,7 @@ totext_hinfo(ARGS_TOTEXT) {
dns_rdata_toregion(rdata, &region);
RETERR(txt_totext(&region, ISC_TRUE, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
return (txt_totext(&region, ISC_TRUE, target));
}
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 096ea93f0d9..9cc6a95fc85 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.12 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: hip_55.c,v 1.13 2020/02/26 18:47:59 florian Exp $ */
/* reviewed: TBC */
@@ -46,13 +46,13 @@ totext_hip(ARGS_TOTEXT) {
isc_region_consume(&region, 2);
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext("( ", target));
+ RETERR(isc_str_tobuffer("( ", target));
/*
* Algorithm
*/
snprintf(buf, sizeof(buf), "%u ", algorithm);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* HIT.
@@ -62,7 +62,7 @@ totext_hip(ARGS_TOTEXT) {
region.length = hit_len;
RETERR(isc_hex_totext(&region, 1, "", target));
region.length = length - hit_len;
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
/*
* Public KEY.
@@ -72,7 +72,7 @@ totext_hip(ARGS_TOTEXT) {
region.length = key_len;
RETERR(isc_base64_totext(&region, 1, "", target));
region.length = length - key_len;
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
/*
* Rendezvous Servers.
@@ -84,10 +84,10 @@ totext_hip(ARGS_TOTEXT) {
RETERR(dns_name_totext(&name, ISC_FALSE, target));
isc_region_consume(&region, name.length);
if (region.length > 0)
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
}
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" )", target));
+ RETERR(isc_str_tobuffer(" )", target));
return (ISC_R_SUCCESS);
}
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 7db73fce5c0..1e675582e0b 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.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: ipseckey_45.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
#ifndef RDATA_GENERIC_IPSECKEY_45_C
#define RDATA_GENERIC_IPSECKEY_45_C
@@ -40,7 +40,7 @@ totext_ipseckey(ARGS_TOTEXT) {
return (ISC_R_NOTIMPLEMENTED);
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext("( ", target));
+ RETERR(isc_str_tobuffer("( ", target));
/*
* Precedence.
@@ -49,7 +49,7 @@ totext_ipseckey(ARGS_TOTEXT) {
num = uint8_fromregion(&region);
isc_region_consume(&region, 1);
snprintf(buf, sizeof(buf), "%u ", num);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Gateway type.
@@ -57,7 +57,7 @@ totext_ipseckey(ARGS_TOTEXT) {
gateway = uint8_fromregion(&region);
isc_region_consume(&region, 1);
snprintf(buf, sizeof(buf), "%u ", gateway);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Algorithm.
@@ -65,14 +65,14 @@ totext_ipseckey(ARGS_TOTEXT) {
num = uint8_fromregion(&region);
isc_region_consume(&region, 1);
snprintf(buf, sizeof(buf), "%u ", num);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Gateway.
*/
switch (gateway) {
case 0:
- RETERR(str_totext(".", target));
+ RETERR(isc_str_tobuffer(".", target));
break;
case 1:
@@ -96,7 +96,7 @@ totext_ipseckey(ARGS_TOTEXT) {
* Key.
*/
if (region.length > 0U) {
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&region, 60, "", target));
else
@@ -105,7 +105,7 @@ totext_ipseckey(ARGS_TOTEXT) {
}
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" )", target));
+ RETERR(isc_str_tobuffer(" )", target));
return (ISC_R_SUCCESS);
}
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 f230dbf4ff5..ebcb2f4aabe 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.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: isdn_20.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/* Reviewed: Wed Mar 15 16:53:11 PST 2000 by bwelling */
@@ -36,7 +36,7 @@ totext_isdn(ARGS_TOTEXT) {
RETERR(txt_totext(&region, ISC_TRUE, target));
if (region.length == 0)
return (ISC_R_SUCCESS);
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
return (txt_totext(&region, ISC_TRUE, target));
}
diff --git a/usr.bin/dig/lib/dns/rdata/generic/key_25.c b/usr.bin/dig/lib/dns/rdata/generic/key_25.c
index 473aa5aa63a..24c84496c22 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/key_25.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/key_25.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: key_25.c,v 1.12 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: key_25.c,v 1.13 2020/02/26 18:47:59 florian Exp $ */
/*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
@@ -45,8 +45,8 @@ generic_totext_key(ARGS_TOTEXT) {
flags = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
snprintf(buf, sizeof(buf), "%u", flags);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
if ((flags & DNS_KEYFLAG_KSK) != 0) {
if (flags & DNS_KEYFLAG_REVOKE)
keyinfo = "revoked KSK";
@@ -58,14 +58,14 @@ generic_totext_key(ARGS_TOTEXT) {
/* protocol */
snprintf(buf, sizeof(buf), "%u", sr.base[0]);
isc_region_consume(&sr, 1);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
/* algorithm */
algorithm = sr.base[0];
snprintf(buf, sizeof(buf), "%u", algorithm);
isc_region_consume(&sr, 1);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/* No Key? */
if ((flags & 0xc000) == 0xc000)
@@ -84,8 +84,8 @@ generic_totext_key(ARGS_TOTEXT) {
/* key */
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" (", target));
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(" (", target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_NOCRYPTO) == 0) {
if (tctx->width == 0) /* No splitting */
@@ -97,31 +97,31 @@ generic_totext_key(ARGS_TOTEXT) {
dns_rdata_toregion(rdata, &tmpr);
snprintf(buf, sizeof(buf), "[key id = %u]",
dst_region_computeid(&tmpr, algorithm));
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
}
if ((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0)
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
else if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(")", target));
+ RETERR(isc_str_tobuffer(")", target));
if ((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0) {
if (rdata->type == dns_rdatatype_dnskey ||
rdata->type == dns_rdatatype_cdnskey) {
- RETERR(str_totext(" ; ", target));
- RETERR(str_totext(keyinfo, target));
+ RETERR(isc_str_tobuffer(" ; ", target));
+ RETERR(isc_str_tobuffer(keyinfo, target));
}
- RETERR(str_totext("; alg = ", target));
- RETERR(str_totext(algbuf, target));
- RETERR(str_totext(" ; key id = ", target));
+ RETERR(isc_str_tobuffer("; alg = ", target));
+ RETERR(isc_str_tobuffer(algbuf, target));
+ RETERR(isc_str_tobuffer(" ; key id = ", target));
dns_rdata_toregion(rdata, &tmpr);
snprintf(buf, sizeof(buf), "%u",
dst_region_computeid(&tmpr, algorithm));
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
}
return (ISC_R_SUCCESS);
}
diff --git a/usr.bin/dig/lib/dns/rdata/generic/keydata_65533.c b/usr.bin/dig/lib/dns/rdata/generic/keydata_65533.c
index 39bcbac052e..0a59232cb3f 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/keydata_65533.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/keydata_65533.c
@@ -61,26 +61,26 @@ totext_keydata(ARGS_TOTEXT) {
refresh = uint32_fromregion(&sr);
isc_region_consume(&sr, 4);
RETERR(dns_time32_totext(refresh, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
/* add hold-down */
add = uint32_fromregion(&sr);
isc_region_consume(&sr, 4);
RETERR(dns_time32_totext(add, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
/* remove hold-down */
deltime = uint32_fromregion(&sr);
isc_region_consume(&sr, 4);
RETERR(dns_time32_totext(deltime, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
/* flags */
flags = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
snprintf(buf, sizeof(buf), "%u", flags);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
if ((flags & DNS_KEYFLAG_KSK) != 0) {
if (flags & DNS_KEYFLAG_REVOKE)
keyinfo = "revoked KSK";
@@ -92,14 +92,14 @@ totext_keydata(ARGS_TOTEXT) {
/* protocol */
snprintf(buf, sizeof(buf), "%u", sr.base[0]);
isc_region_consume(&sr, 1);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
/* algorithm */
algorithm = sr.base[0];
snprintf(buf, sizeof(buf), "%u", algorithm);
isc_region_consume(&sr, 1);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/* No Key? */
if ((flags & 0xc000) == 0xc000)
@@ -107,8 +107,8 @@ totext_keydata(ARGS_TOTEXT) {
/* key */
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" (", target));
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(" (", target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&sr, 60, "", target));
else
@@ -116,12 +116,12 @@ totext_keydata(ARGS_TOTEXT) {
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0)
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
else if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(")", target));
+ RETERR(isc_str_tobuffer(")", target));
if ((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0) {
isc_region_t tmpr;
@@ -130,60 +130,60 @@ totext_keydata(ARGS_TOTEXT) {
char dbuf[ISC_FORMATHTTPTIMESTAMP_SIZE];
struct timespec t;
- RETERR(str_totext(" ; ", target));
- RETERR(str_totext(keyinfo, target));
+ RETERR(isc_str_tobuffer(" ; ", target));
+ RETERR(isc_str_tobuffer(keyinfo, target));
dns_secalg_format((dns_secalg_t) algorithm, algbuf,
sizeof(algbuf));
- RETERR(str_totext("; alg = ", target));
- RETERR(str_totext(algbuf, target));
- RETERR(str_totext("; key id = ", target));
+ RETERR(isc_str_tobuffer("; alg = ", target));
+ RETERR(isc_str_tobuffer(algbuf, target));
+ RETERR(isc_str_tobuffer("; key id = ", target));
dns_rdata_toregion(rdata, &tmpr);
/* Skip over refresh, addhd, and removehd */
isc_region_consume(&tmpr, 12);
snprintf(buf, sizeof(buf), "%u",
dst_region_computeid(&tmpr, algorithm));
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) {
time_t now;
time(&now);
- RETERR(str_totext(tctx->linebreak, target));
- RETERR(str_totext("; next refresh: ", target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer("; next refresh: ", target));
t.tv_sec = refresh;
t.tv_nsec = 0;
isc_time_formathttptimestamp(&t, rbuf, sizeof(rbuf));
- RETERR(str_totext(rbuf, target));
+ RETERR(isc_str_tobuffer(rbuf, target));
if (add == 0U) {
- RETERR(str_totext(tctx->linebreak, target));
- RETERR(str_totext("; no trust", target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer("; no trust", target));
} else {
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
if ((time_t)add < now) {
- RETERR(str_totext("; trusted since: ",
+ RETERR(isc_str_tobuffer("; trusted since: ",
target));
} else {
- RETERR(str_totext("; trust pending: ",
+ RETERR(isc_str_tobuffer("; trust pending: ",
target));
}
t.tv_sec = add;
t.tv_nsec = 0;
isc_time_formathttptimestamp(&t, abuf,
sizeof(abuf));
- RETERR(str_totext(abuf, target));
+ RETERR(isc_str_tobuffer(abuf, target));
}
if (deltime != 0U) {
- RETERR(str_totext(tctx->linebreak, target));
- RETERR(str_totext("; removal pending: ",
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer("; removal pending: ",
target));
t.tv_sec = deltime;
t.tv_nsec = 0;
isc_time_formathttptimestamp(&t, dbuf,
sizeof(dbuf));
- RETERR(str_totext(dbuf, target));
+ RETERR(isc_str_tobuffer(dbuf, target));
}
}
diff --git a/usr.bin/dig/lib/dns/rdata/generic/l32_105.c b/usr.bin/dig/lib/dns/rdata/generic/l32_105.c
index 9a79fc091f2..16be0340513 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/l32_105.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/l32_105.c
@@ -36,9 +36,9 @@ totext_l32(ARGS_TOTEXT) {
num = uint16_fromregion(&region);
isc_region_consume(&region, 2);
snprintf(buf, sizeof(buf), "%u", num);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
return (inet_totext(AF_INET, &region, target));
}
diff --git a/usr.bin/dig/lib/dns/rdata/generic/l64_106.c b/usr.bin/dig/lib/dns/rdata/generic/l64_106.c
index f7fa25b61c1..d0395f0e0a4 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/l64_106.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/l64_106.c
@@ -36,16 +36,16 @@ totext_l64(ARGS_TOTEXT) {
num = uint16_fromregion(&region);
isc_region_consume(&region, 2);
snprintf(buf, sizeof(buf), "%u", num);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
snprintf(buf, sizeof(buf), "%x:%x:%x:%x",
region.base[0]<<8 | region.base[1],
region.base[2]<<8 | region.base[3],
region.base[4]<<8 | region.base[5],
region.base[6]<<8 | region.base[7]);
- return (str_totext(buf, target));
+ return (isc_str_tobuffer(buf, 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 c648cfee6b9..2dc998589a9 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.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: loc_29.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/* Reviewed: Wed Mar 15 18:13:09 PST 2000 by explorer */
@@ -137,7 +137,7 @@ totext_loc(ARGS_TOTEXT) {
below ? "-" : "", altitude/100, altitude % 100,
sbuf, hbuf, vbuf);
- return (str_totext(buf, target));
+ return (isc_str_tobuffer(buf, target));
}
static inline isc_result_t
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 751e8eb002c..20fe155cf82 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/lp_107.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/lp_107.c
@@ -40,9 +40,9 @@ totext_lp(ARGS_TOTEXT) {
num = uint16_fromregion(&region);
isc_region_consume(&region, 2);
snprintf(buf, sizeof(buf), "%u", num);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
dns_name_fromregion(&name, &region);
sub = name_prefix(&name, tctx->origin, &prefix);
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 8ed1a1acd40..1b87778eadd 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: minfo_14.c,v 1.11 2020/02/26 18:47:59 florian Exp $ */
/* reviewed: Wed Mar 15 17:45:32 PST 2000 by brister */
@@ -48,7 +48,7 @@ totext_minfo(ARGS_TOTEXT) {
RETERR(dns_name_totext(&prefix, sub, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
sub = name_prefix(&email, tctx->origin, &prefix);
return (dns_name_totext(&prefix, sub, target));
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 591c1c639d5..87ba5128b8f 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.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: mx_15.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/* reviewed: Wed Mar 15 18:05:46 PST 2000 by brister */
@@ -44,9 +44,9 @@ totext_mx(ARGS_TOTEXT) {
num = uint16_fromregion(&region);
isc_region_consume(&region, 2);
snprintf(buf, sizeof(buf), "%u", num);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
dns_name_fromregion(&name, &region);
sub = name_prefix(&name, tctx->origin, &prefix);
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 34374e33619..2f34a272e36 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.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: naptr_35.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */
@@ -140,8 +140,8 @@ totext_naptr(ARGS_TOTEXT) {
num = uint16_fromregion(&region);
isc_region_consume(&region, 2);
snprintf(buf, sizeof(buf), "%u", num);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Preference.
@@ -149,26 +149,26 @@ totext_naptr(ARGS_TOTEXT) {
num = uint16_fromregion(&region);
isc_region_consume(&region, 2);
snprintf(buf, sizeof(buf), "%u", num);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Flags.
*/
RETERR(txt_totext(&region, ISC_TRUE, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Service.
*/
RETERR(txt_totext(&region, ISC_TRUE, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Regexp.
*/
RETERR(txt_totext(&region, ISC_TRUE, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Replacement.
diff --git a/usr.bin/dig/lib/dns/rdata/generic/nid_104.c b/usr.bin/dig/lib/dns/rdata/generic/nid_104.c
index eab3c450a57..fd6898a7a95 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/nid_104.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/nid_104.c
@@ -36,16 +36,16 @@ totext_nid(ARGS_TOTEXT) {
num = uint16_fromregion(&region);
isc_region_consume(&region, 2);
snprintf(buf, sizeof(buf), "%u", num);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
snprintf(buf, sizeof(buf), "%x:%x:%x:%x",
region.base[0]<<8 | region.base[1],
region.base[2]<<8 | region.base[3],
region.base[4]<<8 | region.base[5],
region.base[6]<<8 | region.base[7]);
- return (str_totext(buf, target));
+ return (isc_str_tobuffer(buf, target));
}
static inline isc_result_t
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 be6a50202fc..7a041c92502 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.10 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: nsec3_50.c,v 1.11 2020/02/26 18:47:59 florian Exp $ */
/*
* Copyright (C) 2004 Nominet, Ltd.
@@ -57,19 +57,19 @@ totext_nsec3(ARGS_TOTEXT) {
hash = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
snprintf(buf, sizeof(buf), "%u ", hash);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/* Flags */
flags = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
snprintf(buf, sizeof(buf), "%u ", flags);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/* Iterations */
iterations = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
snprintf(buf, sizeof(buf), "%u ", iterations);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/* Salt */
j = uint8_fromregion(&sr);
@@ -82,11 +82,11 @@ totext_nsec3(ARGS_TOTEXT) {
RETERR(isc_hex_totext(&sr, 1, "", target));
sr.length = i - j;
} else
- RETERR(str_totext("-", target));
+ RETERR(isc_str_tobuffer("-", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" (", target));
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(" (", target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
/* Next hash */
j = uint8_fromregion(&sr);
@@ -102,12 +102,12 @@ totext_nsec3(ARGS_TOTEXT) {
* Don't leave a trailing space when there's no typemap present.
*/
if (((tctx->flags & DNS_STYLEFLAG_MULTILINE) == 0) && (sr.length > 0)) {
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
}
RETERR(typemap_totext(&sr, tctx, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" )", target));
+ RETERR(isc_str_tobuffer(" )", target));
return (ISC_R_SUCCESS);
}
diff --git a/usr.bin/dig/lib/dns/rdata/generic/nsec3param_51.c b/usr.bin/dig/lib/dns/rdata/generic/nsec3param_51.c
index 263ae213feb..faced7660ce 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/nsec3param_51.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/nsec3param_51.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nsec3param_51.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: nsec3param_51.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/*
* Copyright (C) 2004 Nominet, Ltd.
@@ -65,13 +65,13 @@ totext_nsec3param(ARGS_TOTEXT) {
isc_region_consume(&sr, 2);
snprintf(buf, sizeof(buf), "%u ", hash);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
snprintf(buf, sizeof(buf), "%u ", flags);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
snprintf(buf, sizeof(buf), "%u ", iterations);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
j = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
@@ -83,7 +83,7 @@ totext_nsec3param(ARGS_TOTEXT) {
RETERR(isc_hex_totext(&sr, 1, "", target));
sr.length = i - j;
} else
- RETERR(str_totext("-", target));
+ RETERR(isc_str_tobuffer("-", target));
return (ISC_R_SUCCESS);
}
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 0a3eb43a4f8..b666dd16898 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.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: nsec_47.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */
@@ -47,7 +47,7 @@ totext_nsec(ARGS_TOTEXT) {
* Don't leave a trailing space when there's no typemap present.
*/
if (sr.length > 0) {
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
}
return (typemap_totext(&sr, NULL, target));
}
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 942a4399237..dde232d087c 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.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: nxt_30.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */
@@ -52,7 +52,7 @@ totext_nxt(ARGS_TOTEXT) {
for (j = 0; j < 8; j++)
if ((sr.base[i] & (0x80 >> j)) != 0) {
dns_rdatatype_t t = i * 8 + j;
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
RETERR(dns_rdatatype_totext(t, target));
}
}
diff --git a/usr.bin/dig/lib/dns/rdata/generic/openpgpkey_61.c b/usr.bin/dig/lib/dns/rdata/generic/openpgpkey_61.c
index f89c874aca8..e3446a5601d 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/openpgpkey_61.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/openpgpkey_61.c
@@ -30,7 +30,7 @@ totext_openpgpkey(ARGS_TOTEXT) {
* Keyring
*/
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext("( ", target));
+ RETERR(isc_str_tobuffer("( ", target));
if ((tctx->flags & DNS_STYLEFLAG_NOCRYPTO) == 0) {
if (tctx->width == 0) /* No splitting */
@@ -39,10 +39,10 @@ totext_openpgpkey(ARGS_TOTEXT) {
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
} else
- RETERR(str_totext("[omitted]", target));
+ RETERR(isc_str_tobuffer("[omitted]", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" )", target));
+ RETERR(isc_str_tobuffer(" )", target));
return (ISC_R_SUCCESS);
}
diff --git a/usr.bin/dig/lib/dns/rdata/generic/opt_41.c b/usr.bin/dig/lib/dns/rdata/generic/opt_41.c
index 7709b4bd28a..c7257867f1d 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/opt_41.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/opt_41.c
@@ -42,12 +42,12 @@ totext_opt(ARGS_TOTEXT) {
length = uint16_fromregion(&r);
isc_region_consume(&r, 2);
snprintf(buf, sizeof(buf), "%u %u", option, length);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
INSIST(r.length >= length);
if (length > 0) {
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" (", target));
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(" (", target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
or = r;
or.length = length;
if (tctx->width == 0) /* No splitting */
@@ -58,10 +58,10 @@ totext_opt(ARGS_TOTEXT) {
target));
isc_region_consume(&r, length);
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" )", target));
+ RETERR(isc_str_tobuffer(" )", target));
}
if (r.length > 0)
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
}
return (ISC_R_SUCCESS);
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 9a805550957..bf726107fec 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: rp_17.c,v 1.11 2020/02/26 18:47:59 florian Exp $ */
/* RFC1183 */
@@ -47,7 +47,7 @@ totext_rp(ARGS_TOTEXT) {
sub = name_prefix(&rmail, tctx->origin, &prefix);
RETERR(dns_name_totext(&prefix, sub, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
sub = name_prefix(&email, tctx->origin, &prefix);
return (dns_name_totext(&prefix, sub, target));
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 7e6fa1307f4..eb0b64d20b9 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.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: rrsig_46.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */
@@ -46,23 +46,23 @@ totext_rrsig(ARGS_TOTEXT) {
isc_region_consume(&sr, 2);
RETERR(dns_rdatatype_totext(covered, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Algorithm.
*/
snprintf(buf, sizeof(buf), "%u", sr.base[0]);
isc_region_consume(&sr, 1);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Labels.
*/
snprintf(buf, sizeof(buf), "%u", sr.base[0]);
isc_region_consume(&sr, 1);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Ttl.
@@ -70,11 +70,11 @@ totext_rrsig(ARGS_TOTEXT) {
ttl = uint32_fromregion(&sr);
isc_region_consume(&sr, 4);
snprintf(buf, sizeof(buf), "%lu", ttl);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" (", target));
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(" (", target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
/*
* Sig exp.
@@ -82,7 +82,7 @@ totext_rrsig(ARGS_TOTEXT) {
exp = uint32_fromregion(&sr);
isc_region_consume(&sr, 4);
RETERR(dns_time32_totext(exp, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Time signed.
@@ -90,7 +90,7 @@ totext_rrsig(ARGS_TOTEXT) {
when = uint32_fromregion(&sr);
isc_region_consume(&sr, 4);
RETERR(dns_time32_totext(when, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Footprint.
@@ -98,8 +98,8 @@ totext_rrsig(ARGS_TOTEXT) {
foot = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
snprintf(buf, sizeof(buf), "%lu", foot);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Signer.
@@ -112,7 +112,7 @@ totext_rrsig(ARGS_TOTEXT) {
/*
* Sig.
*/
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_NOCRYPTO) == 0) {
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&sr, 60, "", target));
@@ -120,10 +120,10 @@ totext_rrsig(ARGS_TOTEXT) {
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
} else
- RETERR(str_totext("[omitted]", target));
+ RETERR(isc_str_tobuffer("[omitted]", target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" )", target));
+ RETERR(isc_str_tobuffer(" )", target));
return (ISC_R_SUCCESS);
}
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 d2b31379d8f..fd506e530b0 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: rt_21.c,v 1.11 2020/02/26 18:47:59 florian Exp $ */
/* reviewed: Thu Mar 16 15:02:31 PST 2000 by brister */
@@ -42,8 +42,8 @@ totext_rt(ARGS_TOTEXT) {
num = uint16_fromregion(&region);
isc_region_consume(&region, 2);
snprintf(buf, sizeof(buf), "%u", num);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
dns_name_fromregion(&name, &region);
sub = name_prefix(&name, tctx->origin, &prefix);
return (dns_name_totext(&prefix, sub, target));
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 471fb985754..e26cd63831a 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.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: sig_24.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */
@@ -48,23 +48,23 @@ totext_sig(ARGS_TOTEXT) {
isc_region_consume(&sr, 2);
RETERR(dns_rdatatype_totext(covered, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Algorithm.
*/
snprintf(buf, sizeof(buf), "%u", sr.base[0]);
isc_region_consume(&sr, 1);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Labels.
*/
snprintf(buf, sizeof(buf), "%u", sr.base[0]);
isc_region_consume(&sr, 1);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Ttl.
@@ -72,8 +72,8 @@ totext_sig(ARGS_TOTEXT) {
ttl = uint32_fromregion(&sr);
isc_region_consume(&sr, 4);
snprintf(buf, sizeof(buf), "%lu", ttl);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Sig exp.
@@ -83,8 +83,8 @@ totext_sig(ARGS_TOTEXT) {
RETERR(dns_time32_totext(exp, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" (", target));
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(" (", target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
/*
* Time signed.
@@ -92,7 +92,7 @@ totext_sig(ARGS_TOTEXT) {
when = uint32_fromregion(&sr);
isc_region_consume(&sr, 4);
RETERR(dns_time32_totext(when, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Footprint.
@@ -100,8 +100,8 @@ totext_sig(ARGS_TOTEXT) {
foot = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
snprintf(buf, sizeof(buf), "%lu", foot);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Signer.
@@ -116,14 +116,14 @@ totext_sig(ARGS_TOTEXT) {
/*
* Sig.
*/
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&sr, 60, "", target));
else
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" )", target));
+ RETERR(isc_str_tobuffer(" )", target));
return (ISC_R_SUCCESS);
}
diff --git a/usr.bin/dig/lib/dns/rdata/generic/sink_40.c b/usr.bin/dig/lib/dns/rdata/generic/sink_40.c
index 7a7f39e78db..9d68c1c24dc 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/sink_40.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/sink_40.c
@@ -38,16 +38,16 @@ totext_sink(ARGS_TOTEXT) {
subcoding = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
snprintf(buf, sizeof(buf), "%u %u %u", meaning, coding, subcoding);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
if (sr.length == 0U)
return (ISC_R_SUCCESS);
/* data */
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" (", target));
+ RETERR(isc_str_tobuffer(" (", target));
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&sr, 60, "", target));
@@ -56,7 +56,7 @@ totext_sink(ARGS_TOTEXT) {
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" )", target));
+ RETERR(isc_str_tobuffer(" )", target));
return (ISC_R_SUCCESS);
}
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 5a5ded87108..307f660d10c 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.7 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: soa_6.c,v 1.8 2020/02/26 18:47:59 florian Exp $ */
/* Reviewed: Thu Mar 16 15:18:32 PST 2000 by explorer */
@@ -60,14 +60,14 @@ totext_soa(ARGS_TOTEXT) {
sub = name_prefix(&mname, tctx->origin, &prefix);
RETERR(dns_name_totext(&prefix, sub, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
sub = name_prefix(&rname, tctx->origin, &prefix);
RETERR(dns_name_totext(&prefix, sub, target));
if (multiline)
- RETERR(str_totext(" (" , target));
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(" (" , target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
for (i = 0; i < 5; i++) {
char buf[sizeof("0123456789 ; ")];
@@ -75,23 +75,23 @@ totext_soa(ARGS_TOTEXT) {
num = uint32_fromregion(&dregion);
isc_region_consume(&dregion, 4);
snprintf(buf, sizeof(buf), comm ? "%-10lu ; " : "%lu", num);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
if (comm) {
- RETERR(str_totext(soa_fieldnames[i], target));
+ RETERR(isc_str_tobuffer(soa_fieldnames[i], target));
/* Print times in week/day/hour/minute/second form */
if (i >= 1) {
- RETERR(str_totext(" (", target));
+ RETERR(isc_str_tobuffer(" (", target));
RETERR(dns_ttl_totext(num, ISC_TRUE, target));
- RETERR(str_totext(")", target));
+ RETERR(isc_str_tobuffer(")", target));
}
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
} else if (i < 4) {
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
}
}
if (multiline)
- RETERR(str_totext(")", target));
+ RETERR(isc_str_tobuffer(")", target));
return (ISC_R_SUCCESS);
}
diff --git a/usr.bin/dig/lib/dns/rdata/generic/sshfp_44.c b/usr.bin/dig/lib/dns/rdata/generic/sshfp_44.c
index a0d957d9341..be2623285c1 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/sshfp_44.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/sshfp_44.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sshfp_44.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: sshfp_44.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/* RFC 4255 */
@@ -40,7 +40,7 @@ totext_sshfp(ARGS_TOTEXT) {
n = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
snprintf(buf, sizeof(buf), "%u ", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Digest type.
@@ -48,21 +48,21 @@ totext_sshfp(ARGS_TOTEXT) {
n = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
snprintf(buf, sizeof(buf), "%u", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Digest.
*/
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" (", target));
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(" (", target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_hex_totext(&sr, 0, "", target));
else
RETERR(isc_hex_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" )", target));
+ RETERR(isc_str_tobuffer(" )", target));
return (ISC_R_SUCCESS);
}
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 7e3409eb1fb..433906c026d 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/talink_58.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/talink_58.c
@@ -43,7 +43,7 @@ totext_talink(ARGS_TOTEXT) {
sub = name_prefix(&prev, tctx->origin, &prefix);
RETERR(dns_name_totext(&prefix, sub, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
sub = name_prefix(&next, tctx->origin, &prefix);
return(dns_name_totext(&prefix, sub, target));
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 52ab95f747f..73f4691e35f 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.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: tkey_249.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/*
* Reviewed: Thu Mar 16 17:35:30 PST 2000 by halley.
@@ -47,7 +47,7 @@ totext_tkey(ARGS_TOTEXT) {
dns_name_fromregion(&name, &sr);
sub = name_prefix(&name, tctx->origin, &prefix);
RETERR(dns_name_totext(&prefix, sub, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
isc_region_consume(&sr, name_length(&name));
/*
@@ -56,7 +56,7 @@ totext_tkey(ARGS_TOTEXT) {
n = uint32_fromregion(&sr);
isc_region_consume(&sr, 4);
snprintf(buf, sizeof(buf), "%lu ", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Expiration.
@@ -64,7 +64,7 @@ totext_tkey(ARGS_TOTEXT) {
n = uint32_fromregion(&sr);
isc_region_consume(&sr, 4);
snprintf(buf, sizeof(buf), "%lu ", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Mode.
@@ -72,7 +72,7 @@ totext_tkey(ARGS_TOTEXT) {
n = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
snprintf(buf, sizeof(buf), "%lu ", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Error.
@@ -80,10 +80,10 @@ totext_tkey(ARGS_TOTEXT) {
n = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
if (dns_tsigrcode_totext((dns_rcode_t)n, target) == ISC_R_SUCCESS)
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
else {
snprintf(buf, sizeof(buf), "%lu ", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
}
/*
@@ -92,7 +92,7 @@ totext_tkey(ARGS_TOTEXT) {
n = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
snprintf(buf, sizeof(buf), "%lu", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Key Data.
@@ -101,17 +101,17 @@ totext_tkey(ARGS_TOTEXT) {
dr = sr;
dr.length = n;
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" (", target));
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(" (", target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&dr, 60, "", target));
else
RETERR(isc_base64_totext(&dr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" ) ", target));
+ RETERR(isc_str_tobuffer(" ) ", target));
else
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
isc_region_consume(&sr, n);
/*
@@ -120,7 +120,7 @@ totext_tkey(ARGS_TOTEXT) {
n = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
snprintf(buf, sizeof(buf), "%lu", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Other Data.
@@ -130,15 +130,15 @@ totext_tkey(ARGS_TOTEXT) {
dr = sr;
dr.length = n;
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" (", target));
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(" (", target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&dr, 60, "", target));
else
RETERR(isc_base64_totext(&dr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" )", target));
+ RETERR(isc_str_tobuffer(" )", target));
}
return (ISC_R_SUCCESS);
}
diff --git a/usr.bin/dig/lib/dns/rdata/generic/tlsa_52.c b/usr.bin/dig/lib/dns/rdata/generic/tlsa_52.c
index 062568b3c56..bafe487c863 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/tlsa_52.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/tlsa_52.c
@@ -37,7 +37,7 @@ generic_totext_tlsa(ARGS_TOTEXT) {
n = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
snprintf(buf, sizeof(buf), "%u ", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Selector.
@@ -45,7 +45,7 @@ generic_totext_tlsa(ARGS_TOTEXT) {
n = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
snprintf(buf, sizeof(buf), "%u ", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Matching type.
@@ -53,21 +53,21 @@ generic_totext_tlsa(ARGS_TOTEXT) {
n = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
snprintf(buf, sizeof(buf), "%u", n);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Certificate Association Data.
*/
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" (", target));
- RETERR(str_totext(tctx->linebreak, target));
+ RETERR(isc_str_tobuffer(" (", target));
+ RETERR(isc_str_tobuffer(tctx->linebreak, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_hex_totext(&sr, 0, "", target));
else
RETERR(isc_hex_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" )", target));
+ RETERR(isc_str_tobuffer(" )", target));
return (ISC_R_SUCCESS);
}
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 353e81cbcd9..1da4fe293c6 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/txt_16.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/txt_16.c
@@ -30,7 +30,7 @@ generic_totext_txt(ARGS_TOTEXT) {
while (region.length > 0) {
RETERR(txt_totext(&region, ISC_TRUE, target));
if (region.length > 0)
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
}
return (ISC_R_SUCCESS);
diff --git a/usr.bin/dig/lib/dns/rdata/generic/uri_256.c b/usr.bin/dig/lib/dns/rdata/generic/uri_256.c
index dadbda99a3b..799ca6339e4 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/uri_256.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/uri_256.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: uri_256.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: uri_256.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
#ifndef GENERIC_URI_256_C
#define GENERIC_URI_256_C 1
@@ -38,7 +38,7 @@ totext_uri(ARGS_TOTEXT) {
priority = uint16_fromregion(&region);
isc_region_consume(&region, 2);
snprintf(buf, sizeof(buf), "%u ", priority);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Weight
@@ -46,7 +46,7 @@ totext_uri(ARGS_TOTEXT) {
weight = uint16_fromregion(&region);
isc_region_consume(&region, 2);
snprintf(buf, sizeof(buf), "%u ", weight);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
/*
* Target URI
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 641e7f07273..fdc5ff18355 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.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: a6_38.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/* RFC2874 */
@@ -44,8 +44,8 @@ totext_in_a6(ARGS_TOTEXT) {
INSIST(prefixlen <= 128);
isc_region_consume(&sr, 1);
snprintf(buf, sizeof(buf), "%u", prefixlen);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
if (prefixlen != 128) {
octets = prefixlen/8;
@@ -62,7 +62,7 @@ totext_in_a6(ARGS_TOTEXT) {
if (prefixlen == 0)
return (ISC_R_SUCCESS);
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
dns_name_init(&name, NULL);
dns_name_init(&prefix, NULL);
dns_name_fromregion(&name, &sr);
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 93fa777e4ec..b1990fd3748 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.12 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: apl_42.c,v 1.13 2020/02/26 18:47:59 florian Exp $ */
/* RFC3123 */
@@ -56,7 +56,7 @@ totext_in_apl(ARGS_TOTEXT) {
n = snprintf(txt, sizeof(txt), "%s%s%u:", sep,
neg ? "!" : "", afi);
INSIST(n < (int)sizeof(txt));
- RETERR(str_totext(txt, target));
+ RETERR(isc_str_tobuffer(txt, target));
switch (afi) {
case 1:
INSIST(len <= 4);
@@ -79,7 +79,7 @@ totext_in_apl(ARGS_TOTEXT) {
}
n = snprintf(txt, sizeof(txt), "/%u", prefix);
INSIST(n < (int)sizeof(txt));
- RETERR(str_totext(txt, target));
+ RETERR(isc_str_tobuffer(txt, target));
isc_region_consume(&sr, len);
sep = " ";
}
diff --git a/usr.bin/dig/lib/dns/rdata/in_1/dhcid_49.c b/usr.bin/dig/lib/dns/rdata/in_1/dhcid_49.c
index 15cb7add667..197d6892412 100644
--- a/usr.bin/dig/lib/dns/rdata/in_1/dhcid_49.c
+++ b/usr.bin/dig/lib/dns/rdata/in_1/dhcid_49.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dhcid_49.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: dhcid_49.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/* RFC 4701 */
@@ -35,20 +35,20 @@ totext_in_dhcid(ARGS_TOTEXT) {
sr2 = sr;
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext("( " /*)*/, target));
+ RETERR(isc_str_tobuffer("( " /*)*/, target));
if (tctx->width == 0) /* No splitting */
RETERR(isc_base64_totext(&sr, 60, "", target));
else
RETERR(isc_base64_totext(&sr, tctx->width - 2,
tctx->linebreak, target));
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) {
- RETERR(str_totext(/* ( */ " )", target));
+ RETERR(isc_str_tobuffer(/* ( */ " )", target));
if (rdata->length > 2) {
n = snprintf(buf, sizeof(buf), " ; %u %u %u",
sr2.base[0] * 256U + sr2.base[1],
sr2.base[2], rdata->length - 3U);
INSIST(n < sizeof(buf));
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
}
}
return (ISC_R_SUCCESS);
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 968fc84b39a..a88b18e6fe5 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.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: kx_36.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/* Reviewed: Thu Mar 16 17:24:54 PST 2000 by explorer */
@@ -43,9 +43,9 @@ totext_in_kx(ARGS_TOTEXT) {
num = uint16_fromregion(&region);
isc_region_consume(&region, 2);
snprintf(buf, sizeof(buf), "%u", num);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
dns_name_fromregion(&name, &region);
sub = name_prefix(&name, tctx->origin, &prefix);
diff --git a/usr.bin/dig/lib/dns/rdata/in_1/nsap_22.c b/usr.bin/dig/lib/dns/rdata/in_1/nsap_22.c
index ec7f4bb8f39..abe33e16c48 100644
--- a/usr.bin/dig/lib/dns/rdata/in_1/nsap_22.c
+++ b/usr.bin/dig/lib/dns/rdata/in_1/nsap_22.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nsap_22.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: nsap_22.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/* Reviewed: Fri Mar 17 10:41:07 PST 2000 by gson */
@@ -35,11 +35,11 @@ totext_in_nsap(ARGS_TOTEXT) {
UNUSED(tctx);
dns_rdata_toregion(rdata, &region);
- RETERR(str_totext("0x", target));
+ RETERR(isc_str_tobuffer("0x", target));
while (region.length != 0) {
snprintf(buf, sizeof(buf), "%02x", region.base[0]);
isc_region_consume(&region, 1);
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
}
return (ISC_R_SUCCESS);
}
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 4bf0aa9ced2..426b5daea6f 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.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: px_26.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/* Reviewed: Mon Mar 20 10:44:27 PST 2000 */
@@ -46,8 +46,8 @@ totext_in_px(ARGS_TOTEXT) {
num = uint16_fromregion(&region);
isc_region_consume(&region, 2);
snprintf(buf, sizeof(buf), "%u", num);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* MAP822.
@@ -56,7 +56,7 @@ totext_in_px(ARGS_TOTEXT) {
sub = name_prefix(&name, tctx->origin, &prefix);
isc_region_consume(&region, name_length(&name));
RETERR(dns_name_totext(&prefix, sub, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* MAPX400.
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 bb1be779f8b..f7ded8556e6 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.11 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: srv_33.c,v 1.12 2020/02/26 18:47:59 florian Exp $ */
/* Reviewed: Fri Mar 17 13:01:00 PST 2000 by bwelling */
@@ -46,8 +46,8 @@ totext_in_srv(ARGS_TOTEXT) {
num = uint16_fromregion(&region);
isc_region_consume(&region, 2);
snprintf(buf, sizeof buf, "%u", num);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Weight.
@@ -55,8 +55,8 @@ totext_in_srv(ARGS_TOTEXT) {
num = uint16_fromregion(&region);
isc_region_consume(&region, 2);
snprintf(buf, sizeof buf, "%u", num);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Port.
@@ -64,8 +64,8 @@ totext_in_srv(ARGS_TOTEXT) {
num = uint16_fromregion(&region);
isc_region_consume(&region, 2);
snprintf(buf, sizeof buf, "%u", num);
- RETERR(str_totext(buf, target));
- RETERR(str_totext(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
/*
* Target.
diff --git a/usr.bin/dig/lib/dns/rdata/in_1/wks_11.c b/usr.bin/dig/lib/dns/rdata/in_1/wks_11.c
index fe7df30288f..78d1243c68c 100644
--- a/usr.bin/dig/lib/dns/rdata/in_1/wks_11.c
+++ b/usr.bin/dig/lib/dns/rdata/in_1/wks_11.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: wks_11.c,v 1.12 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: wks_11.c,v 1.13 2020/02/26 18:47:59 florian Exp $ */
/* Reviewed: Fri Mar 17 15:01:49 PST 2000 by explorer */
@@ -46,8 +46,8 @@ totext_in_wks(ARGS_TOTEXT) {
proto = uint8_fromregion(&sr);
snprintf(buf, sizeof(buf), "%u", proto);
- RETERR(str_totext(" ", target));
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
isc_region_consume(&sr, 1);
INSIST(sr.length <= 8*1024);
@@ -57,8 +57,8 @@ totext_in_wks(ARGS_TOTEXT) {
if ((sr.base[i] & (0x80 >> j)) != 0) {
snprintf(buf, sizeof(buf),
"%u", i * 8 + j);
- RETERR(str_totext(" ", target));
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(" ", target));
+ RETERR(isc_str_tobuffer(buf, target));
}
}
diff --git a/usr.bin/dig/lib/isc/base32.c b/usr.bin/dig/lib/isc/base32.c
index d4aefa84052..becc95c42cb 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.6 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: base32.c,v 1.7 2020/02/26 18:47:59 florian Exp $ */
/*! \file */
@@ -30,14 +30,6 @@
return (_r); \
} while (0)
-/*@{*/
-/*!
- * These static functions are also present in lib/dns/rdata.c. I'm not
- * sure where they should go. -- bwelling
- */
-static isc_result_t
-str_totext(const char *source, isc_buffer_t *target);
-
/*@}*/
static const char base32hex[] =
@@ -60,7 +52,7 @@ base32_totext(isc_region_t *source, int wordlength, const char *wordbreak,
buf[1] = base[(source->base[0]<<2)&0x1c];
buf[2] = buf[3] = buf[4] = pad;
buf[5] = buf[6] = buf[7] = pad;
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
break;
}
buf[1] = base[((source->base[0]<<2)&0x1c)| /* 3 = 8 */
@@ -69,7 +61,7 @@ base32_totext(isc_region_t *source, int wordlength, const char *wordbreak,
if (source->length == 2) {
buf[3] = base[(source->base[1]<<4)&0x10];
buf[4] = buf[5] = buf[6] = buf[7] = pad;
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
break;
}
buf[3] = base[((source->base[1]<<4)&0x10)| /* 1 = 8 */
@@ -77,7 +69,7 @@ base32_totext(isc_region_t *source, int wordlength, const char *wordbreak,
if (source->length == 3) {
buf[4] = base[(source->base[2]<<1)&0x1e];
buf[5] = buf[6] = buf[7] = pad;
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
break;
}
buf[4] = base[((source->base[2]<<1)&0x1e)| /* 4 = 8 */
@@ -86,13 +78,13 @@ base32_totext(isc_region_t *source, int wordlength, const char *wordbreak,
if (source->length == 4) {
buf[6] = base[(source->base[3]<<3)&0x18];
buf[7] = pad;
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
break;
}
buf[6] = base[((source->base[3]<<3)&0x18)| /* 2 = 8 */
((source->base[4]>>5)&0x07)]; /* 3 + */
buf[7] = base[source->base[4]&0x1f]; /* 5 = 8 */
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
isc_region_consume(source, 5);
loops++;
@@ -100,7 +92,7 @@ base32_totext(isc_region_t *source, int wordlength, const char *wordbreak,
(int)((loops + 1) * 8) >= wordlength)
{
loops = 0;
- RETERR(str_totext(wordbreak, target));
+ RETERR(isc_str_tobuffer(wordbreak, target));
}
}
if (source->length > 0)
@@ -277,19 +269,3 @@ isc_result_t
isc_base32hexnp_decoderegion(isc_region_t *source, isc_buffer_t *target) {
return (base32_decoderegion(source, base32hex, ISC_FALSE, target));
}
-
-static isc_result_t
-str_totext(const char *source, isc_buffer_t *target) {
- unsigned int l;
- isc_region_t region;
-
- isc_buffer_availableregion(target, &region);
- l = strlen(source);
-
- if (l > region.length)
- return (ISC_R_NOSPACE);
-
- memmove(region.base, source, l);
- isc_buffer_add(target, l);
- return (ISC_R_SUCCESS);
-}
diff --git a/usr.bin/dig/lib/isc/base64.c b/usr.bin/dig/lib/isc/base64.c
index 4b8f95c318d..df6aef7cab1 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.5 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: base64.c,v 1.6 2020/02/26 18:47:59 florian Exp $ */
/*! \file */
@@ -32,12 +32,6 @@
} while (0)
/*@{*/
-/*!
- * These static functions are also present in lib/dns/rdata.c. I'm not
- * sure where they should go. -- bwelling
- */
-static isc_result_t
-str_totext(const char *source, isc_buffer_t *target);
static const char base64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
@@ -61,7 +55,7 @@ isc_base64_totext(isc_region_t *source, int wordlength,
buf[2] = base64[((source->base[1]<<2)&0x3c)|
((source->base[2]>>6)&0x03)];
buf[3] = base64[source->base[2]&0x3f];
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
isc_region_consume(source, 3);
loops++;
@@ -69,7 +63,7 @@ isc_base64_totext(isc_region_t *source, int wordlength,
(int)((loops + 1) * 4) >= wordlength)
{
loops = 0;
- RETERR(str_totext(wordbreak, target));
+ RETERR(isc_str_tobuffer(wordbreak, target));
}
}
if (source->length == 2) {
@@ -78,13 +72,13 @@ isc_base64_totext(isc_region_t *source, int wordlength,
((source->base[1]>>4)&0x0f)];
buf[2] = base64[((source->base[1]<<2)&0x3c)];
buf[3] = '=';
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
isc_region_consume(source, 2);
} else if (source->length == 1) {
buf[0] = base64[(source->base[0]>>2)&0x3f];
buf[1] = base64[((source->base[0]<<4)&0x30)];
buf[2] = buf[3] = '=';
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
isc_region_consume(source, 1);
}
return (ISC_R_SUCCESS);
@@ -186,19 +180,3 @@ isc_base64_decodestring(const char *cstr, isc_buffer_t *target) {
RETERR(base64_decode_finish(&ctx));
return (ISC_R_SUCCESS);
}
-
-static isc_result_t
-str_totext(const char *source, isc_buffer_t *target) {
- unsigned int l;
- isc_region_t region;
-
- isc_buffer_availableregion(target, &region);
- l = strlen(source);
-
- if (l > region.length)
- return (ISC_R_NOSPACE);
-
- memmove(region.base, source, l);
- isc_buffer_add(target, l);
- return (ISC_R_SUCCESS);
-}
diff --git a/usr.bin/dig/lib/isc/buffer.c b/usr.bin/dig/lib/isc/buffer.c
index 9dce1033ec8..421b7abe1d8 100644
--- a/usr.bin/dig/lib/isc/buffer.c
+++ b/usr.bin/dig/lib/isc/buffer.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: buffer.c,v 1.7 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: buffer.c,v 1.8 2020/02/26 18:47:59 florian Exp $ */
/*! \file */
@@ -364,3 +364,20 @@ isc_mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) {
isc_buffer_add(target, length);
return (ISC_R_SUCCESS);
}
+
+/* this used to be str_totext() in rdata.c etc. */
+isc_result_t
+isc_str_tobuffer(const char *source, isc_buffer_t *target) {
+ unsigned int l;
+ isc_region_t region;
+
+ isc_buffer_availableregion(target, &region);
+ l = strlen(source);
+
+ if (l > region.length)
+ return (ISC_R_NOSPACE);
+
+ memmove(region.base, source, l);
+ isc_buffer_add(target, l);
+ return (ISC_R_SUCCESS);
+}
diff --git a/usr.bin/dig/lib/isc/hex.c b/usr.bin/dig/lib/isc/hex.c
index bb55f3b9260..35512536c35 100644
--- a/usr.bin/dig/lib/isc/hex.c
+++ b/usr.bin/dig/lib/isc/hex.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: hex.c,v 1.4 2020/02/26 18:47:25 florian Exp $ */
+/* $Id: hex.c,v 1.5 2020/02/26 18:47:59 florian Exp $ */
/*! \file */
@@ -33,12 +33,6 @@
return (_r); \
} while (0)
-/*
- * BEW: These static functions are copied from lib/dns/rdata.c.
- */
-static isc_result_t
-str_totext(const char *source, isc_buffer_t *target);
-
static const char hex[] = "0123456789ABCDEF";
isc_result_t
@@ -55,7 +49,7 @@ isc_hex_totext(isc_region_t *source, int wordlength,
while (source->length > 0) {
buf[0] = hex[(source->base[0] >> 4) & 0xf];
buf[1] = hex[(source->base[0]) & 0xf];
- RETERR(str_totext(buf, target));
+ RETERR(isc_str_tobuffer(buf, target));
isc_region_consume(source, 1);
loops++;
@@ -63,7 +57,7 @@ isc_hex_totext(isc_region_t *source, int wordlength,
(int)((loops + 1) * 2) >= wordlength)
{
loops = 0;
- RETERR(str_totext(wordbreak, target));
+ RETERR(isc_str_tobuffer(wordbreak, target));
}
}
return (ISC_R_SUCCESS);
@@ -135,19 +129,3 @@ isc_hex_decodestring(const char *cstr, isc_buffer_t *target) {
RETERR(hex_decode_finish(&ctx));
return (ISC_R_SUCCESS);
}
-
-static isc_result_t
-str_totext(const char *source, isc_buffer_t *target) {
- unsigned int l;
- isc_region_t region;
-
- isc_buffer_availableregion(target, &region);
- l = strlen(source);
-
- if (l > region.length)
- return (ISC_R_NOSPACE);
-
- memmove(region.base, source, l);
- isc_buffer_add(target, l);
- return (ISC_R_SUCCESS);
-}
diff --git a/usr.bin/dig/lib/isc/include/isc/buffer.h b/usr.bin/dig/lib/isc/include/isc/buffer.h
index d3740724443..049238cd4df 100644
--- a/usr.bin/dig/lib/isc/include/isc/buffer.h
+++ b/usr.bin/dig/lib/isc/include/isc/buffer.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: buffer.h,v 1.8 2020/02/26 18:47:26 florian Exp $ */
+/* $Id: buffer.h,v 1.9 2020/02/26 18:48:00 florian Exp $ */
#ifndef ISC_BUFFER_H
#define ISC_BUFFER_H 1
@@ -717,4 +717,8 @@ isc_buffer_copyregion(isc_buffer_t *b, const isc_region_t *r);
isc_result_t
isc_mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length);
+
+/* this used to be str_totext() in rdata.c etc. */
+isc_result_t
+isc_str_tobuffer(const char *source, isc_buffer_t *target);
#endif /* ISC_BUFFER_H */