1135446Strhodes/*
2254897Serwin * Copyright (C) 2004-2007, 2010, 2011  Internet Systems Consortium, Inc. ("ISC")
3135446Strhodes * Copyright (C) 1999-2002  Internet Software Consortium.
4135446Strhodes *
5193149Sdougb * Permission to use, copy, modify, and/or distribute this software for any
6135446Strhodes * purpose with or without fee is hereby granted, provided that the above
7135446Strhodes * copyright notice and this permission notice appear in all copies.
8135446Strhodes *
9135446Strhodes * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10135446Strhodes * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11135446Strhodes * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12135446Strhodes * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13135446Strhodes * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14135446Strhodes * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15135446Strhodes * PERFORMANCE OF THIS SOFTWARE.
16135446Strhodes */
17135446Strhodes
18254897Serwin/* $Id: zoneconf.h,v 1.30 2011/08/30 23:46:51 tbox Exp $ */
19135446Strhodes
20135446Strhodes#ifndef NS_ZONECONF_H
21135446Strhodes#define NS_ZONECONF_H 1
22135446Strhodes
23170222Sdougb/*! \file */
24170222Sdougb
25135446Strhodes#include <isc/lang.h>
26135446Strhodes#include <isc/types.h>
27135446Strhodes
28170222Sdougb#include <isccfg/aclconf.h>
29135446Strhodes#include <isccfg/cfg.h>
30135446Strhodes
31135446StrhodesISC_LANG_BEGINDECLS
32135446Strhodes
33135446Strhodesisc_result_t
34165071Sdougbns_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
35170222Sdougb		  const cfg_obj_t *zconfig, cfg_aclconfctx_t *ac,
36254897Serwin		  dns_zone_t *zone, dns_zone_t *raw);
37170222Sdougb/*%<
38135446Strhodes * Configure or reconfigure a zone according to the named.conf
39135446Strhodes * data in 'cctx' and 'czone'.
40135446Strhodes *
41135446Strhodes * The zone origin is not configured, it is assumed to have been set
42135446Strhodes * at zone creation time.
43135446Strhodes *
44135446Strhodes * Require:
45170222Sdougb * \li	'lctx' to be initialized or NULL.
46170222Sdougb * \li	'cctx' to be initialized or NULL.
47170222Sdougb * \li	'ac' to point to an initialized ns_aclconfctx_t.
48170222Sdougb * \li	'czone' to be initialized.
49170222Sdougb * \li	'zone' to be initialized.
50135446Strhodes */
51135446Strhodes
52135446Strhodesisc_boolean_t
53165071Sdougbns_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig);
54170222Sdougb/*%<
55135446Strhodes * If 'zone' can be safely reconfigured according to the configuration
56135446Strhodes * data in 'zconfig', return ISC_TRUE.  If the configuration data is so
57135446Strhodes * different from the current zone state that the zone needs to be destroyed
58135446Strhodes * and recreated, return ISC_FALSE.
59135446Strhodes */
60135446Strhodes
61224092Sdougb
62224092Sdougbisc_result_t
63224092Sdougbns_zone_configure_writeable_dlz(dns_dlzdb_t *dlzdatabase, dns_zone_t *zone,
64224092Sdougb				dns_rdataclass_t rdclass, dns_name_t *name);
65224092Sdougb/*%>
66224092Sdougb * configure a DLZ zone, setting up the database methods and calling
67224092Sdougb * postload to load the origin values
68224092Sdougb *
69224092Sdougb * Require:
70224092Sdougb * \li	'dlzdatabase' to be a valid dlz database
71224092Sdougb * \li	'zone' to be initialized.
72224092Sdougb * \li	'rdclass' to be a valid rdataclass
73224092Sdougb * \li	'name' to be a valid zone origin name
74224092Sdougb */
75224092Sdougb
76135446StrhodesISC_LANG_ENDDECLS
77135446Strhodes
78135446Strhodes#endif /* NS_ZONECONF_H */
79