server.h revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 1999-2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef NAMED_SERVER_H
#define NAMED_SERVER_H 1
/*! \file */
#include <isc/sockaddr.h>
#define NS_EVENT_RELOAD (NS_EVENTCLASS + 0)
/*%
* Name server state. Better here than in lots of separate global variables.
*/
struct ns_server {
unsigned int magic;
isc_task_t * task;
/* Configurable data. */
char * statsfile; /*%< Statistics file name */
char * dumpfile; /*%< Dump file name */
char * secrootsfile; /*%< Secroots file name */
char * bindkeysfile; /*%< bind.keys file name */
char * recfile; /*%< Recursive file name */
char * version; /*%< User-specified version */
char * hostname; /*%< User-specified hostname */
/*% Use hostname for server id */
char * server_id; /*%< User-specified server id */
/*%
* Current ACL environment. This defines the
* current values of the localhost and localnets
* ACLs.
*/
/* Server data structures. */
unsigned int dispatchgen;
char *session_keyfile;
unsigned int session_keyalg;
char * lockfile;
};
/*%
* Server statistics counters. Used as isc_statscounter_t values.
*/
enum {
dns_nsstatscounter_dns64 = 37,
dns_nsstatscounter_udp = 41,
dns_nsstatscounter_tcp = 42,
};
/*%
* Traffic size statistics counters. Used as isc_statscounter_t values.
*/
enum {
dns_sizecounter_in_0 = 0,
dns_sizecounter_in_160 = 10,
dns_sizecounter_in_176 = 11,
dns_sizecounter_in_192 = 12,
dns_sizecounter_in_208 = 13,
dns_sizecounter_in_224 = 14,
dns_sizecounter_in_240 = 15,
dns_sizecounter_in_256 = 16,
dns_sizecounter_in_272 = 17,
dns_sizecounter_in_288 = 18,
dns_sizecounter_in_max = 19,
};
enum {
dns_sizecounter_out_160 = 10,
dns_sizecounter_out_176 = 11,
dns_sizecounter_out_192 = 12,
dns_sizecounter_out_208 = 13,
dns_sizecounter_out_224 = 14,
dns_sizecounter_out_240 = 15,
dns_sizecounter_out_256 = 16,
dns_sizecounter_out_272 = 17,
dns_sizecounter_out_288 = 18,
dns_sizecounter_out_304 = 19,
dns_sizecounter_out_320 = 20,
dns_sizecounter_out_336 = 21,
dns_sizecounter_out_352 = 22,
dns_sizecounter_out_368 = 23,
dns_sizecounter_out_384 = 24,
dns_sizecounter_out_400 = 25,
dns_sizecounter_out_416 = 26,
dns_sizecounter_out_432 = 27,
dns_sizecounter_out_448 = 28,
dns_sizecounter_out_464 = 29,
dns_sizecounter_out_480 = 30,
dns_sizecounter_out_496 = 31,
dns_sizecounter_out_512 = 32,
dns_sizecounter_out_528 = 33,
dns_sizecounter_out_544 = 34,
dns_sizecounter_out_560 = 35,
dns_sizecounter_out_576 = 36,
dns_sizecounter_out_592 = 37,
dns_sizecounter_out_608 = 38,
dns_sizecounter_out_624 = 39,
dns_sizecounter_out_640 = 40,
dns_sizecounter_out_656 = 41,
dns_sizecounter_out_672 = 42,
dns_sizecounter_out_688 = 43,
dns_sizecounter_out_704 = 44,
dns_sizecounter_out_720 = 45,
dns_sizecounter_out_736 = 46,
dns_sizecounter_out_752 = 47,
dns_sizecounter_out_768 = 48,
dns_sizecounter_out_784 = 49,
dns_sizecounter_out_800 = 50,
dns_sizecounter_out_816 = 51,
dns_sizecounter_out_832 = 52,
dns_sizecounter_out_848 = 53,
dns_sizecounter_out_864 = 54,
dns_sizecounter_out_880 = 55,
dns_sizecounter_out_896 = 56,
dns_sizecounter_out_912 = 57,
dns_sizecounter_out_928 = 58,
dns_sizecounter_out_944 = 59,
dns_sizecounter_out_960 = 60,
dns_sizecounter_out_976 = 61,
dns_sizecounter_out_992 = 62,
dns_sizecounter_out_1008 = 63,
dns_sizecounter_out_1024 = 64,
dns_sizecounter_out_1040 = 65,
dns_sizecounter_out_1056 = 66,
dns_sizecounter_out_1072 = 67,
dns_sizecounter_out_1088 = 68,
dns_sizecounter_out_1104 = 69,
dns_sizecounter_out_1120 = 70,
dns_sizecounter_out_1136 = 71,
dns_sizecounter_out_1152 = 72,
dns_sizecounter_out_1168 = 73,
dns_sizecounter_out_1184 = 74,
dns_sizecounter_out_1200 = 75,
dns_sizecounter_out_1216 = 76,
dns_sizecounter_out_1232 = 77,
dns_sizecounter_out_1248 = 78,
dns_sizecounter_out_1264 = 79,
dns_sizecounter_out_1280 = 80,
dns_sizecounter_out_1296 = 81,
dns_sizecounter_out_1312 = 82,
dns_sizecounter_out_1328 = 83,
dns_sizecounter_out_1344 = 84,
dns_sizecounter_out_1360 = 85,
dns_sizecounter_out_1376 = 86,
dns_sizecounter_out_1392 = 87,
dns_sizecounter_out_1408 = 88,
dns_sizecounter_out_1424 = 89,
dns_sizecounter_out_1440 = 90,
dns_sizecounter_out_1456 = 91,
dns_sizecounter_out_1472 = 92,
dns_sizecounter_out_1488 = 93,
dns_sizecounter_out_1504 = 94,
dns_sizecounter_out_1520 = 95,
dns_sizecounter_out_1536 = 96,
dns_sizecounter_out_1552 = 97,
dns_sizecounter_out_1568 = 98,
dns_sizecounter_out_1584 = 99,
dns_sizecounter_out_1600 = 100,
dns_sizecounter_out_1616 = 101,
dns_sizecounter_out_1632 = 102,
dns_sizecounter_out_1648 = 103,
dns_sizecounter_out_1664 = 104,
dns_sizecounter_out_1680 = 105,
dns_sizecounter_out_1696 = 106,
dns_sizecounter_out_1712 = 107,
dns_sizecounter_out_1728 = 108,
dns_sizecounter_out_1744 = 109,
dns_sizecounter_out_1760 = 110,
dns_sizecounter_out_1776 = 111,
dns_sizecounter_out_1792 = 112,
dns_sizecounter_out_1808 = 113,
dns_sizecounter_out_1824 = 114,
dns_sizecounter_out_1840 = 115,
dns_sizecounter_out_1856 = 116,
dns_sizecounter_out_1872 = 117,
dns_sizecounter_out_1888 = 118,
dns_sizecounter_out_1904 = 119,
dns_sizecounter_out_1920 = 120,
dns_sizecounter_out_1936 = 121,
dns_sizecounter_out_1952 = 122,
dns_sizecounter_out_1968 = 123,
dns_sizecounter_out_1984 = 124,
dns_sizecounter_out_2000 = 125,
dns_sizecounter_out_2016 = 126,
dns_sizecounter_out_2032 = 127,
dns_sizecounter_out_2048 = 128,
dns_sizecounter_out_2064 = 129,
dns_sizecounter_out_2080 = 130,
dns_sizecounter_out_2096 = 131,
dns_sizecounter_out_2112 = 132,
dns_sizecounter_out_2128 = 133,
dns_sizecounter_out_2144 = 134,
dns_sizecounter_out_2160 = 135,
dns_sizecounter_out_2176 = 136,
dns_sizecounter_out_2192 = 137,
dns_sizecounter_out_2208 = 138,
dns_sizecounter_out_2224 = 139,
dns_sizecounter_out_2240 = 140,
dns_sizecounter_out_2256 = 141,
dns_sizecounter_out_2272 = 142,
dns_sizecounter_out_2288 = 143,
dns_sizecounter_out_2304 = 144,
dns_sizecounter_out_2320 = 145,
dns_sizecounter_out_2336 = 146,
dns_sizecounter_out_2352 = 147,
dns_sizecounter_out_2368 = 148,
dns_sizecounter_out_2384 = 149,
dns_sizecounter_out_2400 = 150,
dns_sizecounter_out_2416 = 151,
dns_sizecounter_out_2432 = 152,
dns_sizecounter_out_2448 = 153,
dns_sizecounter_out_2464 = 154,
dns_sizecounter_out_2480 = 155,
dns_sizecounter_out_2496 = 156,
dns_sizecounter_out_2512 = 157,
dns_sizecounter_out_2528 = 158,
dns_sizecounter_out_2544 = 159,
dns_sizecounter_out_2560 = 160,
dns_sizecounter_out_2576 = 161,
dns_sizecounter_out_2592 = 162,
dns_sizecounter_out_2608 = 163,
dns_sizecounter_out_2624 = 164,
dns_sizecounter_out_2640 = 165,
dns_sizecounter_out_2656 = 166,
dns_sizecounter_out_2672 = 167,
dns_sizecounter_out_2688 = 168,
dns_sizecounter_out_2704 = 169,
dns_sizecounter_out_2720 = 170,
dns_sizecounter_out_2736 = 171,
dns_sizecounter_out_2752 = 172,
dns_sizecounter_out_2768 = 173,
dns_sizecounter_out_2784 = 174,
dns_sizecounter_out_2800 = 175,
dns_sizecounter_out_2816 = 176,
dns_sizecounter_out_2832 = 177,
dns_sizecounter_out_2848 = 178,
dns_sizecounter_out_2864 = 179,
dns_sizecounter_out_2880 = 180,
dns_sizecounter_out_2896 = 181,
dns_sizecounter_out_2912 = 182,
dns_sizecounter_out_2928 = 183,
dns_sizecounter_out_2944 = 184,
dns_sizecounter_out_2960 = 185,
dns_sizecounter_out_2976 = 186,
dns_sizecounter_out_2992 = 187,
dns_sizecounter_out_3008 = 188,
dns_sizecounter_out_3024 = 189,
dns_sizecounter_out_3040 = 190,
dns_sizecounter_out_3056 = 191,
dns_sizecounter_out_3072 = 192,
dns_sizecounter_out_3088 = 193,
dns_sizecounter_out_3104 = 194,
dns_sizecounter_out_3120 = 195,
dns_sizecounter_out_3136 = 196,
dns_sizecounter_out_3152 = 197,
dns_sizecounter_out_3168 = 198,
dns_sizecounter_out_3184 = 199,
dns_sizecounter_out_3200 = 200,
dns_sizecounter_out_3216 = 201,
dns_sizecounter_out_3232 = 202,
dns_sizecounter_out_3248 = 203,
dns_sizecounter_out_3264 = 204,
dns_sizecounter_out_3280 = 205,
dns_sizecounter_out_3296 = 206,
dns_sizecounter_out_3312 = 207,
dns_sizecounter_out_3328 = 208,
dns_sizecounter_out_3344 = 209,
dns_sizecounter_out_3360 = 210,
dns_sizecounter_out_3376 = 211,
dns_sizecounter_out_3392 = 212,
dns_sizecounter_out_3408 = 213,
dns_sizecounter_out_3424 = 214,
dns_sizecounter_out_3440 = 215,
dns_sizecounter_out_3456 = 216,
dns_sizecounter_out_3472 = 217,
dns_sizecounter_out_3488 = 218,
dns_sizecounter_out_3504 = 219,
dns_sizecounter_out_3520 = 220,
dns_sizecounter_out_3536 = 221,
dns_sizecounter_out_3552 = 222,
dns_sizecounter_out_3568 = 223,
dns_sizecounter_out_3584 = 224,
dns_sizecounter_out_3600 = 225,
dns_sizecounter_out_3616 = 226,
dns_sizecounter_out_3632 = 227,
dns_sizecounter_out_3648 = 228,
dns_sizecounter_out_3664 = 229,
dns_sizecounter_out_3680 = 230,
dns_sizecounter_out_3696 = 231,
dns_sizecounter_out_3712 = 232,
dns_sizecounter_out_3728 = 233,
dns_sizecounter_out_3744 = 234,
dns_sizecounter_out_3760 = 235,
dns_sizecounter_out_3776 = 236,
dns_sizecounter_out_3792 = 237,
dns_sizecounter_out_3808 = 238,
dns_sizecounter_out_3824 = 239,
dns_sizecounter_out_3840 = 240,
dns_sizecounter_out_3856 = 241,
dns_sizecounter_out_3872 = 242,
dns_sizecounter_out_3888 = 243,
dns_sizecounter_out_3904 = 244,
dns_sizecounter_out_3920 = 245,
dns_sizecounter_out_3936 = 246,
dns_sizecounter_out_3952 = 247,
dns_sizecounter_out_3968 = 248,
dns_sizecounter_out_3984 = 249,
dns_sizecounter_out_4000 = 250,
dns_sizecounter_out_4016 = 251,
dns_sizecounter_out_4032 = 252,
dns_sizecounter_out_4048 = 253,
dns_sizecounter_out_4064 = 254,
dns_sizecounter_out_4080 = 255,
dns_sizecounter_out_4096 = 256,
dns_sizecounter_out_max = 257
};
void
/*%<
* Create a server object with default settings.
* This function either succeeds or causes the program to exit
* with a fatal error.
*/
void
/*%<
* Destroy a server object, freeing its memory.
*/
void
/*%<
* Inform a server that a reload is wanted. This function
* may be called asynchronously, from outside the server's task.
* If a reload is already scheduled or in progress, the call
* is ignored.
*/
void
/*%<
* Trigger a interface scan.
* Must only be called when running under server->task.
*/
void
/*%<
* Inform the server that the zones should be flushed to disk on shutdown.
*/
isc_buffer_t **text);
/*%<
* Act on a "reload" command from the command channel.
*/
/*%<
* Act on a "reconfig" command from the command channel.
*/
isc_buffer_t **text);
/*%<
* Act on a "notify" command from the command channel.
*/
isc_buffer_t **text);
/*%<
* Act on a "refresh" command from the command channel.
*/
isc_buffer_t **text);
/*%<
* Act on a "retransfer" command from the command channel.
*/
/*%<
* but can also be used as a toggle for backward comptibility.)
*/
/*%
* Save the current NTAs for all views to files.
*/
/*%
* Load NTAs for all views from files.
*/
/*%
* Dump the current statistics to the statistics file.
*/
/*%
* Dump the current cache to the dump file.
*/
/*%
* Dump the current security roots to the secroots file.
*/
isc_buffer_t **text);
/*%
* Change or increment the server debug level.
*/
/*%
* Flush the server's cache(s)
*/
/*%
* Flush a particular name from the server's cache. If 'tree' is false,
* also flush the name from the ADB and badcache. If 'tree' is true, also
* flush all the names under the specified name.
*/
/*%
* Report the server's status.
*/
/*%
* Report a list of dynamic and static tsig keys, per view.
*/
/*%
* Delete a specific key (with optional view).
*/
isc_buffer_t **text);
/*%
* Enable or disable updates for a zone.
*/
/*%
* Dump zone updates to disk, optionally removing the journal file
*/
/*%
* Update a zone's DNSKEY set from the key repository. If
* the command that triggered the call to this function was "sign",
* then force a full signing of the zone. If it was "loadkeys",
* then don't sign the zone; any needed changes to signatures can
* take place incrementally.
*/
/*%
* Dump the current recursive queries.
*/
/*%
* Maintain a list of dispatches that require reserved ports.
*/
void
/*%
* Enable or disable dnssec validation.
*/
/*%
* Add a zone to a running process, or modify an existing zone
*/
/*%
* Deletes a zone from a running process
*/
/*%
* Show current configuration for a given zone
*/
/*%
* Lists the status of the signing records for a given zone.
*/
/*%
* Lists status information for a given zone (e.g., name, type, files,
* load time, expiry, etc).
*/
/*%
* duration, in a particular view if specified, or in all views.
*/
isc_buffer_t **text);
/*%
* Generates a test sequence that is only for use in system tests. The
* argument is the size of required output in bytes.
*/
/*%
* Force fefresh or print status for managed keys zones.
*/
/*%
* Close and reopen DNSTAP output file.
*/
#endif /* NAMED_SERVER_H */