Merge branch 'vendor/OPENSSL'
[dragonfly.git] / contrib / bind-9.3 / lib / dns / include / dns / nsec.h
1 /*
2  * Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC")
3  * Copyright (C) 1999-2001, 2003  Internet Software Consortium.
4  *
5  * Permission to use, copy, modify, and distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15  * PERFORMANCE OF THIS SOFTWARE.
16  */
17
18 /* $Id: nsec.h,v 1.4.2.1 2004/03/08 02:08:00 marka Exp $ */
19
20 #ifndef DNS_NSEC_H
21 #define DNS_NSEC_H 1
22
23 #include <isc/lang.h>
24
25 #include <dns/types.h>
26 #include <dns/name.h>
27
28 #define DNS_NSEC_BUFFERSIZE (DNS_NAME_MAXWIRE + 8192 + 512)
29
30 ISC_LANG_BEGINDECLS
31
32 isc_result_t
33 dns_nsec_buildrdata(dns_db_t *db, dns_dbversion_t *version,
34                     dns_dbnode_t *node, dns_name_t *target,
35                     unsigned char *buffer, dns_rdata_t *rdata);
36 /*
37  * Build the rdata of a NSEC record.
38  *
39  * Requires:
40  *      buffer  Points to a temporary buffer of at least
41  *              DNS_NSEC_BUFFERSIZE bytes.
42  *      rdata   Points to an initialized dns_rdata_t.
43  *
44  * Ensures:
45  *      *rdata  Contains a valid NSEC rdata.  The 'data' member refers
46  *              to 'buffer'.
47  */
48
49 isc_result_t
50 dns_nsec_build(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node,
51                dns_name_t *target, dns_ttl_t ttl);
52 /*
53  * Build a NSEC record and add it to a database.
54  */
55
56 isc_boolean_t
57 dns_nsec_typepresent(dns_rdata_t *nsec, dns_rdatatype_t type);
58 /*
59  * Determine if a type is marked as present in an NSEC record.
60  *
61  * Requires:
62  *      'nsec' points to a valid rdataset of type NSEC
63  */
64
65 ISC_LANG_ENDDECLS
66
67 #endif /* DNS_NSEC_H */