BIND - Update BIND to 9.5.2
[dragonfly.git] / contrib / bind-9.5.2 / bin / named / include / named / globals.h
1 /*
2  * Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
3  * Copyright (C) 1999-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: globals.h,v 1.73.46.2 2008/10/24 01:44:15 tbox Exp $ */
19
20 #ifndef NAMED_GLOBALS_H
21 #define NAMED_GLOBALS_H 1
22
23 /*! \file */
24
25 #include <isc/rwlock.h>
26 #include <isc/log.h>
27 #include <isc/net.h>
28
29 #include <isccfg/cfg.h>
30
31 #include <dns/zone.h>
32
33 #include <named/types.h>
34
35 #undef EXTERN
36 #undef INIT
37 #ifdef NS_MAIN
38 #define EXTERN
39 #define INIT(v) = (v)
40 #else
41 #define EXTERN extern
42 #define INIT(v)
43 #endif
44
45 EXTERN isc_mem_t *              ns_g_mctx               INIT(NULL);
46 EXTERN unsigned int             ns_g_cpus               INIT(0);
47 EXTERN isc_taskmgr_t *          ns_g_taskmgr            INIT(NULL);
48 EXTERN dns_dispatchmgr_t *      ns_g_dispatchmgr        INIT(NULL);
49 EXTERN isc_entropy_t *          ns_g_entropy            INIT(NULL);
50 EXTERN isc_entropy_t *          ns_g_fallbackentropy    INIT(NULL);
51 EXTERN unsigned int             ns_g_cpus_detected      INIT(1);
52
53 /*
54  * XXXRTH  We're going to want multiple timer managers eventually.  One
55  *         for really short timers, another for client timers, and one
56  *         for zone timers.
57  */
58 EXTERN isc_timermgr_t *         ns_g_timermgr           INIT(NULL);
59 EXTERN isc_socketmgr_t *        ns_g_socketmgr          INIT(NULL);
60 EXTERN cfg_parser_t *           ns_g_parser             INIT(NULL);
61 EXTERN const char *             ns_g_version            INIT(VERSION);
62 EXTERN in_port_t                ns_g_port               INIT(0);
63 EXTERN in_port_t                lwresd_g_listenport     INIT(0);
64
65 EXTERN ns_server_t *            ns_g_server             INIT(NULL);
66
67 EXTERN isc_boolean_t            ns_g_lwresdonly         INIT(ISC_FALSE);
68
69 /*
70  * Logging.
71  */
72 EXTERN isc_log_t *              ns_g_lctx               INIT(NULL);
73 EXTERN isc_logcategory_t *      ns_g_categories         INIT(NULL);
74 EXTERN isc_logmodule_t *        ns_g_modules            INIT(NULL);
75 EXTERN unsigned int             ns_g_debuglevel         INIT(0);
76
77 /*
78  * Current configuration information.
79  */
80 EXTERN cfg_obj_t *              ns_g_config             INIT(NULL);
81 EXTERN const cfg_obj_t *        ns_g_defaults           INIT(NULL);
82 EXTERN const char *             ns_g_conffile           INIT(NS_SYSCONFDIR
83                                                              "/named.conf");
84 EXTERN const char *             ns_g_keyfile            INIT(NS_SYSCONFDIR
85                                                              "/rndc.key");
86 EXTERN const char *             lwresd_g_conffile       INIT(NS_SYSCONFDIR
87                                                              "/lwresd.conf");
88 EXTERN const char *             lwresd_g_resolvconffile INIT("/etc"
89                                                              "/resolv.conf");
90 EXTERN isc_boolean_t            ns_g_conffileset        INIT(ISC_FALSE);
91 EXTERN isc_boolean_t            lwresd_g_useresolvconf  INIT(ISC_FALSE);
92 EXTERN isc_uint16_t             ns_g_udpsize            INIT(4096);
93
94 /*
95  * Initial resource limits.
96  */
97 EXTERN isc_resourcevalue_t      ns_g_initstacksize      INIT(0);
98 EXTERN isc_resourcevalue_t      ns_g_initdatasize       INIT(0);
99 EXTERN isc_resourcevalue_t      ns_g_initcoresize       INIT(0);
100 EXTERN isc_resourcevalue_t      ns_g_initopenfiles      INIT(0);
101
102 /*
103  * Misc.
104  */
105 EXTERN isc_boolean_t            ns_g_coreok             INIT(ISC_TRUE);
106 EXTERN const char *             ns_g_chrootdir          INIT(NULL);
107 EXTERN isc_boolean_t            ns_g_foreground         INIT(ISC_FALSE);
108 EXTERN isc_boolean_t            ns_g_logstderr          INIT(ISC_FALSE);
109
110 EXTERN const char *             ns_g_defaultpidfile     INIT(NS_LOCALSTATEDIR
111                                                              "/run/named.pid");
112 EXTERN const char *             lwresd_g_defaultpidfile INIT(NS_LOCALSTATEDIR
113                                                             "/run/lwresd.pid");
114 EXTERN const char *             ns_g_username           INIT(NULL);
115
116 EXTERN int                      ns_g_listen             INIT(3);
117 EXTERN isc_time_t               ns_g_boottime;
118 EXTERN isc_boolean_t            ns_g_memstatistics      INIT(ISC_FALSE);
119
120 #undef EXTERN
121 #undef INIT
122
123 #endif /* NAMED_GLOBALS_H */