]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bind/bin/named/ns_glob.h
This commit was generated by cvs2svn to compensate for changes in r56639,
[FreeBSD/FreeBSD.git] / contrib / bind / bin / named / ns_glob.h
1 /*
2  *      from ns.h       4.33 (Berkeley) 8/23/90
3  *      $Id: ns_glob.h,v 8.51 1999/10/15 21:53:32 vixie Exp $
4  */
5
6 /*
7  * Copyright (c) 1986
8  *    The Regents of the University of California.  All rights reserved.
9  * 
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  * 3. All advertising materials mentioning features or use of this software
19  *    must display the following acknowledgement:
20  *      This product includes software developed by the University of
21  *      California, Berkeley and its contributors.
22  * 4. Neither the name of the University nor the names of its contributors
23  *    may be used to endorse or promote products derived from this software
24  *    without specific prior written permission.
25  * 
26  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36  * SUCH DAMAGE.
37  */
38
39 /*
40  * Portions Copyright (c) 1993 by Digital Equipment Corporation.
41  * 
42  * Permission to use, copy, modify, and distribute this software for any
43  * purpose with or without fee is hereby granted, provided that the above
44  * copyright notice and this permission notice appear in all copies, and that
45  * the name of Digital Equipment Corporation not be used in advertising or
46  * publicity pertaining to distribution of the document or software without
47  * specific, written prior permission.
48  * 
49  * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
50  * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
51  * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
52  * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
53  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
54  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
55  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
56  * SOFTWARE.
57  */
58
59 /*
60  * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
61  *
62  * Permission to use, copy, modify, and distribute this software for any
63  * purpose with or without fee is hereby granted, provided that the above
64  * copyright notice and this permission notice appear in all copies.
65  *
66  * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
67  * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
68  * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
69  * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
70  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
71  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
72  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
73  * SOFTWARE.
74  */
75
76 /*
77  * Global variables for the name server.
78  */
79
80         /* original argv[] from main() */
81 DECL    char                    **saved_argv;
82
83 #ifdef DEBUG
84 DECL    int                     debug           INIT(0);
85 DECL    int                     desired_debug   INIT(0);
86 #endif
87
88         /* global event context */
89 DECL    evContext               ev;
90
91         /* global resolver context. */
92 DECL    struct __res_state      res;
93
94         /* list of open streams */
95 DECL    struct qstream          *streamq;
96
97         /* often set to the current time */
98 DECL    struct timeval          tt;
99
100         /* head of allocated queries */
101 DECL    struct qinfo            *nsqhead;
102
103         /* datagram socket for sysquery() and ns_forw(). */
104 DECL    int                     ds              INIT(-1);
105
106         /* event ID for reads of "ds". */
107 DECL    evFileID                ds_evID;
108
109 #ifdef QRYLOG
110         /* is query logging turned on? */
111 DECL    int                     qrylog;
112 #endif /*QRYLOG*/
113
114         /* port to which we send queries */
115 DECL    u_int16_t               ns_port;
116
117         /* Source addr of our internal resolver. */
118 DECL    struct sockaddr_in      source_addr;    /* INITs to <INADDR_ANY, 0>. */
119
120         /* Used by ns_stats */
121 DECL    time_t                  boottime;
122
123 DECL    time_t                  resettime;
124
125         /* next query to retry */
126 DECL    struct qinfo            *retryqp;
127
128         /* default configuration file */
129 DECL    char                    *conffile;
130
131         /* default debug output file */
132 DECL    char                    *debugfile;
133
134         /* zone information */
135 DECL    struct zoneinfo         *zones;
136
137         /* number of zones allocated */
138 DECL    int                     nzones;
139
140         /* free list of unused zones[] elements. */
141 DECL    LIST(struct zoneinfo)   freezones;
142
143         /* list of zones that have a reload pending. */
144 DECL    LIST(struct zoneinfo)   reloadingzones;
145
146         /* set if we need a priming */
147 DECL    int                     needs_prime_cache;
148
149         /* is cache being primed */
150 DECL    int                     priming;
151
152         /* ptrs to dnames in msg for dn_comp */
153 DECL    u_char                  *dnptrs[40];
154
155         /* end pointer for dnptrs */
156 DECL    u_char                  **dnptrs_end
157                                 INIT(dnptrs + sizeof dnptrs / sizeof(u_char*));
158
159         /* number of names in addinfo */
160 DECL    int                     addcount;
161
162         /* name of cache file */
163 DECL    const char              *cache_file;
164
165 #ifdef SLAVE_FORWARD
166         /* retry time when a slave */
167 DECL    int                     slave_retry     INIT(4);
168 #endif
169
170 #ifdef BIND_UPDATE
171 DECL    const char *            LogSignature    INIT(";BIND LOG V8\n");
172 DECL    const char *            DumpSignature   INIT(";BIND DUMP V8\n");
173 DECL    const char *            DumpSuffix      INIT(".dumptmp");
174 #endif
175
176 DECL    const char              sendtoStr[]     INIT("sendto");
177 DECL    const char              tcpsendStr[]    INIT("tcp_send");
178
179         /* defined in version.c, can't use DECL/INIT */
180 extern  char                    Version[];
181 extern  char                    ShortVersion[];
182
183         /* If getnum() has an error, here will be the result. */
184 DECL    int                     getnum_error            INIT(0);
185
186 enum context { domain_ctx, owner_ctx, mailname_ctx, hostname_ctx };
187 DECL    const char              *context_strings[]
188 #ifdef MAIN_PROGRAM
189         = { "domain", "owner", "mail", "host", NULL }
190 #endif
191 ;
192
193 DECL    const char              *transport_strings[]
194 #ifdef MAIN_PROGRAM
195         = { "primary", "secondary", "response", NULL }
196 #endif
197 ;
198
199 DECL    const char              *severity_strings[]
200 #ifdef MAIN_PROGRAM
201         = { "ignore", "warn", "fail", "not_set", NULL }
202 #endif
203 ;
204
205 DECL    struct in_addr          inaddr_any;             /* Inits to 0.0.0.0 */
206
207 DECL    options                 server_options          INIT(NULL);
208
209 DECL    server_info             nameserver_info         INIT(NULL);
210 DECL    key_info_list           secretkey_info          INIT(NULL);
211
212 DECL    int                     main_needs_exit         INIT(0);
213 DECL    ip_match_list           bogus_nameservers       INIT(NULL);
214
215 DECL    log_context             log_ctx;
216 DECL    int                     log_ctx_valid           INIT(0);
217
218 DECL    log_channel             syslog_channel          INIT(NULL);
219 DECL    log_channel             debug_channel           INIT(NULL);
220 DECL    log_channel             stderr_channel          INIT(NULL);
221 DECL    log_channel             eventlib_channel        INIT(NULL);
222 DECL    log_channel             packet_channel          INIT(NULL);
223 DECL    log_channel             null_channel            INIT(NULL);
224
225 DECL    ip_match_list           local_addresses         INIT(NULL);
226 DECL    ip_match_list           local_networks          INIT(NULL);
227
228         /* are we running in no-fork mode? */
229 DECL    int                     foreground              INIT(0);
230
231 DECL    const struct ns_sym     logging_constants[]
232 #ifdef MAIN_PROGRAM
233 = {
234         { log_info,     "info" },
235         { log_notice,   "notice" },
236         { log_warning,  "warning" },
237         { log_error,    "error" },
238         { log_critical, "critical" },
239         { 0,            NULL }
240 }
241 #endif
242 ;
243
244 DECL    const struct ns_sym     syslog_constants[]
245 #ifdef MAIN_PROGRAM
246 = {
247         { LOG_KERN,     "kern" },
248         { LOG_USER,     "user" },
249         { LOG_MAIL,     "mail" },
250         { LOG_DAEMON,   "daemon" },
251         { LOG_AUTH,     "auth" },
252         { LOG_SYSLOG,   "syslog" },
253         { LOG_LPR,      "lpr" },
254 #ifdef LOG_NEWS
255         { LOG_NEWS,     "news" },
256 #endif
257 #ifdef LOG_UUCP
258         { LOG_UUCP,     "uucp" },
259 #endif
260 #ifdef LOG_CRON
261         { LOG_CRON,     "cron" },
262 #endif
263 #ifdef LOG_AUTHPRIV
264         { LOG_AUTHPRIV, "authpriv" },
265 #endif
266 #ifdef LOG_FTP
267         { LOG_FTP,      "ftp" },
268 #endif
269         { LOG_LOCAL0,   "local0"}, 
270         { LOG_LOCAL1,   "local1"}, 
271         { LOG_LOCAL2,   "local2"}, 
272         { LOG_LOCAL3,   "local3"}, 
273         { LOG_LOCAL4,   "local4"}, 
274         { LOG_LOCAL5,   "local5"}, 
275         { LOG_LOCAL6,   "local6"}, 
276         { LOG_LOCAL7,   "local7"}, 
277         { 0,            NULL }
278 }
279 #endif
280 ;
281
282 DECL    const struct ns_sym     category_constants[]
283 #ifdef MAIN_PROGRAM
284 = {
285         { ns_log_default,       "default" },
286         { ns_log_config,        "config" },
287         { ns_log_parser,        "parser" },
288         { ns_log_queries,       "queries" },
289         { ns_log_lame_servers,  "lame-servers" },
290         { ns_log_statistics,    "statistics" },
291         { ns_log_panic,         "panic" },
292         { ns_log_update,        "update" },
293         { ns_log_ncache,        "ncache" },
294         { ns_log_xfer_in,       "xfer-in" },
295         { ns_log_xfer_out,      "xfer-out" },
296         { ns_log_db,            "db" },
297         { ns_log_eventlib,      "eventlib" },
298         { ns_log_packet,        "packet" },
299 #ifdef BIND_NOTIFY
300         { ns_log_notify,        "notify" },
301 #endif
302         { ns_log_cname,         "cname" },
303         { ns_log_security,      "security" },
304         { ns_log_os,            "os" },
305         { ns_log_insist,        "insist" },
306         { ns_log_maint,         "maintenance" },
307         { ns_log_load,          "load" },
308         { ns_log_resp_checks,   "response-checks" },
309         { ns_log_control,       "control" },
310         { 0,                    NULL }
311 }
312 #endif
313 ;
314
315 DECL    const char panic_msg_no_options[]
316         INIT("no server_options in NS_OPTION_P");
317
318 DECL    const char panic_msg_insist_failed[]
319         INIT("%s:%d: insist '%s' failed: %s");
320
321 DECL    const char panic_msg_bad_which[]
322         INIT("%s:%d: INCRSTATS(%s): bad \"which\"");
323
324 DECL    u_long                  globalStats[nssLast];
325
326 DECL    evTimerID               clean_timer;
327 DECL    evTimerID               interface_timer;
328 DECL    evTimerID               stats_timer;
329 DECL    evTimerID               heartbeat_timer;
330 DECL    int                     active_timers           INIT(0);
331
332 DECL    uid_t                   user_id;
333 DECL    char *                  user_name               INIT(NULL);
334 DECL    gid_t                   group_id;
335 DECL    char *                  group_name              INIT(NULL);
336 DECL    char *                  chroot_dir              INIT(NULL);
337
338 DECL    int                     loading                 INIT(0);
339
340 DECL    int                     xfers_running           INIT(0);
341 DECL    int                     xfers_deferred          INIT(0);
342 DECL    int                     qserials_running        INIT(0);