globals.h 2.5 KB
Newer Older
Bob Halley's avatar
add  
Bob Halley committed
1
/*
Bob Halley's avatar
Bob Halley committed
2
 * Copyright (C) 1999, 2000  Internet Software Consortium.
Bob Halley's avatar
add  
Bob Halley committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 * 
 * 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.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
 * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
 * CONSORTIUM 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.
 */

#ifndef NS_GLOBALS_H
#define NS_GLOBALS_H 1

#include <isc/types.h>
#include <isc/rwlock.h>
Andreas Gustafsson's avatar
Andreas Gustafsson committed
23
#include <isc/log.h>
24
#include <isc/net.h>
Bob Halley's avatar
add  
Bob Halley committed
25 26 27

#include <dns/types.h>

28 29
#include <omapi/types.h>

30
#include <named/types.h>
Bob Halley's avatar
add  
Bob Halley committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

#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);
EXTERN unsigned int		ns_g_cpus		INIT(1);
EXTERN isc_taskmgr_t *		ns_g_taskmgr		INIT(NULL);
/*
 * 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);
52
EXTERN omapi_object_t *		ns_g_omapimgr		INIT(NULL);
Bob Halley's avatar
add  
Bob Halley committed
53
EXTERN char *			ns_g_version		INIT(VERSION);
Bob Halley's avatar
Bob Halley committed
54
EXTERN in_port_t		ns_g_port		INIT(53);
Bob Halley's avatar
add  
Bob Halley committed
55

56 57
EXTERN ns_server_t *		ns_g_server		INIT(NULL);

58 59 60 61 62 63 64
/*
 * 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);
65 66 67 68

/*
 * Current config information
 */
69
EXTERN const char *		ns_g_conffile	INIT("/etc/named.conf");
Bob Halley's avatar
add  
Bob Halley committed
70

Bob Halley's avatar
Bob Halley committed
71 72 73 74
/*
 * Misc.
 */
EXTERN isc_boolean_t		ns_g_coreok		INIT(ISC_TRUE);
75 76 77 78 79
EXTERN const char *		ns_g_chrootdir		INIT(NULL);
EXTERN isc_boolean_t		ns_g_foreground		INIT(ISC_FALSE);

EXTERN const char *		ns_g_defaultpidfile INIT("/var/run/named.pid");
EXTERN char *			ns_g_pidfile		INIT(NULL);
Bob Halley's avatar
Bob Halley committed
80
EXTERN const char *		ns_g_username		INIT(NULL);
Bob Halley's avatar
Bob Halley committed
81

Bob Halley's avatar
Bob Halley committed
82 83 84 85 86
/*
 * XXX  Temporary.
 */
EXTERN const char *		ns_g_cachefile		INIT(NULL);

Bob Halley's avatar
add  
Bob Halley committed
87 88 89 90
#undef EXTERN
#undef INIT

#endif /* NS_GLOBALS_H */