master.c revision 8d3e74b1683f714a484bbcf73249e8ee470e36d7
/*
* Copyright (C) 1999 Internet Software Consortium.
*
* Permission to use, copy, modify, and 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 INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM 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.
*/
/* $Id: master.c,v 1.8 1999/02/04 06:38:41 marka Exp $ */
#include <config.h>
#include <stdio.h>
#include <string.h>
#include <isc/assertions.h>
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
#include <dns/rdataclass.h>
#include <dns/rdatatype.h>
dns_result_t (*)(dns_name_t *,
void *),
void *);
isc_mem_t *);
do { \
unsigned int __o; \
!= ISC_R_SUCCESS) { \
result = DNS_R_UNEXPECTED; \
goto cleanup; \
} \
goto cleanup; \
} \
} while (0)
void *private),
{
unsigned long ttl = 0;
unsigned long default_ttl = 0;
char *include_file = NULL;
int rdlcount = 0;
int rdlcount_save = 0;
int rdatalist_size = 0;
int rdcount = 0;
int rdcount_save = 0;
int rdata_size = 0;
unsigned char *target_mem = NULL;
int glue_in_use = -1;
int current_in_use = -1;
int origin_in_use = -1;
int new_in_use;
goto cleanup;
goto cleanup;
if (target_mem == NULL) {
goto cleanup;
}
do {
continue;
}
continue; /* blank line */
}
if (read_till_eol)
continue;
if (!current_known) {
goto cleanup;
}
/* still working on the same name */
/* "$" Support */
"$ORIGIN") == 0) {
"$TTL") == 0) {
if (ttl > 0x7fffffff) {
goto cleanup;
}
default_ttl = ttl;
continue;
"$INCLUDE") == 0) {
if (include_file != NULL)
top,
mctx);
if (result != DNS_R_SUCCESS)
goto cleanup;
continue;
}
}
if (!name_in_use[new_in_use])
break;
if (result != DNS_R_SUCCESS)
goto cleanup;
if (finish_origin) {
if (origin_in_use != -1)
continue;
}
if (finish_include) {
top,
&new_name,
mctx);
if (result != DNS_R_SUCCESS)
goto cleanup;
continue;
}
/*
* commit glue and pop stacks
*/
&new_name) != 0) {
if (result != DNS_R_SUCCESS)
goto cleanup;
if (glue_in_use != -1)
glue_in_use = -1;
}
if (!in_glue && (!current_known ||
if (current_has_delegation &&
} else {
if (result != DNS_R_SUCCESS)
goto cleanup;
rdcount = 0;
rdlcount = 0;
if (current_in_use != -1)
= ISC_FALSE;
}
}
} else {
goto cleanup;
}
type = 0;
class = 0;
if (ttl > 0x7fffffff) {
goto cleanup;
}
} else if (!ttl_known && !default_ttl_known) {
goto cleanup;
} else if (default_ttl_known)
ttl = default_ttl;
goto cleanup;
}
== DNS_R_SUCCESS)
goto cleanup;
}
if (result != DNS_R_SUCCESS)
goto cleanup;
goto cleanup;
}
(*soacount)++;
}
(*nscount)++;
}
if (in_glue)
else
break;
}
if (rdlcount == rdatalist_size) {
mctx);
if (new_rdatalist == NULL) {
goto cleanup;
}
rdatalist_size += 32;
}
if (in_glue)
else
}
if (rdcount == rdata_size) {
goto cleanup;
}
rdata_size += 512;
}
if (result != DNS_R_SUCCESS)
goto cleanup;
rdcount++;
/* We must have at least 64k as rdlen is 16 bits. */
if (result != DNS_R_SUCCESS)
goto cleanup;
if (result != DNS_R_SUCCESS)
goto cleanup;
rdcount = 0;
rdlcount = 0;
if (glue_in_use != -1)
glue_in_use = -1;
}
} while (!done);
if (result != DNS_R_SUCCESS)
goto cleanup;
if (result != DNS_R_SUCCESS)
goto cleanup;
}
rdatalist_size * sizeof *rdatalist);
if (target_mem != NULL)
if (include_file != NULL)
return (result);
}
static dns_rdatalist_t *
{
int rdlcount = 0;
return (NULL);
}
rdlcount++;
}
}
rdlcount++;
}
return (new);
}
static dns_rdata_t *
{
int rdcount = 0;
return (NULL);
/* copy current relinking */
}
rdcount++;
}
}
/* copy glue relinking */
}
rdcount++;
}
}
return (new);
}
static dns_result_t
void *private)
{
if (result != DNS_R_SUCCESS)
return (result);
}
return (DNS_R_SUCCESS);
}
static isc_boolean_t
/* find NS rrset */
break;
}
return (ISC_FALSE);
return (ISC_TRUE);
}
return (ISC_FALSE);
}