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