PageRenderTime 35ms CodeModel.GetById 25ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/contrib/bind9/lib/dns/log.c

https://bitbucket.org/freebsd/freebsd-head/
C | 100 lines | 61 code | 12 blank | 27 comment | 1 complexity | 51e4a57988352906601829de78463d9b MD5 | raw file
  1/*
  2 * Copyright (C) 2004-2007, 2009, 2011, 2012  Internet Systems Consortium, Inc. ("ISC")
  3 * Copyright (C) 1999-2001, 2003  Internet Software Consortium.
  4 *
  5 * Permission to use, copy, modify, and/or 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$ */
 19
 20/*! \file */
 21
 22/* Principal Authors: DCL */
 23
 24#include <config.h>
 25
 26#include <isc/util.h>
 27
 28#include <dns/log.h>
 29
 30/*%
 31 * When adding a new category, be sure to add the appropriate
 32 * \#define to <dns/log.h>.
 33 */
 34LIBDNS_EXTERNAL_DATA isc_logcategory_t dns_categories[] = {
 35	{ "notify", 	0 },
 36	{ "database", 	0 },
 37	{ "security", 	0 },
 38	{ "_placeholder", 0 },
 39	{ "dnssec",	0 },
 40	{ "resolver",	0 },
 41	{ "xfer-in",	0 },
 42	{ "xfer-out",	0 },
 43	{ "dispatch",	0 },
 44	{ "lame-servers", 0 },
 45	{ "delegation-only", 0 },
 46	{ "edns-disabled", 0 },
 47	{ "rpz",	0 },
 48	{ NULL, 	0 }
 49};
 50
 51/*%
 52 * When adding a new module, be sure to add the appropriate
 53 * \#define to <dns/log.h>.
 54 */
 55LIBDNS_EXTERNAL_DATA isc_logmodule_t dns_modules[] = {
 56	{ "dns/db",	 	0 },
 57	{ "dns/rbtdb", 		0 },
 58	{ "dns/rbtdb64", 	0 },
 59	{ "dns/rbt", 		0 },
 60	{ "dns/rdata", 		0 },
 61	{ "dns/master", 	0 },
 62	{ "dns/message", 	0 },
 63	{ "dns/cache", 		0 },
 64	{ "dns/config",		0 },
 65	{ "dns/resolver",	0 },
 66	{ "dns/zone",		0 },
 67	{ "dns/journal",	0 },
 68	{ "dns/adb",		0 },
 69	{ "dns/xfrin",		0 },
 70	{ "dns/xfrout",		0 },
 71	{ "dns/acl",		0 },
 72	{ "dns/validator",	0 },
 73	{ "dns/dispatch",	0 },
 74	{ "dns/request",	0 },
 75	{ "dns/masterdump",	0 },
 76	{ "dns/tsig",		0 },
 77	{ "dns/tkey",		0 },
 78	{ "dns/sdb",		0 },
 79	{ "dns/diff",		0 },
 80	{ "dns/hints",		0 },
 81	{ "dns/acache",		0 },
 82	{ "dns/dlz",		0 },
 83	{ "dns/dnssec",		0 },
 84	{ NULL, 		0 }
 85};
 86
 87LIBDNS_EXTERNAL_DATA isc_log_t *dns_lctx = NULL;
 88
 89void
 90dns_log_init(isc_log_t *lctx) {
 91	REQUIRE(lctx != NULL);
 92
 93	isc_log_registercategories(lctx, dns_categories);
 94	isc_log_registermodules(lctx, dns_modules);
 95}
 96
 97void
 98dns_log_setcontext(isc_log_t *lctx) {
 99	dns_lctx = lctx;
100}