control.c revision d4859b0b2a0510d8c4f3c48c606a5568a3b0c1d8
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley/*
d362465c77b375be2707bc83cebc731d0645d12dAutomatic Updater * Copyright (C) 2004-2007, 2009-2014 Internet Systems Consortium, Inc. ("ISC")
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * Copyright (C) 2001-2003 Internet Software Consortium.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence *
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * Permission to use, copy, modify, and/or distribute this software for any
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley * purpose with or without fee is hereby granted, provided that the above
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley * copyright notice and this permission notice appear in all copies.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence *
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * PERFORMANCE OF THIS SOFTWARE.
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley */
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley
0cae66577c69c89086cd065bb297690072b471b4Mark Andrews/* $Id: control.c,v 1.49 2012/01/31 23:47:31 tbox Exp $ */
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*! \file */
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence
110d1702731f42dd620879c1d765ebe91f3920ceMichael Graff#include <config.h>
110d1702731f42dd620879c1d765ebe91f3920ceMichael Graff
c3b708aaf1bb0a118e0e11befa1b732acfb1d079Bob Halley
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley#include <isc/app.h>
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence#include <isc/event.h>
c569a0e4d518bf30be1b2ba9cc3592fe470e9822Mark Andrews#include <isc/mem.h>
def8e47c688e2480a4539d69c3d1a0a28a7c0550Mark Andrews#include <isc/string.h>
364a82f7c25b62967678027043425201a5e5171aBob Halley#include <isc/timer.h>
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley#include <isc/util.h>
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence
8dfa9caeec8e68db0c937e347a3d6629e7627d54Bob Halley#include <dns/result.h>
54f959d12b5a1f9315fbf6a776c6d349316e9686Bob Halley
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley#include <isccc/alist.h>
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews#include <isccc/cc.h>
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley#include <isccc/result.h>
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley#include <named/control.h>
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley#include <named/log.h>
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley#include <named/os.h>
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley#include <named/server.h>
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley#ifdef HAVE_LIBSCF
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley#include <named/ns_smf_globals.h>
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley#endif
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley
078d49b63324f01d98301ee21671abee0c41fcdeBob Halleystatic isc_boolean_t
5619558151f1aa4249b3ead979e76876e29278b6Bob Halleycommand_compare(const char *text, const char *command) {
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley unsigned int commandlen = strlen(command);
904a5734375869ffb504ed8cde6b68cafadb6d64Bob Halley if (strncasecmp(text, command, commandlen) == 0 &&
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley (text[commandlen] == '\0' ||
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley text[commandlen] == ' ' ||
ca67883a666bdf314d3da958d5195e7215b1f797Bob Halley text[commandlen] == '\t'))
732e0731dec1922747bb3b3147cf2c3d16b22eaaBob Halley return (ISC_TRUE);
b12f0228b32775ee688ed21ddbf3a116c1adfb43Michael Graff return (ISC_FALSE);
61fb42c4ef45d88e115bd769c30c4f36b461870bMark Andrews}
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley/*%
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley * This function is called to process the incoming command
80b782f356f0692c11b4e52e8dd46ec41704e5a2Mark Andrews * when a control channel message is received.
e496615043400500492fa7b891c515c8e7cb7d08Bob Halley */
35541328a8c18ba1f984300dfe30ec8713c90031Mark Andrewsisc_result_t
a76b380643a22f23a67a9df284e86cd7ef7608c1Mark Andrewsns_control_docommand(isccc_sexpr_t *message, isc_buffer_t *text) {
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley isccc_sexpr_t *data;
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley char *command = NULL;
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley isc_result_t result;
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley int log_level;
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley#ifdef HAVE_LIBSCF
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley ns_smf_want_disable = 0;
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley#endif
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley data = isccc_alist_lookup(message, "_data");
078d49b63324f01d98301ee21671abee0c41fcdeBob Halley if (data == NULL) {
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley /*
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * No data section.
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley */
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley return (ISC_R_FAILURE);
904a5734375869ffb504ed8cde6b68cafadb6d64Bob Halley }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley result = isccc_cc_lookupstring(data, "type", &command);
ca67883a666bdf314d3da958d5195e7215b1f797Bob Halley if (result != ISC_R_SUCCESS) {
732e0731dec1922747bb3b3147cf2c3d16b22eaaBob Halley /*
b12f0228b32775ee688ed21ddbf3a116c1adfb43Michael Graff * We have no idea what this is.
61fb42c4ef45d88e115bd769c30c4f36b461870bMark Andrews */
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley return (result);
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley
80b782f356f0692c11b4e52e8dd46ec41704e5a2Mark Andrews /*
e496615043400500492fa7b891c515c8e7cb7d08Bob Halley * Compare the 'command' parameter against all known control commands.
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley */
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley if (command_compare(command, NS_COMMAND_NULL) ||
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley command_compare(command, NS_COMMAND_STATUS)) {
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley log_level = ISC_LOG_DEBUG(1);
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley } else {
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley log_level = ISC_LOG_INFO;
2cd0c38115b1efb043ed3104c0d08e51ceade0d7Bob Halley }
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley NS_LOGMODULE_CONTROL, log_level,
078d49b63324f01d98301ee21671abee0c41fcdeBob Halley "received control channel command '%s'",
0180ccf72c79b98eb8ee5abbb7331aec6951dd9fBob Halley command);
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley if (command_compare(command, NS_COMMAND_RELOAD)) {
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley result = ns_server_reloadcommand(ns_g_server, command, text);
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley } else if (command_compare(command, NS_COMMAND_RECONFIG)) {
904a5734375869ffb504ed8cde6b68cafadb6d64Bob Halley result = ns_server_reconfigcommand(ns_g_server, command);
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley } else if (command_compare(command, NS_COMMAND_REFRESH)) {
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley result = ns_server_refreshcommand(ns_g_server, command, text);
ca67883a666bdf314d3da958d5195e7215b1f797Bob Halley } else if (command_compare(command, NS_COMMAND_RETRANSFER)) {
732e0731dec1922747bb3b3147cf2c3d16b22eaaBob Halley result = ns_server_retransfercommand(ns_g_server,
b12f0228b32775ee688ed21ddbf3a116c1adfb43Michael Graff command, text);
61fb42c4ef45d88e115bd769c30c4f36b461870bMark Andrews } else if (command_compare(command, NS_COMMAND_HALT)) {
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley#ifdef HAVE_LIBSCF
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley /*
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley * If we are managed by smf(5), AND in chroot, then
80b782f356f0692c11b4e52e8dd46ec41704e5a2Mark Andrews * we cannot connect to the smf repository, so just
e496615043400500492fa7b891c515c8e7cb7d08Bob Halley * return with an appropriate message back to rndc.
35541328a8c18ba1f984300dfe30ec8713c90031Mark Andrews */
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley if (ns_smf_got_instance == 1 && ns_smf_chroot == 1) {
5619558151f1aa4249b3ead979e76876e29278b6Bob Halley result = ns_smf_add_message(text);
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halley return (result);
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halley }
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halley /*
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halley * If we are managed by smf(5) but not in chroot,
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halley * try to disable ourselves the smf way.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence */
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halley if (ns_smf_got_instance == 1 && ns_smf_chroot == 0)
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halley ns_smf_want_disable = 1;
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halley /*
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halley * If ns_smf_got_instance = 0, ns_smf_chroot
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halley * is not relevant and we fall through to
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halley * isc_app_shutdown below.
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halley */
28640d1da26d561f4137122fe64e9e8cc08bf11eBob Halley#endif
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley /* Do not flush master files */
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley ns_server_flushonshutdown(ns_g_server, ISC_FALSE);
e02884167b7c969b56413f76c48c3802c4dca14dAndreas Gustafsson ns_os_shutdownmsg(command, text);
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley isc_app_shutdown();
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley result = ISC_R_SUCCESS;
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff } else if (command_compare(command, NS_COMMAND_STOP)) {
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley /*
e02884167b7c969b56413f76c48c3802c4dca14dAndreas Gustafsson * "stop" is the same as "halt" except it does
e672951ed28b2e9cc7a19c3d7fa4a258382f981cAutomatic Updater * flush master files.
419590499823ce15b5d2ad4fe71eaf04bd5a86c0Michael Graff */
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley#ifdef HAVE_LIBSCF
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley if (ns_smf_got_instance == 1 && ns_smf_chroot == 1) {
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley result = ns_smf_add_message(text);
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley return (result);
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley }
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley if (ns_smf_got_instance == 1 && ns_smf_chroot == 0)
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley ns_smf_want_disable = 1;
e02884167b7c969b56413f76c48c3802c4dca14dAndreas Gustafsson#endif
e02884167b7c969b56413f76c48c3802c4dca14dAndreas Gustafsson ns_server_flushonshutdown(ns_g_server, ISC_TRUE);
e672951ed28b2e9cc7a19c3d7fa4a258382f981cAutomatic Updater ns_os_shutdownmsg(command, text);
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley isc_app_shutdown();
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley result = ISC_R_SUCCESS;
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley } else if (command_compare(command, NS_COMMAND_DUMPSTATS)) {
1c724c986de1449e3b2f1eeae4c724dc0d97603cBob Halley result = ns_server_dumpstats(ns_g_server);
1c724c986de1449e3b2f1eeae4c724dc0d97603cBob Halley } else if (command_compare(command, NS_COMMAND_QUERYLOG)) {
1c724c986de1449e3b2f1eeae4c724dc0d97603cBob Halley result = ns_server_togglequerylog(ns_g_server, command);
1c724c986de1449e3b2f1eeae4c724dc0d97603cBob Halley } else if (command_compare(command, NS_COMMAND_DUMPDB)) {
1c724c986de1449e3b2f1eeae4c724dc0d97603cBob Halley ns_server_dumpdb(ns_g_server, command);
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley result = ISC_R_SUCCESS;
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley } else if (command_compare(command, NS_COMMAND_SECROOTS)) {
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley result = ns_server_dumpsecroots(ns_g_server, command);
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley } else if (command_compare(command, NS_COMMAND_TRACE)) {
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley result = ns_server_setdebuglevel(ns_g_server, command);
e02884167b7c969b56413f76c48c3802c4dca14dAndreas Gustafsson } else if (command_compare(command, NS_COMMAND_NOTRACE)) {
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley ns_g_debuglevel = 0;
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley isc_log_setdebuglevel(ns_g_lctx, ns_g_debuglevel);
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley result = ISC_R_SUCCESS;
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley } else if (command_compare(command, NS_COMMAND_FLUSH)) {
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley result = ns_server_flushcache(ns_g_server, command);
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley } else if (command_compare(command, NS_COMMAND_FLUSHNAME)) {
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley result = ns_server_flushnode(ns_g_server, command, ISC_FALSE);
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley } else if (command_compare(command, NS_COMMAND_FLUSHTREE)) {
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley result = ns_server_flushnode(ns_g_server, command, ISC_TRUE);
1c724c986de1449e3b2f1eeae4c724dc0d97603cBob Halley } else if (command_compare(command, NS_COMMAND_STATUS)) {
732e0731dec1922747bb3b3147cf2c3d16b22eaaBob Halley result = ns_server_status(ns_g_server, text);
35541328a8c18ba1f984300dfe30ec8713c90031Mark Andrews } else if (command_compare(command, NS_COMMAND_TSIGLIST)) {
35541328a8c18ba1f984300dfe30ec8713c90031Mark Andrews result = ns_server_tsiglist(ns_g_server, text);
d0eb2cc33c5db3366a16b1cb0abcca6ec7c8ee3cTatuya JINMEI 神明達哉 } else if (command_compare(command, NS_COMMAND_TSIGDELETE)) {
d0eb2cc33c5db3366a16b1cb0abcca6ec7c8ee3cTatuya JINMEI 神明達哉 result = ns_server_tsigdelete(ns_g_server, command, text);
d0eb2cc33c5db3366a16b1cb0abcca6ec7c8ee3cTatuya JINMEI 神明達哉 } else if (command_compare(command, NS_COMMAND_FREEZE)) {
6098d364b690cb9dabf96e9664c4689c8559bd2eMark Andrews result = ns_server_freeze(ns_g_server, ISC_TRUE, command,
6098d364b690cb9dabf96e9664c4689c8559bd2eMark Andrews text);
0cae66577c69c89086cd065bb297690072b471b4Mark Andrews } else if (command_compare(command, NS_COMMAND_UNFREEZE) ||
0cae66577c69c89086cd065bb297690072b471b4Mark Andrews command_compare(command, NS_COMMAND_THAW)) {
35541328a8c18ba1f984300dfe30ec8713c90031Mark Andrews result = ns_server_freeze(ns_g_server, ISC_FALSE, command,
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley text);
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley } else if (command_compare(command, NS_COMMAND_SCAN)) {
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley result = ISC_R_SUCCESS;
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley ns_server_scan_interfaces(ns_g_server);
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley } else if (command_compare(command, NS_COMMAND_SYNC)) {
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley result = ns_server_sync(ns_g_server, command, text);
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley } else if (command_compare(command, NS_COMMAND_RECURSING)) {
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley result = ns_server_dumprecursing(ns_g_server);
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley } else if (command_compare(command, NS_COMMAND_TIMERPOKE)) {
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley result = ISC_R_SUCCESS;
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley isc_timermgr_poke(ns_g_timermgr);
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley } else if (command_compare(command, NS_COMMAND_NULL)) {
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley result = ISC_R_SUCCESS;
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley } else if (command_compare(command, NS_COMMAND_NOTIFY)) {
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley result = ns_server_notifycommand(ns_g_server, command, text);
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley } else if (command_compare(command, NS_COMMAND_VALIDATION)) {
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley result = ns_server_validation(ns_g_server, command, text);
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley } else if (command_compare(command, NS_COMMAND_SIGN) ||
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley command_compare(command, NS_COMMAND_LOADKEYS)) {
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley result = ns_server_rekey(ns_g_server, command, text);
bf345589ce0b0b64533d4566e4992a0e63aac6f5Bob Halley } else if (command_compare(command, NS_COMMAND_ADDZONE)) {
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley result = ns_server_add_zone(ns_g_server, command, text);
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley } else if (command_compare(command, NS_COMMAND_DELZONE)) {
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley result = ns_server_del_zone(ns_g_server, command, text);
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley } else if (command_compare(command, NS_COMMAND_SIGNING)) {
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley result = ns_server_signing(ns_g_server, command, text);
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley } else if (command_compare(command, NS_COMMAND_ZONESTATUS)) {
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley result = ns_server_zonestatus(ns_g_server, command, text);
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley } else if (command_compare(command, NS_COMMAND_NTA)) {
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley result = ns_server_nta(ns_g_server, command, text);
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley } else {
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley NS_LOGMODULE_CONTROL, ISC_LOG_WARNING,
7837d146219db7a85a4b444a9cdf6602254a4f75Bob Halley "unknown control channel command '%s'",
1c724c986de1449e3b2f1eeae4c724dc0d97603cBob Halley command);
1c724c986de1449e3b2f1eeae4c724dc0d97603cBob Halley result = DNS_R_UNKNOWNCOMMAND;
1c724c986de1449e3b2f1eeae4c724dc0d97603cBob Halley }
1c724c986de1449e3b2f1eeae4c724dc0d97603cBob Halley
1c724c986de1449e3b2f1eeae4c724dc0d97603cBob Halley return (result);
1c724c986de1449e3b2f1eeae4c724dc0d97603cBob Halley}
1c724c986de1449e3b2f1eeae4c724dc0d97603cBob Halley