1 /*
2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
3  *
4  * SPDX-License-Identifier: MPL-2.0
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, you can obtain one at https://mozilla.org/MPL/2.0/.
9  *
10  * See the COPYRIGHT file distributed with this work for additional
11  * information regarding copyright ownership.
12  */
13 
14 #ifndef NAMED_ZONECONF_H
15 #define NAMED_ZONECONF_H 1
16 
17 /*! \file */
18 
19 #include <stdbool.h>
20 
21 #include <isc/lang.h>
22 #include <isc/types.h>
23 
24 #include <isccfg/aclconf.h>
25 #include <isccfg/cfg.h>
26 
27 ISC_LANG_BEGINDECLS
28 
29 isc_result_t
30 named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
31 		     const cfg_obj_t *zconfig, cfg_aclconfctx_t *ac,
32 		     dns_kasplist_t *kasplist, dns_zone_t *zone,
33 		     dns_zone_t *raw);
34 /*%<
35  * Configure or reconfigure a zone according to the named.conf
36  * data.
37  *
38  * The zone origin is not configured, it is assumed to have been set
39  * at zone creation time.
40  *
41  * Require:
42  * \li	'ac' to point to an initialized cfg_aclconfctx_t.
43  * \li	'kasplist' to be initialized.
44  * \li	'zone' to be initialized.
45  */
46 
47 bool
48 named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig,
49 		    const cfg_obj_t *vconfig, const cfg_obj_t *config,
50 		    cfg_aclconfctx_t *actx);
51 /*%<
52  * If 'zone' can be safely reconfigured according to the configuration
53  * data in 'zconfig', return true.  If the configuration data is so
54  * different from the current zone state that the zone needs to be destroyed
55  * and recreated, return false.
56  */
57 
58 bool
59 named_zone_inlinesigning(dns_zone_t *zone, const cfg_obj_t *zconfig,
60 			 const cfg_obj_t *vconfig, const cfg_obj_t *config,
61 			 cfg_aclconfctx_t *actx);
62 /*%<
63  * Determine if zone uses inline-signing. This is true if inline-signing
64  * is set to yes, or if there is a dnssec-policy on a non-dynamic zone.
65  */
66 
67 isc_result_t
68 named_zone_configure_writeable_dlz(dns_dlzdb_t *dlzdatabase, dns_zone_t *zone,
69 				   dns_rdataclass_t rdclass, dns_name_t *name);
70 /*%>
71  * configure a DLZ zone, setting up the database methods and calling
72  * postload to load the origin values
73  *
74  * Require:
75  * \li	'dlzdatabase' to be a valid dlz database
76  * \li	'zone' to be initialized.
77  * \li	'rdclass' to be a valid rdataclass
78  * \li	'name' to be a valid zone origin name
79  */
80 
81 ISC_LANG_ENDDECLS
82 
83 #endif /* NAMED_ZONECONF_H */
84