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