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 #include <stdbool.h>
15 
16 #include <isc/lang.h>
17 #include <isc/types.h>
18 
19 #include <dns/db.h>
20 #include <dns/types.h>
21 
22 #ifndef DNS_PRIVATE_H
23 #define DNS_PRIVATE_H
24 
25 ISC_LANG_BEGINDECLS
26 
27 isc_result_t
28 dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
29 		   dns_rdatatype_t privatetype, bool *build_nsec,
30 		   bool *build_nsec3);
31 /*%<
32  * Examine the NSEC, NSEC3PARAM and privatetype RRsets at the apex of the
33  * database to determine which of NSEC or NSEC3 chains we are currently
34  * maintaining.  In normal operations only one of NSEC or NSEC3 is being
35  * maintained but when we are transitiong between NSEC and NSEC3 we need
36  * to update both sets of chains.  If 'privatetype' is zero then the
37  * privatetype RRset will not be examined.
38  *
39  * Requires:
40  * \li	'db' is valid.
41  * \li	'version' is valid or NULL.
42  * \li	'build_nsec' is a pointer to a bool or NULL.
43  * \li	'build_nsec3' is a pointer to a bool or NULL.
44  *
45  * Returns:
46  * \li 	ISC_R_SUCCESS, 'build_nsec' and 'build_nsec3' will be valid.
47  * \li	other on error
48  */
49 
50 isc_result_t
51 dns_private_totext(dns_rdata_t *privaterdata, isc_buffer_t *buffer);
52 /*%<
53  * Convert a private-type RR 'privaterdata' to human-readable form,
54  * and place the result in 'buffer'.  The text should indicate
55  * which action the private-type record specifies and whether the
56  * action has been completed.
57  *
58  * Requires:
59  * \li	'privaterdata' is a valid rdata containing at least five bytes
60  * \li	'buffer' is a valid buffer
61  *
62  * Returns:
63  * \li 	ISC_R_SUCCESS
64  * \li	other on error
65  */
66 
67 ISC_LANG_ENDDECLS
68 
69 #endif /* ifndef DNS_PRIVATE_H */
70