#include <config.h>
#include <stdlib.h>
#include <unistd.h>
#include <limits.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <isc/app.h>
#include <isc/base64.h>
#include <isc/dir.h>
#include <isc/entropy.h>
#include <isc/file.h>
#include <isc/hash.h>
#include <isc/hex.h>
#include <isc/httpd.h>
#include <isc/lex.h>
#include <isc/parseint.h>
#include <isc/portset.h>
#include <isc/print.h>
#include <isc/random.h>
#include <isc/refcount.h>
#include <isc/resource.h>
#include <isc/sha2.h>
#include <isc/socket.h>
#include <isc/stat.h>
#include <isc/stats.h>
#include <isc/stdio.h>
#include <isc/string.h>
#include <isc/task.h>
#include <isc/timer.h>
#include <isc/util.h>
#include <isc/xml.h>
#include <isc/hmacsha.h>
#include <isccfg/grammar.h>
#include <isccfg/namedconf.h>
#include <bind9/check.h>
#include <dns/acache.h>
#include <dns/adb.h>
#include <dns/badcache.h>
#include <dns/cache.h>
#include <dns/db.h>
#include <dns/dispatch.h>
#include <dns/dlz.h>
#include <dns/dns64.h>
#include <dns/forward.h>
#include <dns/journal.h>
#include <dns/keytable.h>
#include <dns/keyvalues.h>
#include <dns/lib.h>
#include <dns/master.h>
#include <dns/masterdump.h>
#include <dns/nta.h>
#include <dns/order.h>
#include <dns/peer.h>
#include <dns/portlist.h>
#include <dns/private.h>
#include <dns/rbt.h>
#include <dns/rdataclass.h>
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
#include <dns/rdatastruct.h>
#include <dns/resolver.h>
#include <dns/rootns.h>
#include <dns/rriterator.h>
#include <dns/secalg.h>
#include <dns/soa.h>
#include <dns/stats.h>
#include <dns/tkey.h>
#include <dns/tsig.h>
#include <dns/ttl.h>
#include <dns/view.h>
#include <dns/zone.h>
#include <dns/zt.h>
#include <dst/dst.h>
#include <dst/result.h>
#include <named/client.h>
#include <named/control.h>
#include <named/geoip.h>
#include <named/interfacemgr.h>
#include <named/log.h>
#include <named/logconf.h>
#include <named/lwresd.h>
#include <named/main.h>
#include <named/os.h>
#include <named/server.h>
#include <named/statschannel.h>
#include <named/tkeyconf.h>
#include <named/tsigconf.h>
#include <named/zoneconf.h>
Go to the source code of this file.
Data Structures | |
struct | ns_dispatch |
struct | ns_cache |
struct | dumpcontext |
struct | viewlistentry |
struct | zonelistentry |
struct | ns_cfgctx |
Configuration context to retain for each view that allows new zones to be added at runtime. More... | |
struct | ns_zoneload_t |
Holds state information for the initial zone loading process. Uses the isc_refcount structure to count the number of views with pending zone loads, dereferencing as each view finishes. More... | |
Defines | |
#define | PATH_MAX 1024 |
#define | SIZE_MAX ((size_t)-1) |
#define | RESOLVER_NTASKS 31 |
#define | UDPBUFFERS 1000 |
#define | EXCLBUFFERS 4096 |
#define | CHECK(op) |
Check an operation for failure. Assumes that the function using it has a 'result' variable and a 'cleanup' label. | |
#define | TCHECK(op) |
#define | CHECKM(op, msg) |
#define | CHECKMF(op, msg, file) |
#define | CHECKFATAL(op, msg) |
#define | MAX_ADB_SIZE_FOR_CACHESHARE 8388608U |
Maximum ADB size for views that share a cache. Use this limit to suppress the total of memory footprint, which should be the main reason for sharing a cache. Only effective when a finite max-cache-size is specified. This is currently defined to be 8MB. | |
#define | CHECK_RRL(cond, pat, val1, val2) |
#define | CHECK_RRL_RATE(rate, def, max_rate, name) |
#define | SETLIMIT(cfgvar, resource, description) |
#define | HEADER1 "# New zone file for view: " |
#define | HEADER2 |
Typedefs | |
typedef struct ns_cfgctx | ns_cfgctx_t |
Functions | |
static ISC_PLATFORM_NORETURN_PRE void | fatal (const char *msg, isc_result_t result) ISC_PLATFORM_NORETURN_POST |
static void | ns_server_reload (isc_task_t *task, isc_event_t *event) |
static isc_result_t | ns_listenelt_fromconfig (const cfg_obj_t *listener, const cfg_obj_t *config, cfg_aclconfctx_t *actx, isc_mem_t *mctx, isc_uint16_t family, ns_listenelt_t **target) |
static isc_result_t | ns_listenlist_fromconfig (const cfg_obj_t *listenlist, const cfg_obj_t *config, cfg_aclconfctx_t *actx, isc_mem_t *mctx, isc_uint16_t family, ns_listenlist_t **target) |
static isc_result_t | configure_forward (const cfg_obj_t *config, dns_view_t *view, dns_name_t *origin, const cfg_obj_t *forwarders, const cfg_obj_t *forwardtype) |
static isc_result_t | configure_alternates (const cfg_obj_t *config, dns_view_t *view, const cfg_obj_t *alternates) |
static isc_result_t | configure_zone (const cfg_obj_t *config, const cfg_obj_t *zconfig, const cfg_obj_t *vconfig, isc_mem_t *mctx, dns_view_t *view, dns_viewlist_t *viewlist, cfg_aclconfctx_t *aclconf, isc_boolean_t added, isc_boolean_t old_rpz_ok, isc_boolean_t modify) |
static isc_result_t | add_keydata_zone (dns_view_t *view, const char *directory, isc_mem_t *mctx) |
static void | end_reserved_dispatches (ns_server_t *server, isc_boolean_t all) |
static void | newzone_cfgctx_destroy (void **cfgp) |
static isc_result_t | putstr (isc_buffer_t **b, const char *str) |
static isc_result_t | putmem (isc_buffer_t **b, const char *str, size_t len) |
static isc_result_t | putuint8 (isc_buffer_t **b, isc_uint8_t val) |
static isc_result_t | putnull (isc_buffer_t **b) |
static isc_result_t | add_comment (FILE *fp, const char *viewname) |
static isc_result_t | configure_view_acl (const cfg_obj_t *vconfig, const cfg_obj_t *config, const char *aclname, const char *acltuplename, cfg_aclconfctx_t *actx, isc_mem_t *mctx, dns_acl_t **aclp) |
Configure a single view ACL at '*aclp'. Get its configuration from 'vconfig' (for per-view configuration) and maybe from 'config'. | |
static isc_result_t | configure_view_sortlist (const cfg_obj_t *vconfig, const cfg_obj_t *config, cfg_aclconfctx_t *actx, isc_mem_t *mctx, dns_acl_t **aclp) |
Configure a sortlist at '*aclp'. Essentially the same as configure_view_acl() except it calls cfg_acl_fromconfig with a nest_level value of 2. | |
static isc_result_t | configure_view_nametable (const cfg_obj_t *vconfig, const cfg_obj_t *config, const char *confname, const char *conftuplename, isc_mem_t *mctx, dns_rbt_t **rbtp) |
static isc_result_t | dstkey_fromconfig (const cfg_obj_t *vconfig, const cfg_obj_t *key, isc_boolean_t managed, dst_key_t **target, isc_mem_t *mctx) |
static isc_result_t | load_view_keys (const cfg_obj_t *keys, const cfg_obj_t *vconfig, dns_view_t *view, isc_boolean_t managed, dns_name_t *keyname, isc_mem_t *mctx) |
static isc_result_t | configure_view_dnsseckeys (dns_view_t *view, const cfg_obj_t *vconfig, const cfg_obj_t *config, const cfg_obj_t *bindkeys, isc_boolean_t auto_dlv, isc_boolean_t auto_root, isc_mem_t *mctx) |
Configure DNSSEC keys for a view. | |
static isc_result_t | mustbesecure (const cfg_obj_t *mbs, dns_resolver_t *resolver) |
static isc_result_t | get_view_querysource_dispatch (const cfg_obj_t **maps, int af, dns_dispatch_t **dispatchp, isc_dscp_t *dscpp, isc_boolean_t is_firstview) |
Get a dispatch appropriate for the resolver of a given view. | |
static isc_result_t | configure_order (dns_order_t *order, const cfg_obj_t *ent) |
static isc_result_t | configure_peer (const cfg_obj_t *cpeer, isc_mem_t *mctx, dns_peer_t **peerp) |
static isc_result_t | disable_algorithms (const cfg_obj_t *disabled, dns_resolver_t *resolver) |
static isc_result_t | disable_ds_digests (const cfg_obj_t *disabled, dns_resolver_t *resolver) |
static isc_boolean_t | on_disable_list (const cfg_obj_t *disablelist, dns_name_t *zonename) |
static isc_result_t | check_dbtype (dns_zone_t *zone, unsigned int dbtypec, const char **dbargv, isc_mem_t *mctx) |
static isc_result_t | setquerystats (dns_zone_t *zone, isc_mem_t *mctx, dns_zonestat_level_t level) |
static ns_cache_t * | cachelist_find (ns_cachelist_t *cachelist, const char *cachename) |
static isc_boolean_t | cache_reusable (dns_view_t *originview, dns_view_t *view, isc_boolean_t new_zero_no_soattl) |
static isc_boolean_t | cache_sharable (dns_view_t *originview, dns_view_t *view, isc_boolean_t new_zero_no_soattl, unsigned int new_cleaning_interval, isc_uint64_t new_max_cache_size) |
static isc_result_t | dlzconfigure_callback (dns_view_t *view, dns_dlzdb_t *dlzdb, dns_zone_t *zone) |
static isc_result_t | dns64_reverse (dns_view_t *view, isc_mem_t *mctx, isc_netaddr_t *na, unsigned int prefixlen, const char *server, const char *contact) |
static isc_result_t | configure_rpz_name (dns_view_t *view, const cfg_obj_t *obj, dns_name_t *name, const char *str, const char *msg) |
static isc_result_t | configure_rpz_name2 (dns_view_t *view, const cfg_obj_t *obj, dns_name_t *name, const char *str, const dns_name_t *origin) |
static isc_result_t | configure_rpz_zone (dns_view_t *view, const cfg_listelt_t *element, isc_boolean_t recursive_only_def, dns_ttl_t ttl_def, const dns_rpz_zone_t *old, isc_boolean_t *old_rpz_okp) |
static isc_result_t | configure_rpz (dns_view_t *view, const cfg_obj_t *rpz_obj, isc_boolean_t *old_rpz_okp) |
static isc_result_t | configure_rrl (dns_view_t *view, const cfg_obj_t *config, const cfg_obj_t *map) |
static isc_result_t | add_soa (dns_db_t *db, dns_dbversion_t *version, dns_name_t *name, dns_name_t *origin, dns_name_t *contact) |
static isc_result_t | add_ns (dns_db_t *db, dns_dbversion_t *version, dns_name_t *name, dns_name_t *nsname) |
static isc_result_t | create_empty_zone (dns_zone_t *zone, dns_name_t *name, dns_view_t *view, const cfg_obj_t *zonelist, const char **empty_dbtype, int empty_dbtypec, dns_zonestat_level_t statlevel) |
static isc_result_t | configure_view (dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config, cfg_obj_t *vconfig, ns_cachelist_t *cachelist, const cfg_obj_t *bindkeys, isc_mem_t *mctx, cfg_aclconfctx_t *actx, isc_boolean_t need_hints) |
static isc_result_t | configure_hints (dns_view_t *view, const char *filename) |
static isc_result_t | get_viewinfo (const cfg_obj_t *vconfig, const char **namep, dns_rdataclass_t *classp) |
static isc_result_t | find_view (const cfg_obj_t *vconfig, dns_viewlist_t *viewlist, dns_view_t **viewp) |
static isc_result_t | create_view (const cfg_obj_t *vconfig, dns_viewlist_t *viewlist, dns_view_t **viewp) |
static void | configure_server_quota (const cfg_obj_t **maps, const char *name, isc_quota_t *quota) |
static isc_result_t | directory_callback (const char *clausename, const cfg_obj_t *obj, void *arg) |
static isc_result_t | scan_interfaces (ns_server_t *server, isc_boolean_t verbose) |
static isc_result_t | add_listenelt (isc_mem_t *mctx, ns_listenlist_t *list, isc_sockaddr_t *addr, isc_dscp_t dscp, isc_boolean_t wcardport_ok) |
static void | adjust_interfaces (ns_server_t *server, isc_mem_t *mctx) |
static void | interface_timer_tick (isc_task_t *task, isc_event_t *event) |
static void | heartbeat_timer_tick (isc_task_t *task, isc_event_t *event) |
static void | pps_timer_tick (isc_task_t *task, isc_event_t *event) |
static isc_result_t | setstring (ns_server_t *server, char **field, const char *value) |
static isc_result_t | setoptstring (ns_server_t *server, char **field, const cfg_obj_t *obj) |
static void | set_limit (const cfg_obj_t **maps, const char *configname, const char *description, isc_resource_t resourceid, isc_resourcevalue_t defaultvalue) |
static void | set_limits (const cfg_obj_t **maps) |
static void | portset_fromconf (isc_portset_t *portset, const cfg_obj_t *ports, isc_boolean_t positive) |
static isc_result_t | removed (dns_zone_t *zone, void *uap) |
static void | cleanup_session_key (ns_server_t *server, isc_mem_t *mctx) |
static isc_result_t | generate_session_key (const char *filename, const char *keynamestr, dns_name_t *keyname, const char *algstr, dns_name_t *algname, unsigned int algtype, isc_uint16_t bits, isc_mem_t *mctx, dns_tsigkey_t **tsigkeyp) |
static isc_result_t | configure_session_key (const cfg_obj_t **maps, ns_server_t *server, isc_mem_t *mctx) |
static isc_result_t | setup_newzones (dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig, cfg_parser_t *conf_parser, cfg_aclconfctx_t *actx) |
static int | count_zones (const cfg_obj_t *conf) |
static isc_result_t | check_lockfile (ns_server_t *server, const cfg_obj_t *config, isc_boolean_t first_time) |
static isc_result_t | load_configuration (const char *filename, ns_server_t *server, isc_boolean_t first_time) |
static isc_result_t | view_loaded (void *arg) |
static isc_result_t | load_zones (ns_server_t *server, isc_boolean_t init) |
static isc_result_t | load_new_zones (ns_server_t *server, isc_boolean_t stop) |
static void | run_server (isc_task_t *task, isc_event_t *event) |
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. | |
static void | shutdown_server (isc_task_t *task, isc_event_t *event) |
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. | |
static void | start_reserved_dispatches (ns_server_t *server) |
void | ns_add_reserved_dispatch (ns_server_t *server, const isc_sockaddr_t *addr) |
Maintain a list of dispatches that require reserved ports. | |
static isc_result_t | loadconfig (ns_server_t *server) |
static isc_result_t | reload (ns_server_t *server) |
static void | reconfig (ns_server_t *server) |
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. | |
static char * | next_token (char **stringp, const char *delim) |
static isc_result_t | zone_from_args (ns_server_t *server, char *args, const char *zonetxt, dns_zone_t **zonep, const char **zonename, isc_buffer_t **text, isc_boolean_t skip) |
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_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_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_dumpstats (ns_server_t *server) |
Dump the current statistics to the statistics file. | |
static isc_result_t | add_zone_tolist (dns_zone_t *zone, void *uap) |
static isc_result_t | add_view_tolist (struct dumpcontext *dctx, dns_view_t *view) |
static void | dumpcontext_destroy (struct dumpcontext *dctx) |
static void | dumpdone (void *arg, isc_result_t result) |
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_dumprecursing (ns_server_t *server) |
Dump the current recursive queries. | |
isc_result_t | ns_server_setdebuglevel (ns_server_t *server, char *args) |
Change or increment the server debug level. | |
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_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_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. | |
static isc_result_t | delete_keynames (dns_tsig_keyring_t *ring, char *target, unsigned int *foundkeys) |
isc_result_t | ns_server_tsigdelete (ns_server_t *server, char *command, isc_buffer_t **text) |
Delete a specific key (with optional view). | |
static isc_result_t | list_keynames (dns_view_t *view, dns_tsig_keyring_t *ring, isc_buffer_t **text, unsigned int *foundkeys) |
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_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. | |
static isc_result_t | synczone (dns_zone_t *zone, void *uap) |
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_freeze (ns_server_t *server, isc_boolean_t freeze, char *args, isc_buffer_t **text) |
Enable or disable updates for a zone. | |
static isc_result_t | nzf_remove (const char *nzfile, const char *viewname, const char *zonename) |
static void | dumpzone (void *arg, const char *buf, int len) |
static isc_result_t | nzf_append (FILE *fp, const char *viewname, const cfg_obj_t *zconfig) |
static isc_result_t | newzone_parse (ns_server_t *server, char *args, dns_view_t **viewp, cfg_obj_t **zoneconfp, const cfg_obj_t **zoneobjp) |
static isc_result_t | delete_zoneconf (cfg_parser_t *pctx, const cfg_obj_t *config, const char *zname) |
static isc_result_t | do_addzone (ns_server_t *server, ns_cfgctx_t *cfg, dns_view_t *view, dns_name_t *name, cfg_obj_t *zoneconf, const cfg_obj_t *zoneobj, isc_buffer_t **text) |
static isc_result_t | do_modzone (ns_server_t *server, ns_cfgctx_t *cfg, dns_view_t *view, dns_name_t *name, const char *zname, const cfg_obj_t *zoneobj, isc_buffer_t **text) |
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. | |
static isc_boolean_t | inuse (const char *file, isc_boolean_t first, isc_buffer_t **text) |
isc_result_t | ns_server_delzone (ns_server_t *server, char *args, isc_buffer_t **text) |
Deletes a zone from a running process. | |
static const cfg_obj_t * | find_name_in_list_from_map (const cfg_obj_t *config, const char *map_key_for_list, const char *name) |
static void | emitzone (void *arg, const char *buf, int len) |
isc_result_t | ns_server_showzone (ns_server_t *server, char *args, isc_buffer_t **text) |
Show current configuration for a given zone. | |
static isc_result_t | generate_salt (unsigned char *salt, size_t saltlen) |
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). | |
static isc_boolean_t | argcheck (char *cmd, const char *full) |
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_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. | |
static isc_result_t | mkey_refresh (dns_view_t *view, isc_buffer_t **text) |
static isc_result_t | mkey_dumpzone (dns_view_t *view, isc_buffer_t **text) |
static isc_result_t | mkey_status (dns_view_t *view, isc_buffer_t **text) |
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. | |
Variables | |
const char * | empty_zones [] |
Definition in file server.c.
#define SIZE_MAX ((size_t)-1) |
#define EXCLBUFFERS 4096 |
#define CHECK | ( | op | ) |
Value:
do { result = (op); \ if (result != ISC_R_SUCCESS) goto cleanup; \ } while (0)
#define TCHECK | ( | op | ) |
Value:
do { tresult = (op); \ if (tresult != ISC_R_SUCCESS) { \ isc_buffer_clear(*text); \ goto cleanup; \ } \ } while (0)
Definition at line 157 of file server.c.
Referenced by do_addzone(), do_modzone(), and ns_server_delzone().
#define CHECKM | ( | op, | |||
msg | ) |
Value:
do { result = (op); \ if (result != ISC_R_SUCCESS) { \ isc_log_write(ns_g_lctx, \ NS_LOGCATEGORY_GENERAL, \ NS_LOGMODULE_SERVER, \ ISC_LOG_ERROR, \ "%s: %s", msg, \ isc_result_totext(result)); \ goto cleanup; \ } \ } while (0) \
Definition at line 165 of file server.c.
Referenced by configure_alternates(), configure_forward(), configure_view(), dstkey_fromconfig(), and load_configuration().
#define CHECKMF | ( | op, | |||
msg, | |||||
file | ) |
Value:
do { result = (op); \ if (result != ISC_R_SUCCESS) { \ isc_log_write(ns_g_lctx, \ NS_LOGCATEGORY_GENERAL, \ NS_LOGMODULE_SERVER, \ ISC_LOG_ERROR, \ "%s '%s': %s", msg, file, \ isc_result_totext(result)); \ goto cleanup; \ } \ } while (0) \
Definition at line 178 of file server.c.
Referenced by ns_server_dumpdb(), ns_server_dumprecursing(), ns_server_dumpsecroots(), and ns_server_dumpstats().
#define CHECKFATAL | ( | op, | |||
msg | ) |
Value:
do { result = (op); \ if (result != ISC_R_SUCCESS) \ fatal(msg, result); \ } while (0) \
Definition at line 191 of file server.c.
Referenced by ns_server_create(), run_server(), and view_loaded().
#define MAX_ADB_SIZE_FOR_CACHESHARE 8388608U |
Maximum ADB size for views that share a cache. Use this limit to suppress the total of memory footprint, which should be the main reason for sharing a cache. Only effective when a finite max-cache-size is specified. This is currently defined to be 8MB.
Definition at line 203 of file server.c.
Referenced by configure_view().
#define CHECK_RRL | ( | cond, | |||
pat, | |||||
val1, | |||||
val2 | ) |
Value:
do { \ if (!(cond)) { \ cfg_obj_log(obj, ns_g_lctx, ISC_LOG_ERROR, \ pat, val1, val2); \ result = ISC_R_RANGE; \ goto cleanup; \ } \ } while (0)
Definition at line 1941 of file server.c.
Referenced by configure_rrl().
#define CHECK_RRL_RATE | ( | rate, | |||
def, | |||||
max_rate, | |||||
name | ) |
Value:
do { \ obj = NULL; \ rrl->rate.str = name; \ result = cfg_map_get(map, name, &obj); \ if (result == ISC_R_SUCCESS) { \ rrl->rate.r = cfg_obj_asuint32(obj); \ CHECK_RRL(rrl->rate.r <= max_rate, \ name" %d > %d", \ rrl->rate.r, max_rate); \ } else { \ rrl->rate.r = def; \ } \ rrl->rate.scaled = rrl->rate.r; \ } while (0)
Definition at line 1951 of file server.c.
Referenced by configure_rrl().
#define SETLIMIT | ( | cfgvar, | |||
resource, | |||||
description | ) |
Value:
set_limit(maps, cfgvar, description, isc_resource_ ## resource, \ ns_g_init ## resource)
Definition at line 5007 of file server.c.
Referenced by set_limits().
#define HEADER1 "# New zone file for view: " |
#define HEADER2 |
Value:
"\n# This file contains configuration for zones added by\n" \ "# the 'rndc addzone' command. DO NOT EDIT BY HAND.\n"
Definition at line 9056 of file server.c.
Referenced by add_comment().
typedef struct ns_cfgctx ns_cfgctx_t |
static void fatal | ( | const char * | msg, | |
isc_result_t | result | |||
) | [static] |
Definition at line 7035 of file server.c.
References ISC_LOG_CRITICAL, isc_log_write(), isc_result_totext(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, and ns_os_shutdown().
static void ns_server_reload | ( | isc_task_t * | task, | |
isc_event_t * | event | |||
) | [static] |
Definition at line 7212 of file server.c.
References INSIST, ISC_LOG_INFO, isc_log_write(), LOCK, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, reload, ns_server::reload_event, ns_server::reload_event_lock, ns_server::task, UNLOCK, and UNUSED.
Referenced by ns_server_create().
static isc_result_t ns_listenelt_fromconfig | ( | const cfg_obj_t * | listener, | |
const cfg_obj_t * | config, | |||
cfg_aclconfctx_t * | actx, | |||
isc_mem_t * | mctx, | |||
isc_uint16_t | family, | |||
ns_listenelt_t ** | target | |||
) | [static] |
Definition at line 7609 of file server.c.
References ns_listenelt::acl, cfg_acl_fromconfig2(), cfg_obj_asuint32(), cfg_obj_isuint32(), cfg_obj_log(), cfg_tuple_get(), ISC_LOG_ERROR, ISC_R_RANGE, ISC_R_SUCCESS, ISC_UINT16_MAX, ns_config_getport(), ns_listenelt_create(), ns_listenelt_destroy(), port, and REQUIRE.
Referenced by ns_listenlist_fromconfig().
static isc_result_t ns_listenlist_fromconfig | ( | const cfg_obj_t * | listenlist, | |
const cfg_obj_t * | config, | |||
cfg_aclconfctx_t * | actx, | |||
isc_mem_t * | mctx, | |||
isc_uint16_t | family, | |||
ns_listenlist_t ** | target | |||
) | [static] |
Definition at line 7570 of file server.c.
References cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cleanup(), ISC_LIST_APPEND, ISC_R_SUCCESS, ns_listenelt_fromconfig(), ns_listenlist_create(), ns_listenlist_detach(), and REQUIRE.
Referenced by load_configuration().
static isc_result_t configure_forward | ( | const cfg_obj_t * | config, | |
dns_view_t * | view, | |||
dns_name_t * | origin, | |||
const cfg_obj_t * | forwarders, | |||
const cfg_obj_t * | forwardtype | |||
) | [static] |
Definition at line 3968 of file server.c.
References dns_forwarder::addr, cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_obj_assockaddr(), cfg_obj_asstring(), cfg_obj_asuint32(), cfg_obj_getdscp(), cfg_obj_isuint32(), cfg_obj_log(), cfg_tuple_get(), CHECKM, cleanup(), dns_fwdpolicy_first, dns_fwdpolicy_none, dns_fwdpolicy_only, dns_fwdtable_addfwd(), dns_name_format(), DNS_NAME_FORMATSIZE, dns_forwarder::dscp, dns_view::fwdtable, INSIST, ISC_LINK_INIT, ISC_LIST_APPEND, ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_INIT, ISC_LIST_UNLINK, ISC_LOG_ERROR, ISC_LOG_WARNING, isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_RANGE, ISC_R_SUCCESS, isc_result_totext(), isc_sockaddr_getport(), isc_sockaddr_setport(), ISC_UINT16_MAX, dns_view::mctx, namebuf, ns_config_getport(), and port.
Referenced by configure_view(), and configure_zone().
static isc_result_t configure_alternates | ( | const cfg_obj_t * | config, | |
dns_view_t * | view, | |||
const cfg_obj_t * | alternates | |||
) | [static] |
Definition at line 3883 of file server.c.
References buffer, cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_obj_assockaddr(), cfg_obj_asstring(), cfg_obj_asuint32(), cfg_obj_issockaddr(), cfg_obj_isuint32(), cfg_obj_log(), cfg_tuple_get(), CHECK, CHECKM, cleanup(), dns_fixedname_init, dns_fixedname_name, dns_name_fromtext(), dns_resolver_addalternate(), dns_rootname, fixed, isc_buffer_add, isc_buffer_constinit, ISC_LOG_ERROR, ISC_R_RANGE, ISC_R_SUCCESS, isc_sockaddr_getport(), isc_sockaddr_setport(), ISC_UINT16_MAX, name, ns_config_getport(), port, dns_view::resolver, and str.
Referenced by configure_view().
static isc_result_t configure_zone | ( | const cfg_obj_t * | config, | |
const cfg_obj_t * | zconfig, | |||
const cfg_obj_t * | vconfig, | |||
isc_mem_t * | mctx, | |||
dns_view_t * | view, | |||
dns_viewlist_t * | viewlist, | |||
cfg_aclconfctx_t * | aclconf, | |||
isc_boolean_t | added, | |||
isc_boolean_t | old_rpz_ok, | |||
isc_boolean_t | modify | |||
) | [static] |
Definition at line 4195 of file server.c.
References dns_view::acache, buffer, cfg_map_get(), cfg_obj_asboolean(), cfg_obj_asstring(), cfg_obj_log(), cfg_tuple_get(), CHECK, cleanup(), configure_forward(), configure_hints(), dns_fixedname_init, dns_fixedname_name, dns_name_equal(), dns_name_fromtext(), dns_rootname, DNS_RPZ_INVALID_NUM, dns_view_adddelegationonly(), dns_view_addzone(), dns_view_detach(), dns_view_findzone(), dns_viewlist_find(), dns_zone_attach(), dns_zone_create(), dns_zone_detach(), dns_zone_get_rpz_num(), dns_zone_getkeyopts(), dns_zone_getraw(), dns_zone_link(), dns_zone_rekey(), dns_zone_rpz_enable(), dns_zone_setacache(), dns_zone_setadded(), dns_zone_setorigin(), dns_zone_setstats(), dns_zone_setview(), DNS_ZONEKEY_MAINTAIN, dns_zonemgr_createzone(), dns_zonemgr_managezone(), INSIST, isc_buffer_add, isc_buffer_constinit, ISC_FALSE, ISC_LOG_ERROR, ISC_LOG_WARNING, isc_log_write(), ISC_R_EXISTS, ISC_R_FAILURE, ISC_R_NOTFOUND, ISC_R_SUCCESS, dns_view::name, ns_config_getclass(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, ns_zone_configure(), ns_zone_reusable(), dns_rpz_zones::num_zones, dns_rpz_zone::origin, origin, dns_rpz_zones::p, dns_view::rdclass, dns_view::redirect, dns_view::rpzs, zname, and dns_rpz_zones::zones.
static isc_result_t add_keydata_zone | ( | dns_view_t * | view, | |
const char * | directory, | |||
isc_mem_t * | mctx | |||
) | [static] |
Definition at line 4591 of file server.c.
References dns_view::acache, CHECK, cleanup(), dns_acl_detach(), dns_acl_none(), dns_dialuptype_no, dns_notifytype_no, dns_rootname, dns_view_detach(), dns_viewlist_find(), dns_zone_attach(), dns_zone_detach(), dns_zone_key, dns_zone_setacache(), dns_zone_setclass(), dns_zone_setdialup(), dns_zone_setfile(), dns_zone_setjournalsize(), dns_zone_setnotifytype(), dns_zone_setoption(), dns_zone_setorigin(), dns_zone_setqueryacl(), dns_zone_setqueryonacl(), dns_zone_setstats(), dns_zone_settype(), dns_zone_setview(), dns_zone_synckeyzone(), dns_zonemgr_createzone(), dns_zonemgr_managezone(), DNS_ZONEOPT_NOCHECKNS, dns_zonestat_none, isc_file_sanitize(), ISC_LOG_INFO, isc_log_write(), ISC_R_NOTFOUND, ISC_R_SUCCESS, ISC_TF, ISC_TRUE, dns_view::managed_keys, dns_view::name, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, PATH_MAX, dns_view::rdclass, REQUIRE, and setquerystats().
Referenced by configure_view_dnsseckeys().
static void end_reserved_dispatches | ( | ns_server_t * | server, | |
isc_boolean_t | all | |||
) | [static] |
Definition at line 7054 of file server.c.
References ns_dispatch::dispatch, ns_server::dispatches, ns_dispatch::dispatchgen, ns_server::dispatchgen, dns_dispatch_detach(), ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, isc_mem_put, ns_server::mctx, NS_SERVER_VALID, and REQUIRE.
Referenced by loadconfig(), and shutdown_server().
static void newzone_cfgctx_destroy | ( | void ** | cfgp | ) | [static] |
Definition at line 9896 of file server.c.
References ns_cfgctx::actx, ns_cfgctx::add_parser, cfg_aclconfctx_detach(), cfg_obj_destroy(), cfg_parser_destroy(), ns_cfgctx::conf_parser, ns_cfgctx::config, isc_mem_putanddetach, ns_cfgctx::mctx, ns_cfgctx::nzconfig, REQUIRE, and ns_cfgctx::vconfig.
Referenced by setup_newzones().
static isc_result_t putstr | ( | isc_buffer_t ** | b, | |
const char * | str | |||
) | [inline, static] |
static isc_result_t putmem | ( | isc_buffer_t ** | b, | |
const char * | str, | |||
size_t | len | |||
) | [static] |
Definition at line 10135 of file server.c.
References isc_buffer_putmem, isc_buffer_reserve(), ISC_R_NOSPACE, and ISC_R_SUCCESS.
Referenced by emitzone(), and putstr().
static isc_result_t putuint8 | ( | isc_buffer_t ** | b, | |
isc_uint8_t | val | |||
) | [static] |
Definition at line 10152 of file server.c.
References isc_buffer_putuint8, isc_buffer_reserve(), ISC_R_NOSPACE, and ISC_R_SUCCESS.
Referenced by ns_server_testgen(), and putnull().
static isc_result_t putnull | ( | isc_buffer_t ** | b | ) | [inline, static] |
Definition at line 10164 of file server.c.
References putuint8().
Referenced by inuse(), ns_server_changezone(), ns_server_delzone(), ns_server_dumpsecroots(), ns_server_freeze(), ns_server_mkeys(), ns_server_notifycommand(), ns_server_nta(), ns_server_refreshcommand(), ns_server_reloadcommand(), ns_server_showzone(), ns_server_signing(), ns_server_status(), ns_server_testgen(), ns_server_tsigdelete(), ns_server_tsiglist(), ns_server_validation(), ns_server_zonestatus(), and zone_from_args().
static isc_result_t add_comment | ( | FILE * | fp, | |
const char * | viewname | |||
) | [static] |
Definition at line 9059 of file server.c.
References CHECK, cleanup(), HEADER1, HEADER2, and isc_stdio_write().
Referenced by nzf_append(), and nzf_remove().
static isc_result_t configure_view_acl | ( | const cfg_obj_t * | vconfig, | |
const cfg_obj_t * | config, | |||
const char * | aclname, | |||
const char * | acltuplename, | |||
cfg_aclconfctx_t * | actx, | |||
isc_mem_t * | mctx, | |||
dns_acl_t ** | aclp | |||
) | [static] |
Configure a single view ACL at '*aclp'. Get its configuration from 'vconfig' (for per-view configuration) and maybe from 'config'.
Definition at line 444 of file server.c.
References cfg_acl_fromconfig(), cfg_map_get(), cfg_tuple_get(), dns_acl_detach(), ISC_R_SUCCESS, and ns_config_get().
Referenced by configure_view(), and load_configuration().
static isc_result_t configure_view_sortlist | ( | const cfg_obj_t * | vconfig, | |
const cfg_obj_t * | config, | |||
cfg_aclconfctx_t * | actx, | |||
isc_mem_t * | mctx, | |||
dns_acl_t ** | aclp | |||
) | [static] |
Configure a sortlist at '*aclp'. Essentially the same as configure_view_acl() except it calls cfg_acl_fromconfig with a nest_level value of 2.
Definition at line 493 of file server.c.
References cfg_acl_fromconfig(), cfg_map_get(), cfg_tuple_get(), dns_acl_detach(), ISC_R_SUCCESS, and ns_config_get().
Referenced by configure_view().
static isc_result_t configure_view_nametable | ( | const cfg_obj_t * | vconfig, | |
const cfg_obj_t * | config, | |||
const char * | confname, | |||
const char * | conftuplename, | |||
isc_mem_t * | mctx, | |||
dns_rbt_t ** | rbtp | |||
) | [static] |
Definition at line 531 of file server.c.
References cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_map_get(), cfg_obj_asstring(), cfg_obj_isvoid(), cfg_obj_log(), cfg_tuple_get(), CHECK, cleanup(), dns_fixedname_init, dns_fixedname_name, dns_name_fromtext(), dns_rbt_addname(), dns_rbt_create(), dns_rbt_destroy(), dns_rootname, fixed, isc_buffer_add, isc_buffer_constinit, ISC_LOG_ERROR, ISC_R_SUCCESS, isc_result_totext(), name, ns_config_get(), and str.
Referenced by configure_view().
static isc_result_t dstkey_fromconfig | ( | const cfg_obj_t * | vconfig, | |
const cfg_obj_t * | key, | |||
isc_boolean_t | managed, | |||
dst_key_t ** | target, | |||
isc_mem_t * | mctx | |||
) | [static] |
Definition at line 611 of file server.c.
References isc_region::base, cfg_obj_asstring(), cfg_obj_asuint32(), cfg_obj_log(), cfg_tuple_get(), CHECK, CHECKM, cleanup(), dns_fixedname_init, dns_fixedname_name, dns_name_fromtext(), dns_rdata_fromstruct(), dns_rootname, DST_ALG_RSAMD5, DST_ALG_RSASHA1, dst_key_free(), dst_key_fromdns(), DST_R_NOCRYPTO, DST_R_UNSUPPORTEDALG, INSIST, isc_base64_decodestring(), isc_buffer_add, isc_buffer_constinit, isc_buffer_init, isc_buffer_usedregion, ISC_LINK_INIT, ISC_LOG_ERROR, ISC_LOG_WARNING, ISC_R_FAILURE, ISC_R_RANGE, ISC_R_SUCCESS, isc_result_totext(), keystr, isc_region::length, namebuf, ns_config_getclass(), and r.
Referenced by load_view_keys().
static isc_result_t load_view_keys | ( | const cfg_obj_t * | keys, | |
const cfg_obj_t * | vconfig, | |||
dns_view_t * | view, | |||
isc_boolean_t | managed, | |||
dns_name_t * | keyname, | |||
isc_mem_t * | mctx | |||
) | [static] |
Definition at line 734 of file server.c.
References cfg_list_first(), cfg_list_next(), cfg_listelt_value(), CHECK, cleanup(), dns_keytable_add(), dns_keytable_detach(), dns_name_equal(), dns_view_getsecroots(), dst_key_free(), dst_key_name(), DST_R_NOCRYPTO, DST_R_UNSUPPORTEDALG, dstkey_fromconfig(), ISC_R_SUCCESS, key, and keylist.
Referenced by configure_view_dnsseckeys().
static isc_result_t configure_view_dnsseckeys | ( | dns_view_t * | view, | |
const cfg_obj_t * | vconfig, | |||
const cfg_obj_t * | config, | |||
const cfg_obj_t * | bindkeys, | |||
isc_boolean_t | auto_dlv, | |||
isc_boolean_t | auto_root, | |||
isc_mem_t * | mctx | |||
) | [static] |
Configure DNSSEC keys for a view.
The per-view configuration values and the server-global defaults are read from 'vconfig' and 'config'.
Definition at line 795 of file server.c.
References add_keydata_zone(), cfg_map_get(), cfg_obj_asstring(), cfg_tuple_get(), CHECK, cleanup(), directory, dns_view::dlv, DNS_LOGCATEGORY_SECURITY, dns_rootname, dns_view_initntatable(), dns_view_initsecroots(), ISC_FALSE, isc_file_isdirectory(), ISC_LOG_ERROR, ISC_LOG_INFO, isc_log_write(), ISC_R_SUCCESS, ISC_R_UNEXPECTED, isc_result_totext(), ISC_TRUE, load_view_keys(), dns_view::name, ns_config_get(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, and dns_view::rdclass.
Referenced by configure_view().
static isc_result_t mustbesecure | ( | const cfg_obj_t * | mbs, | |
dns_resolver_t * | resolver | |||
) | [static] |
Definition at line 959 of file server.c.
References cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_obj_asboolean(), cfg_obj_asstring(), cfg_tuple_get(), CHECK, cleanup(), dns_fixedname_init, dns_fixedname_name, dns_name_fromtext(), dns_resolver_setmustbesecure(), dns_rootname, fixed, isc_buffer_add, isc_buffer_constinit, ISC_R_SUCCESS, name, and str.
static isc_result_t get_view_querysource_dispatch | ( | const cfg_obj_t ** | maps, | |
int | af, | |||
dns_dispatch_t ** | dispatchp, | |||
isc_dscp_t * | dscpp, | |||
isc_boolean_t | is_firstview | |||
) | [static] |
Get a dispatch appropriate for the resolver of a given view.
Definition at line 994 of file server.c.
References AF_INET6, cfg_obj_assockaddr(), cfg_obj_getdscp(), cfg_obj_log(), dns_dispatch_getudp(), DNS_DISPATCHATTR_EXCLUSIVE, DNS_DISPATCHATTR_IPV4, DNS_DISPATCHATTR_IPV6, DNS_DISPATCHATTR_TCP, DNS_DISPATCHATTR_UDP, EXCLBUFFERS, INSIST, ISC_LOG_ERROR, ISC_LOG_INFO, isc_log_write(), isc_net_probeipv4(), isc_net_probeipv6(), ISC_R_FAILURE, ISC_R_SUCCESS, isc_sockaddr_any(), isc_sockaddr_any6(), isc_sockaddr_equal(), isc_sockaddr_format(), ISC_SOCKADDR_FORMATSIZE, isc_sockaddr_getport(), isc_sockaddr_pf(), ns_config_get(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, and UDPBUFFERS.
Referenced by configure_view().
static isc_result_t configure_order | ( | dns_order_t * | order, | |
const cfg_obj_t * | ent | |||
) | [static] |
Definition at line 1107 of file server.c.
References cfg_obj_asstring(), cfg_obj_isstring(), cfg_tuple_get(), dns_fixedname_init, dns_fixedname_name, dns_name_fromtext(), dns_order_add(), DNS_RDATASETATTR_FIXEDORDER, DNS_RDATASETATTR_RANDOMIZE, dns_rootname, fixed, INSIST, isc_buffer_add, isc_buffer_constinit, ISC_R_SUCCESS, ISC_TF, ns_config_getclass(), ns_config_gettype(), rdclass, and str.
Referenced by configure_view().
static isc_result_t configure_peer | ( | const cfg_obj_t * | cpeer, | |
isc_mem_t * | mctx, | |||
dns_peer_t ** | peerp | |||
) | [static] |
Definition at line 1175 of file server.c.
References cfg_map_get(), cfg_map_getname(), cfg_obj_asboolean(), cfg_obj_asnetprefix(), cfg_obj_assockaddr(), cfg_obj_asstring(), cfg_obj_asuint32(), cfg_obj_getdscp(), CHECK, cleanup(), dns_many_answers, dns_one_answer, dns_peer_detach(), dns_peer_newprefix(), dns_peer_setbogus(), dns_peer_setednsversion(), dns_peer_setforcetcp(), dns_peer_setkeybycharp(), dns_peer_setmaxudp(), dns_peer_setnotifydscp(), dns_peer_setnotifysource(), dns_peer_setprovideixfr(), dns_peer_setquerydscp(), dns_peer_setquerysource(), dns_peer_setrequestexpire(), dns_peer_setrequestixfr(), dns_peer_setrequestnsid(), dns_peer_setrequestsit(), dns_peer_setsupportedns(), dns_peer_settransferdscp(), dns_peer_settransferformat(), dns_peer_settransfers(), dns_peer_settransfersource(), dns_peer_setudpsize(), isc_netaddr::family, INSIST, ISC_R_SUCCESS, ns_add_reserved_dispatch(), and str.
Referenced by configure_view().
static isc_result_t disable_algorithms | ( | const cfg_obj_t * | disabled, | |
dns_resolver_t * | resolver | |||
) | [static] |
Definition at line 1347 of file server.c.
References algorithms, isc_textregion::base, cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_obj_asstring(), cfg_obj_log(), cfg_tuple_get(), CHECK, cleanup(), DE_CONST, dns_fixedname_init, dns_fixedname_name, dns_name_fromtext(), dns_resolver_disable_algorithm(), dns_rootname, dns_secalg_fromtext(), fixed, isc_buffer_add, isc_buffer_constinit, ISC_LOG_ERROR, isc_parse_uint8(), ISC_R_SUCCESS, isc_textregion::length, name, r, and str.
Referenced by configure_view().
static isc_result_t disable_ds_digests | ( | const cfg_obj_t * | disabled, | |
dns_resolver_t * | resolver | |||
) | [static] |
Definition at line 1393 of file server.c.
References isc_textregion::base, cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_obj_asstring(), cfg_obj_log(), cfg_tuple_get(), CHECK, cleanup(), DE_CONST, digest, dns_dsdigest_fromtext(), dns_fixedname_init, dns_fixedname_name, dns_name_fromtext(), dns_resolver_disable_ds_digest(), dns_rootname, fixed, isc_buffer_add, isc_buffer_constinit, ISC_LOG_ERROR, ISC_R_SUCCESS, isc_textregion::length, name, r, and str.
Referenced by configure_view().
static isc_boolean_t on_disable_list | ( | const cfg_obj_t * | disablelist, | |
dns_name_t * | zonename | |||
) | [static] |
Definition at line 1435 of file server.c.
References cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_obj_asstring(), dns_fixedname_init, dns_fixedname_name, dns_name_equal(), dns_name_fromtext(), dns_rootname, fixed, isc_buffer_add, isc_buffer_constinit, ISC_FALSE, ISC_R_SUCCESS, ISC_TRUE, name, RUNTIME_CHECK, and str.
Referenced by configure_view().
static isc_result_t check_dbtype | ( | dns_zone_t * | zone, | |
unsigned int | dbtypec, | |||
const char ** | dbargv, | |||
isc_mem_t * | mctx | |||
) | [static] |
Definition at line 1465 of file server.c.
References CHECK, cleanup(), dns_zone_getdbtype(), isc_mem_free, ISC_R_FAILURE, and ISC_R_SUCCESS.
Referenced by create_empty_zone().
static isc_result_t setquerystats | ( | dns_zone_t * | zone, | |
isc_mem_t * | mctx, | |||
dns_zonestat_level_t | level | |||
) | [static] |
Definition at line 1493 of file server.c.
References dns_nsstatscounter_max, dns_zone_setrequeststats(), dns_zone_setstatlevel(), dns_zonestat_full, ISC_R_SUCCESS, isc_stats_create(), and isc_stats_detach().
Referenced by add_keydata_zone(), create_empty_zone(), and dns64_reverse().
static ns_cache_t* cachelist_find | ( | ns_cachelist_t * | cachelist, | |
const char * | cachename | |||
) | [static] |
Definition at line 1514 of file server.c.
References ns_cache::cache, dns_cache_getname(), ISC_LIST_HEAD, and ISC_LIST_NEXT.
Referenced by configure_view().
static isc_boolean_t cache_reusable | ( | dns_view_t * | originview, | |
dns_view_t * | view, | |||
isc_boolean_t | new_zero_no_soattl | |||
) | [static] |
Definition at line 1528 of file server.c.
References dns_view::acceptexpired, dns_view::checknames, dns_resolver_getzeronosoattl(), dns_view::enablevalidation, ISC_FALSE, ISC_TRUE, dns_view::maxcachettl, dns_view::maxncachettl, and dns_view::resolver.
Referenced by cache_sharable(), and configure_view().
static isc_boolean_t cache_sharable | ( | dns_view_t * | originview, | |
dns_view_t * | view, | |||
isc_boolean_t | new_zero_no_soattl, | |||
unsigned int | new_cleaning_interval, | |||
isc_uint64_t | new_max_cache_size | |||
) | [static] |
Definition at line 1545 of file server.c.
References dns_view::cache, cache_reusable(), dns_cache_getcachesize(), dns_cache_getcleaninginterval(), ISC_FALSE, and ISC_TRUE.
Referenced by configure_view().
static isc_result_t dlzconfigure_callback | ( | dns_view_t * | view, | |
dns_dlzdb_t * | dlzdb, | |||
dns_zone_t * | zone | |||
) | [static] |
Definition at line 1574 of file server.c.
References dns_zone_getorigin(), dns_zone_setstats(), dns_zonemgr_managezone(), ISC_R_SUCCESS, ns_zone_configure_writeable_dlz(), origin, and dns_view::rdclass.
Referenced by configure_view().
static isc_result_t dns64_reverse | ( | dns_view_t * | view, | |
isc_mem_t * | mctx, | |||
isc_netaddr_t * | na, | |||
unsigned int | prefixlen, | |||
const char * | server, | |||
const char * | contact | |||
) | [static] |
Definition at line 1588 of file server.c.
References CHECK, cleanup(), dns_dialuptype_no, dns_fixedname_init, dns_fixedname_name, dns_name_fromtext(), dns_notifytype_no, dns_rootname, dns_view_addzone(), dns_zone_create(), dns_zone_detach(), dns_zone_master, dns_zone_setclass(), dns_zone_setdbtype(), dns_zone_setdialup(), dns_zone_setnotifytype(), dns_zone_setoption(), dns_zone_setorigin(), dns_zone_setqueryacl(), dns_zone_setqueryonacl(), dns_zone_setstats(), dns_zone_settype(), dns_zone_setview(), dns_zonemgr_managezone(), DNS_ZONEOPT_NOCHECKNS, dns_zonestat_none, fixed, isc_netaddr::in6, isc_buffer_add, isc_buffer_constinit, ISC_LOG_INFO, isc_log_write(), ISC_TRUE, name, dns_view::name, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, dns_view::queryacl, dns_view::queryonacl, dns_view::rdclass, REQUIRE, setquerystats(), and isc_netaddr::type.
Referenced by configure_view().
static isc_result_t configure_rpz_name | ( | dns_view_t * | view, | |
const cfg_obj_t * | obj, | |||
dns_name_t * | name, | |||
const char * | str, | |||
const char * | msg | |||
) | [static] |
Definition at line 1666 of file server.c.
References cfg_obj_log(), DNS_NAME_DOWNCASE, dns_name_fromstring(), DNS_RPZ_ERROR_LEVEL, ISC_R_SUCCESS, and dns_view::mctx.
Referenced by configure_rpz_zone().
static isc_result_t configure_rpz_name2 | ( | dns_view_t * | view, | |
const cfg_obj_t * | obj, | |||
dns_name_t * | name, | |||
const char * | str, | |||
const dns_name_t * | origin | |||
) | [static] |
Definition at line 1679 of file server.c.
References cfg_obj_log(), DNS_NAME_DOWNCASE, dns_name_fromstring2(), DNS_RPZ_ERROR_LEVEL, ISC_R_SUCCESS, and dns_view::mctx.
Referenced by configure_rpz_zone().
static isc_result_t configure_rpz_zone | ( | dns_view_t * | view, | |
const cfg_listelt_t * | element, | |||
isc_boolean_t | recursive_only_def, | |||
dns_ttl_t | ttl_def, | |||
const dns_rpz_zone_t * | old, | |||
isc_boolean_t * | old_rpz_okp | |||
) | [static] |
Definition at line 1693 of file server.c.
References cfg_listelt_value(), cfg_obj_asboolean(), cfg_obj_asstring(), cfg_obj_asuint32(), cfg_obj_isuint32(), cfg_obj_isvoid(), cfg_obj_log(), cfg_tuple_get(), dns_rpz_zone::cname, configure_rpz_name(), configure_rpz_name2(), dns_name_equal(), dns_name_init(), DNS_R_DUPLICATE, DNS_R_EMPTYLABEL, dns_rootname, DNS_RPZ_CLIENT_IP_ZONE, DNS_RPZ_DROP_NAME, DNS_RPZ_ERROR_LEVEL, DNS_RPZ_IP_ZONE, DNS_RPZ_MAX_ZONES, DNS_RPZ_NSDNAME_ZONE, DNS_RPZ_NSIP_ZONE, DNS_RPZ_PASSTHRU_NAME, DNS_RPZ_POLICY_CNAME, DNS_RPZ_POLICY_ERROR, DNS_RPZ_POLICY_GIVEN, dns_rpz_str2policy(), DNS_RPZ_TCP_ONLY_NAME, DNS_RPZ_ZBIT, INSIST, ISC_FALSE, isc_mem_get, isc_mem_put, ISC_R_FAILURE, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_refcount_init(), dns_rpz_zone::max_policy_ttl, dns_rpz_zones::mctx, dns_rpz_zones::no_rd_ok, dns_rpz_zones::num_zones, dns_rpz_zone::origin, dns_rpz_zones::p, dns_rpz_zone::policy, REQUIRE, dns_view::rpzs, str, and dns_rpz_zones::zones.
Referenced by configure_rpz().
static isc_result_t configure_rpz | ( | dns_view_t * | view, | |
const cfg_obj_t * | rpz_obj, | |||
isc_boolean_t * | old_rpz_okp | |||
) | [static] |
Definition at line 1834 of file server.c.
References cfg_list_first(), cfg_list_next(), cfg_obj_asboolean(), cfg_obj_asuint32(), cfg_obj_isuint32(), cfg_obj_isvoid(), cfg_tuple_get(), configure_rpz_zone(), dns_rpz_attach_rpzs(), dns_rpz_detach_rpzs(), DNS_RPZ_MAX_TTL_DEFAULT, dns_rpz_new_zones(), dns_view_detach(), dns_viewlist_find(), INSIST, ISC_FALSE, ISC_R_SUCCESS, ISC_TRUE, dns_view::mctx, dns_view::name, dns_rpz_zones::p, dns_view::rdclass, dns_view::rpzs, and dns_rpz_zones::zones.
Referenced by configure_view().
static isc_result_t configure_rrl | ( | dns_view_t * | view, | |
const cfg_obj_t * | config, | |||
const cfg_obj_t * | map | |||
) | [static] |
Definition at line 1968 of file server.c.
References cfg_acl_fromconfig(), cfg_map_get(), cfg_obj_asboolean(), cfg_obj_asuint32(), CHECK_RRL, CHECK_RRL_RATE, cleanup(), dns_rrl_init(), DNS_RRL_MAX_PREFIX, DNS_RRL_MAX_RATE, DNS_RRL_MAX_SLIP, DNS_RRL_MAX_WINDOW, dns_rrl_view_destroy(), dns_rrl::exempt, dns_rrl::ipv4_mask, dns_rrl::ipv4_prefixlen, dns_rrl::ipv6_mask, dns_rrl::ipv6_prefixlen, ISC_FALSE, ISC_MAX, ISC_R_SUCCESS, ISC_TRUE, dns_rrl::log_only, dns_rrl::max_entries, dns_rrl::qps, dns_rrl::qps_scale, dns_rrl_rate::r, dns_rrl::responses_per_second, and dns_rrl::window.
Referenced by configure_view().
static isc_result_t add_soa | ( | dns_db_t * | db, | |
dns_dbversion_t * | version, | |||
dns_name_t * | name, | |||
dns_name_t * | origin, | |||
dns_name_t * | contact | |||
) | [static] |
Definition at line 2104 of file server.c.
References CHECK, cleanup(), dns_db_addrdataset(), dns_db_class(), dns_db_detachnode(), dns_db_findnode(), DNS_RDATA_INIT, dns_rdatalist_init(), dns_rdatalist_tordataset(), dns_rdataset_init(), DNS_SOA_BUFFERSIZE, dns_soa_buildrdata(), ISC_LIST_APPEND, ISC_TRUE, dns_rdata::rdclass, dns_rdatalist::rdclass, dns_rdatalist::ttl, dns_rdata::type, and dns_rdatalist::type.
static isc_result_t add_ns | ( | dns_db_t * | db, | |
dns_dbversion_t * | version, | |||
dns_name_t * | name, | |||
dns_name_t * | nsname | |||
) | [static] |
Definition at line 2135 of file server.c.
References CHECK, cleanup(), dns_db_addrdataset(), dns_db_class(), dns_db_detachnode(), dns_db_findnode(), dns_name_clone(), dns_name_init(), DNS_NAME_MAXWIRE, dns_rdata_fromstruct(), DNS_RDATA_INIT, dns_rdatalist_init(), dns_rdatalist_tordataset(), dns_rdataset_init(), isc_buffer_init, ISC_LIST_APPEND, ISC_TRUE, dns_rdata::rdclass, dns_rdatalist::rdclass, dns_rdatalist::ttl, dns_rdata::type, and dns_rdatalist::type.
Referenced by create_empty_zone().
static isc_result_t create_empty_zone | ( | dns_zone_t * | zone, | |
dns_name_t * | name, | |||
dns_view_t * | view, | |||
const cfg_obj_t * | zonelist, | |||
const char ** | empty_dbtype, | |||
int | empty_dbtypec, | |||
dns_zonestat_level_t | statlevel | |||
) | [static] |
Definition at line 2175 of file server.c.
References add_ns(), add_soa(), cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_map_get(), cfg_obj_asstring(), cfg_tuple_get(), CHECK, check_dbtype(), cleanup(), dns_db_closeversion(), dns_db_create(), dns_db_detach(), dns_db_newversion(), dns_dbtype_zone, dns_dialuptype_no, dns_fixedname_init, dns_fixedname_name, dns_name_clone(), dns_name_format(), DNS_NAME_FORMATSIZE, dns_name_fromstring(), dns_name_fullcompare(), dns_namereln_subdomain, dns_notifytype_no, dns_rootname, dns_view_addzone(), dns_zone_clearqueryacl(), dns_zone_clearqueryonacl(), dns_zone_clearupdateacl(), dns_zone_clearxfracl(), dns_zone_detach(), dns_zone_getfile(), dns_zone_getraw(), dns_zone_gettype(), dns_zone_master, dns_zone_replacedb(), dns_zone_setautomatic(), dns_zone_setclass(), dns_zone_setdbtype(), dns_zone_setdialup(), dns_zone_setnotifytype(), dns_zone_setoption(), dns_zone_setorigin(), dns_zone_setqueryacl(), dns_zone_setqueryonacl(), dns_zone_setstats(), dns_zone_settype(), dns_zone_setview(), dns_zone_setxfracl(), dns_zonemgr_createzone(), dns_zonemgr_managezone(), DNS_ZONEOPT_NOCHECKNS, fixed, INSIST, ISC_FALSE, ISC_LOG_INFO, isc_log_write(), ISC_R_SUCCESS, ISC_TRUE, dns_view::mctx, dns_view::name, namebuf, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, dns_view::queryacl, dns_view::queryonacl, dns_view::rdclass, setquerystats(), str, dns_view::transferacl, and zname.
Referenced by configure_view().
static isc_result_t configure_view | ( | dns_view_t * | view, | |
dns_viewlist_t * | viewlist, | |||
cfg_obj_t * | config, | |||
cfg_obj_t * | vconfig, | |||
ns_cachelist_t * | cachelist, | |||
const cfg_obj_t * | bindkeys, | |||
isc_mem_t * | mctx, | |||
cfg_aclconfctx_t * | actx, | |||
isc_boolean_t | need_hints | |||
) | [static] |
Definition at line 2358 of file server.c.
References dns_view::aaaa_acl, dns_view::acache, dns_view::acceptexpired, dns_view::aclenv, dns_view::adb, ns_cache::adbsizeadjusted, dns_view::additionalfromauth, dns_view::additionalfromcache, AF_INET6, dns_view::answeracl_exclude, dns_view::answernames_exclude, dns_view::auth_nxdomain, buffer, dns_view::cache, ns_cache::cache, cache_reusable(), cache_sharable(), dns_view::cacheacl, cachelist_find(), dns_view::cacheonacl, cfg_acl_fromconfig(), cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_map_get(), cfg_map_getname(), cfg_obj_asboolean(), cfg_obj_asnetprefix(), cfg_obj_assockaddr(), cfg_obj_asstring(), cfg_obj_asuint32(), cfg_obj_asuint64(), cfg_obj_isboolean(), cfg_obj_isstring(), cfg_obj_isuint32(), cfg_obj_isvoid(), cfg_obj_log(), cfg_tuple_get(), CHECK, CHECKM, dns_view::checknames, cleanup(), configure_alternates(), configure_forward(), configure_order(), configure_peer(), configure_rpz(), configure_rrl(), configure_view_acl(), configure_view_dnsseckeys(), configure_view_nametable(), configure_view_sortlist(), configure_zone(), create_empty_zone(), dns_rpz_zones::defined, dns_view::denyansweracl, dns_view::denyanswernames, disable_algorithms(), disable_ds_digests(), dns_view::dlv, dlv, dns_view::dlv_fixed, dns_view::dlz_searched, dns_view::dlz_unsearched, dlzconfigure_callback(), dns_view::dns64, dns64_reverse(), dns_view::dns64cnt, dns_aaaa_break_dnssec, dns_aaaa_filter, dns_aaaa_ok, dns_acache_create(), dns_acache_setcachesize(), dns_acache_setcleaninginterval(), dns_acl_attach(), dns_acl_detach(), dns_acl_none(), dns_aclenv_copy(), dns_adb_setadbsize(), dns_cache_attach(), dns_cache_create3(), dns_cache_detach(), dns_cache_load(), dns_cache_setcachesize(), dns_cache_setcleaninginterval(), dns_cache_setfilename(), dns_dispatch_detach(), dns_dlzconfigure(), dns_dlzcreate(), dns_dlzstrtoargv(), dns_dns64_append(), DNS_DNS64_BREAK_DNSSEC, dns_dns64_create(), DNS_DNS64_RECURSIVE_ONLY, dns_fixedname_init, dns_fixedname_name, dns_fwdpolicy_only, dns_fwdtable_find(), dns_many_answers, DNS_NAME_DOWNCASE, dns_name_format(), DNS_NAME_FORMATSIZE, dns_name_fromstring(), dns_name_totext(), dns_one_answer, dns_order_attach(), dns_order_create(), dns_order_detach(), dns_peer_detach(), dns_peerlist_addpeer(), dns_peerlist_detach(), dns_peerlist_new(), dns_rdatatypestats_create(), DNS_RESOLVER_CHECKNAMES, DNS_RESOLVER_CHECKNAMESFAIL, dns_resolver_reset_algorithms(), dns_resolver_reset_ds_digests(), dns_resolver_resetmustbesecure(), dns_resolver_setclientsperquery(), dns_resolver_setlamettl(), dns_resolver_setmaxdepth(), dns_resolver_setmaxqueries(), dns_resolver_setquerydscp4(), dns_resolver_setquerydscp6(), dns_resolver_settimeout(), dns_resolver_setudpsize(), dns_resolver_setzeronosoattl(), dns_resstatscounter_max, dns_rootname, DNS_RPZ_ERROR_LEVEL, DNS_RPZ_ZBIT, dns_stats_detach(), dns_tsigkeyring_add(), dns_tsigkeyring_detach(), dns_view_createresolver(), dns_view_detach(), dns_view_excludedelegationonly(), dns_view_findzone(), dns_view_getdynamickeyring(), dns_view_getresquerystats(), dns_view_getresstats(), dns_view_restorekeyring(), dns_view_setcache2(), dns_view_setdstport(), dns_view_setdynamickeyring(), dns_view_setfailttl(), dns_view_sethints(), dns_view_setkeyring(), dns_view_setresquerystats(), dns_view_setresstats(), dns_view_setrootdelonly(), DNS_VIEW_VALID, dns_viewlist_find(), dns_zone_detach(), dns_zonestat_full, dns_zonestat_none, dns_zonestat_terse, dns_view::enablednssec, dns_view::enablevalidation, fixed, dns_forwarders::fwdpolicy, dns_view::fwdtable, get_view_querysource_dispatch(), dns_view::hints, INSIST, isc_buffer_init, isc_buffer_usedlength, ISC_FALSE, ISC_LINK_INIT, ISC_LIST_APPEND, ISC_LIST_PREV, ISC_LOG_DEBUG, ISC_LOG_ERROR, ISC_LOG_INFO, ISC_LOG_WARNING, isc_log_write(), isc_mem_create(), isc_mem_detach(), isc_mem_free, isc_mem_get, isc_mem_put, isc_mem_setname(), isc_mem_strdup, ISC_MIN, isc_netaddr_fromsockaddr(), ISC_PRINT_QUADFORMAT, ISC_R_FAILURE, ISC_R_NOMEMORY, ISC_R_NOTFOUND, ISC_R_SUCCESS, ISC_R_UNEXPECTED, isc_stats_create(), isc_stats_detach(), ISC_TF, ISC_TRUE, map, dns_view::matchclients, dns_view::matchdestinations, dns_view::matchrecursiveonly, MAX_ADB_SIZE_FOR_CACHESHARE, MAX_UDP_DISPATCH, dns_view::maxbits, dns_view::maxcachettl, dns_view::maxncachettl, dns_view::maxudp, dns_view::mctx, dns_view::minimalresponses, mustbesecure(), name, dns_view::name, namebuf, ns_cache::needflush, dns_view::new_zone_config, dns_view::nocasecompress, dns_view::notifyacl, ns_checknames_get(), ns_config_get(), ns_config_getport(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, ns_tsigkeyring_fromconfig(), dns_view::nta_lifetime, dns_view::nta_recheck, dns_rpz_zones::num_zones, ns_cfgctx::nzconfig, on_disable_list(), dns_view::order, dns_rpz_zone::origin, dns_rpz_zones::p, dns_view::peers, port, dns_view::preferred_glue, dns_view::prefetch_eligible, dns_view::prefetch_trigger, ns_cache::primaryview, dns_view::provideixfr, dns_view::queryacl, dns_view::rdclass, dns_view::recursion, dns_view::recursionacl, dns_view::recursiononacl, dns_view::redirectfixed, dns_view::redirectzone, dns_view::requestnsid, dns_view::requestsit, REQUIRE, dns_view::resolver, RESOLVER_NTASKS, dns_view::rpzs, s, dns_dlzdb::search, search(), dns_view::situdp, SIZE_MAX, dns_view::sortlist, str, dns_view::transfer_format, dns_view::transferacl, UNEXPECTED_ERROR, dns_view::updateacl, dns_view::upfwdacl, dns_view::v4_aaaa, dns_view::v6_aaaa, and dns_rpz_zones::zones.
static isc_result_t configure_hints | ( | dns_view_t * | view, | |
const char * | filename | |||
) | [static] |
Definition at line 3868 of file server.c.
References dns_db_detach(), dns_rootns_create(), dns_view_sethints(), ISC_R_SUCCESS, dns_view::mctx, and dns_view::rdclass.
Referenced by configure_zone().
static isc_result_t get_viewinfo | ( | const cfg_obj_t * | vconfig, | |
const char ** | namep, | |||
dns_rdataclass_t * | classp | |||
) | [static] |
Definition at line 4090 of file server.c.
References cfg_obj_asstring(), cfg_tuple_get(), ISC_R_SUCCESS, ns_config_getclass(), and REQUIRE.
Referenced by create_view(), and find_view().
static isc_result_t find_view | ( | const cfg_obj_t * | vconfig, | |
dns_viewlist_t * | viewlist, | |||
dns_view_t ** | viewp | |||
) | [static] |
Definition at line 4124 of file server.c.
References dns_viewlist_find(), get_viewinfo(), and ISC_R_SUCCESS.
Referenced by load_configuration().
static isc_result_t create_view | ( | const cfg_obj_t * | vconfig, | |
dns_viewlist_t * | viewlist, | |||
dns_view_t ** | viewp | |||
) | [static] |
Definition at line 4152 of file server.c.
References dns_view::aclenv, dns_view_attach(), dns_view_create(), dns_view_detach(), dns_viewlist_find(), get_viewinfo(), INSIST, isc_entropy_getdata(), ISC_LIST_APPEND, ISC_R_EXISTS, ISC_R_NOTFOUND, ISC_R_SUCCESS, and dns_view::secret.
Referenced by load_configuration().
static void configure_server_quota | ( | const cfg_obj_t ** | maps, | |
const char * | name, | |||
isc_quota_t * | quota | |||
) | [static] |
Definition at line 4672 of file server.c.
References cfg_obj_asuint32(), INSIST, isc_quota_max(), ISC_R_SUCCESS, and ns_config_get().
Referenced by load_configuration().
static isc_result_t directory_callback | ( | const char * | clausename, | |
const cfg_obj_t * | obj, | |||
void * | arg | |||
) | [static] |
Definition at line 4688 of file server.c.
References cfg_obj_asstring(), cfg_obj_log(), directory, isc_dir_chdir(), isc_file_ischdiridempotent(), ISC_LOG_ERROR, ISC_LOG_WARNING, ISC_R_SUCCESS, isc_result_totext(), REQUIRE, and UNUSED.
static isc_result_t scan_interfaces | ( | ns_server_t * | server, | |
isc_boolean_t | verbose | |||
) | [static] |
Definition at line 4719 of file server.c.
References ns_server::aclenv, dns_aclenv_copy(), ns_server::interfacemgr, dns_aclenv::match_mapped, ns_interfacemgr_getaclenv(), and ns_interfacemgr_scan().
Referenced by interface_timer_tick(), load_configuration(), and ns_server_scan_interfaces().
static isc_result_t add_listenelt | ( | isc_mem_t * | mctx, | |
ns_listenlist_t * | list, | |||
isc_sockaddr_t * | addr, | |||
isc_dscp_t | dscp, | |||
isc_boolean_t | wcardport_ok | |||
) | [static] |
Definition at line 4743 of file server.c.
References AF_INET6, dns_acl_create(), dns_acl_detach(), dns_iptable_addprefix(), INSIST, dns_acl::iptable, ISC_LIST_APPEND, isc_netaddr_fromin6(), ISC_R_SUCCESS, isc_sockaddr_any6(), isc_sockaddr_equal(), isc_sockaddr_getport(), isc_sockaddr_pf(), ISC_TRUE, ns_listenelt_create(), REQUIRE, isc_sockaddr::sin6, sockaddr_in6::sin6_addr, and isc_sockaddr::type.
Referenced by adjust_interfaces().
static void adjust_interfaces | ( | ns_server_t * | server, | |
isc_mem_t * | mctx | |||
) | [static] |
Definition at line 4791 of file server.c.
References add_listenelt(), ns_dispatch::addr, dns_dispatch_getlocaladdress(), dns_resolver_dispatchv6(), dns_zone_first(), dns_zone_getnotifysrc6(), dns_zone_getnotifysrc6dscp(), dns_zone_getview(), dns_zone_getxfrsource6(), dns_zone_getxfrsource6dscp(), dns_zone_next(), ns_server::interfacemgr, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LOG_WARNING, isc_log_write(), ISC_R_SUCCESS, ISC_TRUE, ns_interfacemgr_adjust(), ns_listenlist_create(), ns_listenlist_detach(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, dns_view::resolver, ns_server::viewlist, and ns_server::zonemgr.
Referenced by load_configuration().
static void interface_timer_tick | ( | isc_task_t * | task, | |
isc_event_t * | event | |||
) | [static] |
Definition at line 4891 of file server.c.
References INSIST, isc_event_free(), ISC_FALSE, ISC_R_SUCCESS, isc_task_beginexclusive(), isc_task_endexclusive(), RUNTIME_CHECK, scan_interfaces(), ns_server::task, and UNUSED.
Referenced by run_server().
static void heartbeat_timer_tick | ( | isc_task_t * | task, | |
isc_event_t * | event | |||
) | [static] |
Definition at line 4910 of file server.c.
References dns_view_dialup(), isc_event_free(), ISC_LIST_HEAD, ISC_LIST_NEXT, UNUSED, and ns_server::viewlist.
Referenced by run_server().
static void pps_timer_tick | ( | isc_task_t * | task, | |
isc_event_t * | event | |||
) | [static] |
Definition at line 4924 of file server.c.
References dns_pps, isc_event_free(), ns_client_requests, requests, and UNUSED.
Referenced by run_server().
static isc_result_t setstring | ( | ns_server_t * | server, | |
char ** | field, | |||
const char * | value | |||
) | [static] |
Definition at line 4944 of file server.c.
References isc_mem_free, isc_mem_strdup, ISC_R_NOMEMORY, ISC_R_SUCCESS, and ns_server::mctx.
Referenced by load_configuration(), and setoptstring().
static isc_result_t setoptstring | ( | ns_server_t * | server, | |
char ** | field, | |||
const cfg_obj_t * | obj | |||
) | [static] |
Definition at line 4968 of file server.c.
References cfg_obj_asstring(), cfg_obj_isvoid(), and setstring().
Referenced by load_configuration().
static void set_limit | ( | const cfg_obj_t ** | maps, | |
const char * | configname, | |||
const char * | description, | |||
isc_resource_t | resourceid, | |||
isc_resourcevalue_t | defaultvalue | |||
) | [static] |
Definition at line 4976 of file server.c.
References cfg_obj_asstring(), cfg_obj_asuint64(), cfg_obj_isstring(), INSIST, ISC_LOG_DEBUG, ISC_LOG_WARNING, isc_log_write(), ISC_PRINT_QUADFORMAT, ISC_R_SUCCESS, isc_resource_setlimit(), ISC_RESOURCE_UNLIMITED, isc_result_totext(), ns_config_get(), NS_LOGCATEGORY_GENERAL, and NS_LOGMODULE_SERVER.
static void set_limits | ( | const cfg_obj_t ** | maps | ) | [static] |
static void portset_fromconf | ( | isc_portset_t * | portset, | |
const cfg_obj_t * | ports, | |||
isc_boolean_t | positive | |||
) | [static] |
Definition at line 5020 of file server.c.
References cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_obj_asuint32(), cfg_obj_isuint32(), cfg_tuple_get(), isc_portset_add(), isc_portset_addrange(), isc_portset_remove(), isc_portset_removerange(), and port.
Referenced by load_configuration().
static isc_result_t removed | ( | dns_zone_t * | zone, | |
void * | uap | |||
) | [static] |
Definition at line 5057 of file server.c.
References dns_zone_gettype(), dns_zone_getview(), dns_zone_log(), dns_zone_master, dns_zone_redirect, dns_zone_slave, dns_zone_staticstub, dns_zone_stub, ISC_LOG_INFO, and ISC_R_SUCCESS.
Referenced by dns_rdataslab_fromrdataset(), and load_configuration().
static void cleanup_session_key | ( | ns_server_t * | server, | |
isc_mem_t * | mctx | |||
) | [static] |
Definition at line 5088 of file server.c.
References dns_name_dynamic(), dns_name_free(), dns_tsigkey_detach(), DST_ALG_UNKNOWN, isc_file_remove(), isc_mem_free, isc_mem_put, ns_server::session_keyalg, ns_server::session_keybits, ns_server::session_keyfile, ns_server::session_keyname, and ns_server::sessionkey.
Referenced by configure_session_key(), and shutdown_server().
static isc_result_t generate_session_key | ( | const char * | filename, | |
const char * | keynamestr, | |||
dns_name_t * | keyname, | |||
const char * | algstr, | |||
dns_name_t * | algname, | |||
unsigned int | algtype, | |||
isc_uint16_t | bits, | |||
isc_mem_t * | mctx, | |||
dns_tsigkey_t ** | tsigkeyp | |||
) | [static] |
Definition at line 5110 of file server.c.
References CHECK, cleanup(), DNS_KEYPROTO_ANY, dns_tsigkey_createfromkey(), dns_tsigkey_detach(), dst_key_free(), dst_key_generate(), dst_key_name(), dst_key_tobuffer(), isc_base64_totext(), isc_buffer_base, isc_buffer_init, isc_buffer_usedlength, isc_buffer_usedregion, ISC_FALSE, isc_file_remove(), ISC_LOG_ERROR, ISC_LOG_INFO, isc_log_write(), ISC_R_NOPERM, ISC_R_SUCCESS, isc_result_totext(), isc_stdio_close(), isc_stdio_flush(), isc_stdtime_get(), ISC_TRUE, key, now, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, ns_os_openfile(), and tsigkey.
Referenced by configure_session_key().
static isc_result_t configure_session_key | ( | const cfg_obj_t ** | maps, | |
ns_server_t * | server, | |||
isc_mem_t * | mctx | |||
) | [static] |
Definition at line 5198 of file server.c.
References buffer, cfg_obj_asstring(), cfg_obj_isvoid(), cfg_obj_log(), CHECK, cleanup(), cleanup_session_key(), dns_fixedname_init, dns_fixedname_name, dns_name_dup(), dns_name_equal(), dns_name_fromtext(), dns_name_init(), dns_rootname, DST_ALG_UNKNOWN, generate_session_key(), INSIST, isc_buffer_add, isc_buffer_constinit, ISC_FALSE, ISC_LOG_ERROR, isc_mem_get, isc_mem_strdup, ISC_R_SUCCESS, ISC_TRUE, keyfile, ns_config_get(), ns_config_getkeyalgorithm2(), s, ns_server::session_keyalg, ns_server::session_keybits, ns_server::session_keyfile, ns_server::session_keyname, and ns_server::sessionkey.
Referenced by load_configuration().
static isc_result_t setup_newzones | ( | dns_view_t * | view, | |
cfg_obj_t * | config, | |||
cfg_obj_t * | vconfig, | |||
cfg_parser_t * | conf_parser, | |||
cfg_aclconfctx_t * | actx | |||
) | [static] |
Definition at line 5305 of file server.c.
References ns_cfgctx::actx, ns_cfgctx::add_parser, cfg_aclconfctx_attach(), cfg_map_get(), cfg_obj_asboolean(), cfg_obj_attach(), cfg_parse_file(), cfg_parser_attach(), cfg_parser_reset(), cfg_tuple_get(), cfg_type_newzones, ns_cfgctx::conf_parser, ns_cfgctx::config, dns_view_setnewzones(), ISC_FALSE, isc_mem_attach(), isc_mem_get, ISC_R_NOMEMORY, ISC_R_SUCCESS, ns_cfgctx::mctx, dns_view::mctx, dns_view::new_zone_file, newzone_cfgctx_destroy(), ns_config_get(), ns_cfgctx::nzconfig, REQUIRE, and ns_cfgctx::vconfig.
Referenced by load_configuration().
static int count_zones | ( | const cfg_obj_t * | conf | ) | [static] |
Definition at line 5373 of file server.c.
References cfg_list_first(), cfg_list_next(), cfg_map_get(), and REQUIRE.
Referenced by load_configuration().
static isc_result_t check_lockfile | ( | ns_server_t * | server, | |
const cfg_obj_t * | config, | |||
isc_boolean_t | first_time | |||
) | [static] |
Definition at line 5390 of file server.c.
References cfg_map_get(), cfg_obj_asstring(), cfg_obj_isstring(), cfg_obj_isvoid(), INSIST, ISC_LOG_DEBUG, ISC_LOG_ERROR, ISC_LOG_WARNING, isc_log_write(), isc_mem_strdup, ISC_R_FAILURE, ISC_R_NOMEMORY, ISC_R_SUCCESS, ns_server::lockfile, ns_server::mctx, ns_config_get(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, and ns_os_issingleton().
Referenced by load_configuration().
static isc_result_t load_configuration | ( | const char * | filename, | |
ns_server_t * | server, | |||
isc_boolean_t | first_time | |||
) | [static] |
Definition at line 5469 of file server.c.
References ns_server::aclenv, adjust_interfaces(), AF_INET6, bind9_check_namedconf(), ns_server::bindkeysfile, ns_server::blackholeacl, ns_cache::cache, ns_server::cachelist, categories, cfg_aclconfctx_create(), cfg_aclconfctx_detach(), cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_map_get(), cfg_obj_asboolean(), cfg_obj_asstring(), cfg_obj_asuint32(), cfg_obj_destroy(), cfg_obj_isboolean(), cfg_obj_isstring(), cfg_obj_isvoid(), cfg_parse_file(), cfg_parser_create(), cfg_parser_destroy(), cfg_parser_setcallback(), cfg_tuple_get(), cfg_type_bindkeys, cfg_type_namedconf, CHECK, check_lockfile(), CHECKM, cleanup(), configure_server_quota(), configure_session_key(), configure_view(), configure_view_acl(), count_zones(), create_view(), DE_CONST, directory_callback(), dns_cache_detach(), dns_dispatchmgr_setavailports(), dns_dispatchmgr_setblackhole(), dns_tkeyctx_destroy(), dns_view_detach(), dns_view_freeze(), dns_zonemgr_setnotifyrate(), dns_zonemgr_setserialqueryrate(), dns_zonemgr_setsize(), dns_zonemgr_setstartupnotifyrate(), dns_zonemgr_settransfersin(), dns_zonemgr_settransfersperns(), dns_zt_apply(), ns_server::dumpfile, find_view(), ns_server::flushonshutdown, ns_server::heartbeat_interval, ns_server::heartbeat_timer, ns_server::hostname, ns_server::hostname_set, INSIST, ns_server::interface_auto, ns_server::interface_interval, ns_server::interface_timer, ns_server::interfacemgr, isc__socketmgr_setreserved(), ISC_AES128_KEYLENGTH, isc_buffer_init, isc_buffer_usedlength, isc_entropy_attach(), isc_entropy_createfilesource(), isc_entropy_detach(), isc_entropy_getdata(), ISC_FALSE, isc_hex_decodestring(), isc_interval_set(), ISC_LIST_APPENDLIST, ISC_LIST_HEAD, ISC_LIST_INIT, ISC_LIST_NEXT, ISC_LIST_UNLINK, ISC_LOG_DEBUG, ISC_LOG_ERROR, ISC_LOG_INFO, ISC_LOG_WARNING, isc_log_write(), isc_logconfig_create(), isc_logconfig_destroy(), isc_logconfig_use(), isc_mem_debugging, ISC_MEM_DEBUGRECORD, isc_mem_put, isc_net_getudpportrange(), isc_net_probeipv6(), isc_portset_add(), isc_portset_addrange(), isc_portset_create(), isc_portset_destroy(), ISC_PRINT_QUADFORMAT, isc_quota_soft(), ISC_R_ADDRINUSE, ISC_R_FAILURE, ISC_R_FILENOTFOUND, ISC_R_NOSPACE, ISC_R_RANGE, ISC_R_SUCCESS, isc_resource_getcurlimit(), isc_resource_openfiles, isc_result_totext(), ISC_SHA1_DIGESTLENGTH, ISC_SHA256_DIGESTLENGTH, isc_socketmgr_getmaxsockets(), isc_task_beginexclusive(), isc_task_endexclusive(), ISC_TF, isc_time_now(), isc_timer_reset(), isc_timertype_inactive, isc_timertype_ticker, ISC_TRUE, ns_server::keepresporder, ns_server::log_queries, logc, dns_aclenv::match_mapped, isc_quota::max, maxsocks, ns_server::mctx, dns_view::name, dns_view::new_zone_config, ns_config_get(), ns_config_getdscp(), ns_config_getport(), ns_config_parsedefaults(), ns_controls_configure(), ns_g_configtime, ns_geoip_load(), ns_interfacemgr_setlistenon4(), ns_interfacemgr_setlistenon6(), ns_listenlist_default(), ns_listenlist_detach(), ns_listenlist_fromconfig(), ns_log_configure(), ns_log_setdefaultcategory(), ns_log_setdefaultchannels(), ns_log_setunmatchedcategory(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, ns_lwresd_configure(), ns_lwresd_parseeresolvconf(), ns_main_earlyfatal(), ns_main_setmemstats(), ns_os_changeuser(), ns_os_writepidfile(), ns_statschannels_configure(), ns_tkeyctx_fromconfig(), ns_cfgctx::nzconfig, portset_fromconf(), ns_server::pps_timer, ns_server::recfile, ns_server::recursionquota, removed(), RUNTIME_CHECK, scan_interfaces(), ns_server::secret, ns_server::secrootsfile, ns_server::server_id, ns_server::server_usehostname, set_limits(), setoptstring(), setstring(), setup_newzones(), ns_server::statsfile, str, ns_server::task, ns_server::tcpquota, ns_server::tkeyctx, ns_server::version, ns_server::version_set, dns_view::viewlist, ns_server::viewlist, ns_server::xfroutquota, ns_server::zonemgr, and dns_view::zonetable.
Referenced by loadconfig(), and run_server().
static isc_result_t view_loaded | ( | void * | arg | ) | [static] |
Definition at line 6523 of file server.c.
References CHECKFATAL, dns_zonemgr_forcemaint(), ISC_LOG_NOTICE, isc_log_write(), isc_mem_put, ISC_R_SUCCESS, isc_refcount_decrement, isc_refcount_destroy, ns_server::mctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, ns_os_started(), ns_zoneload_t::refs, ns_zoneload_t::server, and ns_server::zonemgr.
Referenced by load_zones().
static isc_result_t load_zones | ( | ns_server_t * | server, | |
isc_boolean_t | init | |||
) | [static] |
Definition at line 6558 of file server.c.
References CHECK, cleanup(), DNS_R_CONTINUE, DNS_R_UPTODATE, dns_view_asyncload(), dns_zone_load(), ISC_LIST_HEAD, ISC_LIST_NEXT, isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_refcount_decrement, isc_refcount_destroy, isc_refcount_increment, isc_refcount_init(), isc_task_beginexclusive(), isc_task_endexclusive(), isc_taskmgr_setmode(), isc_taskmgrmode_privileged, dns_view::managed_keys, ns_server::mctx, dns_view::redirect, ns_zoneload_t::refs, RUNTIME_CHECK, ns_zoneload_t::server, ns_server::task, view_loaded(), and ns_server::viewlist.
Referenced by main(), reload(), and run_server().
static isc_result_t load_new_zones | ( | ns_server_t * | server, | |
isc_boolean_t | stop | |||
) | [static] |
Definition at line 6626 of file server.c.
References CHECK, cleanup(), dns_view_loadnew(), dns_zone_loadnew(), dns_zonemgr_resumexfrs(), ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_R_SUCCESS, isc_task_beginexclusive(), isc_task_endexclusive(), dns_view::managed_keys, dns_view::redirect, RUNTIME_CHECK, ns_server::task, ns_server::viewlist, and ns_server::zonemgr.
Referenced by reconfig().
static void run_server | ( | isc_task_t * | task, | |
isc_event_t * | event | |||
) | [static] |
Definition at line 6659 of file server.c.
References cfg_parser_create(), CHECKFATAL, dns_dispatchmgr_create(), dns_dispatchmgr_setstats(), ns_server::heartbeat_timer, heartbeat_timer_tick(), INSIST, ns_server::interface_timer, interface_timer_tick(), ns_server::interfacemgr, isc_event_free(), isc_hash_init(), isc_timer_create(), isc_timertype_inactive, ISC_TRUE, load_configuration(), load_zones(), ns_interfacemgr_create(), ns_server_loadnta(), ns_server::pps_timer, pps_timer_tick(), ns_server::resolverstats, and ns_server::task.
Referenced by ns_server_create().
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().
static void shutdown_server | ( | isc_task_t * | task, | |
isc_event_t * | event | |||
) | [static] |
Definition at line 6725 of file server.c.
References ns_server::blackholeacl, ns_server::cachelist, cfg_aclconfctx_detach(), cfg_obj_destroy(), cfg_parser_destroy(), cleanup_session_key(), ns_server::controls, dns_acl_detach(), dns_cache_detach(), dns_db_detach(), dns_dispatchmgr_destroy(), dns_geoip_shutdown(), dns_name_free(), dns_tsigkey_detach(), dns_view_detach(), dns_view_flushanddetach(), dns_zonemgr_shutdown(), end_reserved_dispatches(), flush(), ns_server::flushonshutdown, ns_server::heartbeat_timer, ns_server::in_roothints, INSIST, ns_server::interface_timer, ns_server::interfacemgr, isc_event_free(), ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, ISC_LOG_INFO, isc_log_write(), isc_mem_put, ISC_R_SUCCESS, isc_task_beginexclusive(), isc_task_detach(), isc_task_endexclusive(), isc_timer_detach(), ISC_TRUE, ns_server::keepresporder, ns_server::mctx, ns_controls_shutdown(), ns_g_sessionkeyname, ns_interfacemgr_detach(), ns_interfacemgr_shutdown(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, ns_server_saventa(), ns_statschannels_shutdown(), ns_server::pps_timer, RUNTIME_CHECK, ns_server::task, UNUSED, ns_server::viewlist, and ns_server::zonemgr.
Referenced by ns_server_create().
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().
static void start_reserved_dispatches | ( | ns_server_t * | server | ) | [static] |
Definition at line 7046 of file server.c.
References ns_server::dispatchgen, NS_SERVER_VALID, and REQUIRE.
Referenced by loadconfig().
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().
static isc_result_t loadconfig | ( | ns_server_t * | server | ) | [static] |
Definition at line 7148 of file server.c.
References end_reserved_dispatches(), ISC_FALSE, ISC_LOG_ERROR, ISC_LOG_INFO, isc_log_write(), ISC_R_SUCCESS, isc_result_totext(), load_configuration(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, and start_reserved_dispatches().
Referenced by reconfig(), and reload().
static isc_result_t reload | ( | ns_server_t * | server | ) | [static] |
Definition at line 7170 of file server.c.
References CHECK, cleanup(), ISC_FALSE, ISC_LOG_ERROR, ISC_LOG_INFO, isc_log_write(), ISC_R_SUCCESS, isc_result_totext(), load_zones(), loadconfig(), NS_LOGCATEGORY_GENERAL, and NS_LOGMODULE_SERVER.
static void reconfig | ( | ns_server_t * | server | ) | [static] |
Definition at line 7190 of file server.c.
References CHECK, cleanup(), ISC_FALSE, ISC_LOG_ERROR, ISC_LOG_INFO, isc_log_write(), ISC_R_SUCCESS, isc_result_totext(), load_new_zones(), loadconfig(), NS_LOGCATEGORY_GENERAL, and NS_LOGMODULE_SERVER.
Referenced by ns_server_reconfigcommand().
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().
static char* next_token | ( | char ** | stringp, | |
const char * | delim | |||
) | [static] |
static isc_result_t zone_from_args | ( | ns_server_t * | server, | |
char * | args, | |||
const char * | zonetxt, | |||
dns_zone_t ** | zonep, | |||
const char ** | zonename, | |||
isc_buffer_t ** | text, | |||
isc_boolean_t | skip | |||
) | [static] |
Definition at line 7274 of file server.c.
References isc_textregion::base, CHECK, cleanup(), dns_fixedname_init, dns_fixedname_name, DNS_NAME_FORMATSIZE, dns_name_fromstring(), DNS_R_PARTIALMATCH, dns_rdataclass_fromtext(), dns_view_detach(), dns_viewlist_find(), dns_viewlist_findzone(), dns_zone_detach(), dns_zt_find(), input, ISC_R_MULTIPLE, ISC_R_NOTFOUND, ISC_R_SUCCESS, ISC_R_UNEXPECTEDEND, ISC_TF, isc_textregion::length, name, next_token(), putnull(), putstr(), r, rdclass, report(), REQUIRE, ns_server::viewlist, and dns_view::zonetable.
Referenced by ns_server_delzone(), ns_server_freeze(), ns_server_notifycommand(), ns_server_refreshcommand(), ns_server_rekey(), ns_server_reloadcommand(), ns_server_retransfercommand(), ns_server_showzone(), ns_server_signing(), ns_server_sync(), and ns_server_zonestatus().
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_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_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_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().
static isc_result_t add_zone_tolist | ( | dns_zone_t * | zone, | |
void * | uap | |||
) | [static] |
Definition at line 7693 of file server.c.
References dns_zone_attach(), ISC_LINK_INIT, ISC_LIST_APPEND, ISC_LIST_TAIL, isc_mem_get, ISC_R_NOMEMORY, ISC_R_SUCCESS, dumpcontext::mctx, and zonelistentry::zone.
Referenced by add_view_tolist().
static isc_result_t add_view_tolist | ( | struct dumpcontext * | dctx, | |
dns_view_t * | view | |||
) | [static] |
Definition at line 7708 of file server.c.
References add_zone_tolist(), dns_view_attach(), dns_zt_apply(), dumpcontext::dumpzones, ISC_LINK_INIT, ISC_LIST_APPEND, ISC_LIST_HEAD, ISC_LIST_INIT, ISC_LIST_NEXT, isc_mem_get, ISC_R_NOMEMORY, ISC_R_SUCCESS, ISC_TRUE, dumpcontext::mctx, viewlistentry::view, and dns_view::zonetable.
Referenced by ns_server_dumpdb().
static void dumpcontext_destroy | ( | struct dumpcontext * | dctx | ) | [static] |
Definition at line 7736 of file server.c.
References dumpcontext::cache, dumpcontext::db, dns_db_closeversion(), dns_db_detach(), dns_dumpctx_detach(), dns_view_detach(), dns_zone_detach(), dumpcontext::fp, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_UNLINK, isc_mem_put, isc_stdio_close(), isc_task_detach(), dumpcontext::mctx, dumpcontext::mdctx, dumpcontext::task, dumpcontext::version, viewlistentry::view, and zonelistentry::zone.
Referenced by dumpdone(), and ns_server_dumpdb().
static void dumpdone | ( | void * | arg, | |
isc_result_t | result | |||
) | [static] |
Definition at line 7770 of file server.c.
References dns_view::adb, dumpcontext::cache, dns_view::cache, dns_view::cachedb, cleanup(), dumpcontext::db, dns_adb_dump(), dns_badcache_print(), dns_cache_getname(), dns_db_attach(), dns_db_closeversion(), dns_db_currentversion(), dns_db_detach(), dns_dumpctx_detach(), dns_master_dumptostreaminc(), dns_master_style_cache, dns_master_style_full, DNS_R_CONTINUE, dns_resolver_printbadcache(), dns_result_totext(), dns_view_iscacheshared(), dns_zone_getdb(), dns_zone_name(), dumpcontext::dumpcache, dumpcontext_destroy(), dumpcontext::dumpzones, dns_view::failcache, dumpcontext::fp, INSIST, ISC_FALSE, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LOG_ERROR, ISC_LOG_INFO, isc_log_write(), ISC_R_NOTIMPLEMENTED, ISC_R_SUCCESS, isc_stdio_flush(), dumpcontext::mctx, dumpcontext::mdctx, dns_view::name, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, POST, dns_view::resolver, style, dumpcontext::task, dumpcontext::version, viewlistentry::view, dumpcontext::view, zonelistentry::zone, and dumpcontext::zone.
Referenced by ns_server_dumpdb().
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_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().
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_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_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_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().
static isc_result_t delete_keynames | ( | dns_tsig_keyring_t * | ring, | |
char * | target, | |||
unsigned int * | foundkeys | |||
) | [static] |
Definition at line 8549 of file server.c.
References dns_rbtnode::data, dns_fixedname_init, dns_fixedname_name, dns_name_format(), DNS_NAME_FORMATSIZE, dns_name_init(), DNS_R_NEWORIGIN, dns_rbt_deletename(), dns_rbtnodechain_current(), dns_rbtnodechain_first(), dns_rbtnodechain_init(), dns_rbtnodechain_invalidate(), dns_rbtnodechain_next(), dns_tsigkey::generated, ISC_FALSE, ISC_R_NOMORE, ISC_R_NOTFOUND, ISC_R_SUCCESS, dns_tsig_keyring::keys, dns_tsig_keyring::mctx, dns_tsigkey::name, and origin.
Referenced by ns_server_tsigdelete().
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().
static isc_result_t list_keynames | ( | dns_view_t * | view, | |
dns_tsig_keyring_t * | ring, | |||
isc_buffer_t ** | text, | |||
unsigned int * | foundkeys | |||
) | [static] |
Definition at line 8655 of file server.c.
References CHECK, cleanup(), dns_tsigkey::creator, dns_rbtnode::data, dns_fixedname_init, dns_fixedname_name, dns_name_format(), DNS_NAME_FORMATSIZE, dns_name_init(), DNS_R_NEWORIGIN, dns_rbtnodechain_current(), dns_rbtnodechain_first(), dns_rbtnodechain_init(), dns_rbtnodechain_invalidate(), dns_rbtnodechain_next(), dns_tsigkey::generated, ISC_R_NOMORE, ISC_R_NOTFOUND, ISC_R_SUCCESS, dns_tsig_keyring::keys, dns_tsig_keyring::mctx, dns_tsigkey::name, dns_view::name, origin, and putstr().
Referenced by ns_server_tsiglist().
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_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().
static isc_result_t synczone | ( | dns_zone_t * | zone, | |
void * | uap | |||
) | [static] |
Definition at line 8817 of file server.c.
References cleanup(), dns_zone_detach(), dns_zone_flush(), dns_zone_getjournal(), dns_zone_getraw(), ISC_FALSE, isc_file_remove(), ISC_R_SUCCESS, and journal.
Referenced by ns_server_sync().
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_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().
static isc_result_t nzf_remove | ( | const char * | nzfile, | |
const char * | viewname, | |||
const char * | zonename | |||
) | [static] |
Definition at line 9069 of file server.c.
References add_comment(), CHECK, cleanup(), ISC_FALSE, isc_file_openunique(), isc_file_rename(), isc_file_template(), ISC_LOG_WARNING, isc_log_write(), ISC_R_EOF, ISC_R_SUCCESS, isc_stdio_close(), isc_stdio_open(), isc_stdio_read(), isc_stdio_write(), ISC_TRUE, NS_LOGCATEGORY_GENERAL, and NS_LOGMODULE_SERVER.
Referenced by do_modzone(), and ns_server_delzone().
static void dumpzone | ( | void * | arg, | |
const char * | buf, | |||
int | len | |||
) | [static] |
static isc_result_t nzf_append | ( | FILE * | fp, | |
const char * | viewname, | |||
const cfg_obj_t * | zconfig | |||
) | [static] |
Definition at line 9201 of file server.c.
References add_comment(), CFG_PRINTER_ONELINE, cfg_printx(), CHECK, cleanup(), dumpzone, isc_stdio_seek(), isc_stdio_tell(), and isc_stdio_write().
Referenced by do_addzone(), and do_modzone().
static isc_result_t newzone_parse | ( | ns_server_t * | server, | |
char * | args, | |||
dns_view_t ** | viewp, | |||
cfg_obj_t ** | zoneconfp, | |||
const cfg_obj_t ** | zoneobjp | |||
) | [static] |
Definition at line 9220 of file server.c.
References cfg_list_first(), cfg_listelt_value(), cfg_map_get(), cfg_obj_asstring(), cfg_obj_destroy(), cfg_obj_islist(), cfg_obj_isstring(), cfg_parse_buffer(), cfg_parser_reset(), cfg_tuple_get(), cfg_type_addzoneconf, CHECK, cleanup(), dns_view_detach(), dns_viewlist_find(), isc_buffer_add, isc_buffer_forward, isc_buffer_init, ISC_R_FAILURE, ISC_R_SUCCESS, ns_config_getclass(), rdclass, REQUIRE, and ns_server::viewlist.
Referenced by ns_server_changezone().
static isc_result_t delete_zoneconf | ( | cfg_parser_t * | pctx, | |
const cfg_obj_t * | config, | |||
const char * | zname | |||
) | [static] |
Definition at line 9283 of file server.c.
References cfg_listelt_value(), cfg_map_get(), cfg_obj_asstring(), cfg_obj_destroy(), cfg_obj_islist(), cfg_tuple_get(), DE_CONST, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_LIST_UNLINK, isc_mem_put, ISC_R_FAILURE, ISC_R_NOTFOUND, ISC_R_SUCCESS, cfg_obj::list, cfg_parser::mctx, cfg_listelt::obj, REQUIRE, and cfg_obj::value.
Referenced by do_modzone(), and ns_server_delzone().
static isc_result_t do_addzone | ( | ns_server_t * | server, | |
ns_cfgctx_t * | cfg, | |||
dns_view_t * | view, | |||
dns_name_t * | name, | |||
cfg_obj_t * | zoneconf, | |||
const cfg_obj_t * | zoneobj, | |||
isc_buffer_t ** | text | |||
) | [static] |
Definition at line 9323 of file server.c.
References ns_cfgctx::actx, ns_cfgctx::add_parser, cfg_obj_attach(), cfg_parser_mapadd(), CHECK, cleanup(), ns_cfgctx::config, configure_zone(), DE_CONST, dns_db_detach(), DNS_R_PARTIALMATCH, dns_view_freeze(), dns_view_thaw(), dns_zone_detach(), dns_zone_getdb(), dns_zone_loadnew(), dns_zone_setadded(), dns_zone_unload(), dns_zt_find(), dns_zt_unmount(), ISC_FALSE, ISC_LOG_INFO, isc_log_write(), ISC_R_EXISTS, ISC_R_NOTFOUND, ISC_R_SUCCESS, isc_result_totext(), isc_stdio_close(), isc_stdio_open(), isc_task_beginexclusive(), isc_task_endexclusive(), ISC_TRUE, ns_server::mctx, dns_view::name, dns_view::new_zone_file, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, ns_cfgctx::nzconfig, nzf_append(), putstr(), RUNTIME_CHECK, ns_server::task, TCHECK, ns_cfgctx::vconfig, and dns_view::zonetable.
Referenced by ns_server_changezone().
static isc_result_t do_modzone | ( | ns_server_t * | server, | |
ns_cfgctx_t * | cfg, | |||
dns_view_t * | view, | |||
dns_name_t * | name, | |||
const char * | zname, | |||
const cfg_obj_t * | zoneobj, | |||
isc_buffer_t ** | text | |||
) | [static] |
Definition at line 9428 of file server.c.
References ns_cfgctx::actx, ns_cfgctx::add_parser, cfg_parser_mapadd(), cfg_tuple_get(), CHECK, cleanup(), ns_cfgctx::conf_parser, ns_cfgctx::config, configure_zone(), DE_CONST, delete_zoneconf(), dns_db_detach(), dns_view_freeze(), dns_view_thaw(), dns_zone_detach(), dns_zone_getadded(), dns_zone_getdb(), dns_zone_loadnew(), dns_zone_unload(), dns_zt_find(), dns_zt_unmount(), ISC_FALSE, ISC_LOG_INFO, isc_log_write(), ISC_R_FAILURE, ISC_R_SUCCESS, isc_result_totext(), isc_stdio_close(), isc_stdio_open(), isc_task_beginexclusive(), isc_task_endexclusive(), ISC_TRUE, ns_server::mctx, dns_view::name, dns_view::new_zone_config, dns_view::new_zone_file, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, ns_cfgctx::nzconfig, nzf_append(), nzf_remove(), putstr(), RUNTIME_CHECK, ns_server::task, TCHECK, ns_cfgctx::vconfig, and dns_view::zonetable.
Referenced by ns_server_changezone().
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().
static isc_boolean_t inuse | ( | const char * | file, | |
isc_boolean_t | first, | |||
isc_buffer_t ** | text | |||
) | [static] |
Definition at line 9625 of file server.c.
References ISC_FALSE, isc_file_exists(), putnull(), and putstr().
Referenced by ISC_LIST(), mem_putunlocked(), and ns_server_delzone().
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().
static const cfg_obj_t* find_name_in_list_from_map | ( | const cfg_obj_t * | config, | |
const char * | map_key_for_list, | |||
const char * | name | |||
) | [static] |
Definition at line 9801 of file server.c.
References cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_map_get(), cfg_obj_asstring(), cfg_tuple_get(), and INSIST.
Referenced by ns_server_showzone().
static void emitzone | ( | void * | arg, | |
const char * | buf, | |||
int | len | |||
) | [static] |
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().
static isc_result_t generate_salt | ( | unsigned char * | salt, | |
size_t | saltlen | |||
) | [static] |
Definition at line 9924 of file server.c.
References isc_region::base, isc_buffer_init, isc_hex_totext(), ISC_LOG_INFO, isc_log_write(), ISC_R_RANGE, ISC_R_SUCCESS, isc_random_get(), isc_region::length, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, r, and RUNTIME_CHECK.
Referenced by ns_server_signing().
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().
static isc_boolean_t argcheck | ( | char * | cmd, | |
const char * | full | |||
) | [inline, static] |
Definition at line 10433 of file server.c.
References ISC_FALSE, and ISC_TRUE.
Referenced by ns_server_nta().
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_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().
static isc_result_t mkey_refresh | ( | dns_view_t * | view, | |
isc_buffer_t ** | text | |||
) | [static] |
Definition at line 10698 of file server.c.
References CHECK, cleanup(), DNS_NAME_FORMATSIZE, dns_zone_synckeyzone(), dns_view::managed_keys, dns_view::name, and putstr().
Referenced by ns_server_mkeys().
static isc_result_t mkey_dumpzone | ( | dns_view_t * | view, | |
isc_buffer_t ** | text | |||
) | [static] |
Definition at line 10712 of file server.c.
References CHECK, cleanup(), dns_db_closeversion(), dns_db_currentversion(), dns_db_detach(), DNS_KEYFLAG_KSK, DNS_KEYFLAG_REVOKE, dns_name_format(), DNS_NAME_FORMATSIZE, DNS_RDATA_INIT, dns_rdata_reset(), dns_rdata_toregion(), dns_rdata_tostruct(), dns_rdataset_current(), dns_rdataset_first(), dns_rdataset_isassociated(), dns_rdataset_next(), dns_rriterator_current(), dns_rriterator_destroy(), dns_rriterator_first(), dns_rriterator_init(), dns_rriterator_nextrrset(), dns_secalg_format(), DNS_SECALG_FORMATSIZE, dns_zone_getdb(), dst_region_computeid(), ISC_FALSE, ISC_FORMATHTTPTIMESTAMP_SIZE, ISC_R_NOMORE, ISC_R_SUCCESS, isc_region_consume, isc_stdtime_get(), ISC_TF, isc_time_formathttptimestamp(), isc_time_set(), dns_view::managed_keys, name, now, putstr(), r, RUNTIME_CHECK, ttl, and dns_rdataset::type.
Referenced by mkey_status().
static isc_result_t mkey_status | ( | dns_view_t * | view, | |
isc_buffer_t ** | text | |||
) | [static] |
Definition at line 10831 of file server.c.
References CHECK, cleanup(), dns_zone_getrefreshkeytime(), ISC_FORMATHTTPTIMESTAMP_SIZE, isc_time_formathttptimestamp(), isc_time_isepoch(), dns_view::managed_keys, mkey_dumpzone(), dns_view::name, and putstr().
Referenced by ns_server_mkeys().
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().
const char* empty_zones[] |