log.h revision 5fe5a0c02634eaadfcbc3528bf2c184557110a3b
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence/*
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington * Copyright (C) 1999, 2000 Internet Software Consortium.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence *
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * Permission to use, copy, modify, and distribute this software for any
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * purpose with or without fee is hereby granted, provided that the above
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * copyright notice and this permission notice appear in all copies.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence *
15a44745412679c30a6d022733925af70a38b715David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
15a44745412679c30a6d022733925af70a38b715David Lawrence * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
15a44745412679c30a6d022733925af70a38b715David Lawrence * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
15a44745412679c30a6d022733925af70a38b715David Lawrence * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
15a44745412679c30a6d022733925af70a38b715David Lawrence * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15a44745412679c30a6d022733925af70a38b715David Lawrence * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
15a44745412679c30a6d022733925af70a38b715David Lawrence * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
15a44745412679c30a6d022733925af70a38b715David Lawrence * SOFTWARE.
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence */
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence/* $Id: log.h,v 1.13 2000/03/23 00:53:45 gson Exp $ */
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence/* Principal Authors: DCL */
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence#ifndef DNS_LOG_H
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence#define DNS_LOG_H 1
6b7257f756eb0530cdf54df9a7fab8d51a5001c3David Lawrence
6b7257f756eb0530cdf54df9a7fab8d51a5001c3David Lawrence#include <isc/log.h>
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#include <dns/result.h>
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian WellingtonISC_LANG_BEGINDECLS
ce2be9b7211ab5bacaa10fe74ef35def3a3f6089David Lawrence
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrenceextern isc_log_t *dns_lctx;
73a691c373488e4f70387a62462cd8ce0d991705David Lawrenceextern isc_logcategory_t dns_categories[];
8f66dad9393ae0724f758c4a51e06ff55c2d1219Brian Wellingtonextern isc_logmodule_t dns_modules[];
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence
f96b41064bcd427d8125a096fd646c1f068d8ed7David Lawrence#define DNS_LOGCATEGORY_NOTIFY (&dns_categories[0])
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGCATEGORY_DATABASE (&dns_categories[1])
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence#define DNS_LOGCATEGORY_SECURITY (&dns_categories[2])
f96b41064bcd427d8125a096fd646c1f068d8ed7David Lawrence#define DNS_LOGCATEGORY_CONFIG (&dns_categories[3])
e19501436a92cd48eba2ff47d90fa49c661ec8d8Brian Wellington/* Unused slot */
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence#define DNS_LOGCATEGORY_RESOLVER (&dns_categories[5])
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence#define DNS_LOGCATEGORY_XFER_IN (&dns_categories[6])
8f66dad9393ae0724f758c4a51e06ff55c2d1219Brian Wellington#define DNS_LOGCATEGORY_XFER_OUT (&dns_categories[7])
3db78e0855a8dfc162180880cd70d9c1a03d9301David Lawrence
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington/* Backwards compatibility. */
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGCATEGORY_GENERAL ISC_LOGCATEGORY_GENERAL
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGMODULE_DB (&dns_modules[0])
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGMODULE_RBTDB (&dns_modules[1])
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGMODULE_RBTDB64 (&dns_modules[2])
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGMODULE_RBT (&dns_modules[3])
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGMODULE_RDATA (&dns_modules[4])
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGMODULE_MASTER (&dns_modules[5])
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence#define DNS_LOGMODULE_MESSAGE (&dns_modules[6])
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGMODULE_CACHE (&dns_modules[7])
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGMODULE_CONFIG (&dns_modules[8])
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGMODULE_RESOLVER (&dns_modules[9])
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGMODULE_ZONE (&dns_modules[10])
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGMODULE_JOURNAL (&dns_modules[11])
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGMODULE_ADB (&dns_modules[12])
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGMODULE_XFER_IN (&dns_modules[13])
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGMODULE_XFER_OUT (&dns_modules[14])
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington#define DNS_LOGMODULE_ACL (&dns_modules[15])
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellingtonvoid
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellingtondns_log_init(isc_log_t *lctx);
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence/*
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence * Make the libdns.a categories and modules available for use with the
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence * ISC logging library.
4cd765650776027d05fe7fca248478918e02e63bDavid Lawrence *
73a691c373488e4f70387a62462cd8ce0d991705David Lawrence * Requires:
73a691c373488e4f70387a62462cd8ce0d991705David Lawrence * lctx is a valid logging context.
87983da955bf63128de85d180359bdc418516c3cDavid Lawrence *
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington * dns_log_init() is called only once.
73a691c373488e4f70387a62462cd8ce0d991705David Lawrence *
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington * Ensures:
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington * The catgories and modules defined above are available for
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington * use by isc_log_usechannnel() and isc_log_write().
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington */
1d92d8a2456b23842a649b6104c60a9d6ea25333Brian Wellington
30a4d5b0c23eb7a73d9635a98250560437a42d59David LawrenceISC_LANG_ENDDECLS
71ca6e64b4d208a090d255eb64c24f945e615ea0Brian Wellington
73a691c373488e4f70387a62462cd8ce0d991705David Lawrence#endif /* DNS_LOG_H */
73a691c373488e4f70387a62462cd8ce0d991705David Lawrence