globals.h 5.42 KB
Newer Older
Bob Halley's avatar
add  
Bob Halley committed
1
/*
Tinderbox User's avatar
Tinderbox User committed
2
 * Copyright (C) 2004-2013  Internet Systems Consortium, Inc. ("ISC")
Mark Andrews's avatar
Mark Andrews committed
3
 * Copyright (C) 1999-2003  Internet Software Consortium.
4
 *
Automatic Updater's avatar
Automatic Updater committed
5
 * Permission to use, copy, modify, and/or distribute this software for any
Bob Halley's avatar
add  
Bob Halley committed
6 7
 * 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.92 2011/11/09 18:44:04 each 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>
Bob Halley's avatar
add  
Bob Halley committed
28

29
#include <isccfg/aclconf.h>
30 31
#include <isccfg/cfg.h>

Evan Hunt's avatar
Evan Hunt committed
32
#include <dns/acl.h>
33 34
#include <dns/zone.h>

35 36
#include <dst/dst.h>

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

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

49 50 51 52
#ifndef NS_RUN_PID_DIR
#define NS_RUN_PID_DIR 1
#endif

Bob Halley's avatar
add  
Bob Halley committed
53
EXTERN isc_mem_t *		ns_g_mctx		INIT(NULL);
54
EXTERN unsigned int		ns_g_cpus		INIT(0);
55
EXTERN unsigned int		ns_g_udpdisp		INIT(0);
Bob Halley's avatar
add  
Bob Halley committed
56
EXTERN isc_taskmgr_t *		ns_g_taskmgr		INIT(NULL);
57
EXTERN dns_dispatchmgr_t *	ns_g_dispatchmgr	INIT(NULL);
58
EXTERN isc_entropy_t *		ns_g_entropy		INIT(NULL);
59
EXTERN isc_entropy_t *		ns_g_fallbackentropy	INIT(NULL);
60
EXTERN unsigned int		ns_g_cpus_detected	INIT(1);
61

Bob Halley's avatar
add  
Bob Halley committed
62 63 64 65 66 67 68
/*
 * 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);
69
EXTERN cfg_parser_t *		ns_g_parser		INIT(NULL);
David Lawrence's avatar
David Lawrence committed
70
EXTERN const char *		ns_g_version		INIT(VERSION);
71
EXTERN const char *		ns_g_product		INIT(PRODUCT);
72
EXTERN const char *		ns_g_srcid		INIT(SRCID);
73
EXTERN const char *		ns_g_configargs		INIT(CONFIGARGS);
74
EXTERN in_port_t		ns_g_port		INIT(0);
Evan Hunt's avatar
Evan Hunt committed
75
EXTERN isc_dscp_t		ns_g_dscp		INIT(-1);
76
EXTERN in_port_t		lwresd_g_listenport	INIT(0);
Bob Halley's avatar
add  
Bob Halley committed
77

78
EXTERN ns_server_t *		ns_g_server		INIT(NULL);
79 80

EXTERN isc_boolean_t		ns_g_lwresdonly		INIT(ISC_FALSE);
81

82 83 84 85 86 87 88
/*
 * 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);
89 90

/*
91
 * Current configuration information.
92
 */
93
EXTERN cfg_obj_t *		ns_g_config		INIT(NULL);
94
EXTERN const cfg_obj_t *	ns_g_defaults		INIT(NULL);
95 96
EXTERN const char *		ns_g_conffile		INIT(NS_SYSCONFDIR
							     "/named.conf");
97
EXTERN cfg_obj_t *		ns_g_bindkeys		INIT(NULL);
Mark Andrews's avatar
Mark Andrews committed
98 99
EXTERN const char *		ns_g_keyfile		INIT(NS_SYSCONFDIR
							     "/rndc.key");
100

101 102
EXTERN dns_tsigkey_t *		ns_g_sessionkey		INIT(NULL);
EXTERN dns_name_t		ns_g_sessionkeyname;
103

104 105 106 107
EXTERN const char *		lwresd_g_conffile	INIT(NS_SYSCONFDIR
							     "/lwresd.conf");
EXTERN const char *		lwresd_g_resolvconffile	INIT("/etc"
							     "/resolv.conf");
108
EXTERN isc_boolean_t		ns_g_conffileset	INIT(ISC_FALSE);
109
EXTERN isc_boolean_t		lwresd_g_useresolvconf	INIT(ISC_FALSE);
110
EXTERN isc_uint16_t		ns_g_udpsize		INIT(4096);
111
EXTERN cfg_aclconfctx_t *	ns_g_aclconfctx		INIT(NULL);
Bob Halley's avatar
add  
Bob Halley committed
112

113 114 115 116 117 118 119 120
/*
 * 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
121 122 123 124
/*
 * Misc.
 */
EXTERN isc_boolean_t		ns_g_coreok		INIT(ISC_TRUE);
125 126
EXTERN const char *		ns_g_chrootdir		INIT(NULL);
EXTERN isc_boolean_t		ns_g_foreground		INIT(ISC_FALSE);
127
EXTERN isc_boolean_t		ns_g_logstderr		INIT(ISC_FALSE);
128
EXTERN isc_boolean_t		ns_g_nosyslog		INIT(ISC_FALSE);
129

130
EXTERN const char *		ns_g_defaultsessionkeyfile
Automatic Updater's avatar
Automatic Updater committed
131
					INIT(NS_LOCALSTATEDIR "/run/named/"
132
							      "session.key");
133

134
#if NS_RUN_PID_DIR
Mark Andrews's avatar
Mark Andrews committed
135 136
EXTERN const char *		ns_g_defaultpidfile 	INIT(NS_LOCALSTATEDIR
							     "/run/named/"
Automatic Updater's avatar
Automatic Updater committed
137
							     "named.pid");
138
EXTERN const char *		lwresd_g_defaultpidfile INIT(NS_LOCALSTATEDIR
Mark Andrews's avatar
Mark Andrews committed
139
							     "/run/lwresd/"
140
							     "lwresd.pid");
Mark Andrews's avatar
Mark Andrews committed
141 142 143 144 145 146 147
#else
EXTERN const char *		ns_g_defaultpidfile 	INIT(NS_LOCALSTATEDIR
							     "/run/named.pid");
EXTERN const char *		lwresd_g_defaultpidfile INIT(NS_LOCALSTATEDIR
							     "/run/lwresd.pid");
#endif

Bob Halley's avatar
Bob Halley committed
148
EXTERN const char *		ns_g_username		INIT(NULL);
Bob Halley's avatar
Bob Halley committed
149

Francis Dupont's avatar
Francis Dupont committed
150 151 152 153 154 155
#ifdef USE_PKCS11
EXTERN const char *		ns_g_engine		INIT("pkcs11");
#else
EXTERN const char *		ns_g_engine		INIT(NULL);
#endif

Michael Graff's avatar
Michael Graff committed
156
EXTERN int			ns_g_listen		INIT(3);
157
EXTERN isc_time_t		ns_g_boottime;
158
EXTERN isc_time_t		ns_g_configtime;
159
EXTERN isc_boolean_t		ns_g_memstatistics	INIT(ISC_FALSE);
160
EXTERN isc_boolean_t		ns_g_clienttest		INIT(ISC_FALSE);
161 162
EXTERN isc_boolean_t		ns_g_dropedns		INIT(ISC_FALSE);
EXTERN isc_boolean_t		ns_g_noedns		INIT(ISC_FALSE);
163
EXTERN isc_boolean_t		ns_g_nosoa		INIT(ISC_FALSE);
164
EXTERN isc_boolean_t		ns_g_noaa		INIT(ISC_FALSE);
165
EXTERN unsigned int		ns_g_delay		INIT(0);
166
EXTERN isc_boolean_t		ns_g_nonearest		INIT(ISC_FALSE);
Michael Graff's avatar
Michael Graff committed
167

Evan Hunt's avatar
Evan Hunt committed
168 169 170 171
#ifdef HAVE_GEOIP
EXTERN dns_geoip_databases_t	*ns_g_geoip		INIT(NULL);
#endif

Bob Halley's avatar
add  
Bob Halley committed
172 173 174
#undef EXTERN
#undef INIT

175
#endif /* NAMED_GLOBALS_H */