1 /*	$NetBSD: dnsconf.h,v 1.4 2014/12/10 04:37:59 christos Exp $	*/
2 
3 /*
4  * Copyright (C) 2009  Internet Systems Consortium, Inc. ("ISC")
5  *
6  * Permission to use, copy, modify, and/or distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /* Id: dnsconf.h,v 1.3 2009/09/02 23:48:02 tbox Exp  */
20 
21 #ifndef IRS_DNSCONF_H
22 #define IRS_DNSCONF_H 1
23 
24 /*! \file
25  *
26  * \brief
27  * The IRS dnsconf module parses an "advanced" configuration file related to
28  * the DNS library, such as trusted keys for DNSSEC validation, and creates
29  * the corresponding configuration objects for the DNS library modules.
30  *
31  * Notes:
32  * This module is very experimental and the configuration syntax or library
33  * interfaces may change in future versions.  Currently, only the
34  * 'trusted-keys' statement is supported, whose syntax is the same as the
35  * same name of statement for named.conf.
36  */
37 
38 #include <irs/types.h>
39 
40 /*%
41  * A compound structure storing DNS key information mainly for DNSSEC
42  * validation.  A dns_key_t object will be created using the 'keyname' and
43  * 'keydatabuf' members with the dst_key_fromdns() function.
44  */
45 typedef struct irs_dnsconf_dnskey {
46 	dns_name_t				*keyname;
47 	isc_buffer_t				*keydatabuf;
48 	ISC_LINK(struct irs_dnsconf_dnskey)	link;
49 } irs_dnsconf_dnskey_t;
50 
51 typedef ISC_LIST(irs_dnsconf_dnskey_t) irs_dnsconf_dnskeylist_t;
52 
53 ISC_LANG_BEGINDECLS
54 
55 isc_result_t
56 irs_dnsconf_load(isc_mem_t *mctx, const char *filename, irs_dnsconf_t **confp);
57 /*%<
58  * Load the "advanced" DNS configuration file 'filename' in the "dns.conf"
59  * format, and create a new irs_dnsconf_t object from the configuration.
60  *
61  * Requires:
62  *
63  *\li	'mctx' is a valid memory context.
64  *
65  *\li	'filename' != NULL
66  *
67  *\li	'confp' != NULL && '*confp' == NULL
68  */
69 
70 void
71 irs_dnsconf_destroy(irs_dnsconf_t **confp);
72 /*%<
73  * Destroy the dnsconf object.
74  *
75  * Requires:
76  *
77  *\li	'*confp' is a valid dnsconf object.
78  *
79  * Ensures:
80  *
81  *\li	*confp == NULL
82  */
83 
84 irs_dnsconf_dnskeylist_t *
85 irs_dnsconf_gettrustedkeys(irs_dnsconf_t *conf);
86 /*%<
87  * Return a list of key information stored in 'conf'.
88  *
89  * Requires:
90  *
91  *\li	'conf' is a valid dnsconf object.
92  */
93 
94 ISC_LANG_ENDDECLS
95 
96 #endif /* IRS_DNSCONF_H */
97