From add4043305ca411202ed9cf1929a4179016515ce Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Wed, 8 Nov 2000 01:56:15 +0000 Subject: [PATCH] The identical gettoken() routines in rdata.c, hex.c, and base64.c have been replaced with isc_lex_getmastertoken(). --- lib/dns/rdata.c | 74 ++++++++------------------------ lib/dns/rdata/any_255/tsig_250.c | 23 ++++++---- lib/dns/rdata/generic/afsdb_18.c | 8 ++-- lib/dns/rdata/generic/cert_37.c | 11 +++-- lib/dns/rdata/generic/cname_5.c | 7 +-- lib/dns/rdata/generic/dname_39.c | 5 ++- lib/dns/rdata/generic/gpos_27.c | 7 +-- lib/dns/rdata/generic/hinfo_13.c | 7 +-- lib/dns/rdata/generic/isdn_20.c | 8 ++-- lib/dns/rdata/generic/key_25.c | 11 +++-- lib/dns/rdata/generic/loc_29.c | 38 ++++++++++------ lib/dns/rdata/generic/mb_7.c | 5 ++- lib/dns/rdata/generic/md_3.c | 5 ++- lib/dns/rdata/generic/mf_4.c | 5 ++- lib/dns/rdata/generic/mg_8.c | 5 ++- lib/dns/rdata/generic/minfo_14.c | 7 +-- lib/dns/rdata/generic/mr_9.c | 5 ++- lib/dns/rdata/generic/mx_15.c | 8 ++-- lib/dns/rdata/generic/ns_2.c | 5 ++- lib/dns/rdata/generic/nxt_30.c | 9 ++-- lib/dns/rdata/generic/proforma.c | 5 ++- lib/dns/rdata/generic/ptr_12.c | 5 ++- lib/dns/rdata/generic/rp_17.c | 7 +-- lib/dns/rdata/generic/rt_21.c | 8 ++-- lib/dns/rdata/generic/sig_24.c | 26 +++++++---- lib/dns/rdata/generic/soa_6.c | 15 ++++--- lib/dns/rdata/generic/tkey_249.c | 23 ++++++---- lib/dns/rdata/generic/txt_16.c | 7 +-- lib/dns/rdata/generic/x25_19.c | 5 ++- lib/dns/rdata/hs_4/a_1.c | 5 ++- lib/dns/rdata/in_1/a6_38.c | 13 +++--- lib/dns/rdata/in_1/a_1.c | 5 ++- lib/dns/rdata/in_1/aaaa_28.c | 5 ++- lib/dns/rdata/in_1/kx_36.c | 8 ++-- lib/dns/rdata/in_1/naptr_35.c | 20 ++++++--- lib/dns/rdata/in_1/nsap-ptr_23.c | 5 ++- lib/dns/rdata/in_1/nsap_22.c | 5 ++- lib/dns/rdata/in_1/px_26.c | 11 +++-- lib/dns/rdata/in_1/srv_33.c | 14 +++--- lib/dns/rdata/in_1/wks_11.c | 12 +++--- lib/isc/base64.c | 57 +++--------------------- lib/isc/hex.c | 55 +++--------------------- lib/isc/include/isc/lex.h | 21 ++++++++- lib/isc/lex.c | 34 ++++++++++++++- 44 files changed, 319 insertions(+), 305 deletions(-) diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index a35356b02a..e1c03d750d 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rdata.c,v 1.117 2000/11/07 23:44:33 bwelling Exp $ */ +/* $Id: rdata.c,v 1.118 2000/11/08 01:55:25 bwelling Exp $ */ #include #include @@ -132,10 +132,6 @@ uint16_fromregion(isc_region_t *region); static isc_uint8_t uint8_fromregion(isc_region_t *region); -static isc_result_t -gettoken(isc_lex_t *lexer, isc_token_t *token, isc_tokentype_t expect, - isc_boolean_t eol); - static isc_result_t mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length); @@ -561,8 +557,8 @@ dns_rdata_fromtextgeneric(dns_rdata_t *rdata, dns_rdataclass_t rdclass, st = *target; region.base = (unsigned char *)(target->base) + target->used; - result = gettoken(lexer, &token, isc_tokentype_number, - ISC_FALSE); + result = isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE); if (result == ISC_R_SUCCESS && token.value.as_ulong > 65535) result = ISC_R_RANGE; if (result == ISC_R_SUCCESS) @@ -666,8 +662,9 @@ dns_rdata_fromtext(dns_rdata_t *rdata, dns_rdataclass_t rdclass, FROMTEXTSWITCH if (use_default) { - result = gettoken(lexer, &token, isc_tokentype_number, - ISC_FALSE); + result = isc_lex_getmastertoken(lexer, &token, + isc_tokentype_number, + ISC_FALSE); if (result == ISC_R_SUCCESS && token.value.as_ulong > 65535) result = ISC_R_RANGE; if (result == ISC_R_SUCCESS) @@ -1526,48 +1523,6 @@ uint8_fromregion(isc_region_t *region) { return (region->base[0]); } -static isc_result_t -gettoken(isc_lex_t *lexer, isc_token_t *token, isc_tokentype_t expect, - isc_boolean_t eol) -{ - unsigned int options = ISC_LEXOPT_EOL | ISC_LEXOPT_EOF | - ISC_LEXOPT_DNSMULTILINE | ISC_LEXOPT_ESCAPE; - isc_result_t result; - - if (expect == isc_tokentype_qstring) - options |= ISC_LEXOPT_QSTRING; - else if (expect == isc_tokentype_number) - options |= ISC_LEXOPT_NUMBER; - result = isc_lex_gettoken(lexer, options, token); - switch (result) { - case ISC_R_SUCCESS: - break; - case ISC_R_NOMEMORY: - return (ISC_R_NOMEMORY); - case ISC_R_NOSPACE: - return (ISC_R_NOSPACE); - default: - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_lex_gettoken() failed: %s", - isc_result_totext(result)); - return (ISC_R_UNEXPECTED); - } - if (eol && ((token->type == isc_tokentype_eol) || - (token->type == isc_tokentype_eof))) - return (ISC_R_SUCCESS); - if (token->type == isc_tokentype_string && - expect == isc_tokentype_qstring) - return (ISC_R_SUCCESS); - if (token->type != expect) { - isc_lex_ungettoken(lexer, token); - if (token->type == isc_tokentype_eol || - token->type == isc_tokentype_eof) - return (ISC_R_UNEXPECTEDEND); - return (ISC_R_UNEXPECTEDTOKEN); - } - return (ISC_R_SUCCESS); -} - static isc_result_t mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) { isc_region_t tr; @@ -1751,7 +1706,8 @@ atob_tobuffer(isc_lex_t *lexer, isc_buffer_t *target) { Ceor = Csum = Crot = word = bcount = 0; - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); while (token.value.as_textregion.length != 0) { if ((c = token.value.as_textregion.base[0]) == 'x') { break; @@ -1763,14 +1719,16 @@ atob_tobuffer(isc_lex_t *lexer, isc_buffer_t *target) { /* * Number of bytes. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if ((token.value.as_ulong % 4) != 0) isc_buffer_subtract(target, 4 - (token.value.as_ulong % 4)); /* * Checksum. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); oeor = strtol(token.value.as_pointer, &e, 16); if (*e != 0) return (DNS_R_SYNTAX); @@ -1778,7 +1736,8 @@ atob_tobuffer(isc_lex_t *lexer, isc_buffer_t *target) { /* * Checksum. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); osum = strtol(token.value.as_pointer, &e, 16); if (*e != 0) return (DNS_R_SYNTAX); @@ -1786,14 +1745,15 @@ atob_tobuffer(isc_lex_t *lexer, isc_buffer_t *target) { /* * Checksum. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); orot = strtol(token.value.as_pointer, &e, 16); if (*e != 0) return (DNS_R_SYNTAX); if ((oeor != Ceor) || (osum != Csum) || (orot != Crot)) return(DNS_R_BADCKSUM); - return(ISC_R_SUCCESS); + return (ISC_R_SUCCESS); } /* diff --git a/lib/dns/rdata/any_255/tsig_250.c b/lib/dns/rdata/any_255/tsig_250.c index a92fe4fe80..698e25dc9f 100644 --- a/lib/dns/rdata/any_255/tsig_250.c +++ b/lib/dns/rdata/any_255/tsig_250.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: tsig_250.c,v 1.44 2000/10/25 05:43:26 marka Exp $ */ +/* $Id: tsig_250.c,v 1.45 2000/11/08 01:55:31 bwelling Exp $ */ /* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */ @@ -41,7 +41,8 @@ fromtext_any_tsig(ARGS_FROMTEXT) { /* * Algorithm Name. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; @@ -50,7 +51,8 @@ fromtext_any_tsig(ARGS_FROMTEXT) { /* * Time Signed: 48 bits. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); sigtime = isc_string_touint64(token.value.as_pointer, &e, 10); if (*e != 0) return (DNS_R_SYNTAX); @@ -62,7 +64,8 @@ fromtext_any_tsig(ARGS_FROMTEXT) { /* * Fudge. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); @@ -70,7 +73,8 @@ fromtext_any_tsig(ARGS_FROMTEXT) { /* * Signature Size. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); @@ -83,7 +87,8 @@ fromtext_any_tsig(ARGS_FROMTEXT) { /* * Original ID. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); @@ -91,7 +96,8 @@ fromtext_any_tsig(ARGS_FROMTEXT) { /* * Error. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); if (dns_tsigrcode_fromtext(&rcode, &token.value.as_textregion) != ISC_R_SUCCESS) { @@ -107,7 +113,8 @@ fromtext_any_tsig(ARGS_FROMTEXT) { /* * Other Len. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); diff --git a/lib/dns/rdata/generic/afsdb_18.c b/lib/dns/rdata/generic/afsdb_18.c index 96f1e4faa2..7fd15c456f 100644 --- a/lib/dns/rdata/generic/afsdb_18.c +++ b/lib/dns/rdata/generic/afsdb_18.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: afsdb_18.c,v 1.32 2000/10/25 05:43:27 marka Exp $ */ +/* $Id: afsdb_18.c,v 1.33 2000/11/08 01:55:33 bwelling Exp $ */ /* Reviewed: Wed Mar 15 14:59:00 PST 2000 by explorer */ @@ -39,7 +39,8 @@ fromtext_afsdb(ARGS_FROMTEXT) { /* * Subtype. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); @@ -47,7 +48,8 @@ fromtext_afsdb(ARGS_FROMTEXT) { /* * Hostname. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; diff --git a/lib/dns/rdata/generic/cert_37.c b/lib/dns/rdata/generic/cert_37.c index 3623d9ddda..2b646d5d50 100644 --- a/lib/dns/rdata/generic/cert_37.c +++ b/lib/dns/rdata/generic/cert_37.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: cert_37.c,v 1.33 2000/10/25 05:43:28 marka Exp $ */ +/* $Id: cert_37.c,v 1.34 2000/11/08 01:55:34 bwelling Exp $ */ /* Reviewed: Wed Mar 15 21:14:32 EST 2000 by tale */ @@ -41,14 +41,16 @@ fromtext_cert(ARGS_FROMTEXT) { /* * Cert type. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); RETERR(dns_cert_fromtext(&cert, &token.value.as_textregion)); RETERR(uint16_tobuffer(cert, target)); /* * Key tag. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); @@ -56,7 +58,8 @@ fromtext_cert(ARGS_FROMTEXT) { /* * Algorithm. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); RETERR(dns_secalg_fromtext(&secalg, &token.value.as_textregion)); RETERR(mem_tobuffer(target, &secalg, 1)); diff --git a/lib/dns/rdata/generic/cname_5.c b/lib/dns/rdata/generic/cname_5.c index a228044182..eadc2bdd45 100644 --- a/lib/dns/rdata/generic/cname_5.c +++ b/lib/dns/rdata/generic/cname_5.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: cname_5.c,v 1.36 2000/10/25 05:43:29 marka Exp $ */ +/* $Id: cname_5.c,v 1.37 2000/11/08 01:55:35 bwelling Exp $ */ /* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */ @@ -26,7 +26,7 @@ (DNS_RDATATYPEATTR_EXCLUSIVE | DNS_RDATATYPEATTR_SINGLETON) static inline isc_result_t - fromtext_cname(ARGS_FROMTEXT) { +fromtext_cname(ARGS_FROMTEXT) { isc_token_t token; dns_name_t name; isc_buffer_t buffer; @@ -35,7 +35,8 @@ static inline isc_result_t UNUSED(rdclass); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); diff --git a/lib/dns/rdata/generic/dname_39.c b/lib/dns/rdata/generic/dname_39.c index b68499611d..f911f75e84 100644 --- a/lib/dns/rdata/generic/dname_39.c +++ b/lib/dns/rdata/generic/dname_39.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dname_39.c,v 1.26 2000/10/25 05:43:30 marka Exp $ */ +/* $Id: dname_39.c,v 1.27 2000/11/08 01:55:36 bwelling Exp $ */ /* Reviewed: Wed Mar 15 16:52:38 PST 2000 by explorer */ @@ -36,7 +36,8 @@ fromtext_dname(ARGS_FROMTEXT) { REQUIRE(type == 39); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); diff --git a/lib/dns/rdata/generic/gpos_27.c b/lib/dns/rdata/generic/gpos_27.c index fc8ed3a215..bede48d50c 100644 --- a/lib/dns/rdata/generic/gpos_27.c +++ b/lib/dns/rdata/generic/gpos_27.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: gpos_27.c,v 1.25 2000/10/25 05:43:31 marka Exp $ */ +/* $Id: gpos_27.c,v 1.26 2000/11/08 01:55:38 bwelling Exp $ */ /* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */ @@ -38,8 +38,9 @@ fromtext_gpos(ARGS_FROMTEXT) { UNUSED(downcase); for (i = 0; i < 3 ; i++) { - RETERR(gettoken(lexer, &token, isc_tokentype_qstring, - ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, + isc_tokentype_qstring, + ISC_FALSE)); RETERR(txt_fromtext(&token.value.as_textregion, target)); } return (ISC_R_SUCCESS); diff --git a/lib/dns/rdata/generic/hinfo_13.c b/lib/dns/rdata/generic/hinfo_13.c index 9c2bc97103..331577f5b5 100644 --- a/lib/dns/rdata/generic/hinfo_13.c +++ b/lib/dns/rdata/generic/hinfo_13.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: hinfo_13.c,v 1.30 2000/10/25 05:43:33 marka Exp $ */ +/* $Id: hinfo_13.c,v 1.31 2000/11/08 01:55:39 bwelling Exp $ */ /* * Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley. @@ -38,8 +38,9 @@ fromtext_hinfo(ARGS_FROMTEXT) { REQUIRE(type == 13); for (i = 0; i < 2 ; i++) { - RETERR(gettoken(lexer, &token, isc_tokentype_qstring, - ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, + isc_tokentype_qstring, + ISC_FALSE)); RETERR(txt_fromtext(&token.value.as_textregion, target)); } return (ISC_R_SUCCESS); diff --git a/lib/dns/rdata/generic/isdn_20.c b/lib/dns/rdata/generic/isdn_20.c index 632f2b4dfd..d92c1d3563 100644 --- a/lib/dns/rdata/generic/isdn_20.c +++ b/lib/dns/rdata/generic/isdn_20.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: isdn_20.c,v 1.23 2000/10/25 05:43:34 marka Exp $ */ +/* $Id: isdn_20.c,v 1.24 2000/11/08 01:55:40 bwelling Exp $ */ /* Reviewed: Wed Mar 15 16:53:11 PST 2000 by bwelling */ @@ -37,11 +37,13 @@ fromtext_isdn(ARGS_FROMTEXT) { REQUIRE(type == 20); /* ISDN-address */ - RETERR(gettoken(lexer, &token, isc_tokentype_qstring, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, + ISC_FALSE)); RETERR(txt_fromtext(&token.value.as_textregion, target)); /* sa: optional */ - RETERR(gettoken(lexer, &token, isc_tokentype_qstring, ISC_TRUE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, + ISC_TRUE)); if (token.type != isc_tokentype_string && token.type != isc_tokentype_qstring) { isc_lex_ungettoken(lexer, &token); diff --git a/lib/dns/rdata/generic/key_25.c b/lib/dns/rdata/generic/key_25.c index dfc5b9990f..f18b656184 100644 --- a/lib/dns/rdata/generic/key_25.c +++ b/lib/dns/rdata/generic/key_25.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: key_25.c,v 1.33 2000/10/31 20:12:32 bwelling Exp $ */ +/* $Id: key_25.c,v 1.34 2000/11/08 01:55:41 bwelling Exp $ */ /* * Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley. @@ -44,17 +44,20 @@ fromtext_key(ARGS_FROMTEXT) { REQUIRE(type == 25); /* flags */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); RETERR(dns_keyflags_fromtext(&flags, &token.value.as_textregion)); RETERR(uint16_tobuffer(flags, target)); /* protocol */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); RETERR(dns_secproto_fromtext(&proto, &token.value.as_textregion)); RETERR(mem_tobuffer(target, &proto, 1)); /* algorithm */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); RETERR(dns_secalg_fromtext(&alg, &token.value.as_textregion)); RETERR(mem_tobuffer(target, &alg, 1)); diff --git a/lib/dns/rdata/generic/loc_29.c b/lib/dns/rdata/generic/loc_29.c index c791ced1a0..255ebc9306 100644 --- a/lib/dns/rdata/generic/loc_29.c +++ b/lib/dns/rdata/generic/loc_29.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: loc_29.c,v 1.24 2000/10/25 05:43:37 marka Exp $ */ +/* $Id: loc_29.c,v 1.25 2000/11/08 01:55:42 bwelling Exp $ */ /* Reviewed: Wed Mar 15 18:13:09 PST 2000 by explorer */ @@ -69,14 +69,16 @@ fromtext_loc(ARGS_FROMTEXT) { /* * Degrees. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 90) return (ISC_R_RANGE); d1 = (int)token.value.as_ulong; /* * Minutes. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); if (strcasecmp(token.value.as_pointer, "N") == 0) north = ISC_TRUE; if (north || strcasecmp(token.value.as_pointer, "S") == 0) @@ -92,7 +94,8 @@ fromtext_loc(ARGS_FROMTEXT) { /* * Seconds. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); if (strcasecmp(token.value.as_pointer, "N") == 0) north = ISC_TRUE; if (north || strcasecmp(token.value.as_pointer, "S") == 0) @@ -124,7 +127,8 @@ fromtext_loc(ARGS_FROMTEXT) { /* * Direction. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); if (strcasecmp(token.value.as_pointer, "N") == 0) north = ISC_TRUE; if (!north && strcasecmp(token.value.as_pointer, "S") != 0) @@ -134,7 +138,8 @@ fromtext_loc(ARGS_FROMTEXT) { /* * Degrees. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 180) return (ISC_R_RANGE); d2 = (int)token.value.as_ulong; @@ -142,7 +147,8 @@ fromtext_loc(ARGS_FROMTEXT) { /* * Minutes. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); if (strcasecmp(token.value.as_pointer, "E") == 0) east = ISC_TRUE; if (east || strcasecmp(token.value.as_pointer, "W") == 0) @@ -158,7 +164,8 @@ fromtext_loc(ARGS_FROMTEXT) { /* * Seconds. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); if (strcasecmp(token.value.as_pointer, "E") == 0) east = ISC_TRUE; if (east || strcasecmp(token.value.as_pointer, "W") == 0) @@ -190,7 +197,8 @@ fromtext_loc(ARGS_FROMTEXT) { /* * Direction. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); if (strcasecmp(token.value.as_pointer, "E") == 0) east = ISC_TRUE; if (!east && strcasecmp(token.value.as_pointer, "W") != 0) @@ -200,7 +208,8 @@ fromtext_loc(ARGS_FROMTEXT) { /* * Altitude. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); m = strtol(token.value.as_pointer, &e, 10); if (*e != 0 && *e != '.' && *e != 'm') return (DNS_R_SYNTAX); @@ -241,7 +250,8 @@ fromtext_loc(ARGS_FROMTEXT) { /* * Size: optional. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_TRUE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_TRUE)); if (token.type == isc_tokentype_eol || token.type == isc_tokentype_eof) { isc_lex_ungettoken(lexer, &token); @@ -293,7 +303,8 @@ fromtext_loc(ARGS_FROMTEXT) { /* * Horizontal precision: optional. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_TRUE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_TRUE)); if (token.type == isc_tokentype_eol || token.type == isc_tokentype_eof) { isc_lex_ungettoken(lexer, &token); @@ -343,7 +354,8 @@ fromtext_loc(ARGS_FROMTEXT) { /* * Vertical precision: optional. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_TRUE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_TRUE)); if (token.type == isc_tokentype_eol || token.type == isc_tokentype_eof) { isc_lex_ungettoken(lexer, &token); diff --git a/lib/dns/rdata/generic/mb_7.c b/lib/dns/rdata/generic/mb_7.c index fb20ea1290..04251a9c29 100644 --- a/lib/dns/rdata/generic/mb_7.c +++ b/lib/dns/rdata/generic/mb_7.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mb_7.c,v 1.34 2000/10/25 05:43:38 marka Exp $ */ +/* $Id: mb_7.c,v 1.35 2000/11/08 01:55:44 bwelling Exp $ */ /* Reviewed: Wed Mar 15 17:31:26 PST 2000 by bwelling */ @@ -34,7 +34,8 @@ fromtext_mb(ARGS_FROMTEXT) { REQUIRE(type == 7); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); diff --git a/lib/dns/rdata/generic/md_3.c b/lib/dns/rdata/generic/md_3.c index 7698da9f56..c4605f57c9 100644 --- a/lib/dns/rdata/generic/md_3.c +++ b/lib/dns/rdata/generic/md_3.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: md_3.c,v 1.36 2000/10/25 05:43:39 marka Exp $ */ +/* $Id: md_3.c,v 1.37 2000/11/08 01:55:45 bwelling Exp $ */ /* Reviewed: Wed Mar 15 17:48:20 PST 2000 by bwelling */ @@ -34,7 +34,8 @@ fromtext_md(ARGS_FROMTEXT) { REQUIRE(type == 3); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); diff --git a/lib/dns/rdata/generic/mf_4.c b/lib/dns/rdata/generic/mf_4.c index cd27d37df0..9946cb2f81 100644 --- a/lib/dns/rdata/generic/mf_4.c +++ b/lib/dns/rdata/generic/mf_4.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mf_4.c,v 1.34 2000/10/25 05:43:40 marka Exp $ */ +/* $Id: mf_4.c,v 1.35 2000/11/08 01:55:46 bwelling Exp $ */ /* reviewed: Wed Mar 15 17:47:33 PST 2000 by brister */ @@ -34,7 +34,8 @@ fromtext_mf(ARGS_FROMTEXT) { UNUSED(rdclass); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); diff --git a/lib/dns/rdata/generic/mg_8.c b/lib/dns/rdata/generic/mg_8.c index 15279341f1..43e6070659 100644 --- a/lib/dns/rdata/generic/mg_8.c +++ b/lib/dns/rdata/generic/mg_8.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mg_8.c,v 1.32 2000/10/25 05:43:42 marka Exp $ */ +/* $Id: mg_8.c,v 1.33 2000/11/08 01:55:47 bwelling Exp $ */ /* reviewed: Wed Mar 15 17:49:21 PST 2000 by brister */ @@ -34,7 +34,8 @@ fromtext_mg(ARGS_FROMTEXT) { UNUSED(rdclass); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); diff --git a/lib/dns/rdata/generic/minfo_14.c b/lib/dns/rdata/generic/minfo_14.c index 7526b3e195..db353bb290 100644 --- a/lib/dns/rdata/generic/minfo_14.c +++ b/lib/dns/rdata/generic/minfo_14.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: minfo_14.c,v 1.33 2000/10/25 05:43:43 marka Exp $ */ +/* $Id: minfo_14.c,v 1.34 2000/11/08 01:55:48 bwelling Exp $ */ /* reviewed: Wed Mar 15 17:45:32 PST 2000 by brister */ @@ -36,8 +36,9 @@ fromtext_minfo(ARGS_FROMTEXT) { UNUSED(rdclass); for (i = 0; i < 2 ; i++) { - RETERR(gettoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, + isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; diff --git a/lib/dns/rdata/generic/mr_9.c b/lib/dns/rdata/generic/mr_9.c index 86e3aca953..576fc8f79b 100644 --- a/lib/dns/rdata/generic/mr_9.c +++ b/lib/dns/rdata/generic/mr_9.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mr_9.c,v 1.31 2000/10/25 05:43:44 marka Exp $ */ +/* $Id: mr_9.c,v 1.32 2000/11/08 01:55:49 bwelling Exp $ */ /* Reviewed: Wed Mar 15 21:30:35 EST 2000 by tale */ @@ -34,7 +34,8 @@ fromtext_mr(ARGS_FROMTEXT) { UNUSED(rdclass); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); diff --git a/lib/dns/rdata/generic/mx_15.c b/lib/dns/rdata/generic/mx_15.c index 71c171d2ba..54e92d33a2 100644 --- a/lib/dns/rdata/generic/mx_15.c +++ b/lib/dns/rdata/generic/mx_15.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mx_15.c,v 1.41 2000/10/25 05:43:45 marka Exp $ */ +/* $Id: mx_15.c,v 1.42 2000/11/08 01:55:50 bwelling Exp $ */ /* reviewed: Wed Mar 15 18:05:46 PST 2000 by brister */ @@ -34,12 +34,14 @@ fromtext_mx(ARGS_FROMTEXT) { UNUSED(rdclass); - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; diff --git a/lib/dns/rdata/generic/ns_2.c b/lib/dns/rdata/generic/ns_2.c index 7c6f172da2..c9e6aeb0b9 100644 --- a/lib/dns/rdata/generic/ns_2.c +++ b/lib/dns/rdata/generic/ns_2.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ns_2.c,v 1.35 2000/10/25 05:43:46 marka Exp $ */ +/* $Id: ns_2.c,v 1.36 2000/11/08 01:55:52 bwelling Exp $ */ /* Reviewed: Wed Mar 15 18:15:00 PST 2000 by bwelling */ @@ -34,7 +34,8 @@ fromtext_ns(ARGS_FROMTEXT) { REQUIRE(type == 2); - RETERR(gettoken(lexer, &token,isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token,isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); diff --git a/lib/dns/rdata/generic/nxt_30.c b/lib/dns/rdata/generic/nxt_30.c index 315e9b89b1..2b9ad4a686 100644 --- a/lib/dns/rdata/generic/nxt_30.c +++ b/lib/dns/rdata/generic/nxt_30.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nxt_30.c,v 1.41 2000/10/25 05:43:48 marka Exp $ */ +/* $Id: nxt_30.c,v 1.42 2000/11/08 01:55:53 bwelling Exp $ */ /* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */ @@ -49,7 +49,8 @@ fromtext_nxt(ARGS_FROMTEXT) { /* * Next domain. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; @@ -57,8 +58,8 @@ fromtext_nxt(ARGS_FROMTEXT) { memset(bm, 0, sizeof bm); do { - RETERR(gettoken(lexer, &token, isc_tokentype_string, - ISC_TRUE)); + RETERR(isc_lex_getmastertoken(lexer, &token, + isc_tokentype_string, ISC_TRUE)); if (token.type != isc_tokentype_string) break; n = strtol(token.value.as_pointer, &e, 10); diff --git a/lib/dns/rdata/generic/proforma.c b/lib/dns/rdata/generic/proforma.c index 26eaaf9506..7e8c5e49ce 100644 --- a/lib/dns/rdata/generic/proforma.c +++ b/lib/dns/rdata/generic/proforma.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: proforma.c,v 1.28 2000/10/25 05:43:49 marka Exp $ */ +/* $Id: proforma.c,v 1.29 2000/11/08 01:55:54 bwelling Exp $ */ #ifndef RDATA_GENERIC_#_#_C #define RDATA_GENERIC_#_#_C @@ -29,7 +29,8 @@ fromtext_#(ARGS_FROMTEXT) { REQUIRE(type == #); REQUIRE(rdclass == #); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); return (ISC_R_NOTIMPLEMENTED); } diff --git a/lib/dns/rdata/generic/ptr_12.c b/lib/dns/rdata/generic/ptr_12.c index 726ddcb636..f298583ac7 100644 --- a/lib/dns/rdata/generic/ptr_12.c +++ b/lib/dns/rdata/generic/ptr_12.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ptr_12.c,v 1.32 2000/10/25 05:43:50 marka Exp $ */ +/* $Id: ptr_12.c,v 1.33 2000/11/08 01:55:55 bwelling Exp $ */ /* Reviewed: Thu Mar 16 14:05:12 PST 2000 by explorer */ @@ -34,7 +34,8 @@ fromtext_ptr(ARGS_FROMTEXT) { REQUIRE(type == 12); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); diff --git a/lib/dns/rdata/generic/rp_17.c b/lib/dns/rdata/generic/rp_17.c index d43b0d55c8..f7265d68c4 100644 --- a/lib/dns/rdata/generic/rp_17.c +++ b/lib/dns/rdata/generic/rp_17.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rp_17.c,v 1.28 2000/10/25 05:43:52 marka Exp $ */ +/* $Id: rp_17.c,v 1.29 2000/11/08 01:55:56 bwelling Exp $ */ /* RFC 1183 */ @@ -38,8 +38,9 @@ fromtext_rp(ARGS_FROMTEXT) { origin = (origin != NULL) ? origin : dns_rootname; for (i = 0; i < 2 ; i++) { - RETERR(gettoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, + isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); RETERR(dns_name_fromtext(&name, &buffer, origin, diff --git a/lib/dns/rdata/generic/rt_21.c b/lib/dns/rdata/generic/rt_21.c index f578c65504..95a7100033 100644 --- a/lib/dns/rdata/generic/rt_21.c +++ b/lib/dns/rdata/generic/rt_21.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rt_21.c,v 1.30 2000/10/25 05:43:53 marka Exp $ */ +/* $Id: rt_21.c,v 1.31 2000/11/08 01:55:57 bwelling Exp $ */ /* reviewed: Thu Mar 16 15:02:31 PST 2000 by brister */ @@ -36,12 +36,14 @@ fromtext_rt(ARGS_FROMTEXT) { UNUSED(rdclass); - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); diff --git a/lib/dns/rdata/generic/sig_24.c b/lib/dns/rdata/generic/sig_24.c index b396083d49..b9a0872742 100644 --- a/lib/dns/rdata/generic/sig_24.c +++ b/lib/dns/rdata/generic/sig_24.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: sig_24.c,v 1.46 2000/10/25 05:43:54 marka Exp $ */ +/* $Id: sig_24.c,v 1.47 2000/11/08 01:55:58 bwelling Exp $ */ /* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */ @@ -45,7 +45,8 @@ fromtext_sig(ARGS_FROMTEXT) { /* * Type covered. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); result = dns_rdatatype_fromtext(&covered, &token.value.as_textregion); if (result != ISC_R_SUCCESS && result != ISC_R_NOTIMPLEMENTED) { i = strtol(token.value.as_pointer, &e, 10); @@ -60,14 +61,16 @@ fromtext_sig(ARGS_FROMTEXT) { /* * Algorithm. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); RETERR(dns_secalg_fromtext(&c, &token.value.as_textregion)); RETERR(mem_tobuffer(target, &c, 1)); /* * Labels. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xff) return (ISC_R_RANGE); c = (unsigned char)token.value.as_ulong; @@ -76,33 +79,38 @@ fromtext_sig(ARGS_FROMTEXT) { /* * Original ttl. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); RETERR(uint32_tobuffer(token.value.as_ulong, target)); /* * Signature expiration. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); RETERR(dns_time32_fromtext(token.value.as_pointer, &time_expire)); RETERR(uint32_tobuffer(time_expire, target)); /* * Time signed. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); RETERR(dns_time32_fromtext(token.value.as_pointer, &time_signed)); RETERR(uint32_tobuffer(time_signed, target)); /* * Key footprint. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* * Signer. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; diff --git a/lib/dns/rdata/generic/soa_6.c b/lib/dns/rdata/generic/soa_6.c index 054614ac50..381e7ed216 100644 --- a/lib/dns/rdata/generic/soa_6.c +++ b/lib/dns/rdata/generic/soa_6.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: soa_6.c,v 1.45 2000/10/25 05:43:55 marka Exp $ */ +/* $Id: soa_6.c,v 1.46 2000/11/08 01:55:59 bwelling Exp $ */ /* Reviewed: Thu Mar 16 15:18:32 PST 2000 by explorer */ @@ -39,8 +39,9 @@ fromtext_soa(ARGS_FROMTEXT) { origin = (origin != NULL) ? origin : dns_rootname; for (i = 0 ; i < 2 ; i++) { - RETERR(gettoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, + isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); @@ -48,12 +49,14 @@ fromtext_soa(ARGS_FROMTEXT) { downcase, target)); } - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); RETERR(uint32_tobuffer(token.value.as_ulong, target)); for (i = 0; i < 4; i++) { - RETERR(gettoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, + isc_tokentype_string, + ISC_FALSE)); RETERR(dns_counter_fromtext(&token.value.as_textregion, &n)); RETERR(uint32_tobuffer(n, target)); } diff --git a/lib/dns/rdata/generic/tkey_249.c b/lib/dns/rdata/generic/tkey_249.c index 3653d85791..d49d2bd642 100644 --- a/lib/dns/rdata/generic/tkey_249.c +++ b/lib/dns/rdata/generic/tkey_249.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: tkey_249.c,v 1.39 2000/10/25 05:43:56 marka Exp $ */ +/* $Id: tkey_249.c,v 1.40 2000/11/08 01:56:01 bwelling Exp $ */ /* * Reviewed: Thu Mar 16 17:35:30 PST 2000 by halley. @@ -44,7 +44,8 @@ fromtext_tkey(ARGS_FROMTEXT) { /* * Algorithm. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; @@ -54,19 +55,22 @@ fromtext_tkey(ARGS_FROMTEXT) { /* * Inception. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); RETERR(uint32_tobuffer(token.value.as_ulong, target)); /* * Expiration. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); RETERR(uint32_tobuffer(token.value.as_ulong, target)); /* * Mode. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); @@ -74,7 +78,8 @@ fromtext_tkey(ARGS_FROMTEXT) { /* * Error. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); if (dns_tsigrcode_fromtext(&rcode, &token.value.as_textregion) != ISC_R_SUCCESS) { @@ -90,7 +95,8 @@ fromtext_tkey(ARGS_FROMTEXT) { /* * Key Size. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); @@ -103,7 +109,8 @@ fromtext_tkey(ARGS_FROMTEXT) { /* * Other Size. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); diff --git a/lib/dns/rdata/generic/txt_16.c b/lib/dns/rdata/generic/txt_16.c index 68a7f5d592..e38ee12c30 100644 --- a/lib/dns/rdata/generic/txt_16.c +++ b/lib/dns/rdata/generic/txt_16.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: txt_16.c,v 1.30 2000/08/01 01:26:07 tale Exp $ */ +/* $Id: txt_16.c,v 1.31 2000/11/08 01:56:02 bwelling Exp $ */ /* Reviewed: Thu Mar 16 15:40:00 PST 2000 by bwelling */ @@ -35,8 +35,9 @@ fromtext_txt(ARGS_FROMTEXT) { REQUIRE(type == 16); for(;;) { - RETERR(gettoken(lexer, &token, isc_tokentype_qstring, - ISC_TRUE)); + RETERR(isc_lex_getmastertoken(lexer, &token, + isc_tokentype_qstring, + ISC_TRUE)); if (token.type != isc_tokentype_qstring && token.type != isc_tokentype_string) break; diff --git a/lib/dns/rdata/generic/x25_19.c b/lib/dns/rdata/generic/x25_19.c index 91ca65ccb1..b34e7b8a0c 100644 --- a/lib/dns/rdata/generic/x25_19.c +++ b/lib/dns/rdata/generic/x25_19.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: x25_19.c,v 1.24 2000/10/25 05:43:57 marka Exp $ */ +/* $Id: x25_19.c,v 1.25 2000/11/08 01:56:03 bwelling Exp $ */ /* Reviewed: Thu Mar 16 16:15:57 PST 2000 by bwelling */ @@ -37,7 +37,8 @@ fromtext_x25(ARGS_FROMTEXT) { REQUIRE(type == 19); - RETERR(gettoken(lexer, &token, isc_tokentype_qstring, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, + ISC_FALSE)); if (token.value.as_textregion.length < 4) return (DNS_R_SYNTAX); for (i = 0; i < token.value.as_textregion.length; i++) diff --git a/lib/dns/rdata/hs_4/a_1.c b/lib/dns/rdata/hs_4/a_1.c index 45b0e18cc0..3a940c504d 100644 --- a/lib/dns/rdata/hs_4/a_1.c +++ b/lib/dns/rdata/hs_4/a_1.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: a_1.c,v 1.18 2000/10/25 05:43:59 marka Exp $ */ +/* $Id: a_1.c,v 1.19 2000/11/08 01:56:04 bwelling Exp $ */ /* reviewed: Thu Mar 16 15:58:36 PST 2000 by brister */ @@ -38,7 +38,8 @@ fromtext_hs_a(ARGS_FROMTEXT) { UNUSED(origin); UNUSED(downcase); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); if (inet_aton(token.value.as_pointer, &addr) != 1) return (DNS_R_BADDOTTEDQUAD); diff --git a/lib/dns/rdata/in_1/a6_38.c b/lib/dns/rdata/in_1/a6_38.c index a84f612e53..b68017b578 100644 --- a/lib/dns/rdata/in_1/a6_38.c +++ b/lib/dns/rdata/in_1/a6_38.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: a6_38.c,v 1.37 2000/10/25 05:44:00 marka Exp $ */ +/* $Id: a6_38.c,v 1.38 2000/11/08 01:56:05 bwelling Exp $ */ /* draft-ietf-ipngwg-dns-lookups-03.txt */ @@ -42,7 +42,8 @@ fromtext_in_a6(ARGS_FROMTEXT) { /* * Prefix length. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 128) return (ISC_R_RANGE); @@ -60,8 +61,9 @@ fromtext_in_a6(ARGS_FROMTEXT) { /* * Octets 0..15. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, + isc_tokentype_string, + ISC_FALSE)); if (inet_pton(AF_INET6, token.value.as_pointer, addr) != 1) return (DNS_R_BADAAAA); mask = 0xff >> (prefixlen % 8); @@ -72,7 +74,8 @@ fromtext_in_a6(ARGS_FROMTEXT) { if (prefixlen == 0) return (ISC_R_SUCCESS); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; diff --git a/lib/dns/rdata/in_1/a_1.c b/lib/dns/rdata/in_1/a_1.c index 554df8ba14..46c6a63c8c 100644 --- a/lib/dns/rdata/in_1/a_1.c +++ b/lib/dns/rdata/in_1/a_1.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: a_1.c,v 1.39 2000/10/25 05:44:01 marka Exp $ */ +/* $Id: a_1.c,v 1.40 2000/11/08 01:56:07 bwelling Exp $ */ /* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */ @@ -41,7 +41,8 @@ fromtext_in_a(ARGS_FROMTEXT) { UNUSED(downcase); UNUSED(rdclass); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); if (inet_aton(token.value.as_pointer, &addr) != 1) return (DNS_R_BADDOTTEDQUAD); diff --git a/lib/dns/rdata/in_1/aaaa_28.c b/lib/dns/rdata/in_1/aaaa_28.c index 5ee192d42e..3f0045c487 100644 --- a/lib/dns/rdata/in_1/aaaa_28.c +++ b/lib/dns/rdata/in_1/aaaa_28.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: aaaa_28.c,v 1.29 2000/10/25 05:44:02 marka Exp $ */ +/* $Id: aaaa_28.c,v 1.30 2000/11/08 01:56:08 bwelling Exp $ */ /* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */ @@ -40,7 +40,8 @@ fromtext_in_aaaa(ARGS_FROMTEXT) { REQUIRE(type == 28); REQUIRE(rdclass == 1); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); if (inet_pton(AF_INET6, token.value.as_pointer, addr) != 1) return (DNS_R_BADAAAA); diff --git a/lib/dns/rdata/in_1/kx_36.c b/lib/dns/rdata/in_1/kx_36.c index 1a986f0a46..a097ac4136 100644 --- a/lib/dns/rdata/in_1/kx_36.c +++ b/lib/dns/rdata/in_1/kx_36.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: kx_36.c,v 1.30 2000/10/25 05:44:04 marka Exp $ */ +/* $Id: kx_36.c,v 1.31 2000/11/08 01:56:09 bwelling Exp $ */ /* Reviewed: Thu Mar 16 17:24:54 PST 2000 by explorer */ @@ -35,12 +35,14 @@ fromtext_in_kx(ARGS_FROMTEXT) { REQUIRE(type == 36); REQUIRE(rdclass == 1); - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; diff --git a/lib/dns/rdata/in_1/naptr_35.c b/lib/dns/rdata/in_1/naptr_35.c index 8d1a38ad44..7d297e89c0 100644 --- a/lib/dns/rdata/in_1/naptr_35.c +++ b/lib/dns/rdata/in_1/naptr_35.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: naptr_35.c,v 1.34 2000/10/25 05:44:05 marka Exp $ */ +/* $Id: naptr_35.c,v 1.35 2000/11/08 01:56:10 bwelling Exp $ */ /* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */ @@ -38,7 +38,8 @@ fromtext_in_naptr(ARGS_FROMTEXT) { /* * Order. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); @@ -46,7 +47,8 @@ fromtext_in_naptr(ARGS_FROMTEXT) { /* * Preference. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); @@ -54,25 +56,29 @@ fromtext_in_naptr(ARGS_FROMTEXT) { /* * Flags. */ - RETERR(gettoken(lexer, &token, isc_tokentype_qstring, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, + ISC_FALSE)); RETERR(txt_fromtext(&token.value.as_textregion, target)); /* * Service. */ - RETERR(gettoken(lexer, &token, isc_tokentype_qstring, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, + ISC_FALSE)); RETERR(txt_fromtext(&token.value.as_textregion, target)); /* * Regexp. */ - RETERR(gettoken(lexer, &token, isc_tokentype_qstring, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, + ISC_FALSE)); RETERR(txt_fromtext(&token.value.as_textregion, target)); /* * Replacement. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; diff --git a/lib/dns/rdata/in_1/nsap-ptr_23.c b/lib/dns/rdata/in_1/nsap-ptr_23.c index c0d98e3618..244a898980 100644 --- a/lib/dns/rdata/in_1/nsap-ptr_23.c +++ b/lib/dns/rdata/in_1/nsap-ptr_23.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nsap-ptr_23.c,v 1.25 2000/10/25 05:44:06 marka Exp $ */ +/* $Id: nsap-ptr_23.c,v 1.26 2000/11/08 01:56:11 bwelling Exp $ */ /* Reviewed: Fri Mar 17 10:16:02 PST 2000 by gson */ @@ -35,7 +35,8 @@ fromtext_in_nsap_ptr(ARGS_FROMTEXT) { REQUIRE(type == 23); REQUIRE(rdclass == 1); - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); diff --git a/lib/dns/rdata/in_1/nsap_22.c b/lib/dns/rdata/in_1/nsap_22.c index e23c76385c..89f3a74875 100644 --- a/lib/dns/rdata/in_1/nsap_22.c +++ b/lib/dns/rdata/in_1/nsap_22.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nsap_22.c,v 1.26 2000/10/25 05:44:07 marka Exp $ */ +/* $Id: nsap_22.c,v 1.27 2000/11/08 01:56:12 bwelling Exp $ */ /* Reviewed: Fri Mar 17 10:41:07 PST 2000 by gson */ @@ -41,7 +41,8 @@ fromtext_in_nsap(ARGS_FROMTEXT) { UNUSED(downcase); /* 0x */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); sr = &token.value.as_textregion; if (sr->length < 2) return (ISC_R_UNEXPECTEDEND); diff --git a/lib/dns/rdata/in_1/px_26.c b/lib/dns/rdata/in_1/px_26.c index 38c82eb3aa..30eb4353da 100644 --- a/lib/dns/rdata/in_1/px_26.c +++ b/lib/dns/rdata/in_1/px_26.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: px_26.c,v 1.27 2000/10/25 05:44:08 marka Exp $ */ +/* $Id: px_26.c,v 1.28 2000/11/08 01:56:13 bwelling Exp $ */ /* Reviewed: Mon Mar 20 10:44:27 PST 2000 */ @@ -38,7 +38,8 @@ fromtext_in_px(ARGS_FROMTEXT) { /* * Preference. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); @@ -46,7 +47,8 @@ fromtext_in_px(ARGS_FROMTEXT) { /* * MAP822. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; @@ -55,7 +57,8 @@ fromtext_in_px(ARGS_FROMTEXT) { /* * MAPX400. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; diff --git a/lib/dns/rdata/in_1/srv_33.c b/lib/dns/rdata/in_1/srv_33.c index dcbc10a7df..4b61cf03c2 100644 --- a/lib/dns/rdata/in_1/srv_33.c +++ b/lib/dns/rdata/in_1/srv_33.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: srv_33.c,v 1.29 2000/10/25 05:44:09 marka Exp $ */ +/* $Id: srv_33.c,v 1.30 2000/11/08 01:56:14 bwelling Exp $ */ /* Reviewed: Fri Mar 17 13:01:00 PST 2000 by bwelling */ @@ -38,7 +38,8 @@ fromtext_in_srv(ARGS_FROMTEXT) { /* * Priority. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); @@ -46,7 +47,8 @@ fromtext_in_srv(ARGS_FROMTEXT) { /* * Weight. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); @@ -54,7 +56,8 @@ fromtext_in_srv(ARGS_FROMTEXT) { /* * Port. */ - RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); if (token.value.as_ulong > 0xffff) return (ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); @@ -62,7 +65,8 @@ fromtext_in_srv(ARGS_FROMTEXT) { /* * Target. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); dns_name_init(&name, NULL); buffer_fromregion(&buffer, &token.value.as_region); origin = (origin != NULL) ? origin : dns_rootname; diff --git a/lib/dns/rdata/in_1/wks_11.c b/lib/dns/rdata/in_1/wks_11.c index 7a82977c0e..a677e16164 100644 --- a/lib/dns/rdata/in_1/wks_11.c +++ b/lib/dns/rdata/in_1/wks_11.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: wks_11.c,v 1.36 2000/10/25 05:44:10 marka Exp $ */ +/* $Id: wks_11.c,v 1.37 2000/11/08 01:56:15 bwelling Exp $ */ /* Reviewed: Fri Mar 17 15:01:49 PST 2000 by explorer */ @@ -56,7 +56,8 @@ fromtext_in_wks(ARGS_FROMTEXT) { /* * IPv4 dotted quad. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); isc_buffer_availableregion(target, ®ion); if (inet_aton(token.value.as_pointer, &addr) != 1) @@ -69,7 +70,8 @@ fromtext_in_wks(ARGS_FROMTEXT) { /* * Protocol. */ - RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, + ISC_FALSE)); proto = strtol(token.value.as_pointer, &e, 10); if (*e == 0) @@ -90,8 +92,8 @@ fromtext_in_wks(ARGS_FROMTEXT) { memset(bm, 0, sizeof bm); do { - RETERR(gettoken(lexer, &token, isc_tokentype_string, - ISC_TRUE)); + RETERR(isc_lex_getmastertoken(lexer, &token, + isc_tokentype_string, ISC_TRUE)); if (token.type != isc_tokentype_string) break; diff --git a/lib/isc/base64.c b/lib/isc/base64.c index 07c78a1f10..bc87d626b9 100644 --- a/lib/isc/base64.c +++ b/lib/isc/base64.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: base64.c,v 1.19 2000/09/08 00:34:21 gson Exp $ */ +/* $Id: base64.c,v 1.20 2000/11/08 01:55:26 bwelling Exp $ */ #include @@ -39,10 +39,6 @@ static isc_result_t str_totext(const char *source, isc_buffer_t *target); -static isc_result_t -gettoken(isc_lex_t *lexer, isc_token_t *token, isc_tokentype_t expect, - isc_boolean_t eol); - static isc_result_t mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length); @@ -168,6 +164,7 @@ isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) { base64_decode_ctx_t ctx; isc_textregion_t *tr; isc_token_t token; + isc_boolean_t eol; base64_decode_init(&ctx, length, target); @@ -175,11 +172,11 @@ isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) { unsigned int i; if (length > 0) - RETERR(gettoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); + eol = ISC_FALSE; else - RETERR(gettoken(lexer, &token, isc_tokentype_string, - ISC_TRUE)); + eol = ISC_TRUE; + RETERR(isc_lex_getmastertoken(lexer, &token, + isc_tokentype_string, eol)); if (token.type != isc_tokentype_string) break; tr = &token.value.as_textregion; @@ -238,45 +235,3 @@ mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) { isc_buffer_add(target, length); return (ISC_R_SUCCESS); } - -static isc_result_t -gettoken(isc_lex_t *lexer, isc_token_t *token, isc_tokentype_t expect, - isc_boolean_t eol) -{ - unsigned int options = ISC_LEXOPT_EOL | ISC_LEXOPT_EOF | - ISC_LEXOPT_DNSMULTILINE | ISC_LEXOPT_ESCAPE; - isc_result_t result; - - if (expect == isc_tokentype_qstring) - options |= ISC_LEXOPT_QSTRING; - else if (expect == isc_tokentype_number) - options |= ISC_LEXOPT_NUMBER; - result = isc_lex_gettoken(lexer, options, token); - switch (result) { - case ISC_R_SUCCESS: - break; - case ISC_R_NOMEMORY: - return (ISC_R_NOMEMORY); - case ISC_R_NOSPACE: - return (ISC_R_NOSPACE); - default: - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_lex_gettoken() failed: %s", - isc_result_totext(result)); - return (ISC_R_UNEXPECTED); - } - if (eol && ((token->type == isc_tokentype_eol) || - (token->type == isc_tokentype_eof))) - return (ISC_R_SUCCESS); - if (token->type == isc_tokentype_string && - expect == isc_tokentype_qstring) - return (ISC_R_SUCCESS); - if (token->type != expect) { - isc_lex_ungettoken(lexer, token); - if (token->type == isc_tokentype_eol || - token->type == isc_tokentype_eof) - return (ISC_R_UNEXPECTEDEND); - return (ISC_R_UNEXPECTEDTOKEN); - } - return (ISC_R_SUCCESS); -} diff --git a/lib/isc/hex.c b/lib/isc/hex.c index 7a1f8a50de..d1c162dda4 100644 --- a/lib/isc/hex.c +++ b/lib/isc/hex.c @@ -19,10 +19,6 @@ static isc_result_t str_totext(const char *source, isc_buffer_t *target); -static isc_result_t -gettoken(isc_lex_t *lexer, isc_token_t *token, isc_tokentype_t expect, - isc_boolean_t eol); - static isc_result_t mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length); @@ -112,6 +108,7 @@ isc_hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) { hex_decode_ctx_t ctx; isc_textregion_t *tr; isc_token_t token; + isc_boolean_t eol; hex_decode_init(&ctx, length, target); @@ -119,11 +116,11 @@ isc_hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) { unsigned int i; if (length > 0) - RETERR(gettoken(lexer, &token, isc_tokentype_string, - ISC_FALSE)); + eol = ISC_FALSE; else - RETERR(gettoken(lexer, &token, isc_tokentype_string, - ISC_TRUE)); + eol = ISC_TRUE; + RETERR(isc_lex_getmastertoken(lexer, &token, + isc_tokentype_string, eol)); if (token.type != isc_tokentype_string) break; tr = &token.value.as_textregion; @@ -180,45 +177,3 @@ mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) { isc_buffer_add(target, length); return (ISC_R_SUCCESS); } - -static isc_result_t -gettoken(isc_lex_t *lexer, isc_token_t *token, isc_tokentype_t expect, - isc_boolean_t eol) -{ - unsigned int options = ISC_LEXOPT_EOL | ISC_LEXOPT_EOF | - ISC_LEXOPT_DNSMULTILINE | ISC_LEXOPT_ESCAPE; - isc_result_t result; - - if (expect == isc_tokentype_qstring) - options |= ISC_LEXOPT_QSTRING; - else if (expect == isc_tokentype_number) - options |= ISC_LEXOPT_NUMBER; - result = isc_lex_gettoken(lexer, options, token); - switch (result) { - case ISC_R_SUCCESS: - break; - case ISC_R_NOMEMORY: - return (ISC_R_NOMEMORY); - case ISC_R_NOSPACE: - return (ISC_R_NOSPACE); - default: - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_lex_gettoken() failed: %s", - isc_result_totext(result)); - return (ISC_R_UNEXPECTED); - } - if (eol && ((token->type == isc_tokentype_eol) || - (token->type == isc_tokentype_eof))) - return (ISC_R_SUCCESS); - if (token->type == isc_tokentype_string && - expect == isc_tokentype_qstring) - return (ISC_R_SUCCESS); - if (token->type != expect) { - isc_lex_ungettoken(lexer, token); - if (token->type == isc_tokentype_eol || - token->type == isc_tokentype_eof) - return (ISC_R_UNEXPECTEDEND); - return (ISC_R_UNEXPECTEDTOKEN); - } - return (ISC_R_SUCCESS); -} diff --git a/lib/isc/include/isc/lex.h b/lib/isc/include/isc/lex.h index 7fe8ae7ce4..00574e89a9 100644 --- a/lib/isc/include/isc/lex.h +++ b/lib/isc/include/isc/lex.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: lex.h,v 1.22 2000/08/01 01:30:19 tale Exp $ */ +/* $Id: lex.h,v 1.23 2000/11/08 01:55:30 bwelling Exp $ */ #ifndef ISC_LEX_H #define ISC_LEX_H 1 @@ -301,6 +301,25 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp); * ISC_R_NOMORE No more input sources */ +isc_result_t +isc_lex_getmastertoken(isc_lex_t *lex, isc_token_t *token, + isc_tokentype_t expect, isc_boolean_t eol); +/* + * Get the next token from a DNS master file type stream. This is a + * convenience function that sets appropriate options and handles quoted + * strings and end of line correctly for master files. It also ungets + * unexpected tokens. + * + * Requires: + * 'lex' is a valid lexer. + * + * 'token' is a valid pointer + * + * Returns: + * + * any return code from isc_lex_gettoken. + */ + void isc_lex_ungettoken(isc_lex_t *lex, isc_token_t *tokenp); /* diff --git a/lib/isc/lex.c b/lib/isc/lex.c index 278d56f903..3d07ca6d92 100644 --- a/lib/isc/lex.c +++ b/lib/isc/lex.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: lex.c,v 1.39 2000/10/20 02:21:53 marka Exp $ */ +/* $Id: lex.c,v 1.40 2000/11/08 01:55:29 bwelling Exp $ */ #include @@ -691,6 +691,38 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { return (ISC_R_SUCCESS); } +isc_result_t +isc_lex_getmastertoken(isc_lex_t *lex, isc_token_t *token, + isc_tokentype_t expect, isc_boolean_t eol) +{ + unsigned int options = ISC_LEXOPT_EOL | ISC_LEXOPT_EOF | + ISC_LEXOPT_DNSMULTILINE | ISC_LEXOPT_ESCAPE; + isc_result_t result; + + if (expect == isc_tokentype_qstring) + options |= ISC_LEXOPT_QSTRING; + else if (expect == isc_tokentype_number) + options |= ISC_LEXOPT_NUMBER; + result = isc_lex_gettoken(lex, options, token); + if (result != ISC_R_SUCCESS) + return (result); + + if (eol && ((token->type == isc_tokentype_eol) || + (token->type == isc_tokentype_eof))) + return (ISC_R_SUCCESS); + if (token->type == isc_tokentype_string && + expect == isc_tokentype_qstring) + return (ISC_R_SUCCESS); + if (token->type != expect) { + isc_lex_ungettoken(lex, token); + if (token->type == isc_tokentype_eol || + token->type == isc_tokentype_eof) + return (ISC_R_UNEXPECTEDEND); + return (ISC_R_UNEXPECTEDTOKEN); + } + return (ISC_R_SUCCESS); +} + void isc_lex_ungettoken(isc_lex_t *lex, isc_token_t *tokenp) { inputsource *source;