master.c revision 41f11644387cf54e4affe496c0532165ac41eb87
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (C) 2004-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
8b29fc0b7a13db404f1a13fcfad42c2e7cfbe25bMark Andrews * Copyright (C) 1999-2003 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Permission to use, copy, modify, and/or distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * purpose with or without fee is hereby granted, provided that the above
8b29fc0b7a13db404f1a13fcfad42c2e7cfbe25bMark Andrews * copyright notice and this permission notice appear in all copies.
8b29fc0b7a13db404f1a13fcfad42c2e7cfbe25bMark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
8b29fc0b7a13db404f1a13fcfad42c2e7cfbe25bMark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
8b29fc0b7a13db404f1a13fcfad42c2e7cfbe25bMark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
8b29fc0b7a13db404f1a13fcfad42c2e7cfbe25bMark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
8b29fc0b7a13db404f1a13fcfad42c2e7cfbe25bMark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
8b29fc0b7a13db404f1a13fcfad42c2e7cfbe25bMark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
/* $Id: master.c,v 1.183 2012/01/31 23:47:32 tbox Exp $ */
#include <config.h>
struct dns_loadctx {
unsigned int magic;
void *done_arg;
const char *filename);
unsigned int options;
FILE *f;
void *include_arg;
struct dns_incctx {
int glue_in_use;
int current_in_use;
int origin_in_use;
unsigned int glue_line;
unsigned int current_line;
static isc_result_t
static isc_result_t
static isc_result_t
static isc_result_t
static isc_result_t
static isc_result_t
dns_name_t *, const char *, unsigned int);
static isc_boolean_t
static dns_rdatalist_t *
static dns_rdata_t *
isc_mem_t *);
static isc_result_t
switch (result) { \
case ISC_R_SUCCESS: \
case ISC_R_UNEXPECTED: \
goto insist_and_cleanup; \
goto next_line; \
goto log_and_cleanup; \
goto next_line; \
goto log_and_cleanup; \
#define COMMITALL \
goto insist_and_cleanup; \
goto insist_and_cleanup; \
rdcount = 0; \
rdlcount = 0; \
source); \
#define EXPECTEOL \
goto log_and_cleanup; \
static inline isc_result_t
switch (result) {
case ISC_R_NOMEMORY:
return (ISC_R_NOMEMORY);
return (result);
return (ISC_R_UNEXPECTEDEND);
return (ISC_R_SUCCESS);
if (need_destroy)
goto again;
static isc_result_t
isc_region_t r;
return (ISC_R_NOMEMORY);
for (i = 0; i < NBUFS; i++) {
return (ISC_R_SUCCESS);
static isc_result_t
isc_region_t r;
return (ISC_R_NOMEMORY);
return (result);
goto cleanup_ctx;
switch (format) {
INSIST(0);
case dns_masterformat_text:
case dns_masterformat_raw:
goto cleanup_inc;
return (ISC_R_SUCCESS);
return (result);
unsigned int count = 0;
if (length > 0U) {
length--;
if (length > 0U) {
length--;
if (width > 0)
width--;
count++;
if (length > 0U) {
length--;
if (width > 0)
width--;
count++;
return (count);
static isc_result_t
char *cp;
int delta = 0;
unsigned int width;
name++;
if (r.length == 0)
return (ISC_R_NOSPACE);
return (DNS_R_SYNTAX);
if (n >= sizeof(fmt))
return (ISC_R_NOSPACE);
if (nibblemode)
if (n >= sizeof(numbuf))
return (ISC_R_NOSPACE);
if (r.length == 0)
return (ISC_R_NOSPACE);
if (r.length == 0)
return (ISC_R_NOSPACE);
if (r.length == 0)
return (ISC_R_NOSPACE);
if (r.length == 0)
return (ISC_R_NOSPACE);
if (r.length == 0)
return (ISC_R_NOSPACE);
return (ISC_R_SUCCESS);
static isc_result_t
static isc_result_t
return (result);
static isc_result_t
goto error_cleanup;
goto insist_cleanup;
goto insist_cleanup;
goto error_cleanup;
goto error_cleanup;
0, NULL);
goto error_cleanup;
goto error_cleanup;
goto error_cleanup;
goto error_cleanup;
goto cleanup;
return (result);
*ttlp);
*ttlp = 0;
static isc_result_t
unsigned long line)
return (ISC_R_NOMEMORY);
return (result);
static isc_result_t
int rdlcount = 0;
int rdlcount_save = 0;
int rdatalist_size = 0;
int rdcount = 0;
int rdcount_save = 0;
int rdata_size = 0;
int new_in_use;
unsigned int loop_cnt = 0;
unsigned long line = 0;
unsigned int options = 0;
goto log_and_cleanup;
if (read_till_eol)
if (read_till_eol)
result =
goto insist_and_cleanup;
goto insist_and_cleanup;
if (ttl_offset != 0) {
goto insist_and_cleanup;
goto log_and_cleanup;
goto insist_and_cleanup;
source =
&dump_time64);
dump_time64 = 0;
goto log_and_cleanup;
goto insist_and_cleanup;
goto log_and_cleanup;
goto log_and_cleanup;
rdclass = 0;
== ISC_R_SUCCESS) {
== ISC_R_SUCCESS) {
if (rdclass == 0 &&
== ISC_R_SUCCESS)
goto log_and_cleanup;
goto log_and_cleanup;
goto insist_and_cleanup;
} else if (!explicit_ttl &&
goto bad_class;
goto insist_and_cleanup;
goto insist_and_cleanup;
goto log_and_cleanup;
if (finish_origin) {
if (finish_include) {
goto insist_and_cleanup;
goto insist_and_cleanup;
if (current_has_delegation &&
goto insist_and_cleanup;
rdcount = 0;
rdlcount = 0;
sizeof(namebuf));
goto insist_and_cleanup;
type = 0;
rdclass = 0;
if (initialws) {
goto insist_and_cleanup;
== ISC_R_SUCCESS)
== ISC_R_SUCCESS) {
goto insist_and_cleanup;
if (rdclass == 0 &&
== ISC_R_SUCCESS)
goto insist_and_cleanup;
goto insist_and_cleanup;
sizeof(classname1));
sizeof(classname2));
goto insist_and_cleanup;
goto insist_and_cleanup;
goto log_and_cleanup;
goto insist_and_cleanup;
ISC_TRUE);
if (!ok) {
const char *desc;
goto cleanup;
goto insist_and_cleanup;
sizeof(namebuf));
goto insist_and_cleanup;
covers = 0;
goto insist_and_cleanup;
NULL);
mctx);
goto log_and_cleanup;
link);
rdcount++;
goto insist_and_cleanup;
goto insist_and_cleanup;
if (!done) {
goto cleanup;
return (result);
static isc_result_t
isc_region_t r;
int new_in_use;
return (result);
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
static inline isc_result_t
if (do_read) {
f, NULL);
return (result);
return (ISC_R_RANGE);
return (ISC_R_SUCCESS);
static isc_result_t
unsigned int loop_cnt = 0;
isc_region_t r;
unsigned int rdata_size = 0;
return (result);
return (ISC_R_NOTIMPLEMENTED);
case DNS_RAWFORMAT_VERSION:
return (ISC_R_NOTIMPLEMENTED);
return (result);
goto cleanup;
for (loop_cnt = 0;
loop_cnt++) {
sizeof(totallen));
goto cleanup;
goto cleanup;
goto cleanup;
if (rdcount == 0) {
goto cleanup;
goto cleanup;
goto cleanup;
lctx->f);
goto cleanup;
goto cleanup;
for (i = 0; i < rdcount; i++) {
if (sequential_read &&
NULL, 0);
goto cleanup;
rdcount -= i;
goto continue_read;
goto cleanup;
goto cleanup;
goto cleanup;
for (i = 0; i < rdcount; i++) {
goto cleanup;
if (!done) {
return (result);
format));
return (result);
goto cleanup;
return (result);
format));
return (result);
goto cleanup;
return (DNS_R_CONTINUE);
return (result);
goto cleanup;
goto cleanup;
return (result);
goto cleanup;
goto cleanup;
return (DNS_R_CONTINUE);
return (result);
unsigned int options,
return (result);
goto cleanup;
return (result);
unsigned int options,
return (result);
goto cleanup;
return (DNS_R_CONTINUE);
return (result);
unsigned int options,
return (result);
return (result);
unsigned int options,
return (result);
return (DNS_R_CONTINUE);
return (result);
static dns_rdatalist_t *
int rdlcount = 0;
return (NULL);
rdlcount++;
rdlcount++;
return (new);
static dns_rdata_t *
int rdcount = 0;
return (NULL);
rdcount++;
rdcount++;
return (new);
static isc_uint32_t
return (when);
static isc_result_t
return (ISC_R_SUCCESS);
== ISC_R_SUCCESS);
&dataset));
return (result);
return (ISC_R_SUCCESS);
static isc_boolean_t
return (ISC_FALSE);
return (ISC_TRUE);
return (ISC_FALSE);
static isc_result_t
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);