/*
* Copyright (C) 2004-2008, 2012 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* 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.
*/
/* $Id$ */
#ifndef DNS_MASTER_H
/***
*** Imports
***/
#include <stdio.h>
/*
* Flags to be passed in the 'options' argument in the functions below.
*/
* Check NS records to see
* if they are an address
*/
* Treat DNS_MASTER_CHECKNS
* matches as fatal
*/
/*
* Structures that implement the "raw" format for master dump.
* These are provided for a reference purpose only; in the actual
* is always "packed", regardless of the hardware architecture.
*/
#define DNS_RAWFORMAT_VERSION 0
/* Common header */
typedef struct {
* dns_masterformat_raw */
* extensions */
* (currently unused)
*/
/* The structure for each RRset */
typedef struct {
* RRset, including the
* "header" part */
/* followed by encoded owner name, and then rdata */
/***
*** Function
***/
dns_master_loadfile(const char *master_file,
unsigned int options,
dns_master_loadfile2(const char *master_file,
unsigned int options,
dns_master_loadfile3(const char *master_file,
unsigned int options,
unsigned int options,
unsigned int options,
unsigned int options,
dns_master_loadfileinc(const char *master_file,
unsigned int options,
dns_master_loadfileinc2(const char *master_file,
unsigned int options,
dns_master_loadfileinc3(const char *master_file,
unsigned int options,
unsigned int options,
unsigned int options,
unsigned int options,
/*%<
* Loads a RFC1305 master file from a file, stream, buffer, or existing
* lexer into rdatasets and then calls 'callbacks->commit' to commit the
* rdatasets. Rdata memory belongs to dns_master_load and will be
* reused / released when the callback completes. dns_load_master will
* abort if callbacks->commit returns any value other than ISC_R_SUCCESS.
*
* If 'DNS_MASTER_AGETTL' is set and the master file contains one or more
* $DATE directives, the TTLs of the data will be aged accordingly.
*
* 'callbacks->commit' is assumed to call 'callbacks->error' or
* 'callbacks->warn' to generate any error messages required.
*
* 'done' is called with 'done_arg' and a result code when the loading
* is completed or has failed. If the initial setup fails 'done' is
* not called.
*
* 'resign' the number of seconds before a RRSIG expires that it should
* be re-signed. 0 is used if not provided.
*
* Requires:
*\li 'master_file' points to a valid string.
*\li 'lexer' points to a valid lexer.
*\li 'top' points to a valid name.
*\li 'origin' points to a valid name.
*\li 'callbacks->commit' points to a valid function.
*\li 'callbacks->error' points to a valid function.
*\li 'callbacks->warn' points to a valid function.
*\li 'mctx' points to a valid memory context.
*\li 'task' and 'done' to be valid.
*\li 'lmgr' to be valid.
*\li 'ctxp != NULL && ctxp == NULL'.
*
* Returns:
*\li ISC_R_SUCCESS upon successfully loading the master file.
*\li ISC_R_SEENINCLUDE upon successfully loading the master file with
* a $INCLUDE statement.
*\li ISC_R_NOMEMORY out of memory.
*\li ISC_R_UNEXPECTEDEND expected to be able to read a input token and
* there was not one.
*\li ISC_R_UNEXPECTED
*\li DNS_R_NOOWNER failed to specify a ownername.
*\li DNS_R_NOTTL failed to specify a ttl.
*\li DNS_R_BADCLASS record class did not match zone class.
*\li DNS_R_CONTINUE load still in progress (dns_master_load*inc() only).
*\li Any dns_rdata_fromtext() error code.
*\li Any error code from callbacks->commit().
*/
void
/*%<
* Detach from the load context.
*
* Requires:
*\li '*ctxp' to be valid.
*
* Ensures:
*\li '*ctxp == NULL'
*/
void
/*%<
* Attach to the load context.
*
* Requires:
*\li 'source' to be valid.
*\li 'target != NULL && *target == NULL'.
*/
void
/*%<
* Cancel loading the zone file associated with this load context.
*
* Requires:
*\li 'ctx' to be valid
*/
#endif /* DNS_MASTER_H */