]>
git.saurik.com Git - apple/network_cmds.git/blob - unbound/daemon/cachedump.h
0f2feabcb7f40352cf319c58d3855f848be45ffb
2 * daemon/cachedump.h - dump the cache to text format.
4 * Copyright (c) 2008, NLnet Labs. All rights reserved.
6 * This software is open source.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
12 * Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
15 * Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
19 * Neither the name of the NLNET LABS nor the names of its contributors may
20 * be used to endorse or promote products derived from this software without
21 * specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 * This file contains functions to read and write the cache(s)
42 * The format of the file is as follows:
45 * EOF -- fixed string "EOF" before end of the file.
53 * ;rrset [nsec_apex] TTL rr_count rrsig_count trust security
54 * resource records, one per line, in zonefile format
55 * rrsig records, one per line, in zonefile format
56 * If the text conversion fails, BADRR is printed on the line.
58 * The Message cache is:
64 * msg name class type flags qdcount ttl security an ns ar
65 * list of rrset references, one per line. If conversion fails, BADREF
67 * name class type flags
69 * Expired cache entries are not printed.
72 #ifndef DAEMON_DUMPCACHE_H
73 #define DAEMON_DUMPCACHE_H
77 * Dump cache(s) to text
78 * @param ssl: to print to
79 * @param worker: worker that is available (buffers, etc) and has
81 * @return false on ssl print error.
83 int dump_cache(SSL
* ssl
, struct worker
* worker
);
86 * Load cache(s) from text
87 * @param ssl: to read from
88 * @param worker: worker that is available (buffers, etc) and has
90 * @return false on ssl error.
92 int load_cache(SSL
* ssl
, struct worker
* worker
);
95 * Print the delegation used to lookup for this name.
96 * @param ssl: to read from
97 * @param worker: worker that is available (buffers, etc) and has
99 * @param nm: name to lookup
100 * @param nmlen: length of name.
101 * @param nmlabs: labels in name.
102 * @return false on ssl error.
104 int print_deleg_lookup(SSL
* ssl
, struct worker
* worker
, uint8_t* nm
,
105 size_t nmlen
, int nmlabs
);
107 #endif /* DAEMON_DUMPCACHE_H */