1 /*	$NetBSD: private.h,v 1.6 2022/09/23 12:15:30 christos Exp $	*/
2 
3 /*
4  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
5  *
6  * SPDX-License-Identifier: MPL-2.0
7  *
8  * This Source Code Form is subject to the terms of the Mozilla Public
9  * License, v. 2.0. If a copy of the MPL was not distributed with this
10  * file, you can obtain one at https://mozilla.org/MPL/2.0/.
11  *
12  * See the COPYRIGHT file distributed with this work for additional
13  * information regarding copyright ownership.
14  */
15 
16 #include <stdbool.h>
17 
18 #include <isc/lang.h>
19 #include <isc/types.h>
20 
21 #include <dns/db.h>
22 #include <dns/types.h>
23 
24 #ifndef DNS_PRIVATE_H
25 #define DNS_PRIVATE_H
26 
27 ISC_LANG_BEGINDECLS
28 
29 isc_result_t
30 dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
31 		   dns_rdatatype_t privatetype, bool *build_nsec,
32 		   bool *build_nsec3);
33 /*%<
34  * Examine the NSEC, NSEC3PARAM and privatetype RRsets at the apex of the
35  * database to determine which of NSEC or NSEC3 chains we are currently
36  * maintaining.  In normal operations only one of NSEC or NSEC3 is being
37  * maintained but when we are transitiong between NSEC and NSEC3 we need
38  * to update both sets of chains.  If 'privatetype' is zero then the
39  * privatetype RRset will not be examined.
40  *
41  * Requires:
42  * \li	'db' is valid.
43  * \li	'version' is valid or NULL.
44  * \li	'build_nsec' is a pointer to a bool or NULL.
45  * \li	'build_nsec3' is a pointer to a bool or NULL.
46  *
47  * Returns:
48  * \li 	ISC_R_SUCCESS, 'build_nsec' and 'build_nsec3' will be valid.
49  * \li	other on error
50  */
51 
52 isc_result_t
53 dns_private_totext(dns_rdata_t *privaterdata, isc_buffer_t *buffer);
54 /*%<
55  * Convert a private-type RR 'privaterdata' to human-readable form,
56  * and place the result in 'buffer'.  The text should indicate
57  * which action the private-type record specifies and whether the
58  * action has been completed.
59  *
60  * Requires:
61  * \li	'privaterdata' is a valid rdata containing at least five bytes
62  * \li	'buffer' is a valid buffer
63  *
64  * Returns:
65  * \li 	ISC_R_SUCCESS
66  * \li	other on error
67  */
68 
69 ISC_LANG_ENDDECLS
70 
71 #endif /* ifndef DNS_PRIVATE_H */
72