* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: master.c,v 1.133 2001/12/11 20:52:38 marka Exp $ */
+/* $Id: master.c,v 1.134 2002/01/21 01:07:14 marka Exp $ */
#include <config.h>
#define DNS_LCTX_MAGIC ISC_MAGIC('L','c','t','x')
#define DNS_LCTX_VALID(lctx) ISC_MAGIC_VALID(lctx, DNS_LCTX_MAGIC)
+#define DNS_AS_STR(t) ((t).value.as_textregion.base)
+
static isc_result_t
pushfile(const char *master_file, dns_name_t *origin, dns_loadctx_t *lctx);
* across the normal domain name processing.
*/
- if (strcasecmp(token.value.as_pointer,
- "$ORIGIN") == 0) {
+ if (strcasecmp(DNS_AS_STR(token), "$ORIGIN") == 0) {
GETTOKEN(lctx->lex, 0, &token, ISC_FALSE);
finish_origin = ISC_TRUE;
- } else if (strcasecmp(token.value.as_pointer,
+ } else if (strcasecmp(DNS_AS_STR(token),
"$TTL") == 0) {
GETTOKEN(lctx->lex, 0, &token, ISC_FALSE);
result =
lctx->default_ttl_known = ISC_TRUE;
EXPECTEOL;
continue;
- } else if (strcasecmp(token.value.as_pointer,
+ } else if (strcasecmp(DNS_AS_STR(token),
"$INCLUDE") == 0) {
COMMITALL;
if ((lctx->options & DNS_MASTER_NOINCLUDE)
if (include_file != NULL)
isc_mem_free(mctx, include_file);
include_file = isc_mem_strdup(mctx,
- token.value.as_pointer);
+ DNS_AS_STR(token));
if (include_file == NULL) {
result = ISC_R_NOMEMORY;
goto log_and_cleanup;
* the actual inclusion later.
*/
finish_include = ISC_TRUE;
- } else if (strcasecmp(token.value.as_pointer,
+ } else if (strcasecmp(DNS_AS_STR(token),
"$DATE") == 0) {
isc_int64_t dump_time64;
isc_stdtime_t dump_time, current_time;
GETTOKEN(lctx->lex, 0, &token, ISC_FALSE);
isc_stdtime_get(¤t_time);
- result = dns_time64_fromtext(token.value.
- as_pointer, &dump_time64);
+ result = dns_time64_fromtext(DNS_AS_STR(token),
+ &dump_time64);
if (MANYERRS(lctx, result)) {
SETRESULT(lctx, result);
LOGIT(result);
ttl_offset = current_time - dump_time;
EXPECTEOL;
continue;
- } else if (strcasecmp(token.value.as_pointer,
+ } else if (strcasecmp(DNS_AS_STR(token),
"$GENERATE") == 0) {
/*
* Use default ttl if known otherwise
/* range */
GETTOKEN(lctx->lex, 0, &token, ISC_FALSE);
range = isc_mem_strdup(mctx,
- token.value.as_pointer);
+ DNS_AS_STR(token));
if (range == NULL) {
result = ISC_R_NOMEMORY;
goto log_and_cleanup;
}
/* LHS */
GETTOKEN(lctx->lex, 0, &token, ISC_FALSE);
- lhs = isc_mem_strdup(mctx,
- token.value.as_pointer);
+ lhs = isc_mem_strdup(mctx, DNS_AS_STR(token));
if (lhs == NULL) {
result = ISC_R_NOMEMORY;
goto log_and_cleanup;
/* TYPE */
GETTOKEN(lctx->lex, 0, &token, ISC_FALSE);
gtype = isc_mem_strdup(mctx,
- token.value.as_pointer);
+ DNS_AS_STR(token));
if (gtype == NULL) {
result = ISC_R_NOMEMORY;
goto log_and_cleanup;
}
/* RHS */
GETTOKEN(lctx->lex, 0, &token, ISC_FALSE);
- rhs = isc_mem_strdup(mctx,
- token.value.as_pointer);
+ rhs = isc_mem_strdup(mctx, DNS_AS_STR(token));
if (rhs == NULL) {
result = ISC_R_NOMEMORY;
goto log_and_cleanup;
goto insist_and_cleanup;
EXPECTEOL;
continue;
- } else if (strncasecmp(token.value.as_pointer,
+ } else if (strncasecmp(DNS_AS_STR(token),
"$", 1) == 0) {
(callbacks->error)(callbacks,
"%s: %s:%lu: "
"unknown $ directive '%s'",
"dns_master_load", source, line,
- token.value.as_pointer);
+ DNS_AS_STR(token));
result = DNS_R_SYNTAX;
if (MANYERRS(lctx, result)) {
SETRESULT(lctx, result);
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdata.c,v 1.157 2002/01/05 07:05:05 ogud Exp $ */
+/* $Id: rdata.c,v 1.158 2002/01/21 01:07:16 marka Exp $ */
#include <config.h>
#include <ctype.h>
if (_r != ISC_R_SUCCESS) \
return (_r); \
} while (0)
+
#define RETTOK(x) \
do { \
isc_result_t _r = (x); \
} \
} while (0)
+#define DNS_AS_STR(t) ((t).value.as_textregion.base)
+
#define ARGS_FROMTEXT int rdclass, dns_rdatatype_t type, \
isc_lex_t *lexer, dns_name_t *origin, \
isc_boolean_t downcase, isc_buffer_t *target, \
return (result);
}
- if (strcmp((char *)token.value.as_pointer, "\\#") == 0)
+ if (strcmp(DNS_AS_STR(token), "\\#") == 0)
result = unknown_fromtext(rdclass, type, lexer, mctx, target);
else {
isc_lex_ungettoken(lexer, &token);
*/
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- oeor = strtol(token.value.as_pointer, &e, 16);
+ oeor = strtol(DNS_AS_STR(token), &e, 16);
if (*e != 0)
return (DNS_R_SYNTAX);
*/
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- osum = strtol(token.value.as_pointer, &e, 16);
+ osum = strtol(DNS_AS_STR(token), &e, 16);
if (*e != 0)
return (DNS_R_SYNTAX);
*/
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- orot = strtol(token.value.as_pointer, &e, 16);
+ orot = strtol(DNS_AS_STR(token), &e, 16);
if (*e != 0)
return (DNS_R_SYNTAX);
case isc_tokentype_qstring:
(*callback)(callbacks, "%s: %s:%lu: near '%s': %s",
"dns_rdata_fromtext", name, line,
- (char *)token->value.as_pointer,
+ DNS_AS_STR(*token),
dns_result_totext(result));
break;
default:
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tsig_250.c,v 1.54 2002/01/05 07:05:06 ogud Exp $ */
+/* $Id: tsig_250.c,v 1.55 2002/01/21 01:07:18 marka Exp $ */
/* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */
*/
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- sigtime = isc_string_touint64(token.value.as_pointer, &e, 10);
+ sigtime = isc_string_touint64(DNS_AS_STR(token), &e, 10);
if (*e != 0)
RETTOK(DNS_R_SYNTAX);
if ((sigtime >> 48) != 0)
if (dns_tsigrcode_fromtext(&rcode, &token.value.as_textregion)
!= ISC_R_SUCCESS)
{
- i = strtol(token.value.as_pointer, &e, 10);
+ i = strtol(DNS_AS_STR(token), &e, 10);
if (*e != 0)
RETTOK(DNS_R_UNKNOWN);
if (i < 0 || i > 0xffff)
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: loc_29.c,v 1.32 2002/01/05 07:05:13 ogud Exp $ */
+/* $Id: loc_29.c,v 1.33 2002/01/21 01:07:19 marka Exp $ */
/* Reviewed: Wed Mar 15 18:13:09 PST 2000 by explorer */
*/
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- if (strcasecmp(token.value.as_pointer, "N") == 0)
+ if (strcasecmp(DNS_AS_STR(token), "N") == 0)
north = ISC_TRUE;
- if (north || strcasecmp(token.value.as_pointer, "S") == 0)
+ if (north || strcasecmp(DNS_AS_STR(token), "S") == 0)
goto getlong;
- m1 = strtol(token.value.as_pointer, &e, 10);
+ m1 = strtol(DNS_AS_STR(token), &e, 10);
if (*e != 0)
RETTOK(DNS_R_SYNTAX);
if (m1 < 0 || m1 > 59)
*/
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- if (strcasecmp(token.value.as_pointer, "N") == 0)
+ if (strcasecmp(DNS_AS_STR(token), "N") == 0)
north = ISC_TRUE;
- if (north || strcasecmp(token.value.as_pointer, "S") == 0)
+ if (north || strcasecmp(DNS_AS_STR(token), "S") == 0)
goto getlong;
- s1 = strtol(token.value.as_pointer, &e, 10);
+ s1 = strtol(DNS_AS_STR(token), &e, 10);
if (*e != 0 && *e != '.')
RETTOK(DNS_R_SYNTAX);
if (s1 < 0 || s1 > 59)
*/
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- if (strcasecmp(token.value.as_pointer, "N") == 0)
+ if (strcasecmp(DNS_AS_STR(token), "N") == 0)
north = ISC_TRUE;
- if (!north && strcasecmp(token.value.as_pointer, "S") != 0)
+ if (!north && strcasecmp(DNS_AS_STR(token), "S") != 0)
RETTOK(DNS_R_SYNTAX);
getlong:
*/
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- if (strcasecmp(token.value.as_pointer, "E") == 0)
+ if (strcasecmp(DNS_AS_STR(token), "E") == 0)
east = ISC_TRUE;
- if (east || strcasecmp(token.value.as_pointer, "W") == 0)
+ if (east || strcasecmp(DNS_AS_STR(token), "W") == 0)
goto getalt;
- m2 = strtol(token.value.as_pointer, &e, 10);
+ m2 = strtol(DNS_AS_STR(token), &e, 10);
if (*e != 0)
RETTOK(DNS_R_SYNTAX);
if (m2 < 0 || m2 > 59)
*/
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- if (strcasecmp(token.value.as_pointer, "E") == 0)
+ if (strcasecmp(DNS_AS_STR(token), "E") == 0)
east = ISC_TRUE;
- if (east || strcasecmp(token.value.as_pointer, "W") == 0)
+ if (east || strcasecmp(DNS_AS_STR(token), "W") == 0)
goto getalt;
- s2 = strtol(token.value.as_pointer, &e, 10);
+ s2 = strtol(DNS_AS_STR(token), &e, 10);
if (*e != 0 && *e != '.')
RETTOK(DNS_R_SYNTAX);
if (s2 < 0 || s2 > 59)
*/
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- if (strcasecmp(token.value.as_pointer, "E") == 0)
+ if (strcasecmp(DNS_AS_STR(token), "E") == 0)
east = ISC_TRUE;
- if (!east && strcasecmp(token.value.as_pointer, "W") != 0)
+ if (!east && strcasecmp(DNS_AS_STR(token), "W") != 0)
RETTOK(DNS_R_SYNTAX);
getalt:
*/
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- m = strtol(token.value.as_pointer, &e, 10);
+ m = strtol(DNS_AS_STR(token), &e, 10);
if (*e != 0 && *e != '.' && *e != 'm')
RETTOK(DNS_R_SYNTAX);
if (m < -100000 || m > 42849672)
isc_lex_ungettoken(lexer, &token);
goto encode;
}
- m = strtol(token.value.as_pointer, &e, 10);
+ m = strtol(DNS_AS_STR(token), &e, 10);
if (*e != 0 && *e != '.' && *e != 'm')
RETTOK(DNS_R_SYNTAX);
if (m < 0 || m > 90000000)
isc_lex_ungettoken(lexer, &token);
goto encode;
}
- m = strtol(token.value.as_pointer, &e, 10);
+ m = strtol(DNS_AS_STR(token), &e, 10);
if (*e != 0 && *e != '.' && *e != 'm')
RETTOK(DNS_R_SYNTAX);
if (m < 0 || m > 90000000)
isc_lex_ungettoken(lexer, &token);
goto encode;
}
- m = strtol(token.value.as_pointer, &e, 10);
+ m = strtol(DNS_AS_STR(token), &e, 10);
if (*e != 0 && *e != '.' && *e != 'm')
RETTOK(DNS_R_SYNTAX);
if (m < 0 || m > 90000000)
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nxt_30.c,v 1.52 2002/01/05 07:05:15 ogud Exp $ */
+/* $Id: nxt_30.c,v 1.53 2002/01/21 01:07:21 marka Exp $ */
/* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */
isc_tokentype_string, ISC_TRUE));
if (token.type != isc_tokentype_string)
break;
- n = strtol(token.value.as_pointer, &e, 10);
- if (e != (char *)token.value.as_pointer && *e == '\0') {
+ n = strtol(DNS_AS_STR(token), &e, 10);
+ if (e != DNS_AS_STR(token) && *e == '\0') {
covered = (dns_rdatatype_t)n;
} else if (dns_rdatatype_fromtext(&covered,
&token.value.as_textregion) == DNS_R_UNKNOWN)
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sig_24.c,v 1.56 2002/01/05 07:05:18 ogud Exp $ */
+/* $Id: sig_24.c,v 1.57 2002/01/21 01:07:22 marka Exp $ */
/* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */
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);
+ i = strtol(DNS_AS_STR(token), &e, 10);
if (i < 0 || i > 65535)
RETTOK(ISC_R_RANGE);
if (*e != 0)
*/
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- RETTOK(dns_time32_fromtext(token.value.as_pointer, &time_expire));
+ RETTOK(dns_time32_fromtext(DNS_AS_STR(token), &time_expire));
RETERR(uint32_tobuffer(time_expire, target));
/*
*/
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- RETTOK(dns_time32_fromtext(token.value.as_pointer, &time_signed));
+ RETTOK(dns_time32_fromtext(DNS_AS_STR(token), &time_signed));
RETERR(uint32_tobuffer(time_signed, target));
/*
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tkey_249.c,v 1.50 2002/01/05 07:05:20 ogud Exp $ */
+/* $Id: tkey_249.c,v 1.51 2002/01/21 01:07:23 marka Exp $ */
/*
* Reviewed: Thu Mar 16 17:35:30 PST 2000 by halley.
if (dns_tsigrcode_fromtext(&rcode, &token.value.as_textregion)
!= ISC_R_SUCCESS)
{
- i = strtol(token.value.as_pointer, &e, 10);
+ i = strtol(DNS_AS_STR(token), &e, 10);
if (*e != 0)
RETTOK(DNS_R_UNKNOWN);
if (i < 0 || i > 0xffff)
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: a_1.c,v 1.25 2001/07/16 03:06:37 marka Exp $ */
+/* $Id: a_1.c,v 1.26 2002/01/21 01:07:24 marka Exp $ */
/* reviewed: Thu Mar 16 15:58:36 PST 2000 by brister */
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- if (getquad(token.value.as_pointer, &addr, lexer, callbacks) != 1)
+ if (getquad(DNS_AS_STR(token), &addr, lexer, callbacks) != 1)
RETTOK(DNS_R_BADDOTTEDQUAD);
isc_buffer_availableregion(target, ®ion);
if (region.length < 4)
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: a6_38.c,v 1.47 2001/11/27 01:55:44 gson Exp $ */
+/* $Id: a6_38.c,v 1.48 2002/01/21 01:07:26 marka Exp $ */
/* RFC2874 */
RETERR(isc_lex_getmastertoken(lexer, &token,
isc_tokentype_string,
ISC_FALSE));
- if (inet_pton(AF_INET6, token.value.as_pointer, addr) != 1)
+ if (inet_pton(AF_INET6, DNS_AS_STR(token), addr) != 1)
RETTOK(DNS_R_BADAAAA);
mask = 0xff >> (prefixlen % 8);
addr[octets] &= mask;
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: a_1.c,v 1.47 2002/01/05 07:05:25 ogud Exp $ */
+/* $Id: a_1.c,v 1.48 2002/01/21 01:07:28 marka Exp $ */
/* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- if (getquad(token.value.as_pointer, &addr, lexer, callbacks) != 1)
+ if (getquad(DNS_AS_STR(token), &addr, lexer, callbacks) != 1)
RETTOK(DNS_R_BADDOTTEDQUAD);
isc_buffer_availableregion(target, ®ion);
if (region.length < 4)
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: aaaa_28.c,v 1.37 2002/01/05 07:05:26 ogud Exp $ */
+/* $Id: aaaa_28.c,v 1.38 2002/01/21 01:07:29 marka Exp $ */
/* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- if (inet_pton(AF_INET6, token.value.as_pointer, addr) != 1)
+ if (inet_pton(AF_INET6, DNS_AS_STR(token), addr) != 1)
RETTOK(DNS_R_BADAAAA);
isc_buffer_availableregion(target, ®ion);
if (region.length < 16)
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: wks_11.c,v 1.47 2002/01/05 07:05:28 ogud Exp $ */
+/* $Id: wks_11.c,v 1.48 2002/01/21 01:07:30 marka Exp $ */
/* Reviewed: Fri Mar 17 15:01:49 PST 2000 by explorer */
ISC_FALSE));
isc_buffer_availableregion(target, ®ion);
- if (getquad(token.value.as_pointer, &addr, lexer, callbacks) != 1)
+ if (getquad(DNS_AS_STR(token), &addr, lexer, callbacks) != 1)
RETTOK(DNS_R_BADDOTTEDQUAD);
if (region.length < 4)
return (ISC_R_NOSPACE);
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
- proto = strtol(token.value.as_pointer, &e, 10);
+ proto = strtol(DNS_AS_STR(token), &e, 10);
if (*e == 0)
;
- else if ((pe = getprotobyname(token.value.as_pointer)) != NULL)
+ else if ((pe = getprotobyname(DNS_AS_STR(token))) != NULL)
proto = pe->p_proto;
else
RETTOK(DNS_R_UNKNOWNPROTO);
* Lowercase the service string as some getservbyname() are
* case sensitive and the database is usually in lowercase.
*/
- strncpy(service, token.value.as_pointer, sizeof(service));
+ strncpy(service, DNS_AS_STR(token), sizeof(service));
service[sizeof(service)-1] = '\0';
for (i = strlen(service) - 1; i >= 0; i--)
if (isupper(service[i]&0xff))
service[i] = tolower(service[i]);
- port = strtol(token.value.as_pointer, &e, 10);
+ port = strtol(DNS_AS_STR(token), &e, 10);
if (*e == 0)
;
else if ((se = getservbyname(service, ps)) != NULL)
port = ntohs(se->s_port);
- else if ((se = getservbyname(token.value.as_pointer, ps))
+ else if ((se = getservbyname(DNS_AS_STR(token), ps))
!= NULL)
port = ntohs(se->s_port);
else
/*
* Principal Author: Brian Wellington
- * $Id: dst_api.c,v 1.100 2001/12/18 06:05:39 bwelling Exp $
+ * $Id: dst_api.c,v 1.101 2002/01/21 01:07:31 marka Exp $
*/
#include <config.h>
#include "dst_internal.h"
+#define DST_AS_STR(t) ((t).value.as_textregion.base)
+
static dst_func_t *dst_t_func[DST_MAX_ALGS];
static isc_entropy_t *dst_entropy_pool = NULL;
static unsigned int dst_entropy_flags = 0;
unsigned int opt = ISC_LEXOPT_DNSMULTILINE;
char *newfilename;
unsigned int newfilenamelen;
- isc_textregion_t r;
dns_rdataclass_t rdclass = dns_rdataclass_in;
newfilenamelen = strlen(filename) + 5;
if (token.type != isc_tokentype_string)
BADTOKEN();
dns_fixedname_init(&name);
- isc_buffer_init(&b, token.value.as_pointer,
- strlen(token.value.as_pointer));
- isc_buffer_add(&b, strlen(token.value.as_pointer));
+ isc_buffer_init(&b, DST_AS_STR(token), strlen(DST_AS_STR(token)));
+ isc_buffer_add(&b, strlen(DST_AS_STR(token)));
ret = dns_name_fromtext(dns_fixedname_name(&name), &b, dns_rootname,
ISC_FALSE, NULL);
if (ret != ISC_R_SUCCESS)
if (token.type != isc_tokentype_string)
BADTOKEN();
- r.base = token.value.as_pointer;
- r.length = strlen(r.base);
- ret = dns_rdataclass_fromtext(&rdclass, &r);
+ ret = dns_rdataclass_fromtext(&rdclass, &token.value.as_textregion);
if (ret == ISC_R_SUCCESS)
NEXTTOKEN(lex, opt, &token);
if (token.type != isc_tokentype_string)
BADTOKEN();
- if (strcasecmp(token.value.as_pointer, "KEY") != 0)
+ if (strcasecmp(DST_AS_STR(token), "KEY") != 0)
BADTOKEN();
isc_buffer_init(&b, rdatabuf, sizeof(rdatabuf));
/*
* Principal Author: Brian Wellington
- * $Id: dst_parse.c,v 1.34 2001/11/30 01:59:30 gson Exp $
+ * $Id: dst_parse.c,v 1.35 2002/01/21 01:07:32 marka Exp $
*/
#include <config.h>
#include "dst_parse.h"
#include "dst/result.h"
+#define DST_AS_STR(t) ((t).value.as_textregion.base)
#define PRIVATE_KEY_STR "Private-key-format:"
#define ALGORITHM_STR "Algorithm:"
*/
NEXTTOKEN(lex, opt, &token);
if (token.type != isc_tokentype_string ||
- strcmp(token.value.as_pointer, PRIVATE_KEY_STR) != 0)
+ strcmp(DST_AS_STR(token), PRIVATE_KEY_STR) != 0)
{
ret = DST_R_INVALIDPRIVATEKEY;
goto fail;
NEXTTOKEN(lex, opt, &token);
if (token.type != isc_tokentype_string ||
- ((char *)token.value.as_pointer)[0] != 'v')
+ (DST_AS_STR(token))[0] != 'v')
{
ret = DST_R_INVALIDPRIVATEKEY;
goto fail;
}
- if (sscanf(token.value.as_pointer, "v%d.%d", &major, &minor) != 2)
+ if (sscanf(DST_AS_STR(token), "v%d.%d", &major, &minor) != 2)
{
ret = DST_R_INVALIDPRIVATEKEY;
goto fail;
*/
NEXTTOKEN(lex, opt, &token);
if (token.type != isc_tokentype_string ||
- strcmp(token.value.as_pointer, ALGORITHM_STR) != 0)
+ strcmp(DST_AS_STR(token), ALGORITHM_STR) != 0)
{
ret = DST_R_INVALIDPRIVATEKEY;
goto fail;
}
memset(&priv->elements[n], 0, sizeof(dst_private_element_t));
- tag = find_value(token.value.as_pointer, alg);
+ tag = find_value(DST_AS_STR(token), alg);
if (tag < 0 || TAG_ALG(tag) != alg) {
ret = DST_R_INVALIDPRIVATEKEY;
goto fail;