server.h 1.96 KB
Newer Older
Bob Halley's avatar
add    
Bob Halley committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * Copyright (C) 1999  Internet Software Consortium.
 * 
 * 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_SERVER_H
#define NS_SERVER_H 1

#include <isc/types.h>
Bob Halley's avatar
Bob Halley committed
22
#include <isc/log.h>
Bob Halley's avatar
add    
Bob Halley committed
23

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <dns/types.h>

/*
 * Name server state.  Better here than in lots of separate global variables.
 */
struct ns_server {
	isc_uint32_t		magic;
	isc_mem_t *		mctx;

	/* Configurable data. */
	isc_boolean_t		recursion;
	isc_boolean_t		auth_nxdomain;
	dns_transfer_format_t	transfer_format;
	dns_acl_t *		queryacl;
	dns_acl_t *		recursionacl;
	dns_acl_t *		transferacl;
40
41
42
43

	/* Server data structures. */
	dns_viewlist_t		viewlist;
	isc_rwlock_t		viewlock;
44
	ns_interfacemgr_t *	interfacemgr;
45
46
47
48
49
50
};

#define NS_SERVER_MAGIC			0x53564552	/* SVER */
#define NS_SERVER_VALID(s)		((s) != NULL && \
					 (s)->magic == NS_SERVER_MAGIC)

Bob Halley's avatar
Bob Halley committed
51
isc_result_t
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
ns_server_create(isc_mem_t *mctx, ns_server_t **serverp);
/*
 * Create a server object with default settings.
 */

void
ns_server_destroy(ns_server_t **serverp);
/*
 * Destroy a server object, freeing its memory.
 */
     
isc_result_t ns_server_init(void);
/*
 * Create the singleton names server object of BIND 9.
 */
Bob Halley's avatar
Bob Halley committed
67
68
69
70

void
ns_server_fatal(isc_logmodule_t *module, isc_boolean_t want_core,
		const char *format, ...);
Bob Halley's avatar
add    
Bob Halley committed
71
72

#endif /* NS_SERVER_H */