xref: /minix/external/bsd/bind/dist/lib/dns/include/dns/log.h (revision 00b67f09)
1 /*	$NetBSD: log.h,v 1.8 2015/07/08 17:28:59 christos Exp $	*/
2 
3 /*
4  * Copyright (C) 2004-2007, 2009, 2011-2014  Internet Systems Consortium, Inc. ("ISC")
5  * Copyright (C) 1999-2001, 2003  Internet Software Consortium.
6  *
7  * Permission to use, copy, modify, and/or distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
12  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
16  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /* Id: log.h,v 1.47 2011/10/13 22:48:24 tbox Exp  */
21 
22 /*! \file dns/log.h
23  * \author  Principal Authors: DCL */
24 
25 #ifndef DNS_LOG_H
26 #define DNS_LOG_H 1
27 
28 #include <isc/lang.h>
29 #include <isc/log.h>
30 
31 LIBDNS_EXTERNAL_DATA extern isc_log_t *dns_lctx;
32 LIBDNS_EXTERNAL_DATA extern isc_logcategory_t dns_categories[];
33 LIBDNS_EXTERNAL_DATA extern isc_logmodule_t dns_modules[];
34 
35 #define DNS_LOGCATEGORY_NOTIFY		(&dns_categories[0])
36 #define DNS_LOGCATEGORY_DATABASE	(&dns_categories[1])
37 #define DNS_LOGCATEGORY_SECURITY	(&dns_categories[2])
38 /* DNS_LOGCATEGORY_CONFIG superseded by CFG_LOGCATEGORY_CONFIG */
39 #define DNS_LOGCATEGORY_DNSSEC		(&dns_categories[4])
40 #define DNS_LOGCATEGORY_RESOLVER	(&dns_categories[5])
41 #define DNS_LOGCATEGORY_XFER_IN		(&dns_categories[6])
42 #define DNS_LOGCATEGORY_XFER_OUT	(&dns_categories[7])
43 #define DNS_LOGCATEGORY_DISPATCH	(&dns_categories[8])
44 #define DNS_LOGCATEGORY_LAME_SERVERS	(&dns_categories[9])
45 #define DNS_LOGCATEGORY_DELEGATION_ONLY	(&dns_categories[10])
46 #define DNS_LOGCATEGORY_EDNS_DISABLED	(&dns_categories[11])
47 #define DNS_LOGCATEGORY_RPZ		(&dns_categories[12])
48 #define DNS_LOGCATEGORY_RRL		(&dns_categories[13])
49 #define DNS_LOGCATEGORY_CNAME		(&dns_categories[14])
50 
51 /* Backwards compatibility. */
52 #define DNS_LOGCATEGORY_GENERAL		ISC_LOGCATEGORY_GENERAL
53 
54 #define DNS_LOGMODULE_DB		(&dns_modules[0])
55 #define DNS_LOGMODULE_RBTDB		(&dns_modules[1])
56 #define DNS_LOGMODULE_RBTDB64		(&dns_modules[2])
57 #define DNS_LOGMODULE_RBT		(&dns_modules[3])
58 #define DNS_LOGMODULE_RDATA		(&dns_modules[4])
59 #define DNS_LOGMODULE_MASTER		(&dns_modules[5])
60 #define DNS_LOGMODULE_MESSAGE		(&dns_modules[6])
61 #define DNS_LOGMODULE_CACHE		(&dns_modules[7])
62 #define DNS_LOGMODULE_CONFIG		(&dns_modules[8])
63 #define DNS_LOGMODULE_RESOLVER		(&dns_modules[9])
64 #define DNS_LOGMODULE_ZONE		(&dns_modules[10])
65 #define DNS_LOGMODULE_JOURNAL		(&dns_modules[11])
66 #define DNS_LOGMODULE_ADB		(&dns_modules[12])
67 #define DNS_LOGMODULE_XFER_IN		(&dns_modules[13])
68 #define DNS_LOGMODULE_XFER_OUT		(&dns_modules[14])
69 #define DNS_LOGMODULE_ACL		(&dns_modules[15])
70 #define DNS_LOGMODULE_VALIDATOR		(&dns_modules[16])
71 #define DNS_LOGMODULE_DISPATCH		(&dns_modules[17])
72 #define DNS_LOGMODULE_REQUEST		(&dns_modules[18])
73 #define DNS_LOGMODULE_MASTERDUMP	(&dns_modules[19])
74 #define DNS_LOGMODULE_TSIG		(&dns_modules[20])
75 #define DNS_LOGMODULE_TKEY		(&dns_modules[21])
76 #define DNS_LOGMODULE_SDB		(&dns_modules[22])
77 #define DNS_LOGMODULE_DIFF		(&dns_modules[23])
78 #define DNS_LOGMODULE_HINTS		(&dns_modules[24])
79 #define DNS_LOGMODULE_ACACHE		(&dns_modules[25])
80 #define DNS_LOGMODULE_DLZ		(&dns_modules[26])
81 #define DNS_LOGMODULE_DNSSEC		(&dns_modules[27])
82 #define DNS_LOGMODULE_CRYPTO		(&dns_modules[28])
83 #define DNS_LOGMODULE_PACKETS		(&dns_modules[29])
84 
85 ISC_LANG_BEGINDECLS
86 
87 void
88 dns_log_init(isc_log_t *lctx);
89 /*%
90  * Make the libdns categories and modules available for use with the
91  * ISC logging library.
92  *
93  * Requires:
94  *\li	lctx is a valid logging context.
95  *
96  *\li	dns_log_init() is called only once.
97  *
98  * Ensures:
99  * \li	The categories and modules defined above are available for
100  * 	use by isc_log_usechannnel() and isc_log_write().
101  */
102 
103 void
104 dns_log_setcontext(isc_log_t *lctx);
105 /*%
106  * Make the libdns library use the provided context for logging internal
107  * messages.
108  *
109  * Requires:
110  *\li	lctx is a valid logging context.
111  */
112 
113 ISC_LANG_ENDDECLS
114 
115 #endif /* DNS_LOG_H */
116