#include <isc/log.h>
#include <isc/magic.h>
#include <isc/quota.h>
#include <isc/sockaddr.h>
#include <isc/types.h>
#include <isc/xml.h>
#include <dns/acl.h>
#include <dns/types.h>
#include <named/types.h>
Go to the source code of this file.
Data Structures | |
struct | ns_server |
Name server state. Better here than in lots of separate global variables. More... | |
Defines | |
#define | NAMED_SERVER_H 1 |
#define | NS_EVENTCLASS ISC_EVENTCLASS(0x4E43) |
#define | NS_EVENT_RELOAD (NS_EVENTCLASS + 0) |
#define | NS_EVENT_CLIENTCONTROL (NS_EVENTCLASS + 1) |
#define | NS_SERVER_MAGIC ISC_MAGIC('S','V','E','R') |
#define | NS_SERVER_VALID(s) ISC_MAGIC_VALID(s, NS_SERVER_MAGIC) |
Enumerations | |
enum | { dns_nsstatscounter_requestv4 = 0, dns_nsstatscounter_requestv6 = 1, dns_nsstatscounter_edns0in = 2, dns_nsstatscounter_badednsver = 3, dns_nsstatscounter_tsigin = 4, dns_nsstatscounter_sig0in = 5, dns_nsstatscounter_invalidsig = 6, dns_nsstatscounter_requesttcp = 7, dns_nsstatscounter_authrej = 8, dns_nsstatscounter_recurserej = 9, dns_nsstatscounter_xfrrej = 10, dns_nsstatscounter_updaterej = 11, dns_nsstatscounter_response = 12, dns_nsstatscounter_truncatedresp = 13, dns_nsstatscounter_edns0out = 14, dns_nsstatscounter_tsigout = 15, dns_nsstatscounter_sig0out = 16, dns_nsstatscounter_success = 17, dns_nsstatscounter_authans = 18, dns_nsstatscounter_nonauthans = 19, dns_nsstatscounter_referral = 20, dns_nsstatscounter_nxrrset = 21, dns_nsstatscounter_servfail = 22, dns_nsstatscounter_formerr = 23, dns_nsstatscounter_nxdomain = 24, dns_nsstatscounter_recursion = 25, dns_nsstatscounter_duplicate = 26, dns_nsstatscounter_dropped = 27, dns_nsstatscounter_failure = 28, dns_nsstatscounter_xfrdone = 29, dns_nsstatscounter_updatereqfwd = 30, dns_nsstatscounter_updaterespfwd = 31, dns_nsstatscounter_updatefwdfail = 32, dns_nsstatscounter_updatedone = 33, dns_nsstatscounter_updatefail = 34, dns_nsstatscounter_updatebadprereq = 35, dns_nsstatscounter_recursclients = 36, dns_nsstatscounter_dns64 = 37, dns_nsstatscounter_ratedropped = 38, dns_nsstatscounter_rateslipped = 39, dns_nsstatscounter_rpz_rewrites = 40, dns_nsstatscounter_udp = 41, dns_nsstatscounter_tcp = 42, dns_nsstatscounter_nsidopt = 43, dns_nsstatscounter_expireopt = 44, dns_nsstatscounter_otheropt = 45, dns_nsstatscounter_ecsopt = 46, dns_nsstatscounter_max = 47 } |
Server statistics counters. Used as isc_statscounter_t values. More... | |
Functions | |
void | ns_server_create (isc_mem_t *mctx, ns_server_t **serverp) |
Create a server object with default settings. This function either succeeds or causes the program to exit with a fatal error. | |
void | ns_server_destroy (ns_server_t **serverp) |
Destroy a server object, freeing its memory. | |
void | ns_server_reloadwanted (ns_server_t *server) |
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 | ns_server_scan_interfaces (ns_server_t *server) |
Trigger a interface scan. Must only be called when running under server->task. | |
void | ns_server_flushonshutdown (ns_server_t *server, isc_boolean_t flush) |
Inform the server that the zones should be flushed to disk on shutdown. | |
isc_result_t | ns_server_reloadcommand (ns_server_t *server, char *args, isc_buffer_t **text) |
Act on a "reload" command from the command channel. | |
isc_result_t | ns_server_reconfigcommand (ns_server_t *server, char *args) |
Act on a "reconfig" command from the command channel. | |
isc_result_t | ns_server_notifycommand (ns_server_t *server, char *args, isc_buffer_t **text) |
Act on a "notify" command from the command channel. | |
isc_result_t | ns_server_refreshcommand (ns_server_t *server, char *args, isc_buffer_t **text) |
Act on a "refresh" command from the command channel. | |
isc_result_t | ns_server_retransfercommand (ns_server_t *server, char *args, isc_buffer_t **text) |
Act on a "retransfer" command from the command channel. | |
isc_result_t | ns_server_togglequerylog (ns_server_t *server, char *args) |
Enable/disable logging of queries. (Takes "yes" or "no" argument, but can also be used as a toggle for backward comptibility.). | |
isc_result_t | ns_server_saventa (ns_server_t *server) |
Save the current NTAs for all views to files. | |
isc_result_t | ns_server_loadnta (ns_server_t *server) |
Load NTAs for all views from files. | |
isc_result_t | ns_server_dumpstats (ns_server_t *server) |
Dump the current statistics to the statistics file. | |
isc_result_t | ns_server_dumpdb (ns_server_t *server, char *args) |
Dump the current cache to the dump file. | |
isc_result_t | ns_server_dumpsecroots (ns_server_t *server, char *args, isc_buffer_t **text) |
Dump the current security roots to the secroots file. | |
isc_result_t | ns_server_setdebuglevel (ns_server_t *server, char *args) |
Change or increment the server debug level. | |
isc_result_t | ns_server_flushcache (ns_server_t *server, char *args) |
Flush the server's cache(s). | |
isc_result_t | ns_server_flushnode (ns_server_t *server, char *args, isc_boolean_t tree) |
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. | |
isc_result_t | ns_server_status (ns_server_t *server, isc_buffer_t **text) |
Report the server's status. | |
isc_result_t | ns_server_tsiglist (ns_server_t *server, isc_buffer_t **text) |
Report a list of dynamic and static tsig keys, per view. | |
isc_result_t | ns_server_tsigdelete (ns_server_t *server, char *command, isc_buffer_t **text) |
Delete a specific key (with optional view). | |
isc_result_t | ns_server_freeze (ns_server_t *server, isc_boolean_t freeze, char *args, isc_buffer_t **text) |
Enable or disable updates for a zone. | |
isc_result_t | ns_server_sync (ns_server_t *server, char *args, isc_buffer_t **text) |
Dump zone updates to disk, optionally removing the journal file. | |
isc_result_t | ns_server_rekey (ns_server_t *server, char *args, isc_buffer_t **text) |
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. | |
isc_result_t | ns_server_dumprecursing (ns_server_t *server) |
Dump the current recursive queries. | |
void | ns_add_reserved_dispatch (ns_server_t *server, const isc_sockaddr_t *addr) |
Maintain a list of dispatches that require reserved ports. | |
isc_result_t | ns_server_validation (ns_server_t *server, char *args, isc_buffer_t **text) |
Enable or disable dnssec validation. | |
isc_result_t | ns_server_changezone (ns_server_t *server, char *args, isc_buffer_t **text) |
Add a zone to a running process, or modify an existing zone. | |
isc_result_t | ns_server_delzone (ns_server_t *server, char *args, isc_buffer_t **text) |
Deletes a zone from a running process. | |
isc_result_t | ns_server_showzone (ns_server_t *server, char *args, isc_buffer_t **text) |
Show current configuration for a given zone. | |
isc_result_t | ns_server_signing (ns_server_t *server, char *args, isc_buffer_t **text) |
Lists the status of the signing records for a given zone. | |
isc_result_t | ns_server_zonestatus (ns_server_t *server, char *args, isc_buffer_t **text) |
Lists status information for a given zone (e.g., name, type, files, load time, expiry, etc). | |
isc_result_t | ns_server_nta (ns_server_t *server, char *args, isc_buffer_t **text) |
Adds a Negative Trust Anchor (NTA) for a specified name and duration, in a particular view if specified, or in all views. | |
isc_result_t | ns_server_testgen (char *args, 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. | |
isc_result_t | ns_server_mkeys (ns_server_t *server, char *args, isc_buffer_t **text) |
Force fefresh or print status for managed keys zones. |
Definition in file server.h.
#define NS_EVENT_RELOAD (NS_EVENTCLASS + 0) |
#define NS_EVENT_CLIENTCONTROL (NS_EVENTCLASS + 1) |
#define NS_SERVER_MAGIC ISC_MAGIC('S','V','E','R') |
Definition at line 125 of file server.h.
Referenced by end_reserved_dispatches(), ns_add_reserved_dispatch(), ns_server_destroy(), ns_server_flushonshutdown(), and start_reserved_dispatches().
anonymous enum |
Server statistics counters. Used as isc_statscounter_t values.
void ns_server_create | ( | isc_mem_t * | mctx, | |
ns_server_t ** | serverp | |||
) |
Create a server object with default settings. This function either succeeds or causes the program to exit with a fatal error.
Definition at line 6809 of file server.c.
References ns_server::aclenv, ns_server::bindkeysfile, ns_server::blackholeacl, ns_server::cachelist, CHECKFATAL, ns_server::controls, ns_server::dispatches, ns_server::dispatchgen, dns_aclenv_init(), dns_nsstatscounter_max, dns_opcodestats_create(), dns_rdatatypestats_create(), dns_resstatscounter_max, dns_rootns_create(), dns_tkeyctx_create(), dns_zonemgr_create(), dns_zonemgr_setsize(), dns_zonestatscounter_max, DST_ALG_UNKNOWN, dst_lib_init2(), ns_server::dumpfile, fatal(), ns_server::flushonshutdown, ns_server::heartbeat_interval, ns_server::heartbeat_timer, ns_server::hostname, ns_server::hostname_set, ns_server::in_roothints, ns_server::interface_interval, ns_server::interface_timer, ns_server::interfacemgr, isc_app_onrun(), ISC_ENTROPY_GOODONLY, isc_event_allocate(), ISC_FALSE, ISC_LIST_INIT, isc_mem_get, isc_mem_strdup, isc_mutex_init, isc_quota_init(), ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_socketmgr_setstats(), isc_sockstatscounter_max, isc_stats_create(), isc_task_create(), isc_task_onshutdown(), isc_task_setname(), isc_taskmgr_setexcltask(), ns_server::keepresporder, ns_server::lockfile, ns_server::log_queries, ns_server::magic, ns_server::mctx, ns_controls_create(), NS_EVENT_RELOAD, ns_geoip_init(), NS_SERVER_MAGIC, ns_server_reload(), ns_server::nsstats, ns_server::opcodestats, ns_server::pps_timer, ns_server::rcvquerystats, ns_server::recfile, ns_server::recursionquota, ns_server::reload_event, ns_server::reload_event_lock, ns_server::resolverstats, run_server(), RUNTIME_CHECK, ns_server::secrootsfile, ns_server::server_id, ns_server::server_usehostname, ns_server::session_keyalg, ns_server::session_keybits, ns_server::session_keyfile, ns_server::session_keyname, ns_server::sessionkey, shutdown_server(), ns_server::sockstats, ns_server::statschannels, ns_server::statsfile, ns_server::task, ns_server::tcpquota, ns_server::tkeyctx, ns_server::version, ns_server::version_set, ns_server::viewlist, ns_server::xfroutquota, ns_server::zonemgr, and ns_server::zonestats.
Referenced by setup().
void ns_server_destroy | ( | ns_server_t ** | serverp | ) |
Destroy a server object, freeing its memory.
Definition at line 6982 of file server.c.
References ns_server::aclenv, ns_server::bindkeysfile, ns_server::cachelist, ns_server::controls, dns_aclenv_destroy(), dns_stats_detach(), dns_tkeyctx_destroy(), dns_zonemgr_detach(), dst_lib_destroy(), ns_server::dumpfile, ns_server::hostname, INSIST, isc_event_free(), ISC_LIST_EMPTY, isc_mem_free, isc_mem_put, isc_quota_destroy(), isc_stats_detach(), ns_server::lockfile, ns_server::magic, ns_server::mctx, ns_controls_destroy(), NS_SERVER_VALID, ns_server::nsstats, ns_server::opcodestats, ns_server::rcvquerystats, ns_server::recfile, ns_server::recursionquota, ns_server::reload_event, REQUIRE, ns_server::resolverstats, ns_server::secrootsfile, ns_server::server_id, ns_server::sockstats, ns_server::statsfile, ns_server::tcpquota, ns_server::tkeyctx, ns_server::version, ns_server::viewlist, ns_server::xfroutquota, ns_server::zonemgr, and ns_server::zonestats.
Referenced by cleanup().
void ns_server_reloadwanted | ( | ns_server_t * | server | ) |
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.
Definition at line 7230 of file server.c.
References isc_task_send(), LOCK, ns_server::reload_event, ns_server::reload_event_lock, ns_server::task, and UNLOCK.
Referenced by main().
void ns_server_scan_interfaces | ( | ns_server_t * | server | ) |
Trigger a interface scan. Must only be called when running under server->task.
Definition at line 7238 of file server.c.
References ISC_LOG_DEBUG, isc_log_write(), ISC_R_SUCCESS, isc_task_beginexclusive(), isc_task_endexclusive(), ISC_TRUE, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, RUNTIME_CHECK, scan_interfaces(), and ns_server::task.
Referenced by ns_control_docommand().
void ns_server_flushonshutdown | ( | ns_server_t * | server, | |
isc_boolean_t | flush | |||
) |
Inform the server that the zones should be flushed to disk on shutdown.
Definition at line 6717 of file server.c.
References ns_server::flushonshutdown, NS_SERVER_VALID, and REQUIRE.
Referenced by ns_control_docommand().
isc_result_t ns_server_reloadcommand | ( | ns_server_t * | server, | |
char * | args, | |||
isc_buffer_t ** | text | |||
) |
Act on a "reload" command from the command channel.
Definition at line 7413 of file server.c.
References DNS_R_CONTINUE, DNS_R_UPTODATE, dns_zone_detach(), dns_zone_gettype(), dns_zone_load(), dns_zone_refresh(), dns_zone_slave, dns_zone_stub, ISC_R_SUCCESS, ISC_TRUE, putnull(), putstr(), reload, and zone_from_args().
Referenced by ns_control_docommand().
isc_result_t ns_server_reconfigcommand | ( | ns_server_t * | server, | |
char * | args | |||
) |
Act on a "reconfig" command from the command channel.
Definition at line 7465 of file server.c.
References ISC_R_SUCCESS, reconfig(), and UNUSED.
Referenced by ns_control_docommand().
isc_result_t ns_server_notifycommand | ( | ns_server_t * | server, | |
char * | args, | |||
isc_buffer_t ** | text | |||
) |
Act on a "notify" command from the command channel.
Definition at line 7476 of file server.c.
References dns_zone_detach(), dns_zone_notify(), ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, ISC_TRUE, putnull(), putstr(), and zone_from_args().
Referenced by ns_control_docommand().
isc_result_t ns_server_refreshcommand | ( | ns_server_t * | server, | |
char * | args, | |||
isc_buffer_t ** | text | |||
) |
Act on a "refresh" command from the command channel.
Definition at line 7500 of file server.c.
References dns_zone_attach(), dns_zone_detach(), dns_zone_getraw(), dns_zone_gettype(), dns_zone_refresh(), dns_zone_slave, dns_zone_stub, ISC_R_FAILURE, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, ISC_TRUE, putnull(), putstr(), and zone_from_args().
Referenced by ns_control_docommand().
isc_result_t ns_server_retransfercommand | ( | ns_server_t * | server, | |
char * | args, | |||
isc_buffer_t ** | text | |||
) |
Act on a "retransfer" command from the command channel.
Definition at line 7380 of file server.c.
References dns_zone_attach(), dns_zone_detach(), dns_zone_forcereload(), dns_zone_getraw(), dns_zone_gettype(), dns_zone_slave, dns_zone_stub, ISC_R_NOTFOUND, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, ISC_TRUE, and zone_from_args().
Referenced by ns_control_docommand().
isc_result_t ns_server_togglequerylog | ( | ns_server_t * | server, | |
char * | args | |||
) |
Enable/disable logging of queries. (Takes "yes" or "no" argument, but can also be used as a toggle for backward comptibility.).
Definition at line 7538 of file server.c.
References ISC_FALSE, ISC_LOG_INFO, isc_log_write(), ISC_R_NOTFOUND, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, ISC_TRUE, ns_server::log_queries, next_token(), NS_LOGCATEGORY_GENERAL, and NS_LOGMODULE_SERVER.
Referenced by ns_control_docommand().
isc_result_t ns_server_saventa | ( | ns_server_t * | server | ) |
Save the current NTAs for all views to files.
Definition at line 10651 of file server.c.
References dns_view_saventa(), ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LOG_ERROR, isc_log_write(), ISC_R_SUCCESS, isc_result_totext(), dns_view::name, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, and ns_server::viewlist.
Referenced by shutdown_server().
isc_result_t ns_server_loadnta | ( | ns_server_t * | server | ) |
Load NTAs for all views from files.
Definition at line 10673 of file server.c.
References dns_view_loadnta(), ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LOG_ERROR, isc_log_write(), ISC_R_FILENOTFOUND, ISC_R_NOTFOUND, ISC_R_SUCCESS, isc_result_totext(), dns_view::name, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, and ns_server::viewlist.
Referenced by run_server().
isc_result_t ns_server_dumpstats | ( | ns_server_t * | server | ) |
Dump the current statistics to the statistics file.
Definition at line 7668 of file server.c.
References CHECKMF, cleanup(), dns_result_totext(), ISC_LOG_ERROR, ISC_LOG_INFO, isc_log_write(), ISC_R_SUCCESS, isc_stdio_close(), isc_stdio_open(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, ns_stats_dump(), and ns_server::statsfile.
Referenced by ns_control_docommand().
isc_result_t ns_server_dumpdb | ( | ns_server_t * | server, | |
char * | args | |||
) |
Dump the current cache to the dump file.
Definition at line 7892 of file server.c.
References add_view_tolist(), dumpcontext::cache, CHECK, CHECKMF, cleanup(), dumpcontext::db, dumpcontext::dumpcache, dumpcontext_destroy(), dumpdone(), ns_server::dumpfile, dumpcontext::dumpzones, dumpcontext::fp, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_INIT, ISC_LIST_NEXT, ISC_LOG_INFO, isc_log_write(), isc_mem_get, ISC_R_NOMEMORY, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, isc_stdio_open(), isc_task_attach(), ISC_TRUE, dumpcontext::mctx, ns_server::mctx, dumpcontext::mdctx, dns_view::name, next_token(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, ns_server::task, dumpcontext::task, dumpcontext::version, dumpcontext::view, ns_server::viewlist, and dumpcontext::zone.
Referenced by ns_control_docommand().
isc_result_t ns_server_dumpsecroots | ( | ns_server_t * | server, | |
char * | args, | |||
isc_buffer_t ** | text | |||
) |
Dump the current security roots to the secroots file.
Definition at line 7970 of file server.c.
References CHECK, CHECKMF, cleanup(), dns_keytable_detach(), dns_keytable_totext(), dns_ntatable_detach(), dns_ntatable_totext(), dns_result_totext(), dns_view_getntatable(), dns_view_getsecroots(), isc_buffer_base, isc_buffer_clear, isc_buffer_usedlength, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LOG_ERROR, ISC_LOG_INFO, isc_log_write(), ISC_R_NOTFOUND, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, isc_stdio_close(), isc_stdio_open(), isc_time_formattimestamp(), dns_view::name, next_token(), now, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, putnull(), putstr(), ns_server::secrootsfile, TIME_NOW, and ns_server::viewlist.
Referenced by ns_control_docommand().
isc_result_t ns_server_setdebuglevel | ( | ns_server_t * | server, | |
char * | args | |||
) |
Change or increment the server debug level.
Definition at line 8094 of file server.c.
References ISC_LOG_INFO, isc_log_setdebuglevel(), isc_log_write(), ISC_R_RANGE, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, next_token(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, and UNUSED.
Referenced by ns_control_docommand().
isc_result_t ns_server_flushcache | ( | ns_server_t * | server, | |
char * | args | |||
) |
Flush the server's cache(s).
Definition at line 8196 of file server.c.
References dns_view::cache, ns_cache::cache, ns_server::cachelist, dns_view_flushcache2(), dns_view_iscacheshared(), INSIST, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LOG_ERROR, ISC_LOG_INFO, isc_log_write(), ISC_R_FAILURE, ISC_R_NOTFOUND, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, isc_result_totext(), isc_task_beginexclusive(), isc_task_endexclusive(), ISC_TRUE, dns_view::name, ns_cache::needflush, next_token(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, ns_cache::primaryview, RUNTIME_CHECK, ns_server::task, and ns_server::viewlist.
Referenced by ns_control_docommand().
isc_result_t ns_server_flushnode | ( | ns_server_t * | server, | |
char * | args, | |||
isc_boolean_t | tree | |||
) |
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.
Definition at line 8332 of file server.c.
References dns_fixedname_init, dns_fixedname_name, dns_name_fromtext(), dns_rootname, dns_view_flushnode(), fixed, isc_buffer_add, isc_buffer_constinit, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LOG_ERROR, ISC_LOG_INFO, isc_log_write(), ISC_R_FAILURE, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, isc_result_totext(), isc_task_beginexclusive(), isc_task_endexclusive(), ISC_TRUE, dns_view::name, name, next_token(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, RUNTIME_CHECK, ns_server::task, and ns_server::viewlist.
Referenced by ns_control_docommand().
isc_result_t ns_server_status | ( | ns_server_t * | server, | |
isc_buffer_t ** | text | |||
) |
Report the server's status.
Definition at line 8422 of file server.c.
References CHECK, cleanup(), dns_zonemgr_getcount(), DNS_ZONESTATE_ANY, DNS_ZONESTATE_AUTOMATIC, DNS_ZONESTATE_SOAQUERY, DNS_ZONESTATE_XFERDEFERRED, DNS_ZONESTATE_XFERRUNNING, ISC_FORMATHTTPTIMESTAMP_SIZE, ISC_R_SUCCESS, isc_time_formathttptimestamp(), ns_server::log_queries, isc_quota::max, ns_g_boottime, ns_g_configtime, putnull(), putstr(), ns_server::recursionquota, isc_quota::soft, ns_server::tcpquota, isc_quota::used, and ns_server::zonemgr.
Referenced by ns_control_docommand().
isc_result_t ns_server_tsiglist | ( | ns_server_t * | server, | |
isc_buffer_t ** | text | |||
) |
Report a list of dynamic and static tsig keys, per view.
Definition at line 8733 of file server.c.
References CHECK, cleanup(), dns_view::dynamickeys, isc_buffer_usedlength, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_SUCCESS, isc_rwlocktype_read, isc_task_beginexclusive(), isc_task_endexclusive(), list_keynames(), dns_tsig_keyring::lock, putnull(), putstr(), RUNTIME_CHECK, RWLOCK, RWUNLOCK, dns_view::statickeys, ns_server::task, and ns_server::viewlist.
Referenced by ns_control_docommand().
isc_result_t ns_server_tsigdelete | ( | ns_server_t * | server, | |
char * | command, | |||
isc_buffer_t ** | text | |||
) |
Delete a specific key (with optional view).
Definition at line 8612 of file server.c.
References CHECK, cleanup(), delete_keynames(), dns_view::dynamickeys, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, isc_rwlocktype_write, isc_task_beginexclusive(), isc_task_endexclusive(), dns_tsig_keyring::lock, dns_view::name, next_token(), putnull(), putstr(), RUNTIME_CHECK, RWLOCK, RWUNLOCK, ns_server::task, and ns_server::viewlist.
Referenced by ns_control_docommand().
isc_result_t ns_server_freeze | ( | ns_server_t * | server, | |
isc_boolean_t | freeze, | |||
char * | args, | |||
isc_buffer_t ** | text | |||
) |
Enable or disable updates for a zone.
Definition at line 8920 of file server.c.
References dns_name_format(), DNS_NAME_FORMATSIZE, DNS_R_CONTINUE, DNS_R_FROZEN, DNS_R_NOTDYNAMIC, DNS_R_NOTMASTER, DNS_R_UPTODATE, dns_rdataclass_format(), DNS_RDATACLASS_FORMATSIZE, dns_view_freezezones(), dns_zone_attach(), dns_zone_detach(), dns_zone_flush(), dns_zone_getclass(), dns_zone_getorigin(), dns_zone_getraw(), dns_zone_gettype(), dns_zone_getupdatedisabled(), dns_zone_getview(), dns_zone_isdynamic(), dns_zone_loadandthaw(), dns_zone_master, dns_zone_setupdatedisabled(), ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LOG_INFO, isc_log_write(), ISC_R_SUCCESS, isc_result_totext(), isc_task_beginexclusive(), isc_task_endexclusive(), ISC_TRUE, dns_view::name, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, putnull(), putstr(), RUNTIME_CHECK, ns_server::task, ns_server::viewlist, and zone_from_args().
Referenced by ns_control_docommand().
isc_result_t ns_server_sync | ( | ns_server_t * | server, | |
char * | args, | |||
isc_buffer_t ** | text | |||
) |
Dump zone updates to disk, optionally removing the journal file.
Definition at line 8842 of file server.c.
References arg, cleanup(), dns_name_format(), DNS_NAME_FORMATSIZE, dns_rdataclass_format(), DNS_RDATACLASS_FORMATSIZE, dns_zone_detach(), dns_zone_getclass(), dns_zone_getorigin(), dns_zone_getview(), dns_zt_apply(), ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LOG_INFO, isc_log_write(), ISC_R_SUCCESS, isc_result_totext(), isc_task_beginexclusive(), isc_task_endexclusive(), ISC_TRUE, dns_view::name, next_token(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, RUNTIME_CHECK, synczone(), ns_server::task, ns_server::viewlist, zone_from_args(), and dns_view::zonetable.
Referenced by ns_control_docommand().
isc_result_t ns_server_rekey | ( | ns_server_t * | server, | |
char * | args, | |||
isc_buffer_t ** | text | |||
) |
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.
Definition at line 8776 of file server.c.
References DNS_R_NOTMASTER, dns_zone_detach(), dns_zone_getkeyopts(), dns_zone_gettype(), dns_zone_master, dns_zone_rekey(), DNS_ZONEKEY_ALLOW, DNS_ZONEKEY_MAINTAIN, ISC_FALSE, ISC_R_NOPERM, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, ISC_TRUE, NS_COMMAND_SIGN, and zone_from_args().
Referenced by ns_control_docommand().
isc_result_t ns_server_dumprecursing | ( | ns_server_t * | server | ) |
Dump the current recursive queries.
Definition at line 8068 of file server.c.
References CHECKMF, cleanup(), dns_result_totext(), ns_server::interfacemgr, ISC_LOG_ERROR, ISC_LOG_INFO, isc_log_write(), ISC_R_SUCCESS, isc_stdio_close(), isc_stdio_open(), ns_interfacemgr_dumprecursing(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, and ns_server::recfile.
Referenced by ns_control_docommand().
void ns_add_reserved_dispatch | ( | ns_server_t * | server, | |
const isc_sockaddr_t * | addr | |||
) |
Maintain a list of dispatches that require reserved ports.
Definition at line 7072 of file server.c.
References ns_dispatch::addr, AF_INET6, cleanup(), ns_dispatch::dispatch, ns_server::dispatches, ns_server::dispatchgen, ns_dispatch::dispatchgen, dns_dispatch_getudp(), DNS_DISPATCHATTR_IPV4, DNS_DISPATCHATTR_IPV6, DNS_DISPATCHATTR_TCP, DNS_DISPATCHATTR_UDP, ISC_LIST_HEAD, ISC_LIST_INITANDPREPEND, ISC_LIST_NEXT, ISC_LOG_WARNING, isc_log_write(), isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_NOTIMPLEMENTED, ISC_R_SUCCESS, isc_result_totext(), isc_sockaddr_equal(), isc_sockaddr_format(), ISC_SOCKADDR_FORMATSIZE, isc_sockaddr_getport(), isc_sockaddr_pf(), ns_server::mctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, NS_SERVER_VALID, port, REQUIRE, and UDPBUFFERS.
Referenced by configure_peer(), and ns_zone_configure().
isc_result_t ns_server_validation | ( | ns_server_t * | server, | |
char * | args, | |||
isc_buffer_t ** | text | |||
) |
Enable or disable dnssec validation.
Definition at line 8126 of file server.c.
References CHECK, cleanup(), DNS_R_SYNTAX, dns_view_flushcache(), dns_view::enablevalidation, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_FAILURE, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, isc_task_beginexclusive(), isc_task_endexclusive(), ISC_TRUE, dns_view::name, next_token(), putnull(), putstr(), RUNTIME_CHECK, ns_server::task, and ns_server::viewlist.
Referenced by ns_control_docommand().
isc_result_t ns_server_changezone | ( | ns_server_t * | server, | |
char * | args, | |||
isc_buffer_t ** | text | |||
) |
Add a zone to a running process, or modify an existing zone.
Definition at line 9557 of file server.c.
References cfg_obj_asstring(), cfg_obj_destroy(), cfg_tuple_get(), CHECK, cleanup(), dns_fixedname_init, dns_fixedname_name, dns_name_fromtext(), dns_rootname, dns_view_detach(), do_addzone(), do_modzone(), isc_buffer_add, isc_buffer_constinit, isc_buffer_usedlength, ISC_FALSE, ISC_LOG_INFO, isc_log_write(), ISC_R_FAILURE, ISC_R_NOPERM, isc_time_now(), ISC_TRUE, dns_view::name, dns_view::new_zone_config, dns_view::new_zone_file, newzone_parse(), NS_COMMAND_ADDZONE, NS_COMMAND_MODZONE, ns_g_configtime, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, and putnull().
Referenced by ns_control_docommand().
isc_result_t ns_server_delzone | ( | ns_server_t * | server, | |
char * | args, | |||
isc_buffer_t ** | text | |||
) |
Deletes a zone from a running process.
Definition at line 9644 of file server.c.
References ns_cfgctx::add_parser, arg, cfg_tuple_get(), CHECK, cleanup(), ns_cfgctx::conf_parser, ns_cfgctx::config, delete_zoneconf(), dns_db_detach(), dns_zone_detach(), dns_zone_getadded(), dns_zone_getdb(), dns_zone_getfile(), dns_zone_getjournal(), dns_zone_getraw(), dns_zone_gettype(), dns_zone_getview(), dns_zone_slave, dns_zone_stub, dns_zone_unload(), dns_zt_unmount(), INSIST, inuse(), isc_buffer_usedlength, ISC_FALSE, isc_file_remove(), ISC_LOG_INFO, isc_log_write(), ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, isc_task_beginexclusive(), isc_task_endexclusive(), isc_time_now(), ISC_TRUE, dns_view::name, dns_view::new_zone_config, dns_view::new_zone_file, next_token(), ns_g_configtime, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, ns_cfgctx::nzconfig, nzf_remove(), putnull(), putstr(), RUNTIME_CHECK, ns_server::task, TCHECK, ns_cfgctx::vconfig, zone_from_args(), and dns_view::zonetable.
Referenced by ns_control_docommand().
isc_result_t ns_server_showzone | ( | ns_server_t * | server, | |
char * | args, | |||
isc_buffer_t ** | text | |||
) |
Show current configuration for a given zone.
Definition at line 9833 of file server.c.
References CFG_PRINTER_ONELINE, cfg_printx(), cfg_tuple_get(), CHECK, cleanup(), ns_cfgctx::config, dns_zone_detach(), dns_zone_getview(), emitzone(), find_name_in_list_from_map(), isc_buffer_usedlength, ISC_FALSE, ISC_R_FAILURE, ISC_R_NOTFOUND, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, isc_task_beginexclusive(), isc_task_endexclusive(), ISC_TRUE, map, dns_view::name, dns_view::new_zone_config, ns_cfgctx::nzconfig, putnull(), putstr(), RUNTIME_CHECK, ns_server::task, and zone_from_args().
Referenced by ns_control_docommand().
isc_result_t ns_server_signing | ( | ns_server_t * | server, | |
char * | args, | |||
isc_buffer_t ** | text | |||
) |
Lists the status of the signing records for a given zone.
Definition at line 9960 of file server.c.
References CHECK, cleanup(), dns_db_closeversion(), dns_db_currentversion(), dns_db_detach(), dns_db_detachnode(), dns_db_findnode(), dns_db_findrdataset(), dns_private_totext(), DNS_R_SYNTAX, DNS_RDATA_INIT, dns_rdataset_current(), dns_rdataset_disassociate(), dns_rdataset_first(), dns_rdataset_init(), dns_rdataset_isassociated(), dns_rdataset_next(), DNS_SECALG_FORMATSIZE, dns_zone_detach(), dns_zone_getdb(), dns_zone_getorigin(), dns_zone_getprivatetype(), dns_zone_keydone(), dns_zone_setnsec3param(), dns_zone_setserial(), generate_salt(), hash, isc_buffer_init, isc_buffer_usedlength, ISC_FALSE, isc_hex_decodestring(), isc_parse_uint32(), ISC_R_BADNUMBER, ISC_R_NOMORE, ISC_R_NOSPACE, ISC_R_NOTFOUND, ISC_R_RANGE, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, ISC_TRUE, keystr, next_token(), origin, output(), privatetype, putnull(), putstr(), serial, setserial(), and zone_from_args().
Referenced by ns_control_docommand().
isc_result_t ns_server_zonestatus | ( | ns_server_t * | server, | |
char * | args, | |||
isc_buffer_t ** | text | |||
) |
Lists status information for a given zone (e.g., name, type, files, load time, expiry, etc).
Definition at line 10169 of file server.c.
References CHECK, cleanup(), dns_rdataset::covers, dns_db_detach(), dns_db_getsigningtime(), dns_db_issecure(), dns_db_nodecount(), dns_fixedname_init, dns_fixedname_name, dns_name_format(), DNS_NAME_FORMATSIZE, dns_rdataset_disassociate(), dns_rdataset_init(), dns_rdatatype_format(), DNS_RDATATYPE_FORMATSIZE, dns_zone_detach(), dns_zone_dlz, dns_zone_getadded(), dns_zone_getdb(), dns_zone_getexpiretime(), dns_zone_getfile(), dns_zone_getincludes(), dns_zone_getkeyopts(), dns_zone_getloadtime(), dns_zone_getmctx(), dns_zone_getraw(), dns_zone_getrefreshkeytime(), dns_zone_getrefreshtime(), dns_zone_getserial(), dns_zone_getsigresigninginterval(), dns_zone_gettype(), dns_zone_isdynamic(), dns_zone_key, dns_zone_master, dns_zone_redirect, dns_zone_slave, dns_zone_staticstub, dns_zone_stub, DNS_ZONEKEY_ALLOW, DNS_ZONEKEY_MAINTAIN, DNS_ZONEKEY_NORESIGN, fixed, ISC_FALSE, ISC_FORMATHTTPTIMESTAMP_SIZE, isc_mem_free, ISC_R_NOSPACE, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, isc_stdtime_get(), ISC_TF, isc_time_formathttptimestamp(), isc_time_isepoch(), isc_time_set(), isc_time_settoepoch(), ISC_TRUE, name, namebuf, putnull(), putstr(), dns_rdataset::resign, secure(), serial, zone_from_args(), and zonetype.
Referenced by ns_control_docommand().
isc_result_t ns_server_nta | ( | ns_server_t * | server, | |
char * | args, | |||
isc_buffer_t ** | text | |||
) |
Adds a Negative Trust Anchor (NTA) for a specified name and duration, in a particular view if specified, or in all views.
Definition at line 10448 of file server.c.
References argcheck(), isc_textregion::base, CHECK, cleanup(), dns_fixedname_init, dns_fixedname_name, dns_name_fromtext(), dns_ntatable_add(), dns_ntatable_delete(), dns_ntatable_detach(), dns_ntatable_totext(), dns_rootname, dns_ttl_fromtext(), dns_view_flushnode(), dns_view_getntatable(), dns_view_saventa(), dump(), isc_buffer_add, isc_buffer_init, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LOG_ERROR, ISC_LOG_INFO, isc_log_write(), ISC_R_NOTFOUND, ISC_R_RANGE, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, isc_result_totext(), isc_stdtime_get(), isc_task_beginexclusive(), isc_task_endexclusive(), isc_time_formattimestamp(), isc_time_set(), ISC_TRUE, isc_textregion::length, dns_view::name, next_token(), now, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, dns_view::nta_lifetime, putnull(), putstr(), RUNTIME_CHECK, ns_server::task, UNUSED, and ns_server::viewlist.
Referenced by ns_control_docommand().
isc_result_t ns_server_testgen | ( | char * | args, | |
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.
Definition at line 8520 of file server.c.
References CHECK, cleanup(), isc_buffer_reserve(), ISC_R_UNEXPECTEDEND, next_token(), putnull(), and putuint8().
Referenced by ns_control_docommand().
isc_result_t ns_server_mkeys | ( | ns_server_t * | server, | |
char * | args, | |||
isc_buffer_t ** | text | |||
) |
Force fefresh or print status for managed keys zones.
Definition at line 10856 of file server.c.
References isc_textregion::base, CHECK, cleanup(), DNS_NAME_FORMATSIZE, dns_rdataclass_fromtext(), dns_zone_flush(), INSIST, isc_buffer_usedlength, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_SUCCESS, ISC_R_UNEXPECTED, ISC_R_UNEXPECTEDEND, ISC_TRUE, isc_textregion::length, dns_view::managed_keys, mkey_refresh(), mkey_status(), dns_view::name, next_token(), putnull(), putstr(), r, dns_view::rdclass, rdclass, and ns_server::viewlist.
Referenced by ns_control_docommand().