summaryrefslogtreecommitdiffstats
path: root/bin/named/include/named/control.h
blob: 29b56775fdb3238be6682bd423d0878f9f290ed3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/*
 * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
 *
 * SPDX-License-Identifier: MPL-2.0
 *
 * 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 https://mozilla.org/MPL/2.0/.
 *
 * See the COPYRIGHT file distributed with this work for additional
 * information regarding copyright ownership.
 */

#pragma once

/*! \file
 * \brief
 * The name server command channel.
 */

#include <stdbool.h>

#include <isccfg/aclconf.h>

#include <isccc/types.h>
#include <named/types.h>

#define NAMED_CONTROL_PORT 953

#define NAMED_COMMAND_STOP	   "stop"
#define NAMED_COMMAND_HALT	   "halt"
#define NAMED_COMMAND_RELOAD	   "reload"
#define NAMED_COMMAND_RECONFIG	   "reconfig"
#define NAMED_COMMAND_REFRESH	   "refresh"
#define NAMED_COMMAND_RETRANSFER   "retransfer"
#define NAMED_COMMAND_DUMPSTATS	   "stats"
#define NAMED_COMMAND_QUERYLOG	   "querylog"
#define NAMED_COMMAND_DUMPDB	   "dumpdb"
#define NAMED_COMMAND_SECROOTS	   "secroots"
#define NAMED_COMMAND_TRACE	   "trace"
#define NAMED_COMMAND_NOTRACE	   "notrace"
#define NAMED_COMMAND_FLUSH	   "flush"
#define NAMED_COMMAND_FLUSHNAME	   "flushname"
#define NAMED_COMMAND_FLUSHTREE	   "flushtree"
#define NAMED_COMMAND_STATUS	   "status"
#define NAMED_COMMAND_TSIGLIST	   "tsig-list"
#define NAMED_COMMAND_TSIGDELETE   "tsig-delete"
#define NAMED_COMMAND_FREEZE	   "freeze"
#define NAMED_COMMAND_UNFREEZE	   "unfreeze"
#define NAMED_COMMAND_THAW	   "thaw"
#define NAMED_COMMAND_TIMERPOKE	   "timerpoke"
#define NAMED_COMMAND_RECURSING	   "recursing"
#define NAMED_COMMAND_NULL	   "null"
#define NAMED_COMMAND_NOTIFY	   "notify"
#define NAMED_COMMAND_VALIDATION   "validation"
#define NAMED_COMMAND_SCAN	   "scan"
#define NAMED_COMMAND_SIGN	   "sign"
#define NAMED_COMMAND_LOADKEYS	   "loadkeys"
#define NAMED_COMMAND_ADDZONE	   "addzone"
#define NAMED_COMMAND_MODZONE	   "modzone"
#define NAMED_COMMAND_DELZONE	   "delzone"
#define NAMED_COMMAND_SHOWZONE	   "showzone"
#define NAMED_COMMAND_SYNC	   "sync"
#define NAMED_COMMAND_SIGNING	   "signing"
#define NAMED_COMMAND_DNSSEC	   "dnssec"
#define NAMED_COMMAND_ZONESTATUS   "zonestatus"
#define NAMED_COMMAND_NTA	   "nta"
#define NAMED_COMMAND_TESTGEN	   "testgen"
#define NAMED_COMMAND_MKEYS	   "managed-keys"
#define NAMED_COMMAND_DNSTAPREOPEN "dnstap-reopen"
#define NAMED_COMMAND_DNSTAP	   "dnstap"
#define NAMED_COMMAND_TCPTIMEOUTS  "tcp-timeouts"
#define NAMED_COMMAND_SERVESTALE   "serve-stale"

isc_result_t
named_controls_create(named_server_t *server, named_controls_t **ctrlsp);
/*%<
 * Create an initial, empty set of command channels for 'server'.
 */

void
named_controls_destroy(named_controls_t **ctrlsp);
/*%<
 * Destroy a set of command channels.
 *
 * Requires:
 *	Shutdown of the channels has completed.
 */

isc_result_t
named_controls_configure(named_controls_t *controls, const cfg_obj_t *config,
			 cfg_aclconfctx_t *aclconfctx);
/*%<
 * Configure zero or more command channels into 'controls'
 * as defined in the configuration parse tree 'config'.
 * The channels will evaluate ACLs in the context of
 * 'aclconfctx'.
 */

void
named_controls_shutdown(named_controls_t *controls);
/*%<
 * Initiate shutdown of all the command channels in 'controls'.
 */

isc_result_t
named_control_docommand(isccc_sexpr_t *message, bool readonly,
			isc_buffer_t **text);