2 * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 1999-2001 Internet Software Consortium.
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.
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.
18 /* $Id: ncache.h,v 1.12.2.1 2004/03/09 06:11:19 marka Exp $ */
21 #define DNS_NCACHE_H 1
33 * The caller must ensure any required synchronization.
36 * No anticipated impact.
42 * No anticipated impact.
49 #include <isc/stdtime.h>
51 #include <dns/types.h>
56 dns_ncache_add(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
57 dns_rdatatype_t covers, isc_stdtime_t now, dns_ttl_t maxttl,
58 dns_rdataset_t *addedrdataset);
60 * Convert the authority data from 'message' into a negative cache
61 * rdataset, and store it in 'cache' at 'node' with a TTL limited to
64 * The 'covers' argument is the RR type whose nonexistence we are caching,
65 * or dns_rdatatype_any when caching a NXDOMAIN response.
68 * If 'addedrdataset' is not NULL, then it will be attached to the added
69 * rdataset. See dns_db_addrdataset() for more details.
72 * 'message' is a valid message with a properly formatting negative cache
75 * The requirements of dns_db_addrdataset() apply to 'cache', 'node',
76 * 'now', and 'addedrdataset'.
82 * Any result code of dns_db_addrdataset() is a possible result code
83 * of dns_ncache_add().
87 dns_ncache_towire(dns_rdataset_t *rdataset, dns_compress_t *cctx,
88 isc_buffer_t *target, unsigned int *countp);
90 * Convert the negative caching rdataset 'rdataset' to wire format,
91 * compressing names as specified in 'cctx', and storing the result in
95 * The number of RRs added to target will be added to *countp.
98 * 'rdataset' is a valid negative caching rdataset.
100 * 'rdataset' is not empty.
102 * 'countp' is a valid pointer.
105 * On a return of ISC_R_SUCCESS, 'target' contains a wire format
106 * for the data contained in 'rdataset'. Any error return leaves
107 * the buffer unchanged.
109 * *countp has been incremented by the number of RRs added to
113 * ISC_R_SUCCESS - all ok
114 * ISC_R_NOSPACE - 'target' doesn't have enough room
116 * Any error returned by dns_rdata_towire(), dns_rdataset_next(),
122 #endif /* DNS_NCACHE_H */