globals.h 3.8 KB
Newer Older
Bob Halley's avatar
add  
Bob Halley committed
1
/*
Mark Andrews's avatar
Mark Andrews committed
2
 * Copyright (C) 2004-2006  Internet Systems Consortium, Inc. ("ISC")
Mark Andrews's avatar
Mark Andrews committed
3
 * Copyright (C) 1999-2003  Internet Software Consortium.
4
 *
Bob Halley's avatar
add  
Bob Halley committed
5 6 7
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
8
 *
Mark Andrews's avatar
Mark Andrews committed
9 10 11 12 13 14 15
 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
Bob Halley's avatar
add  
Bob Halley committed
16 17
 */

18
/* $Id: globals.h,v 1.69 2006/12/21 06:02:30 marka Exp $ */
David Lawrence's avatar
David Lawrence committed
19

20 21
#ifndef NAMED_GLOBALS_H
#define NAMED_GLOBALS_H 1
Bob Halley's avatar
add  
Bob Halley committed
22

23 24
/*! \file */

Bob Halley's avatar
add  
Bob Halley committed
25
#include <isc/rwlock.h>
Andreas Gustafsson's avatar
Andreas Gustafsson committed
26
#include <isc/log.h>
27
#include <isc/net.h>
28
#include <isc/mib.h>
Bob Halley's avatar
add  
Bob Halley committed
29

30 31
#include <isccfg/cfg.h>

32 33
#include <dns/zone.h>

34
#include <named/types.h>
Bob Halley's avatar
add  
Bob Halley committed
35 36 37 38 39 40 41 42 43 44 45 46

#undef EXTERN
#undef INIT
#ifdef NS_MAIN
#define EXTERN
#define INIT(v)	= (v)
#else
#define EXTERN extern
#define INIT(v)
#endif

EXTERN isc_mem_t *		ns_g_mctx		INIT(NULL);
47
EXTERN unsigned int		ns_g_cpus		INIT(0);
Bob Halley's avatar
add  
Bob Halley committed
48
EXTERN isc_taskmgr_t *		ns_g_taskmgr		INIT(NULL);
49
EXTERN dns_dispatchmgr_t *	ns_g_dispatchmgr	INIT(NULL);
50
EXTERN isc_entropy_t *		ns_g_entropy		INIT(NULL);
51
EXTERN isc_entropy_t *		ns_g_fallbackentropy	INIT(NULL);
52
EXTERN isc_mib_t *		ns_g_mib		INIT(NULL);
53

Bob Halley's avatar
add  
Bob Halley committed
54 55 56 57 58 59 60
/*
 * XXXRTH  We're going to want multiple timer managers eventually.  One
 *         for really short timers, another for client timers, and one
 *         for zone timers.
 */
EXTERN isc_timermgr_t *		ns_g_timermgr		INIT(NULL);
EXTERN isc_socketmgr_t *	ns_g_socketmgr		INIT(NULL);
61
EXTERN cfg_parser_t *		ns_g_parser		INIT(NULL);
David Lawrence's avatar
David Lawrence committed
62
EXTERN const char *		ns_g_version		INIT(VERSION);
63
EXTERN in_port_t		ns_g_port		INIT(0);
64
EXTERN in_port_t		lwresd_g_listenport	INIT(0);
Bob Halley's avatar
add  
Bob Halley committed
65

66
EXTERN ns_server_t *		ns_g_server		INIT(NULL);
67 68

EXTERN isc_boolean_t		ns_g_lwresdonly		INIT(ISC_FALSE);
69

70 71 72 73 74 75 76
/*
 * Logging.
 */
EXTERN isc_log_t *		ns_g_lctx		INIT(NULL);
EXTERN isc_logcategory_t *	ns_g_categories		INIT(NULL);
EXTERN isc_logmodule_t *	ns_g_modules		INIT(NULL);
EXTERN unsigned int		ns_g_debuglevel		INIT(0);
77 78

/*
79
 * Current configuration information.
80
 */
81
EXTERN cfg_obj_t *		ns_g_config		INIT(NULL);
82
EXTERN const cfg_obj_t *	ns_g_defaults		INIT(NULL);
83 84
EXTERN const char *		ns_g_conffile		INIT(NS_SYSCONFDIR
							     "/named.conf");
Mark Andrews's avatar
Mark Andrews committed
85 86
EXTERN const char *		ns_g_keyfile		INIT(NS_SYSCONFDIR
							     "/rndc.key");
87 88 89 90
EXTERN const char *		lwresd_g_conffile	INIT(NS_SYSCONFDIR
							     "/lwresd.conf");
EXTERN const char *		lwresd_g_resolvconffile	INIT("/etc"
							     "/resolv.conf");
91
EXTERN isc_boolean_t		ns_g_conffileset	INIT(ISC_FALSE);
92
EXTERN isc_boolean_t		lwresd_g_useresolvconf	INIT(ISC_FALSE);
93
EXTERN isc_uint16_t		ns_g_udpsize		INIT(4096);
Bob Halley's avatar
add  
Bob Halley committed
94

95 96 97 98 99 100 101 102
/*
 * Initial resource limits.
 */
EXTERN isc_resourcevalue_t	ns_g_initstacksize	INIT(0);
EXTERN isc_resourcevalue_t	ns_g_initdatasize	INIT(0);
EXTERN isc_resourcevalue_t	ns_g_initcoresize	INIT(0);
EXTERN isc_resourcevalue_t	ns_g_initopenfiles	INIT(0);

Bob Halley's avatar
Bob Halley committed
103 104 105 106
/*
 * Misc.
 */
EXTERN isc_boolean_t		ns_g_coreok		INIT(ISC_TRUE);
107 108
EXTERN const char *		ns_g_chrootdir		INIT(NULL);
EXTERN isc_boolean_t		ns_g_foreground		INIT(ISC_FALSE);
109
EXTERN isc_boolean_t		ns_g_logstderr		INIT(ISC_FALSE);
110

David Lawrence's avatar
David Lawrence committed
111
EXTERN const char *		ns_g_defaultpidfile 	INIT(NS_LOCALSTATEDIR
112
							     "/run/named.pid");
113
EXTERN const char *		lwresd_g_defaultpidfile INIT(NS_LOCALSTATEDIR
David Lawrence's avatar
David Lawrence committed
114
							    "/run/lwresd.pid");
Bob Halley's avatar
Bob Halley committed
115
EXTERN const char *		ns_g_username		INIT(NULL);
Bob Halley's avatar
Bob Halley committed
116

Michael Graff's avatar
Michael Graff committed
117
EXTERN int			ns_g_listen		INIT(3);
118
EXTERN isc_time_t		ns_g_boottime;
Michael Graff's avatar
Michael Graff committed
119

Bob Halley's avatar
add  
Bob Halley committed
120 121 122
#undef EXTERN
#undef INIT

123
#endif /* NAMED_GLOBALS_H */