1 /* $NetBSD: control.h,v 1.7 2022/09/23 12:15:21 christos Exp $ */ 2 3 /* 4 * Copyright (C) Internet Systems Consortium, Inc. ("ISC") 5 * 6 * SPDX-License-Identifier: MPL-2.0 7 * 8 * This Source Code Form is subject to the terms of the Mozilla Public 9 * License, v. 2.0. If a copy of the MPL was not distributed with this 10 * file, you can obtain one at https://mozilla.org/MPL/2.0/. 11 * 12 * See the COPYRIGHT file distributed with this work for additional 13 * information regarding copyright ownership. 14 */ 15 16 #ifndef NAMED_CONTROL_H 17 #define NAMED_CONTROL_H 1 18 19 /*! \file 20 * \brief 21 * The name server command channel. 22 */ 23 24 #include <stdbool.h> 25 26 #include <isccfg/aclconf.h> 27 28 #include <isccc/types.h> 29 #include <named/types.h> 30 31 #define NAMED_CONTROL_PORT 953 32 33 #define NAMED_COMMAND_STOP "stop" 34 #define NAMED_COMMAND_HALT "halt" 35 #define NAMED_COMMAND_RELOAD "reload" 36 #define NAMED_COMMAND_RECONFIG "reconfig" 37 #define NAMED_COMMAND_REFRESH "refresh" 38 #define NAMED_COMMAND_RETRANSFER "retransfer" 39 #define NAMED_COMMAND_DUMPSTATS "stats" 40 #define NAMED_COMMAND_QUERYLOG "querylog" 41 #define NAMED_COMMAND_DUMPDB "dumpdb" 42 #define NAMED_COMMAND_SECROOTS "secroots" 43 #define NAMED_COMMAND_TRACE "trace" 44 #define NAMED_COMMAND_NOTRACE "notrace" 45 #define NAMED_COMMAND_FLUSH "flush" 46 #define NAMED_COMMAND_FLUSHNAME "flushname" 47 #define NAMED_COMMAND_FLUSHTREE "flushtree" 48 #define NAMED_COMMAND_STATUS "status" 49 #define NAMED_COMMAND_TSIGLIST "tsig-list" 50 #define NAMED_COMMAND_TSIGDELETE "tsig-delete" 51 #define NAMED_COMMAND_FREEZE "freeze" 52 #define NAMED_COMMAND_UNFREEZE "unfreeze" 53 #define NAMED_COMMAND_THAW "thaw" 54 #define NAMED_COMMAND_TIMERPOKE "timerpoke" 55 #define NAMED_COMMAND_RECURSING "recursing" 56 #define NAMED_COMMAND_NULL "null" 57 #define NAMED_COMMAND_NOTIFY "notify" 58 #define NAMED_COMMAND_VALIDATION "validation" 59 #define NAMED_COMMAND_SCAN "scan" 60 #define NAMED_COMMAND_SIGN "sign" 61 #define NAMED_COMMAND_LOADKEYS "loadkeys" 62 #define NAMED_COMMAND_ADDZONE "addzone" 63 #define NAMED_COMMAND_MODZONE "modzone" 64 #define NAMED_COMMAND_DELZONE "delzone" 65 #define NAMED_COMMAND_SHOWZONE "showzone" 66 #define NAMED_COMMAND_SYNC "sync" 67 #define NAMED_COMMAND_SIGNING "signing" 68 #define NAMED_COMMAND_DNSSEC "dnssec" 69 #define NAMED_COMMAND_ZONESTATUS "zonestatus" 70 #define NAMED_COMMAND_NTA "nta" 71 #define NAMED_COMMAND_TESTGEN "testgen" 72 #define NAMED_COMMAND_MKEYS "managed-keys" 73 #define NAMED_COMMAND_DNSTAPREOPEN "dnstap-reopen" 74 #define NAMED_COMMAND_DNSTAP "dnstap" 75 #define NAMED_COMMAND_TCPTIMEOUTS "tcp-timeouts" 76 #define NAMED_COMMAND_SERVESTALE "serve-stale" 77 78 isc_result_t 79 named_controls_create(named_server_t *server, named_controls_t **ctrlsp); 80 /*%< 81 * Create an initial, empty set of command channels for 'server'. 82 */ 83 84 void 85 named_controls_destroy(named_controls_t **ctrlsp); 86 /*%< 87 * Destroy a set of command channels. 88 * 89 * Requires: 90 * Shutdown of the channels has completed. 91 */ 92 93 isc_result_t 94 named_controls_configure(named_controls_t *controls, const cfg_obj_t *config, 95 cfg_aclconfctx_t *aclconfctx); 96 /*%< 97 * Configure zero or more command channels into 'controls' 98 * as defined in the configuration parse tree 'config'. 99 * The channels will evaluate ACLs in the context of 100 * 'aclconfctx'. 101 */ 102 103 void 104 named_controls_shutdown(named_controls_t *controls); 105 /*%< 106 * Initiate shutdown of all the command channels in 'controls'. 107 */ 108 109 isc_result_t 110 named_control_docommand(isccc_sexpr_t *message, bool readonly, 111 isc_buffer_t **text); 112 113 #endif /* NAMED_CONTROL_H */ 114