1 /*
2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, you can obtain one at https://mozilla.org/MPL/2.0/.
7  *
8  * See the COPYRIGHT file distributed with this work for additional
9  * information regarding copyright ownership.
10  */
11 
12 #ifndef ISCCFG_KASPCONF_H
13 #define ISCCFG_KASPCONF_H 1
14 
15 #include <isc/lang.h>
16 
17 #include <dns/types.h>
18 
19 #include <isccfg/cfg.h>
20 
21 /***
22  *** Functions
23  ***/
24 
25 ISC_LANG_BEGINDECLS
26 
27 isc_result_t
28 cfg_kasp_fromconfig(const cfg_obj_t *config, const char *name, isc_mem_t *mctx,
29 		    isc_log_t *logctx, dns_kasplist_t *kasplist,
30 		    dns_kasp_t **kaspp);
31 /*%<
32  * Create and configure a KASP. If 'config' is NULL, a built-in configuration
33  * is used, referred to by 'name'. If a 'kasplist' is provided, a lookup
34  * happens and if a KASP already exists with the same name, no new KASP is
35  * created, and no attach to 'kaspp' happens.
36  *
37  * Requires:
38  *
39  *\li  'name' is either NULL, or a valid C string.
40  *
41  *\li  'mctx' is a valid memory context.
42  *
43  *\li  'logctx' is a valid logging context.
44  *
45  *\li  kaspp != NULL && *kaspp == NULL
46  *
47  * Returns:
48  *
49  *\li  #ISC_R_SUCCESS  If creating and configuring the KASP succeeds.
50  *\li  #ISC_R_EXISTS   If 'kasplist' already has a kasp structure with 'name'.
51  *\li  #ISC_R_NOMEMORY
52  *
53  *\li  Other errors are possible.
54  */
55 
56 ISC_LANG_ENDDECLS
57 
58 #endif /* ISCCFG_KASPCONF_H */
59