]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - contrib/bind9/bin/named/include/named/globals.h
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / contrib / bind9 / 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.80 2008/11/16 22:49:18 marka 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 #ifndef NS_RUN_PID_DIR
46 #define NS_RUN_PID_DIR 1
47 #endif
48
49 EXTERN isc_mem_t *              ns_g_mctx               INIT(NULL);
50 EXTERN unsigned int             ns_g_cpus               INIT(0);
51 EXTERN isc_taskmgr_t *          ns_g_taskmgr            INIT(NULL);
52 EXTERN dns_dispatchmgr_t *      ns_g_dispatchmgr        INIT(NULL);
53 EXTERN isc_entropy_t *          ns_g_entropy            INIT(NULL);
54 EXTERN isc_entropy_t *          ns_g_fallbackentropy    INIT(NULL);
55 EXTERN unsigned int             ns_g_cpus_detected      INIT(1);
56
57 /*
58  * XXXRTH  We're going to want multiple timer managers eventually.  One
59  *         for really short timers, another for client timers, and one
60  *         for zone timers.
61  */
62 EXTERN isc_timermgr_t *         ns_g_timermgr           INIT(NULL);
63 EXTERN isc_socketmgr_t *        ns_g_socketmgr          INIT(NULL);
64 EXTERN cfg_parser_t *           ns_g_parser             INIT(NULL);
65 EXTERN const char *             ns_g_version            INIT(VERSION);
66 EXTERN const char *             ns_g_configargs         INIT(CONFIGARGS);
67 EXTERN in_port_t                ns_g_port               INIT(0);
68 EXTERN in_port_t                lwresd_g_listenport     INIT(0);
69
70 EXTERN ns_server_t *            ns_g_server             INIT(NULL);
71
72 EXTERN isc_boolean_t            ns_g_lwresdonly         INIT(ISC_FALSE);
73
74 /*
75  * Logging.
76  */
77 EXTERN isc_log_t *              ns_g_lctx               INIT(NULL);
78 EXTERN isc_logcategory_t *      ns_g_categories         INIT(NULL);
79 EXTERN isc_logmodule_t *        ns_g_modules            INIT(NULL);
80 EXTERN unsigned int             ns_g_debuglevel         INIT(0);
81
82 /*
83  * Current configuration information.
84  */
85 EXTERN cfg_obj_t *              ns_g_config             INIT(NULL);
86 EXTERN const cfg_obj_t *        ns_g_defaults           INIT(NULL);
87 EXTERN const char *             ns_g_conffile           INIT(NS_SYSCONFDIR
88                                                              "/named.conf");
89 EXTERN const char *             ns_g_keyfile            INIT(NS_SYSCONFDIR
90                                                              "/rndc.key");
91 EXTERN const char *             lwresd_g_conffile       INIT(NS_SYSCONFDIR
92                                                              "/lwresd.conf");
93 EXTERN const char *             lwresd_g_resolvconffile INIT("/etc"
94                                                              "/resolv.conf");
95 EXTERN isc_boolean_t            ns_g_conffileset        INIT(ISC_FALSE);
96 EXTERN isc_boolean_t            lwresd_g_useresolvconf  INIT(ISC_FALSE);
97 EXTERN isc_uint16_t             ns_g_udpsize            INIT(4096);
98
99 /*
100  * Initial resource limits.
101  */
102 EXTERN isc_resourcevalue_t      ns_g_initstacksize      INIT(0);
103 EXTERN isc_resourcevalue_t      ns_g_initdatasize       INIT(0);
104 EXTERN isc_resourcevalue_t      ns_g_initcoresize       INIT(0);
105 EXTERN isc_resourcevalue_t      ns_g_initopenfiles      INIT(0);
106
107 /*
108  * Misc.
109  */
110 EXTERN isc_boolean_t            ns_g_coreok             INIT(ISC_TRUE);
111 EXTERN const char *             ns_g_chrootdir          INIT(NULL);
112 EXTERN isc_boolean_t            ns_g_foreground         INIT(ISC_FALSE);
113 EXTERN isc_boolean_t            ns_g_logstderr          INIT(ISC_FALSE);
114
115 #if NS_RUN_PID_DIR
116 EXTERN const char *             ns_g_defaultpidfile     INIT(NS_LOCALSTATEDIR
117                                                              "/run/named/"
118                                                              "named.pid");
119 EXTERN const char *             lwresd_g_defaultpidfile INIT(NS_LOCALSTATEDIR
120                                                              "/run/lwresd/"
121                                                              "lwresd.pid");
122 #else
123 EXTERN const char *             ns_g_defaultpidfile     INIT(NS_LOCALSTATEDIR
124                                                              "/run/named.pid");
125 EXTERN const char *             lwresd_g_defaultpidfile INIT(NS_LOCALSTATEDIR
126                                                              "/run/lwresd.pid");
127 #endif
128
129 EXTERN const char *             ns_g_username           INIT(NULL);
130
131 EXTERN int                      ns_g_listen             INIT(3);
132 EXTERN isc_time_t               ns_g_boottime;
133 EXTERN isc_boolean_t            ns_g_memstatistics      INIT(ISC_FALSE);
134 EXTERN isc_boolean_t            ns_g_clienttest         INIT(ISC_FALSE);
135
136 #undef EXTERN
137 #undef INIT
138
139 #endif /* NAMED_GLOBALS_H */