summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2020-02-26 18:47:27 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2020-02-26 18:47:27 +0000
commitee157feec41661387911a54eda7011ce9d9b89d8 (patch)
tree283ade56b6ed62a8a115b00224751666d5cdbc6c
parent879c80dca3e3c439e96c9a7d40380c676556b779 (diff)
In preparation of compiling lib/dns/rdata/ files individually we need
global visibility of mem_tobuffer. Rename it to isc_mem_tobuffer, put it into buffer.c and delete duplicate implementations.
-rw-r--r--usr.bin/dig/lib/dns/rdata.c21
-rw-r--r--usr.bin/dig/lib/dns/rdata/any_255/tsig_250.c16
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/avc_258.c2
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/caa_257.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/cdnskey_60.c2
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/cds_59.c2
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/cert_37.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/csync_62.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/dlv_32769.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/dnskey_48.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/doa_259.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/ds_43.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/eui48_108.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/eui64_109.c4
-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.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/ipseckey_45.c14
-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.c8
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/keydata_65533.c4
-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.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/loc_29.c8
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/lp_107.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.c12
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/nid_104.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/ninfo_56.c2
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/nsec3_50.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/nsec3param_51.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/nsec_47.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/null_10.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/nxt_30.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/openpgpkey_61.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/opt_41.c2
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/rkey_57.c2
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/rrsig_46.c10
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/sig_24.c10
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/sink_40.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/smimea_53.c2
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/spf_99.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/sshfp_44.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/ta_32768.c2
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/tkey_249.c10
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/tlsa_52.c4
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/txt_16.c2
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/unspec_103.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/uri_256.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/generic/x25_19.c4
-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.c6
-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.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/in_1/srv_33.c6
-rw-r--r--usr.bin/dig/lib/dns/rdata/in_1/wks_11.c4
-rw-r--r--usr.bin/dig/lib/isc/base32.c19
-rw-r--r--usr.bin/dig/lib/isc/base64.c19
-rw-r--r--usr.bin/dig/lib/isc/buffer.c14
-rw-r--r--usr.bin/dig/lib/isc/hex.c19
-rw-r--r--usr.bin/dig/lib/isc/include/isc/buffer.h4
63 files changed, 178 insertions, 228 deletions
diff --git a/usr.bin/dig/lib/dns/rdata.c b/usr.bin/dig/lib/dns/rdata.c
index f919a89855c..108f5c2f546 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.27 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: rdata.c,v 1.28 2020/02/26 18:47:24 florian Exp $ */
/*! \file */
@@ -127,9 +127,6 @@ static uint8_t
uint8_consume_fromregion(isc_region_t *region);
static isc_result_t
-mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length);
-
-static isc_result_t
btoa_totext(unsigned char *inbuf, int inbuflen, isc_buffer_t *target);
static isc_result_t
@@ -1381,22 +1378,6 @@ uint8_consume_fromregion(isc_region_t *region) {
return r;
}
-static isc_result_t
-mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) {
- isc_region_t tr;
-
- if (length == 0U)
- return (ISC_R_SUCCESS);
-
- isc_buffer_availableregion(target, &tr);
- if (length > tr.length)
- return (ISC_R_NOSPACE);
- if (tr.base != base)
- memmove(tr.base, base, length);
- isc_buffer_add(target, length);
- return (ISC_R_SUCCESS);
-}
-
static const char atob_digits[86] =
"!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`" \
"abcdefghijklmnopqrstu";
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 8547ec7bb31..43b23384954 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.7 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: tsig_250.c,v 1.8 2020/02/26 18:47:24 florian Exp $ */
/* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */
@@ -163,7 +163,7 @@ fromwire_any_tsig(ARGS_FROMWIRE) {
*/
if (sr.length < 8)
return (ISC_R_UNEXPECTEDEND);
- RETERR(mem_tobuffer(target, sr.base, 8));
+ RETERR(isc_mem_tobuffer(target, sr.base, 8));
isc_region_consume(&sr, 8);
isc_buffer_forward(source, 8);
@@ -175,7 +175,7 @@ fromwire_any_tsig(ARGS_FROMWIRE) {
n = uint16_fromregion(&sr);
if (sr.length < n + 2)
return (ISC_R_UNEXPECTEDEND);
- RETERR(mem_tobuffer(target, sr.base, n + 2));
+ RETERR(isc_mem_tobuffer(target, sr.base, n + 2));
isc_region_consume(&sr, n + 2);
isc_buffer_forward(source, n + 2);
@@ -184,7 +184,7 @@ fromwire_any_tsig(ARGS_FROMWIRE) {
*/
if (sr.length < 4)
return (ISC_R_UNEXPECTEDEND);
- RETERR(mem_tobuffer(target, sr.base, 4));
+ RETERR(isc_mem_tobuffer(target, sr.base, 4));
isc_region_consume(&sr, 4);
isc_buffer_forward(source, 4);
@@ -197,7 +197,7 @@ fromwire_any_tsig(ARGS_FROMWIRE) {
if (sr.length < n + 2)
return (ISC_R_UNEXPECTEDEND);
isc_buffer_forward(source, n + 2);
- return (mem_tobuffer(target, sr.base, n + 2));
+ return (isc_mem_tobuffer(target, sr.base, n + 2));
}
static inline isc_result_t
@@ -216,7 +216,7 @@ towire_any_tsig(ARGS_TOWIRE) {
dns_name_fromregion(&name, &sr);
RETERR(dns_name_towire(&name, cctx, target));
isc_region_consume(&sr, name_length(&name));
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
static inline isc_result_t
@@ -263,7 +263,7 @@ fromstruct_any_tsig(ARGS_FROMSTRUCT) {
/*
* Signature.
*/
- RETERR(mem_tobuffer(target, tsig->signature, tsig->siglen));
+ RETERR(isc_mem_tobuffer(target, tsig->signature, tsig->siglen));
isc_buffer_availableregion(target, &tr);
if (tr.length < 2 + 2 + 2)
@@ -287,7 +287,7 @@ fromstruct_any_tsig(ARGS_FROMSTRUCT) {
/*
* Other Data.
*/
- return (mem_tobuffer(target, tsig->other, tsig->otherlen));
+ return (isc_mem_tobuffer(target, tsig->other, tsig->otherlen));
}
static inline isc_result_t
diff --git a/usr.bin/dig/lib/dns/rdata/generic/avc_258.c b/usr.bin/dig/lib/dns/rdata/generic/avc_258.c
index 751693c265d..7a79d91e310 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/avc_258.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/avc_258.c
@@ -48,7 +48,7 @@ towire_avc(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_AVC_258_C */
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 096d71ce135..a604d719e3d 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/caa_257.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/caa_257.c
@@ -92,7 +92,7 @@ fromwire_caa(ARGS_FROMWIRE) {
/*
* Flags, tag length
*/
- RETERR(mem_tobuffer(target, sr.base, 2));
+ RETERR(isc_mem_tobuffer(target, sr.base, 2));
len = sr.base[1];
isc_region_consume(&sr, 2);
isc_buffer_forward(source, 2);
@@ -111,7 +111,7 @@ fromwire_caa(ARGS_FROMWIRE) {
* Tag + Value
*/
isc_buffer_forward(source, sr.length);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
static inline isc_result_t
@@ -125,7 +125,7 @@ towire_caa(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &region);
- return (mem_tobuffer(target, region.base, region.length));
+ return (isc_mem_tobuffer(target, region.base, region.length));
}
#endif /* GENERIC_CAA_257_C */
diff --git a/usr.bin/dig/lib/dns/rdata/generic/cdnskey_60.c b/usr.bin/dig/lib/dns/rdata/generic/cdnskey_60.c
index ed98abb9218..e91b07deb47 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/cdnskey_60.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/cdnskey_60.c
@@ -49,7 +49,7 @@ towire_cdnskey(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_CDNSKEY_60_C */
diff --git a/usr.bin/dig/lib/dns/rdata/generic/cds_59.c b/usr.bin/dig/lib/dns/rdata/generic/cds_59.c
index a01a7c3b2de..06c1bade0cf 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/cds_59.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/cds_59.c
@@ -51,7 +51,7 @@ towire_cds(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_CDS_59_C */
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 1e961c88bef..a9daa0f8da5 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: cert_37.c,v 1.11 2020/02/26 18:47:24 florian Exp $ */
/* Reviewed: Wed Mar 15 21:14:32 EST 2000 by tale */
@@ -90,7 +90,7 @@ fromwire_cert(ARGS_FROMWIRE) {
return (ISC_R_UNEXPECTEDEND);
isc_buffer_forward(source, sr.length);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
static inline isc_result_t
@@ -103,7 +103,7 @@ towire_cert(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_CERT_37_C */
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 382d06d8343..f58c2f35dc4 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/csync_62.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/csync_62.c
@@ -71,13 +71,13 @@ fromwire_csync(ARGS_FROMWIRE) {
if (sr.length < 6)
return (ISC_R_UNEXPECTEDEND);
- RETERR(mem_tobuffer(target, sr.base, 6));
+ RETERR(isc_mem_tobuffer(target, sr.base, 6));
isc_buffer_forward(source, 6);
isc_region_consume(&sr, 6);
RETERR(typemap_test(&sr, ISC_TRUE));
- RETERR(mem_tobuffer(target, sr.base, sr.length));
+ RETERR(isc_mem_tobuffer(target, sr.base, sr.length));
isc_buffer_forward(source, sr.length);
return (ISC_R_SUCCESS);
}
@@ -90,7 +90,7 @@ towire_csync(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_CSYNC_62_C */
diff --git a/usr.bin/dig/lib/dns/rdata/generic/dlv_32769.c b/usr.bin/dig/lib/dns/rdata/generic/dlv_32769.c
index 34d98d1abdb..0c3e73a44d6 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/dlv_32769.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/dlv_32769.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dlv_32769.c,v 1.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: dlv_32769.c,v 1.11 2020/02/26 18:47:24 florian Exp $ */
/* RFC3658 */
@@ -53,7 +53,7 @@ towire_dlv(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_DLV_32769_C */
diff --git a/usr.bin/dig/lib/dns/rdata/generic/dnskey_48.c b/usr.bin/dig/lib/dns/rdata/generic/dnskey_48.c
index fb774f48c97..54833293641 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/dnskey_48.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/dnskey_48.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnskey_48.c,v 1.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: dnskey_48.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
@@ -56,7 +56,7 @@ towire_dnskey(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_DNSKEY_48_C */
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 f917900cf08..b3c4be7ac54 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/doa_259.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/doa_259.c
@@ -99,7 +99,7 @@ fromwire_doa(ARGS_FROMWIRE) {
}
isc_buffer_forward(source, region.length);
- return (mem_tobuffer(target, region.base, region.length));
+ return (isc_mem_tobuffer(target, region.base, region.length));
}
static inline isc_result_t
@@ -113,7 +113,7 @@ towire_doa(ARGS_TOWIRE) {
REQUIRE(rdata->length != 0);
dns_rdata_toregion(rdata, &region);
- return (mem_tobuffer(target, region.base, region.length));
+ return (isc_mem_tobuffer(target, region.base, region.length));
}
#endif /* RDATA_GENERIC_DOA_259_C */
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 b5d71b5df02..df37bbd790e 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.11 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: ds_43.c,v 1.12 2020/02/26 18:47:25 florian Exp $ */
/* RFC3658 */
@@ -125,7 +125,7 @@ generic_fromwire_ds(ARGS_FROMWIRE) {
sr.length = 4 + ISC_SHA384_DIGESTLENGTH;
isc_buffer_forward(source, sr.length);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
static inline isc_result_t
@@ -147,7 +147,7 @@ towire_ds(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_DS_43_C */
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 1f3f8f490a6..0db08faa3b7 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/eui48_108.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/eui48_108.c
@@ -49,7 +49,7 @@ fromwire_eui48(ARGS_FROMWIRE) {
if (sregion.length != 6)
return (DNS_R_FORMERR);
isc_buffer_forward(source, sregion.length);
- return (mem_tobuffer(target, sregion.base, sregion.length));
+ return (isc_mem_tobuffer(target, sregion.base, sregion.length));
}
static inline isc_result_t
@@ -60,7 +60,7 @@ towire_eui48(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_EUI48_108_C */
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 00578994770..a8424118e99 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/eui64_109.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/eui64_109.c
@@ -52,7 +52,7 @@ fromwire_eui64(ARGS_FROMWIRE) {
if (sregion.length != 8)
return (DNS_R_FORMERR);
isc_buffer_forward(source, sregion.length);
- return (mem_tobuffer(target, sregion.base, sregion.length));
+ return (isc_mem_tobuffer(target, sregion.base, sregion.length));
}
static inline isc_result_t
@@ -63,7 +63,7 @@ towire_eui64(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_EUI64_109_C */
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 1135f05a399..974e70096bd 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: gpos_27.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */
@@ -68,7 +68,7 @@ towire_gpos(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_GPOS_27_C */
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 61ad5bf5133..06fea0ec1b3 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: hinfo_13.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
@@ -60,7 +60,7 @@ towire_hinfo(ARGS_TOWIRE) {
REQUIRE(rdata->type == dns_rdatatype_hinfo);
REQUIRE(rdata->length != 0);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_HINFO_13_C */
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 9d55a71695a..096ea93f0d9 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.11 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: hip_55.c,v 1.12 2020/02/26 18:47:25 florian Exp $ */
/* reviewed: TBC */
@@ -119,7 +119,7 @@ fromwire_hip(ARGS_FROMWIRE) {
if (region.length < (unsigned) (hit_len + key_len))
RETERR(DNS_R_FORMERR);
- RETERR(mem_tobuffer(target, rr.base, 4 + hit_len + key_len));
+ RETERR(isc_mem_tobuffer(target, rr.base, 4 + hit_len + key_len));
isc_buffer_forward(source, 4 + hit_len + key_len);
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
@@ -140,6 +140,6 @@ towire_hip(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &region);
- return (mem_tobuffer(target, region.base, region.length));
+ return (isc_mem_tobuffer(target, region.base, region.length));
}
#endif /* RDATA_GENERIC_HIP_5_C */
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 ea6e59f1657..7db73fce5c0 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: ipseckey_45.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
#ifndef RDATA_GENERIC_IPSECKEY_45_C
#define RDATA_GENERIC_IPSECKEY_45_C
@@ -130,27 +130,27 @@ fromwire_ipseckey(ARGS_FROMWIRE) {
switch (region.base[1]) {
case 0:
isc_buffer_forward(source, region.length);
- return (mem_tobuffer(target, region.base, region.length));
+ return (isc_mem_tobuffer(target, region.base, region.length));
case 1:
if (region.length < 7)
return (ISC_R_UNEXPECTEDEND);
isc_buffer_forward(source, region.length);
- return (mem_tobuffer(target, region.base, region.length));
+ return (isc_mem_tobuffer(target, region.base, region.length));
case 2:
if (region.length < 19)
return (ISC_R_UNEXPECTEDEND);
isc_buffer_forward(source, region.length);
- return (mem_tobuffer(target, region.base, region.length));
+ return (isc_mem_tobuffer(target, region.base, region.length));
case 3:
- RETERR(mem_tobuffer(target, region.base, 3));
+ RETERR(isc_mem_tobuffer(target, region.base, 3));
isc_buffer_forward(source, 3);
RETERR(dns_name_fromwire(&name, source, dctx, options, target));
isc_buffer_activeregion(source, &region);
isc_buffer_forward(source, region.length);
- return(mem_tobuffer(target, region.base, region.length));
+ return(isc_mem_tobuffer(target, region.base, region.length));
default:
return (ISC_R_NOTIMPLEMENTED);
@@ -167,7 +167,7 @@ towire_ipseckey(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &region);
- return (mem_tobuffer(target, region.base, region.length));
+ return (isc_mem_tobuffer(target, region.base, region.length));
}
#endif /* RDATA_GENERIC_IPSECKEY_45_C */
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 2b1ebf119a9..f230dbf4ff5 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: isdn_20.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* Reviewed: Wed Mar 15 16:53:11 PST 2000 by bwelling */
@@ -62,7 +62,7 @@ towire_isdn(ARGS_TOWIRE) {
REQUIRE(rdata->type == dns_rdatatype_isdn);
REQUIRE(rdata->length != 0);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_ISDN_20_C */
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 9c17a73ed2a..473aa5aa63a 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.11 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: key_25.c,v 1.12 2020/02/26 18:47:25 florian Exp $ */
/*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
@@ -141,7 +141,7 @@ generic_fromwire_key(ARGS_FROMWIRE) {
return (ISC_R_UNEXPECTEDEND);
algorithm = sr.base[3];
- RETERR(mem_tobuffer(target, sr.base, 4));
+ RETERR(isc_mem_tobuffer(target, sr.base, 4));
isc_region_consume(&sr, 4);
isc_buffer_forward(source, 4);
@@ -162,7 +162,7 @@ generic_fromwire_key(ARGS_FROMWIRE) {
isc_buffer_activeregion(source, &sr);
isc_buffer_forward(source, sr.length);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
static inline isc_result_t
@@ -194,7 +194,7 @@ towire_key(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_KEY_25_C */
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 d953ee00d48..39bcbac052e 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/keydata_65533.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/keydata_65533.c
@@ -204,7 +204,7 @@ fromwire_keydata(ARGS_FROMWIRE) {
isc_buffer_activeregion(source, &sr);
isc_buffer_forward(source, sr.length);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
static inline isc_result_t
@@ -216,7 +216,7 @@ towire_keydata(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* GENERIC_KEYDATA_65533_C */
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 66b53321e81..9a79fc091f2 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/l32_105.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/l32_105.c
@@ -58,7 +58,7 @@ fromwire_l32(ARGS_FROMWIRE) {
if (sregion.length != 6)
return (DNS_R_FORMERR);
isc_buffer_forward(source, sregion.length);
- return (mem_tobuffer(target, sregion.base, sregion.length));
+ return (isc_mem_tobuffer(target, sregion.base, sregion.length));
}
static inline isc_result_t
@@ -69,7 +69,7 @@ towire_l32(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_L32_105_C */
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 19267fea2d8..f7fa25b61c1 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/l64_106.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/l64_106.c
@@ -63,7 +63,7 @@ fromwire_l64(ARGS_FROMWIRE) {
if (sregion.length != 10)
return (DNS_R_FORMERR);
isc_buffer_forward(source, sregion.length);
- return (mem_tobuffer(target, sregion.base, sregion.length));
+ return (isc_mem_tobuffer(target, sregion.base, sregion.length));
}
static inline isc_result_t
@@ -74,7 +74,7 @@ towire_l64(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_L64_106_C */
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 ac44955814c..c648cfee6b9 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: loc_29.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* Reviewed: Wed Mar 15 18:13:09 PST 2000 by explorer */
@@ -160,7 +160,7 @@ fromwire_loc(ARGS_FROMWIRE) {
if (sr.base[0] != 0) {
/* Treat as unknown. */
isc_buffer_forward(source, sr.length);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
if (sr.length < 16)
return (ISC_R_UNEXPECTEDEND);
@@ -214,7 +214,7 @@ fromwire_loc(ARGS_FROMWIRE) {
isc_buffer_activeregion(source, &sr);
isc_buffer_forward(source, 16);
- return (mem_tobuffer(target, sr.base, 16));
+ return (isc_mem_tobuffer(target, sr.base, 16));
}
static inline isc_result_t
@@ -224,7 +224,7 @@ towire_loc(ARGS_TOWIRE) {
REQUIRE(rdata->type == dns_rdatatype_loc);
REQUIRE(rdata->length != 0);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_LOC_29_C */
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 1debe262f83..751e8eb002c 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/lp_107.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/lp_107.c
@@ -66,7 +66,7 @@ fromwire_lp(ARGS_FROMWIRE) {
isc_buffer_activeregion(source, &sregion);
if (sregion.length < 2)
return (ISC_R_UNEXPECTEDEND);
- RETERR(mem_tobuffer(target, sregion.base, 2));
+ RETERR(isc_mem_tobuffer(target, sregion.base, 2));
isc_buffer_forward(source, 2);
return (dns_name_fromwire(&name, source, dctx, options, target));
}
@@ -79,7 +79,7 @@ towire_lp(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_LP_107_C */
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 ce6ce272d9a..591c1c639d5 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: mx_15.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* reviewed: Wed Mar 15 18:05:46 PST 2000 by brister */
@@ -70,7 +70,7 @@ fromwire_mx(ARGS_FROMWIRE) {
isc_buffer_activeregion(source, &sregion);
if (sregion.length < 2)
return (ISC_R_UNEXPECTEDEND);
- RETERR(mem_tobuffer(target, sregion.base, 2));
+ RETERR(isc_mem_tobuffer(target, sregion.base, 2));
isc_buffer_forward(source, 2);
return (dns_name_fromwire(&name, source, dctx, options, target));
}
@@ -87,7 +87,7 @@ towire_mx(ARGS_TOWIRE) {
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_rdata_toregion(rdata, &region);
- RETERR(mem_tobuffer(target, region.base, 2));
+ RETERR(isc_mem_tobuffer(target, region.base, 2));
isc_region_consume(&region, 2);
dns_name_init(&name, offsets);
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 ff3a0c4992a..34374e33619 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: naptr_35.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */
@@ -199,7 +199,7 @@ fromwire_naptr(ARGS_FROMWIRE) {
isc_buffer_activeregion(source, &sr);
if (sr.length < 4)
return (ISC_R_UNEXPECTEDEND);
- RETERR(mem_tobuffer(target, sr.base, 4));
+ RETERR(isc_mem_tobuffer(target, sr.base, 4));
isc_buffer_forward(source, 4);
/*
@@ -239,25 +239,25 @@ towire_naptr(ARGS_TOWIRE) {
* Order, preference.
*/
dns_rdata_toregion(rdata, &sr);
- RETERR(mem_tobuffer(target, sr.base, 4));
+ RETERR(isc_mem_tobuffer(target, sr.base, 4));
isc_region_consume(&sr, 4);
/*
* Flags.
*/
- RETERR(mem_tobuffer(target, sr.base, sr.base[0] + 1));
+ RETERR(isc_mem_tobuffer(target, sr.base, sr.base[0] + 1));
isc_region_consume(&sr, sr.base[0] + 1);
/*
* Service.
*/
- RETERR(mem_tobuffer(target, sr.base, sr.base[0] + 1));
+ RETERR(isc_mem_tobuffer(target, sr.base, sr.base[0] + 1));
isc_region_consume(&sr, sr.base[0] + 1);
/*
* Regexp.
*/
- RETERR(mem_tobuffer(target, sr.base, sr.base[0] + 1));
+ RETERR(isc_mem_tobuffer(target, sr.base, sr.base[0] + 1));
isc_region_consume(&sr, sr.base[0] + 1);
/*
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 35c819276f2..eab3c450a57 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/nid_104.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/nid_104.c
@@ -63,7 +63,7 @@ fromwire_nid(ARGS_FROMWIRE) {
if (sregion.length != 10)
return (DNS_R_FORMERR);
isc_buffer_forward(source, sregion.length);
- return (mem_tobuffer(target, sregion.base, sregion.length));
+ return (isc_mem_tobuffer(target, sregion.base, sregion.length));
}
static inline isc_result_t
@@ -74,7 +74,7 @@ towire_nid(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_NID_104_C */
diff --git a/usr.bin/dig/lib/dns/rdata/generic/ninfo_56.c b/usr.bin/dig/lib/dns/rdata/generic/ninfo_56.c
index dbeeaa5e31d..e988f730c6e 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/ninfo_56.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/ninfo_56.c
@@ -48,7 +48,7 @@ towire_ninfo(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_NINFO_56_C */
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 a264f28adba..be6a50202fc 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.9 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: nsec3_50.c,v 1.10 2020/02/26 18:47:25 florian Exp $ */
/*
* Copyright (C) 2004 Nominet, Ltd.
@@ -148,7 +148,7 @@ fromwire_nsec3(ARGS_FROMWIRE) {
RETERR(typemap_test(&sr, ISC_TRUE));
- RETERR(mem_tobuffer(target, rr.base, rr.length));
+ RETERR(isc_mem_tobuffer(target, rr.base, rr.length));
isc_buffer_forward(source, rr.length);
return (ISC_R_SUCCESS);
}
@@ -163,7 +163,7 @@ towire_nsec3(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#define NSEC3_MAX_HASH_LENGTH 155
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 8b02da7dd47..263ae213feb 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: nsec3param_51.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/*
* Copyright (C) 2004 Nominet, Ltd.
@@ -112,7 +112,7 @@ fromwire_nsec3param(ARGS_FROMWIRE) {
if (sr.length < saltlen)
RETERR(DNS_R_FORMERR);
isc_region_consume(&sr, saltlen);
- RETERR(mem_tobuffer(target, rr.base, rr.length));
+ RETERR(isc_mem_tobuffer(target, rr.base, rr.length));
isc_buffer_forward(source, rr.length);
return (ISC_R_SUCCESS);
}
@@ -127,7 +127,7 @@ towire_nsec3param(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_NSEC3PARAM_51_C */
diff --git a/usr.bin/dig/lib/dns/rdata/generic/nsec_47.c b/usr.bin/dig/lib/dns/rdata/generic/nsec_47.c
index 596eb7c0ef5..0a3eb43a4f8 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: nsec_47.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */
@@ -69,7 +69,7 @@ fromwire_nsec(ARGS_FROMWIRE) {
isc_buffer_activeregion(source, &sr);
RETERR(typemap_test(&sr, ISC_FALSE));
- RETERR(mem_tobuffer(target, sr.base, sr.length));
+ RETERR(isc_mem_tobuffer(target, sr.base, sr.length));
isc_buffer_forward(source, sr.length);
return (ISC_R_SUCCESS);
}
@@ -90,7 +90,7 @@ towire_nsec(ARGS_TOWIRE) {
isc_region_consume(&sr, name_length(&name));
RETERR(dns_name_towire(&name, cctx, target));
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_NSEC_47_C */
diff --git a/usr.bin/dig/lib/dns/rdata/generic/null_10.c b/usr.bin/dig/lib/dns/rdata/generic/null_10.c
index 7e29a3a1dd1..a071c8df9ec 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/null_10.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/null_10.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: null_10.c,v 1.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: null_10.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* Reviewed: Thu Mar 16 13:57:50 PST 2000 by explorer */
@@ -41,7 +41,7 @@ fromwire_null(ARGS_FROMWIRE) {
isc_buffer_activeregion(source, &sr);
isc_buffer_forward(source, sr.length);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
static inline isc_result_t
@@ -50,7 +50,7 @@ towire_null(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_NULL_10_C */
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 298b2d2f00f..942a4399237 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: nxt_30.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */
@@ -78,7 +78,7 @@ fromwire_nxt(ARGS_FROMWIRE) {
if (sr.length > 0 && (sr.base[0] & 0x80) == 0 &&
((sr.length > 16) || sr.base[sr.length - 1] == 0))
return (DNS_R_BADBITMAP);
- RETERR(mem_tobuffer(target, sr.base, sr.length));
+ RETERR(isc_mem_tobuffer(target, sr.base, sr.length));
isc_buffer_forward(source, sr.length);
return (ISC_R_SUCCESS);
}
@@ -99,7 +99,7 @@ towire_nxt(ARGS_TOWIRE) {
isc_region_consume(&sr, name_length(&name));
RETERR(dns_name_towire(&name, cctx, target));
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_NXT_30_C */
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 73a63fa9c92..f89c874aca8 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/openpgpkey_61.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/openpgpkey_61.c
@@ -65,7 +65,7 @@ fromwire_openpgpkey(ARGS_FROMWIRE) {
if (sr.length < 1)
return (ISC_R_UNEXPECTEDEND);
isc_buffer_forward(source, sr.length);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
static inline isc_result_t
@@ -78,7 +78,7 @@ towire_openpgpkey(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_OPENPGPKEY_61_C */
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 d8657126eb0..7709b4bd28a 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/opt_41.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/opt_41.c
@@ -193,7 +193,7 @@ towire_opt(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_OPT_41_C */
diff --git a/usr.bin/dig/lib/dns/rdata/generic/rkey_57.c b/usr.bin/dig/lib/dns/rdata/generic/rkey_57.c
index 8219f447d6b..8ea48921028 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/rkey_57.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/rkey_57.c
@@ -46,7 +46,7 @@ towire_rkey(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_RKEY_57_C */
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 fc28d5c7063..7e6fa1307f4 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: rrsig_46.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */
@@ -154,7 +154,7 @@ fromwire_rrsig(ARGS_FROMWIRE) {
return (ISC_R_UNEXPECTEDEND);
isc_buffer_forward(source, 18);
- RETERR(mem_tobuffer(target, sr.base, 18));
+ RETERR(isc_mem_tobuffer(target, sr.base, 18));
/*
* Signer.
@@ -167,7 +167,7 @@ fromwire_rrsig(ARGS_FROMWIRE) {
*/
isc_buffer_activeregion(source, &sr);
isc_buffer_forward(source, sr.length);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
static inline isc_result_t
@@ -190,7 +190,7 @@ towire_rrsig(ARGS_TOWIRE) {
* time signed: 4
* key footprint: 2
*/
- RETERR(mem_tobuffer(target, sr.base, 18));
+ RETERR(isc_mem_tobuffer(target, sr.base, 18));
isc_region_consume(&sr, 18);
/*
@@ -204,7 +204,7 @@ towire_rrsig(ARGS_TOWIRE) {
/*
* Signature.
*/
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
static inline dns_rdatatype_t
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 dff019ccd0a..471fb985754 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: sig_24.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */
@@ -154,7 +154,7 @@ fromwire_sig(ARGS_FROMWIRE) {
return (ISC_R_UNEXPECTEDEND);
isc_buffer_forward(source, 18);
- RETERR(mem_tobuffer(target, sr.base, 18));
+ RETERR(isc_mem_tobuffer(target, sr.base, 18));
/*
* Signer.
@@ -167,7 +167,7 @@ fromwire_sig(ARGS_FROMWIRE) {
*/
isc_buffer_activeregion(source, &sr);
isc_buffer_forward(source, sr.length);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
static inline isc_result_t
@@ -190,7 +190,7 @@ towire_sig(ARGS_TOWIRE) {
* time signed: 4
* key footprint: 2
*/
- RETERR(mem_tobuffer(target, sr.base, 18));
+ RETERR(isc_mem_tobuffer(target, sr.base, 18));
isc_region_consume(&sr, 18);
/*
@@ -204,7 +204,7 @@ towire_sig(ARGS_TOWIRE) {
/*
* Signature.
*/
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
static inline dns_rdatatype_t
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 4a09328c925..7a7f39e78db 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/sink_40.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/sink_40.c
@@ -76,7 +76,7 @@ fromwire_sink(ARGS_FROMWIRE) {
if (sr.length < 3)
return (ISC_R_UNEXPECTEDEND);
- RETERR(mem_tobuffer(target, sr.base, sr.length));
+ RETERR(isc_mem_tobuffer(target, sr.base, sr.length));
isc_buffer_forward(source, sr.length);
return (ISC_R_SUCCESS);
}
@@ -89,7 +89,7 @@ towire_sink(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_SINK_40_C */
diff --git a/usr.bin/dig/lib/dns/rdata/generic/smimea_53.c b/usr.bin/dig/lib/dns/rdata/generic/smimea_53.c
index 641e3698c02..0c50cacf9ac 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/smimea_53.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/smimea_53.c
@@ -44,7 +44,7 @@ towire_smimea(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_SMIMEA_53_C */
diff --git a/usr.bin/dig/lib/dns/rdata/generic/spf_99.c b/usr.bin/dig/lib/dns/rdata/generic/spf_99.c
index ab7c3714bcf..226e4936cd7 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/spf_99.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/spf_99.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: spf_99.c,v 1.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: spf_99.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* Reviewed: Thu Mar 16 15:40:00 PST 2000 by bwelling */
@@ -52,7 +52,7 @@ towire_spf(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_SPF_99_C */
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 3c311076bfe..a0d957d9341 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: sshfp_44.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* RFC 4255 */
@@ -82,7 +82,7 @@ fromwire_sshfp(ARGS_FROMWIRE) {
return (ISC_R_UNEXPECTEDEND);
isc_buffer_forward(source, sr.length);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
static inline isc_result_t
@@ -95,7 +95,7 @@ towire_sshfp(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_SSHFP_44_C */
diff --git a/usr.bin/dig/lib/dns/rdata/generic/ta_32768.c b/usr.bin/dig/lib/dns/rdata/generic/ta_32768.c
index a858ce11e4b..1c374600d0d 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/ta_32768.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/ta_32768.c
@@ -46,7 +46,7 @@ towire_ta(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_TA_32768_C */
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 d5e4653f16e..52ab95f747f 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: tkey_249.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/*
* Reviewed: Thu Mar 16 17:35:30 PST 2000 by halley.
@@ -171,7 +171,7 @@ fromwire_tkey(ARGS_FROMWIRE) {
isc_buffer_activeregion(source, &sr);
if (sr.length < 12)
return (ISC_R_UNEXPECTEDEND);
- RETERR(mem_tobuffer(target, sr.base, 12));
+ RETERR(isc_mem_tobuffer(target, sr.base, 12));
isc_region_consume(&sr, 12);
isc_buffer_forward(source, 12);
@@ -183,7 +183,7 @@ fromwire_tkey(ARGS_FROMWIRE) {
n = uint16_fromregion(&sr);
if (sr.length < n + 2)
return (ISC_R_UNEXPECTEDEND);
- RETERR(mem_tobuffer(target, sr.base, n + 2));
+ RETERR(isc_mem_tobuffer(target, sr.base, n + 2));
isc_region_consume(&sr, n + 2);
isc_buffer_forward(source, n + 2);
@@ -196,7 +196,7 @@ fromwire_tkey(ARGS_FROMWIRE) {
if (sr.length < n + 2)
return (ISC_R_UNEXPECTEDEND);
isc_buffer_forward(source, n + 2);
- return (mem_tobuffer(target, sr.base, n + 2));
+ return (isc_mem_tobuffer(target, sr.base, n + 2));
}
static inline isc_result_t
@@ -218,7 +218,7 @@ towire_tkey(ARGS_TOWIRE) {
RETERR(dns_name_towire(&name, cctx, target));
isc_region_consume(&sr, name_length(&name));
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_TKEY_249_C */
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 8c512d90648..062568b3c56 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/tlsa_52.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/tlsa_52.c
@@ -86,7 +86,7 @@ generic_fromwire_tlsa(ARGS_FROMWIRE) {
return (ISC_R_UNEXPECTEDEND);
isc_buffer_forward(source, sr.length);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
static inline isc_result_t
@@ -116,7 +116,7 @@ towire_tlsa(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_GENERIC_TLSA_52_C */
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 61b9295a0e1..353e81cbcd9 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/txt_16.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/txt_16.c
@@ -77,7 +77,7 @@ towire_txt(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_TXT_16_C */
diff --git a/usr.bin/dig/lib/dns/rdata/generic/unspec_103.c b/usr.bin/dig/lib/dns/rdata/generic/unspec_103.c
index eee961cc879..4c48fd7b60f 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/unspec_103.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/unspec_103.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: unspec_103.c,v 1.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: unspec_103.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
#ifndef RDATA_GENERIC_UNSPEC_103_C
#define RDATA_GENERIC_UNSPEC_103_C
@@ -42,7 +42,7 @@ fromwire_unspec(ARGS_FROMWIRE) {
isc_buffer_activeregion(source, &sr);
isc_buffer_forward(source, sr.length);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
static inline isc_result_t
@@ -52,7 +52,7 @@ towire_unspec(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_UNSPEC_103_C */
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 6f984ffa20e..dadbda99a3b 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: uri_256.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
#ifndef GENERIC_URI_256_C
#define GENERIC_URI_256_C 1
@@ -77,7 +77,7 @@ fromwire_uri(ARGS_FROMWIRE) {
* Priority, weight and target URI
*/
isc_buffer_forward(source, region.length);
- return (mem_tobuffer(target, region.base, region.length));
+ return (isc_mem_tobuffer(target, region.base, region.length));
}
static inline isc_result_t
@@ -90,7 +90,7 @@ towire_uri(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &region);
- return (mem_tobuffer(target, region.base, region.length));
+ return (isc_mem_tobuffer(target, region.base, region.length));
}
#endif /* GENERIC_URI_256_C */
diff --git a/usr.bin/dig/lib/dns/rdata/generic/x25_19.c b/usr.bin/dig/lib/dns/rdata/generic/x25_19.c
index 880acc44f2e..2da9bf8ecaa 100644
--- a/usr.bin/dig/lib/dns/rdata/generic/x25_19.c
+++ b/usr.bin/dig/lib/dns/rdata/generic/x25_19.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: x25_19.c,v 1.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: x25_19.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* Reviewed: Thu Mar 16 16:15:57 PST 2000 by bwelling */
@@ -60,7 +60,7 @@ towire_x25(ARGS_TOWIRE) {
REQUIRE(rdata->type == dns_rdatatype_x25);
REQUIRE(rdata->length != 0);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_GENERIC_X25_19_C */
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 8135dc5a022..641e7f07273 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: a6_38.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* RFC2874 */
@@ -96,7 +96,7 @@ fromwire_in_a6(ARGS_FROMWIRE) {
if (prefixlen > 128)
return (ISC_R_RANGE);
isc_region_consume(&sr, 1);
- RETERR(mem_tobuffer(target, &prefixlen, 1));
+ RETERR(isc_mem_tobuffer(target, &prefixlen, 1));
isc_buffer_forward(source, 1);
/*
@@ -108,7 +108,7 @@ fromwire_in_a6(ARGS_FROMWIRE) {
return (ISC_R_UNEXPECTEDEND);
mask = 0xff >> (prefixlen % 8);
sr.base[0] &= mask; /* Ensure pad bits are zero. */
- RETERR(mem_tobuffer(target, sr.base, octets));
+ RETERR(isc_mem_tobuffer(target, sr.base, octets));
isc_buffer_forward(source, octets);
}
@@ -137,7 +137,7 @@ towire_in_a6(ARGS_TOWIRE) {
INSIST(prefixlen <= 128);
octets = 1 + 16 - prefixlen / 8;
- RETERR(mem_tobuffer(target, sr.base, octets));
+ RETERR(isc_mem_tobuffer(target, sr.base, octets));
isc_region_consume(&sr, octets);
if (prefixlen == 0)
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 a2c92f0e232..93fa777e4ec 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.11 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: apl_42.c,v 1.12 2020/02/26 18:47:25 florian Exp $ */
/* RFC3123 */
@@ -134,7 +134,7 @@ fromwire_in_apl(ARGS_FROMWIRE) {
isc_region_consume(&sr, len);
}
isc_buffer_forward(source, sr2.length);
- return (mem_tobuffer(target, sr2.base, sr2.length));
+ return (isc_mem_tobuffer(target, sr2.base, sr2.length));
}
static inline isc_result_t
@@ -144,7 +144,7 @@ towire_in_apl(ARGS_TOWIRE) {
REQUIRE(rdata->type == dns_rdatatype_apl);
REQUIRE(rdata->rdclass == dns_rdataclass_in);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_IN_1_APL_42_C */
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 4d626aea605..15cb7add667 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: dhcid_49.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* RFC 4701 */
@@ -71,7 +71,7 @@ fromwire_in_dhcid(ARGS_FROMWIRE) {
return (ISC_R_UNEXPECTEDEND);
isc_buffer_forward(source, sr.length);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
static inline isc_result_t
@@ -85,7 +85,7 @@ towire_in_dhcid(ARGS_TOWIRE) {
UNUSED(cctx);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_IN_1_DHCID_49_C */
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 bd7544e9476..968fc84b39a 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: kx_36.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* Reviewed: Thu Mar 16 17:24:54 PST 2000 by explorer */
@@ -70,7 +70,7 @@ fromwire_in_kx(ARGS_FROMWIRE) {
isc_buffer_activeregion(source, &sregion);
if (sregion.length < 2)
return (ISC_R_UNEXPECTEDEND);
- RETERR(mem_tobuffer(target, sregion.base, 2));
+ RETERR(isc_mem_tobuffer(target, sregion.base, 2));
isc_buffer_forward(source, 2);
return (dns_name_fromwire(&name, source, dctx, options, target));
}
@@ -87,7 +87,7 @@ towire_in_kx(ARGS_TOWIRE) {
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
dns_rdata_toregion(rdata, &region);
- RETERR(mem_tobuffer(target, region.base, 2));
+ RETERR(isc_mem_tobuffer(target, region.base, 2));
isc_region_consume(&region, 2);
dns_name_init(&name, offsets);
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 c687dcf442f..ec7f4bb8f39 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: nsap_22.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* Reviewed: Fri Mar 17 10:41:07 PST 2000 by gson */
@@ -60,7 +60,7 @@ fromwire_in_nsap(ARGS_FROMWIRE) {
if (region.length < 1)
return (ISC_R_UNEXPECTEDEND);
- RETERR(mem_tobuffer(target, region.base, region.length));
+ RETERR(isc_mem_tobuffer(target, region.base, region.length));
isc_buffer_forward(source, region.length);
return (ISC_R_SUCCESS);
}
@@ -73,7 +73,7 @@ towire_in_nsap(ARGS_TOWIRE) {
UNUSED(cctx);
- return (mem_tobuffer(target, rdata->data, rdata->length));
+ return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif /* RDATA_IN_1_NSAP_22_C */
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 7a38c105f6b..4bf0aa9ced2 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: px_26.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* Reviewed: Mon Mar 20 10:44:27 PST 2000 */
@@ -87,7 +87,7 @@ fromwire_in_px(ARGS_FROMWIRE) {
isc_buffer_activeregion(source, &sregion);
if (sregion.length < 2)
return (ISC_R_UNEXPECTEDEND);
- RETERR(mem_tobuffer(target, sregion.base, 2));
+ RETERR(isc_mem_tobuffer(target, sregion.base, 2));
isc_buffer_forward(source, 2);
/*
@@ -116,7 +116,7 @@ towire_in_px(ARGS_TOWIRE) {
* Preference.
*/
dns_rdata_toregion(rdata, &region);
- RETERR(mem_tobuffer(target, region.base, 2));
+ RETERR(isc_mem_tobuffer(target, region.base, 2));
isc_region_consume(&region, 2);
/*
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 f84c8d18315..bb1be779f8b 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.10 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: srv_33.c,v 1.11 2020/02/26 18:47:25 florian Exp $ */
/* Reviewed: Fri Mar 17 13:01:00 PST 2000 by bwelling */
@@ -96,7 +96,7 @@ fromwire_in_srv(ARGS_FROMWIRE) {
isc_buffer_activeregion(source, &sr);
if (sr.length < 6)
return (ISC_R_UNEXPECTEDEND);
- RETERR(mem_tobuffer(target, sr.base, 6));
+ RETERR(isc_mem_tobuffer(target, sr.base, 6));
isc_buffer_forward(source, 6);
/*
@@ -119,7 +119,7 @@ towire_in_srv(ARGS_TOWIRE) {
* Priority, weight, port.
*/
dns_rdata_toregion(rdata, &sr);
- RETERR(mem_tobuffer(target, sr.base, 6));
+ RETERR(isc_mem_tobuffer(target, sr.base, 6));
isc_region_consume(&sr, 6);
/*
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 e36d068ddcd..fe7df30288f 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.11 2020/02/26 18:38:15 florian Exp $ */
+/* $Id: wks_11.c,v 1.12 2020/02/26 18:47:25 florian Exp $ */
/* Reviewed: Fri Mar 17 15:01:49 PST 2000 by explorer */
@@ -106,7 +106,7 @@ towire_in_wks(ARGS_TOWIRE) {
REQUIRE(rdata->length != 0);
dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
+ return (isc_mem_tobuffer(target, sr.base, sr.length));
}
#endif /* RDATA_IN_1_WKS_11_C */
diff --git a/usr.bin/dig/lib/isc/base32.c b/usr.bin/dig/lib/isc/base32.c
index 950666752f9..d4aefa84052 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.5 2020/02/25 05:00:43 jsg Exp $ */
+/* $Id: base32.c,v 1.6 2020/02/26 18:47:25 florian Exp $ */
/*! \file */
@@ -38,9 +38,6 @@
static isc_result_t
str_totext(const char *source, isc_buffer_t *target);
-static isc_result_t
-mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length);
-
/*@}*/
static const char base32hex[] =
@@ -229,7 +226,7 @@ base32_decode_char(base32_decode_ctx_t *ctx, int c) {
buf[2] = (ctx->val[3]<<4)|(ctx->val[4]>>1);
buf[3] = (ctx->val[4]<<7)|(ctx->val[5]<<2)|(ctx->val[6]>>3);
buf[4] = (ctx->val[6]<<5)|(ctx->val[7]);
- RETERR(mem_tobuffer(ctx->target, buf, n));
+ RETERR(isc_mem_tobuffer(ctx->target, buf, n));
if (ctx->length >= 0) {
if (n > ctx->length)
return (ISC_R_BADBASE32);
@@ -296,15 +293,3 @@ str_totext(const char *source, isc_buffer_t *target) {
isc_buffer_add(target, l);
return (ISC_R_SUCCESS);
}
-
-static isc_result_t
-mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) {
- isc_region_t tr;
-
- isc_buffer_availableregion(target, &tr);
- if (length > tr.length)
- return (ISC_R_NOSPACE);
- memmove(tr.base, base, length);
- isc_buffer_add(target, length);
- return (ISC_R_SUCCESS);
-}
diff --git a/usr.bin/dig/lib/isc/base64.c b/usr.bin/dig/lib/isc/base64.c
index ff10db8da90..4b8f95c318d 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.4 2020/02/25 05:00:43 jsg Exp $ */
+/* $Id: base64.c,v 1.5 2020/02/26 18:47:25 florian Exp $ */
/*! \file */
@@ -39,9 +39,6 @@
static isc_result_t
str_totext(const char *source, isc_buffer_t *target);
-static isc_result_t
-mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length);
-
static const char base64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
/*@}*/
@@ -152,7 +149,7 @@ base64_decode_char(base64_decode_ctx_t *ctx, int c) {
buf[0] = (ctx->val[0]<<2)|(ctx->val[1]>>4);
buf[1] = (ctx->val[1]<<4)|(ctx->val[2]>>2);
buf[2] = (ctx->val[2]<<6)|(ctx->val[3]);
- RETERR(mem_tobuffer(ctx->target, buf, n));
+ RETERR(isc_mem_tobuffer(ctx->target, buf, n));
if (ctx->length >= 0) {
if (n > ctx->length)
return (ISC_R_BADBASE64);
@@ -205,15 +202,3 @@ str_totext(const char *source, isc_buffer_t *target) {
isc_buffer_add(target, l);
return (ISC_R_SUCCESS);
}
-
-static isc_result_t
-mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) {
- isc_region_t tr;
-
- isc_buffer_availableregion(target, &tr);
- if (length > tr.length)
- return (ISC_R_NOSPACE);
- memmove(tr.base, base, length);
- isc_buffer_add(target, length);
- return (ISC_R_SUCCESS);
-}
diff --git a/usr.bin/dig/lib/isc/buffer.c b/usr.bin/dig/lib/isc/buffer.c
index 735dc0a8c85..9dce1033ec8 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.6 2020/02/25 05:00:43 jsg Exp $ */
+/* $Id: buffer.c,v 1.7 2020/02/26 18:47:25 florian Exp $ */
/*! \file */
@@ -352,3 +352,15 @@ isc_buffer_free(isc_buffer_t **dynbuffer) {
free(dbuf);
}
+
+isc_result_t
+isc_mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) {
+ isc_region_t tr;
+
+ isc_buffer_availableregion(target, &tr);
+ if (length > tr.length)
+ return (ISC_R_NOSPACE);
+ memmove(tr.base, base, length);
+ isc_buffer_add(target, length);
+ return (ISC_R_SUCCESS);
+}
diff --git a/usr.bin/dig/lib/isc/hex.c b/usr.bin/dig/lib/isc/hex.c
index 6bd312b0cc4..bb55f3b9260 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.3 2020/02/24 13:49:38 jsg Exp $ */
+/* $Id: hex.c,v 1.4 2020/02/26 18:47:25 florian Exp $ */
/*! \file */
@@ -39,9 +39,6 @@
static isc_result_t
str_totext(const char *source, isc_buffer_t *target);
-static isc_result_t
-mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length);
-
static const char hex[] = "0123456789ABCDEF";
isc_result_t
@@ -101,7 +98,7 @@ hex_decode_char(hex_decode_ctx_t *ctx, int c) {
unsigned char num;
num = (ctx->val[0] << 4) + (ctx->val[1]);
- RETERR(mem_tobuffer(ctx->target, &num, 1));
+ RETERR(isc_mem_tobuffer(ctx->target, &num, 1));
if (ctx->length >= 0) {
if (ctx->length == 0)
return (ISC_R_BADHEX);
@@ -154,15 +151,3 @@ str_totext(const char *source, isc_buffer_t *target) {
isc_buffer_add(target, l);
return (ISC_R_SUCCESS);
}
-
-static isc_result_t
-mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) {
- isc_region_t tr;
-
- isc_buffer_availableregion(target, &tr);
- if (length > tr.length)
- return (ISC_R_NOSPACE);
- memmove(tr.base, base, length);
- isc_buffer_add(target, length);
- 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 2477bed99e9..d3740724443 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.7 2020/02/22 19:47:07 jung Exp $ */
+/* $Id: buffer.h,v 1.8 2020/02/26 18:47:26 florian Exp $ */
#ifndef ISC_BUFFER_H
#define ISC_BUFFER_H 1
@@ -715,4 +715,6 @@ isc_buffer_copyregion(isc_buffer_t *b, const isc_region_t *r);
#define isc_buffer_putuint32 isc__buffer_putuint32
#define isc_buffer_putuint48 isc__buffer_putuint48
+isc_result_t
+isc_mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length);
#endif /* ISC_BUFFER_H */