--- /dev/null
+; Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+;
+; Permission to use, copy, modify, and/or distribute this software for any
+; purpose with or without fee is hereby granted, provided that the above
+; copyright notice and this permission notice appear in all copies.
+;
+; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+; PERFORMANCE OF THIS SOFTWARE.
+
+
+$TTL
+@ SOA ns hostmaster 2011012708 3600 1200 604800 1200
+ NS ns
+ns A 192.0.2.1
+
+ns-and-dname NS ns.ns-and-dname
+ DNAME example.com.
+ns.ns-and-dname A 203.178.141.207
static void
loadctx_destroy(dns_loadctx_t *lctx);
-#define GETTOKEN(lexer, options, token, eol) \
+#define GETTOKENERR(lexer, options, token, eol, err) \
do { \
result = gettoken(lexer, options, token, eol, callbacks); \
switch (result) { \
SETRESULT(lctx, result); \
LOGIT(result); \
read_till_eol = ISC_TRUE; \
+ err \
goto next_line; \
} else \
goto log_and_cleanup; \
goto log_and_cleanup; \
} \
} while (0)
+#define GETTOKEN(lexer, options, token, eol) \
+ GETTOKENERR(lexer, options, token, eol, )
#define COMMITALL \
do { \
if (eol != ISC_TRUE)
if (token->type == isc_tokentype_eol ||
token->type == isc_tokentype_eof) {
+ unsigned long int line;
+ const char *what;
+ const char *file;
+ file = isc_lex_getsourcename(lex);
+ line = isc_lex_getsourceline(lex);
+ if (token->type == isc_tokentype_eol) {
+ line--;
+ what = "line";
+ } else
+ what = "file";
(*callbacks->error)(callbacks,
"dns_master_load: %s:%lu: unexpected end of %s",
- isc_lex_getsourcename(lex),
- isc_lex_getsourceline(lex),
- (token->type ==
- isc_tokentype_eol) ?
- "line" : "file");
+ file, line, what);
return (ISC_R_UNEXPECTEDEND);
}
return (ISC_R_SUCCESS);
finish_origin = ISC_TRUE;
} else if (strcasecmp(DNS_AS_STR(token),
"$TTL") == 0) {
- GETTOKEN(lctx->lex, 0, &token, ISC_FALSE);
+ GETTOKENERR(lctx->lex, 0, &token, ISC_FALSE,
+ lctx->ttl = 0;
+ lctx->default_ttl_known = ISC_TRUE;);
result =
dns_ttl_fromtext(&token.value.as_textregion,
&lctx->ttl);