af0d9b770594ece695cc9a7325ed42abb728a5f7Tinderbox User * Copyright (C) 1999-2017 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * file, You can obtain one at http://mozilla.org/MPL/2.0/.
f94f59d746daffc38356d0a019b64eb01d2341c0Bob Halley ***** Module Info
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * A "view" is a DNS namespace, together with an optional resolver and a
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * forwarding policy. A "DNS namespace" is a (possibly empty) set of
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * authoritative zones together with an optional cache and optional
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * "hints" information.
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * Views start out "unfrozen". In this state, core attributes like
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * the cache, set of zones, and forwarding policy may be set. While
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * "unfrozen", the caller (e.g. nameserver configuration loading
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * code), must ensure exclusive access to the view. When the view is
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * "frozen", the core attributes become immutable, and the view module
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * will ensure synchronization. Freezing allows the view's core attributes
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * to be accessed without locking.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li Before the view is frozen, the caller must ensure synchronization.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li After the view is frozen, the module guarantees appropriate
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * synchronization of any data structures it creates and manipulates.
f94f59d746daffc38356d0a019b64eb01d2341c0Bob Halley * Reliability:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li No anticipated impact.
f94f59d746daffc38356d0a019b64eb01d2341c0Bob Halley * Resources:
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li No anticipated impact.
f94f59d746daffc38356d0a019b64eb01d2341c0Bob Halley * Standards:
f94f59d746daffc38356d0a019b64eb01d2341c0Bob Halley /* Unlocked. */
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * security roots and negative trust anchors.
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Hunt * internal use only; access via * dns_view_getsecroots()
65a66336a6e2ce2032f68139ef9c8afe18d08c14Andreas Gustafsson /* Configurable data. */
76ec142174aca78f1c476559b4a0b54efa9c3863Andreas Gustafsson * Configurable data for server use only,
76ec142174aca78f1c476559b4a0b54efa9c3863Andreas Gustafsson * locked by server configuration lock.
63ca494e7e9aba8dc6740443fdab69620c7a7523Brian Wellington /* Locked by themselves. */
f94f59d746daffc38356d0a019b64eb01d2341c0Bob Halley /* Locked by lock. */
f94f59d746daffc38356d0a019b64eb01d2341c0Bob Halley /* Under owner's locking control. */
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt * redirectfixed
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt * when valid */
b99bfa184bc9375421b5df915eea7dfac6a68a99Evan Hunt * File and configuration data for zones added at runtime
b99bfa184bc9375421b5df915eea7dfac6a68a99Evan Hunt * (only used in BIND9).
b99bfa184bc9375421b5df915eea7dfac6a68a99Evan Hunt * XXX: This should be a pointer to an opaque type that
b99bfa184bc9375421b5df915eea7dfac6a68a99Evan Hunt * named implements.
28fc90e6c81338c5f34e065fdda49d320e362583Mark Andrews#define DNS_VIEW_MAGIC ISC_MAGIC('V','i','e','w')
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence#define DNS_VIEW_VALID(view) ISC_MAGIC_VALID(view, DNS_VIEW_MAGIC)
81e3e3084980afcd61416f572c6e72d38a3808abMichał Kępień * MDB_NOTLS is used to prevent problems after configuration is reloaded, due
81e3e3084980afcd61416f572c6e72d38a3808abMichał Kępień * to the way LMDB's use of thread-local storage (TLS) interacts with the BIND9
81e3e3084980afcd61416f572c6e72d38a3808abMichał Kępień * thread model.
81e3e3084980afcd61416f572c6e72d38a3808abMichał Kępień#define DNS_LMDB_COMMON_FLAGS (MDB_CREATE | MDB_NOSUBDIR | MDB_NOTLS)
81e3e3084980afcd61416f572c6e72d38a3808abMichał Kępień#else /* __OpenBSD__ */
81e3e3084980afcd61416f572c6e72d38a3808abMichał Kępień * OpenBSD does not have a unified buffer cache, which requires both reads and
81e3e3084980afcd61416f572c6e72d38a3808abMichał Kępień * writes to be performed using mmap().
81e3e3084980afcd61416f572c6e72d38a3808abMichał Kępień#define DNS_LMDB_FLAGS (DNS_LMDB_COMMON_FLAGS | MDB_WRITEMAP)
81e3e3084980afcd61416f572c6e72d38a3808abMichał Kępień#endif /* __OpenBSD__ */
81e3e3084980afcd61416f572c6e72d38a3808abMichał Kępień#endif /* HAVE_LMDB */
6f44af1c8320e84d6b0c0c42bacadfe3020d9a91Mark Andrewsdns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * Create a view.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li The newly created view has no cache, no resolver, and an empty
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * zone table. The view is not frozen.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'mctx' is a valid memory context.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'rdclass' is a valid class.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'name' is a valid C string.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li viewp != NULL && *viewp == NULL
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_SUCCESS
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_NOMEMORY
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li Other errors are possible.
f94f59d746daffc38356d0a019b64eb01d2341c0Bob Halleydns_view_attach(dns_view_t *source, dns_view_t **targetp);
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * Attach '*targetp' to 'source'.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'source' is a valid, frozen view.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'targetp' points to a NULL dns_view_t *.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li *targetp is attached to source.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li While *targetp is attached, the view will not shut down.
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * Detach '*viewp' from its view.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'viewp' points to a valid dns_view_t *
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li *viewp is NULL.
2a37aa188c2297e0c0856c3e5740c43dd426a432Mark Andrews * Detach '*viewp' from its view. If this was the last reference
7d6d9c22404af9e81614e0a143f8bab65a97e8d4Francis Dupont * uncommitted changed in zones will be flushed to disk.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'viewp' points to a valid dns_view_t *
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li *viewp is NULL.
22608315e8e08b1fef12bce6e123c9ff6fe7a17cAndreas Gustafssondns_view_weakattach(dns_view_t *source, dns_view_t **targetp);
22608315e8e08b1fef12bce6e123c9ff6fe7a17cAndreas Gustafsson * Weakly attach '*targetp' to 'source'.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'source' is a valid, frozen view.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'targetp' points to a NULL dns_view_t *.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li *targetp is attached to source.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li While *targetp is attached, the view will not be freed.
22608315e8e08b1fef12bce6e123c9ff6fe7a17cAndreas Gustafssondns_view_weakdetach(dns_view_t **targetp);
22608315e8e08b1fef12bce6e123c9ff6fe7a17cAndreas Gustafsson * Detach '*viewp' from its view.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'viewp' points to a valid dns_view_t *.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li *viewp is NULL.
b99bfa184bc9375421b5df915eea7dfac6a68a99Evan Hunt * Create a zonetable for the view.
b99bfa184bc9375421b5df915eea7dfac6a68a99Evan Hunt *\li 'view' is a valid, unfrozen view.
b99bfa184bc9375421b5df915eea7dfac6a68a99Evan Hunt *\li 'view' does not have a zonetable already.
b99bfa184bc9375421b5df915eea7dfac6a68a99Evan Hunt *\li #ISC_R_SUCCESS
b99bfa184bc9375421b5df915eea7dfac6a68a99Evan Hunt *\li Any error that dns_zt_create() can return.
0df20c101eea3ffa57d9554ec20a1b710fa63064Bob Halley unsigned int options,
726290e9d5b720b736fa39d9f7d92c2efb7d1f24Bob Halley * Create a resolver and address database for the view.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is a valid, unfrozen view.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' does not have a resolver already.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li The requirements of dns_resolver_create() apply to 'taskmgr',
0df20c101eea3ffa57d9554ec20a1b710fa63064Bob Halley * 'ntasks', 'socketmgr', 'timermgr', 'options', 'dispatchv4', and
0df20c101eea3ffa57d9554ec20a1b710fa63064Bob Halley * 'dispatchv6'.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_SUCCESS
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li Any error that dns_resolver_create() can return.
fd15c8e32ed0c1cfd3ed737858a81966e7fbaeacAndreas Gustafssondns_view_setcache(dns_view_t *view, dns_cache_t *cache);
7781f25078c491a9650dec555bdc86cb0ed49861Tatuya JINMEI 神明達哉dns_view_setcache2(dns_view_t *view, dns_cache_t *cache, isc_boolean_t shared);
7781f25078c491a9650dec555bdc86cb0ed49861Tatuya JINMEI 神明達哉 * Set the view's cache database. If 'shared' is true, this means the cache
7781f25078c491a9650dec555bdc86cb0ed49861Tatuya JINMEI 神明達哉 * is created by another view and is shared with that view. dns_view_setcache()
7781f25078c491a9650dec555bdc86cb0ed49861Tatuya JINMEI 神明達哉 * is a backward compatible version equivalent to setcache2(..., ISC_FALSE).
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is a valid, unfrozen view.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'cache' is a valid cache.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li The cache of 'view' is 'cached.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li If this is not the first call to dns_view_setcache() for this
fd15c8e32ed0c1cfd3ed737858a81966e7fbaeacAndreas Gustafsson * view, then previously set cache is detached.
38980568375a6505452550b5677104ab44291b66Bob Halleydns_view_sethints(dns_view_t *view, dns_db_t *hints);
38980568375a6505452550b5677104ab44291b66Bob Halley * Set the view's hints database.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is a valid, unfrozen view, whose hints database has not been
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'hints' is a valid zone database.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li The hints database of 'view' is 'hints'.
b984520acca2532d048eae929dc0682dd334c7a3Brian Wellingtondns_view_setkeyring(dns_view_t *view, dns_tsig_keyring_t *ring);
433e06a25cdd92d665abda3e64c2c65f4a3f9b21Mark Andrewsdns_view_setdynamickeyring(dns_view_t *view, dns_tsig_keyring_t *ring);
b984520acca2532d048eae929dc0682dd334c7a3Brian Wellington * Set the view's static TSIG keys
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li 'view' is a valid, unfrozen view, whose static TSIG keyring has not
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'ring' is a valid TSIG keyring
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li The static TSIG keyring of 'view' is 'ring'.
433e06a25cdd92d665abda3e64c2c65f4a3f9b21Mark Andrewsdns_view_getdynamickeyring(dns_view_t *view, dns_tsig_keyring_t **ringp);
433e06a25cdd92d665abda3e64c2c65f4a3f9b21Mark Andrews * Return the views dynamic keys.
433e06a25cdd92d665abda3e64c2c65f4a3f9b21Mark Andrews * \li 'view' is a valid, unfrozen view.
433e06a25cdd92d665abda3e64c2c65f4a3f9b21Mark Andrews * \li 'ringp' != NULL && ringp == NULL.
f1f2f8bd47370a231c5c700ef918bd6ad6c7d042Andreas Gustafssondns_view_setdstport(dns_view_t *view, in_port_t dstport);
f1f2f8bd47370a231c5c700ef918bd6ad6c7d042Andreas Gustafsson * Set the view's destination port. This is the port to
f1f2f8bd47370a231c5c700ef918bd6ad6c7d042Andreas Gustafsson * which outgoing queries are sent. The default is 53,
f1f2f8bd47370a231c5c700ef918bd6ad6c7d042Andreas Gustafsson * the standard DNS port.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is a valid view.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'dstport' is a valid TCP/UDP port number.
7d6d9c22404af9e81614e0a143f8bab65a97e8d4Francis Dupont *\li External name servers will be assumed to be listening
f1f2f8bd47370a231c5c700ef918bd6ad6c7d042Andreas Gustafsson * on 'dstport'. For servers whose address has already
f1f2f8bd47370a231c5c700ef918bd6ad6c7d042Andreas Gustafsson * obtained obtained at the time of the call, the view may
f1f2f8bd47370a231c5c700ef918bd6ad6c7d042Andreas Gustafsson * continue to use the previously set port until the address
f1f2f8bd47370a231c5c700ef918bd6ad6c7d042Andreas Gustafsson * times out from the view's address database.
800b03baba638ddb3f67cc0d2ad2e70042fe8525Mark Andrewsdns_view_addzone(dns_view_t *view, dns_zone_t *zone);
800b03baba638ddb3f67cc0d2ad2e70042fe8525Mark Andrews * Add zone 'zone' to 'view'.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is a valid, unfrozen view.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'zone' is a valid zone.
86dcc4005887f91d23d970d4574a8f6afa7e28d2Evan Hunt * Freeze view. No changes can be made to view configuration while frozen.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is a valid, unfrozen view.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is frozen.
86dcc4005887f91d23d970d4574a8f6afa7e28d2Evan Hunt * Thaw view. This allows zones to be added or removed at runtime. This is
86dcc4005887f91d23d970d4574a8f6afa7e28d2Evan Hunt * NOT thread-safe; the caller MUST have run isc_task_exclusive() prior to
86dcc4005887f91d23d970d4574a8f6afa7e28d2Evan Hunt * thawing the view.
86dcc4005887f91d23d970d4574a8f6afa7e28d2Evan Hunt *\li 'view' is a valid, frozen view.
86dcc4005887f91d23d970d4574a8f6afa7e28d2Evan Hunt *\li 'view' is no longer frozen.
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halleydns_view_find(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington isc_stdtime_t now, unsigned int options, isc_boolean_t use_hints,
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington dns_db_t **dbp, dns_dbnode_t **nodep, dns_name_t *foundname,
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉dns_view_find2(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 isc_boolean_t use_hints, isc_boolean_t use_static_stub,
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 dns_db_t **dbp, dns_dbnode_t **nodep, dns_name_t *foundname,
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
8f5df5f1fe5aa989dee774cbc2c37c84bfd251d8Bob Halley * Find an rdataset whose owner name is 'name', and whose type is
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * In general, this function first searches view's zone and cache DBs for the
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * best match data against 'name'. If nothing found there, and if 'use_hints'
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * is ISC_TRUE, the view's hint DB (if configured) is searched.
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * If the view is configured with a static-stub zone which gives the longest
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * match for 'name' among the zones, however, the cache DB is not consulted
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * unless 'use_static_stub' is ISC_FALSE (see below about this argument).
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * dns_view_find() is a backward compatible version equivalent to
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * dns_view_find2() with use_static_stub argument being ISC_FALSE.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li See the description of dns_db_find() for information about 'options'.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * If the caller sets #DNS_DBFIND_GLUEOK, it must ensure that 'name'
8f5df5f1fe5aa989dee774cbc2c37c84bfd251d8Bob Halley * and 'type' are appropriate for glue retrieval.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li If 'now' is zero, then the current time will be used.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li If 'use_hints' is ISC_TRUE, and the view has a hints database, then
8f5df5f1fe5aa989dee774cbc2c37c84bfd251d8Bob Halley * it will be searched last. If the answer is found in the hints
58cbc05eb0b80510182496ad905cd407f3624dbeBrian Wellington * database, the result code will be DNS_R_HINT. If the name is found
58cbc05eb0b80510182496ad905cd407f3624dbeBrian Wellington * in the hints database but not the type, the result code will be
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * #DNS_R_HINTNXRRSET.
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 *\li If 'use_static_stub' is ISC_FALSE and the longest match zone for 'name'
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * is a static-stub zone, it's ignored and the cache and/or hints will be
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * searched. In the majority of the cases this argument should be
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * ISC_FALSE. The only known usage of this argument being ISC_TRUE is
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * if this search is for a "bailiwick" glue A or AAAA RRset that may
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * best match a static-stub zone. Consider the following example:
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * this view is configured with a static-stub zone "example.com",
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * and an attempt of recursive resolution needs to send a query for the
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * zone. In this case it's quite likely that the resolver is trying to
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * find A/AAAA RRs for the apex name "example.com". And, to honor the
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * static-stub configuration it needs to return the glue RRs in the
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * static-stub zone even if that exact RRs coming from the authoritative
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * zone has been cached.
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * In other general cases, the requested data is better to be
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * authoritative, either locally configured or retrieved from an external
743bbdc18f839499862e4fb28ec32f607b1632dcTatuya JINMEI 神明達哉 * server, and the data in the static-stub zone should better be ignored.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'foundname' must meet the requirements of dns_db_find().
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li If 'sigrdataset' is not NULL, and there is a SIG rdataset which
8f5df5f1fe5aa989dee774cbc2c37c84bfd251d8Bob Halley * covers 'type', then 'sigrdataset' will be bound to it.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is a valid, frozen view.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'name' is valid name.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'type' is a valid dns_rdatatype_t, and is not a meta query type
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington * except dns_rdatatype_any.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li dbp == NULL || *dbp == NULL
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li nodep == NULL || *nodep == NULL. If nodep != NULL, dbp != NULL.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'foundname' is a valid name with a dedicated buffer or NULL.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'rdataset' is a valid, disassociated rdataset.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'sigrdataset' is NULL, or is a valid, disassociated rdataset.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li In successful cases, 'rdataset', and possibly 'sigrdataset', are
8f5df5f1fe5aa989dee774cbc2c37c84bfd251d8Bob Halley * bound to the found data.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li If dbp != NULL, it points to the database containing the data.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li If nodep != NULL, it points to the database node containing the data.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li If foundname != NULL, it contains the full name of the found data.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li Any result that dns_db_find() can return, with the exception of
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * #DNS_R_DELEGATION.
8f5df5f1fe5aa989dee774cbc2c37c84bfd251d8Bob Halleydns_view_simplefind(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
8f5df5f1fe5aa989dee774cbc2c37c84bfd251d8Bob Halley dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * Find an rdataset whose owner name is 'name', and whose type is
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li This routine is appropriate for simple, exact-match queries of the
38980568375a6505452550b5677104ab44291b66Bob Halley * view. 'name' must be a canonical name; there is no DNAME or CNAME
38980568375a6505452550b5677104ab44291b66Bob Halley * processing.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li See the description of dns_db_find() for information about 'options'.
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * If the caller sets DNS_DBFIND_GLUEOK, it must ensure that 'name'
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * and 'type' are appropriate for glue retrieval.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li If 'now' is zero, then the current time will be used.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li If 'use_hints' is ISC_TRUE, and the view has a hints database, then
38980568375a6505452550b5677104ab44291b66Bob Halley * it will be searched last. If the answer is found in the hints
58cbc05eb0b80510182496ad905cd407f3624dbeBrian Wellington * database, the result code will be DNS_R_HINT. If the name is found
58cbc05eb0b80510182496ad905cd407f3624dbeBrian Wellington * in the hints database but not the type, the result code will be
58cbc05eb0b80510182496ad905cd407f3624dbeBrian Wellington * DNS_R_HINTNXRRSET.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li If 'sigrdataset' is not NULL, and there is a SIG rdataset which
c56c5586b49ccddbaf7e2b5c6c06adee1c509253Bob Halley * covers 'type', then 'sigrdataset' will be bound to it.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is a valid, frozen view.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'name' is valid name.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'type' is a valid dns_rdatatype_t, and is not a meta query type
93d6dfaf66258337985427c86181f01fc51f0bb4Mark Andrews * (e.g. dns_rdatatype_any), or dns_rdatatype_rrsig.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'rdataset' is a valid, disassociated rdataset.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'sigrdataset' is NULL, or is a valid, disassociated rdataset.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li In successful cases, 'rdataset', and possibly 'sigrdataset', are
16804ba3b7470cd5d53890f52de823cd9dd2152aBob Halley * bound to the found data.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_SUCCESS Success; result is desired type.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li DNS_R_GLUE Success; result is glue.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li DNS_R_HINT Success; result is a hint.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li DNS_R_NCACHENXDOMAIN Success; result is a ncache entry.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li DNS_R_NCACHENXRRSET Success; result is a ncache entry.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li DNS_R_NXDOMAIN The name does not exist.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li DNS_R_NXRRSET The rrset does not exist.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_NOTFOUND No matching data found,
16804ba3b7470cd5d53890f52de823cd9dd2152aBob Halley * or an error occurred.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein/*% See dns_view_findzonecut2() */
08f8af2a42ddd2b87f1d67c09c0ba057b3253f29Bob Halleydns_view_findzonecut(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
08f8af2a42ddd2b87f1d67c09c0ba057b3253f29Bob Halley dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
53cf67186506f9557aaf2149898dd76715803db2Mark Andrewsdns_view_findzonecut2(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
53cf67186506f9557aaf2149898dd76715803db2Mark Andrews isc_boolean_t use_hints, isc_boolean_t use_cache,
53cf67186506f9557aaf2149898dd76715803db2Mark Andrews dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
08f8af2a42ddd2b87f1d67c09c0ba057b3253f29Bob Halley * Find the best known zonecut containing 'name'.
2f259b4eecb70af7a8d3ac5e4f1b3ed43f49af81Andreas Gustafsson * This uses local authority, cache, and optionally hints data.
2f259b4eecb70af7a8d3ac5e4f1b3ed43f49af81Andreas Gustafsson * No external queries are performed.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li If 'now' is zero, then the current time will be used.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li If 'use_hints' is ISC_TRUE, and the view has a hints database, then
08f8af2a42ddd2b87f1d67c09c0ba057b3253f29Bob Halley * it will be searched last.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li If 'use_cache' is ISC_TRUE, and the view has a cache, then it will be
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li If 'sigrdataset' is not NULL, and there is a SIG rdataset which
08f8af2a42ddd2b87f1d67c09c0ba057b3253f29Bob Halley * covers 'type', then 'sigrdataset' will be bound to it.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li If the DNS_DBFIND_NOEXACT option is set, then the zonecut returned
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * (if any) will be the deepest known ancestor of 'name'.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is a valid, frozen view.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'name' is valid name.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'rdataset' is a valid, disassociated rdataset.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'sigrdataset' is NULL, or is a valid, disassociated rdataset.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_SUCCESS Success.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li Many other results are possible.
e7dbdb25475cdca583dd41f053da2d7c53622b6cBob Halleydns_viewlist_find(dns_viewlist_t *list, const char *name,
6826f014d6fdcb60a85465dc8290e6582153bbe6Andreas Gustafsson * Search for a view with name 'name' and class 'rdclass' in 'list'.
6826f014d6fdcb60a85465dc8290e6582153bbe6Andreas Gustafsson * If found, '*viewp' is (strongly) attached to it.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'viewp' points to a NULL dns_view_t *.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_SUCCESS A matching view was found.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_NOTFOUND No matching view was found.
40aadb6a143e0f2d351e743dce43cfc894d4d855Mark Andrewsdns_viewlist_findzone(dns_viewlist_t *list, dns_name_t *name, isc_boolean_t allclasses,
40aadb6a143e0f2d351e743dce43cfc894d4d855Mark Andrews * Search zone with 'name' in view with 'rdclass' in viewlist 'list'
40aadb6a143e0f2d351e743dce43cfc894d4d855Mark Andrews * If found, zone is returned in *zonep. If allclasses is set rdclass is ignored
40aadb6a143e0f2d351e743dce43cfc894d4d855Mark Andrews *\li #ISC_R_SUCCESS A matching zone was found.
40aadb6a143e0f2d351e743dce43cfc894d4d855Mark Andrews *\li #ISC_R_NOTFOUND No matching zone was found.
c38341ec435fb78de6d12c1001201f9ac7487b68Mark Andrews *\li #ISC_R_MULTIPLE Multiple zones with the same name were found.
6826f014d6fdcb60a85465dc8290e6582153bbe6Andreas Gustafssondns_view_findzone(dns_view_t *view, dns_name_t *name, dns_zone_t **zonep);
6826f014d6fdcb60a85465dc8290e6582153bbe6Andreas Gustafsson * Search for the zone 'name' in the zone table of 'view'.
6826f014d6fdcb60a85465dc8290e6582153bbe6Andreas Gustafsson * If found, 'zonep' is (strongly) attached to it. There
6826f014d6fdcb60a85465dc8290e6582153bbe6Andreas Gustafsson * are no partial matches.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'zonep' points to a NULL dns_zone_t *.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_SUCCESS A matching zone was found.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_NOTFOUND No matching zone was found.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li others An error occurred.
036df8a12dc56126ada0e472c22d93d55eef9675Andreas Gustafssondns_view_load(dns_view_t *view, isc_boolean_t stop);
9dafd058e3cfdd8218247811cea792588ec19052Andreas Gustafssondns_view_loadnew(dns_view_t *view, isc_boolean_t stop);
8a2ab2b9203120c3e2a883a5ee8c0b5d60c1808cEvan Huntdns_view_asyncload(dns_view_t *view, dns_zt_allloaded_t callback, void *arg);
9dafd058e3cfdd8218247811cea792588ec19052Andreas Gustafsson * Load zones attached to this view. dns_view_load() loads
9dafd058e3cfdd8218247811cea792588ec19052Andreas Gustafsson * all zones whose master file has changed since the last
db30f4bdcb66afb7eb1ab0c6882cc70be9a53d79Mark Andrews * load; dns_view_loadnew() loads only zones that have never
9dafd058e3cfdd8218247811cea792588ec19052Andreas Gustafsson * been loaded.
8a2ab2b9203120c3e2a883a5ee8c0b5d60c1808cEvan Hunt * dns_view_asyncload() loads zones asynchronously. When all zones
8a2ab2b9203120c3e2a883a5ee8c0b5d60c1808cEvan Hunt * in the view have finished loading, 'callback' is called with argument
8a2ab2b9203120c3e2a883a5ee8c0b5d60c1808cEvan Hunt * 'arg' to inform the caller.
9dafd058e3cfdd8218247811cea792588ec19052Andreas Gustafsson * If 'stop' is ISC_TRUE, stop on the first error and return it.
8a2ab2b9203120c3e2a883a5ee8c0b5d60c1808cEvan Hunt * If 'stop' is ISC_FALSE (or we are loading asynchronously), ignore errors.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is valid.
e1368a7770744cbeadcdc27967f855196988eceaAndreas Gustafssondns_view_gettsig(dns_view_t *view, dns_name_t *keyname,
e1368a7770744cbeadcdc27967f855196988eceaAndreas Gustafsson * Find the TSIG key configured in 'view' with name 'keyname',
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li keyp points to a NULL dns_tsigkey_t *.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_SUCCESS A key was found and '*keyp' now points to it.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_NOTFOUND No key was found.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li others An error occurred.
e1368a7770744cbeadcdc27967f855196988eceaAndreas Gustafssondns_view_getpeertsig(dns_view_t *view, isc_netaddr_t *peeraddr,
e1368a7770744cbeadcdc27967f855196988eceaAndreas Gustafsson * Find the TSIG key configured in 'view' for the server whose
e1368a7770744cbeadcdc27967f855196988eceaAndreas Gustafsson * address is 'peeraddr', if any.
e1368a7770744cbeadcdc27967f855196988eceaAndreas Gustafsson * keyp points to a NULL dns_tsigkey_t *.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_SUCCESS A key was found and '*keyp' now points to it.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_NOTFOUND No key was found.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li others An error occurred.
b984520acca2532d048eae929dc0682dd334c7a3Brian Wellingtondns_view_checksig(dns_view_t *view, isc_buffer_t *source, dns_message_t *msg);
b984520acca2532d048eae929dc0682dd334c7a3Brian Wellington * Verifies the signature of a message.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is a valid view.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'source' is a valid buffer containing the message
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'msg' is a valid message
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li see dns_tsig_verify()
bfb0e358c8d7f73afa7f31efb55fdabdddce3a10Andreas Gustafsson * Perform dialup-time maintenance on the zones of 'view'.
113b8ef9731a0c4fb47f3ad41cb9d07d97e022a8Andreas Gustafssondns_view_dumpdbtostream(dns_view_t *view, FILE *fp);
113b8ef9731a0c4fb47f3ad41cb9d07d97e022a8Andreas Gustafsson * Dump the current state of the view 'view' to the stream 'fp'
113b8ef9731a0c4fb47f3ad41cb9d07d97e022a8Andreas Gustafsson * for purposes of analysis or debugging.
113b8ef9731a0c4fb47f3ad41cb9d07d97e022a8Andreas Gustafsson * Currently the dumped state includes the view's cache; in the future
113b8ef9731a0c4fb47f3ad41cb9d07d97e022a8Andreas Gustafsson * it may also include other state such as the address database.
113b8ef9731a0c4fb47f3ad41cb9d07d97e022a8Andreas Gustafsson * It will not not include authoritative data since it is voluminous and
113b8ef9731a0c4fb47f3ad41cb9d07d97e022a8Andreas Gustafsson * easily obtainable by other means.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is valid.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'fp' refers to a file open for writing.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li ISC_R_SUCCESS The cache was successfully dumped.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * \li others An error occurred (see dns_master_dump)
7781f25078c491a9650dec555bdc86cb0ed49861Tatuya JINMEI 神明達哉dns_view_flushcache2(dns_view_t *view, isc_boolean_t fixuponly);
7781f25078c491a9650dec555bdc86cb0ed49861Tatuya JINMEI 神明達哉 * Flush the view's cache (and ADB). If 'fixuponly' is true, it only updates
7781f25078c491a9650dec555bdc86cb0ed49861Tatuya JINMEI 神明達哉 * the internal reference to the cache DB with omitting actual flush operation.
7781f25078c491a9650dec555bdc86cb0ed49861Tatuya JINMEI 神明達哉 * 'fixuponly' is intended to be used for a view that shares a cache with
7781f25078c491a9650dec555bdc86cb0ed49861Tatuya JINMEI 神明達哉 * a different view. dns_view_flushcache() is a backward compatible version
7781f25078c491a9650dec555bdc86cb0ed49861Tatuya JINMEI 神明達哉 * that always sets fixuponly to false.
c20ffa38dee7efa0dc01822d4bac5e41729b9b61Brian Wellington * 'view' is valid.
c20ffa38dee7efa0dc01822d4bac5e41729b9b61Brian Wellington * No other tasks are executing.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_SUCCESS
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_NOMEMORY
9d4ec6d2c59bd5845ac8bca5a5d790be9a772862Evan Huntdns_view_flushnode(dns_view_t *view, dns_name_t *name, isc_boolean_t tree);
01279934803dd45c007a58b61fe20c2852135b52Evan Hunt * Flush the given name from the view's cache (and optionally ADB/badcache).
9d4ec6d2c59bd5845ac8bca5a5d790be9a772862Evan Hunt * Flush the given name from the cache, ADB, and bad cache. If 'tree'
9d4ec6d2c59bd5845ac8bca5a5d790be9a772862Evan Hunt * is true, also flush all subdomains of 'name'.
01279934803dd45c007a58b61fe20c2852135b52Evan Hunt *\li 'view' is valid.
01279934803dd45c007a58b61fe20c2852135b52Evan Hunt *\li 'name' is valid.
01279934803dd45c007a58b61fe20c2852135b52Evan Hunt *\li #ISC_R_SUCCESS
01279934803dd45c007a58b61fe20c2852135b52Evan Hunt * other returns are failures.
01279934803dd45c007a58b61fe20c2852135b52Evan Huntdns_view_flushname(dns_view_t *view, dns_name_t *name);
01279934803dd45c007a58b61fe20c2852135b52Evan Hunt * Flush the given name from the view's cache, ADB and badcache.
01279934803dd45c007a58b61fe20c2852135b52Evan Hunt * Equivalent to dns_view_flushnode(view, name, ISC_FALSE).
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is valid.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'name' is valid.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_SUCCESS
60213f2815a7e6584a2285546d05633fa7b6f5b4Mark Andrews * other returns are failures.
4607e7a9b8dfb1b41c70e51c2b603daaf22cf302Mark Andrewsdns_view_adddelegationonly(dns_view_t *view, dns_name_t *name);
4607e7a9b8dfb1b41c70e51c2b603daaf22cf302Mark Andrews * Add the given name to the delegation only table.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is valid.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'name' is valid.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_SUCCESS
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_NOMEMORY
0b1da8124c817270f5dfe46cd0211b993c931a91Mark Andrewsdns_view_excludedelegationonly(dns_view_t *view, dns_name_t *name);
0b1da8124c817270f5dfe46cd0211b993c931a91Mark Andrews * Add the given name to be excluded from the root-delegation-only.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is valid.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'name' is valid.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_SUCCESS
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li #ISC_R_NOMEMORY
4607e7a9b8dfb1b41c70e51c2b603daaf22cf302Mark Andrewsdns_view_isdelegationonly(dns_view_t *view, dns_name_t *name);
0b1da8124c817270f5dfe46cd0211b993c931a91Mark Andrews * Check if 'name' is in the delegation only table or if
0b1da8124c817270f5dfe46cd0211b993c931a91Mark Andrews * rootdelonly is set that name is not being excluded.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is valid.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'name' is valid.
3fb1637c9265cc593973326ae193783413f68699Tatuya JINMEI 神明達哉 *\li #ISC_TRUE if the name is the table.
7d6d9c22404af9e81614e0a143f8bab65a97e8d4Francis Dupont *\li #ISC_FALSE otherwise.
0b1da8124c817270f5dfe46cd0211b993c931a91Mark Andrewsdns_view_setrootdelonly(dns_view_t *view, isc_boolean_t value);
0b1da8124c817270f5dfe46cd0211b993c931a91Mark Andrews * Set the root delegation only flag.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is valid.
0b1da8124c817270f5dfe46cd0211b993c931a91Mark Andrews * Get the root delegation only flag.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein *\li 'view' is valid.
7502c6600645f120434d84d0ce3df7c3585cfe43Mark Andrewsdns_view_freezezones(dns_view_t *view, isc_boolean_t freeze);
7502c6600645f120434d84d0ce3df7c3585cfe43Mark Andrews * Freeze/thaw updates to master zones.
fb827ed6df9a473770fb69a75a455b4ad0d14f52Mark Andrews * \li 'view' is valid.
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Huntdns_view_setadbstats(dns_view_t *view, isc_stats_t *stats);
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt * Set a adb statistics set 'stats' for 'view'.
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt * \li 'view' is valid and is not frozen.
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt *\li stats is a valid statistics supporting adb statistics
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Huntdns_view_getadbstats(dns_view_t *view, isc_stats_t **statsp);
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt * Get the adb statistics counter set for 'view'. If a statistics set is
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt * set '*statsp' will be attached to the set; otherwise, '*statsp' will be
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt * untouched.
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt * \li 'view' is valid and is not frozen.
dd2a0a6d2dec1c23787351e51b434a838dec5603Evan Hunt *\li 'statsp' != NULL && '*statsp' != NULL
d9059b0c38bd630c367d81424d72b1308cd74b04Tatuya JINMEI 神明達哉dns_view_setresstats(dns_view_t *view, isc_stats_t *stats);
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews * Set a general resolver statistics counter set 'stats' for 'view'.
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews * \li 'view' is valid and is not frozen.
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews *\li stats is a valid statistics supporting resolver statistics counters
d9059b0c38bd630c367d81424d72b1308cd74b04Tatuya JINMEI 神明達哉dns_view_getresstats(dns_view_t *view, isc_stats_t **statsp);
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews * Get the general statistics counter set for 'view'. If a statistics set is
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews * set '*statsp' will be attached to the set; otherwise, '*statsp' will be
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews * untouched.
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews * \li 'view' is valid and is not frozen.
ddad35552931651426ad70912d29d9ab7d2a8d80Automatic Updater *\li 'statsp' != NULL && '*statsp' != NULL
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrewsdns_view_setresquerystats(dns_view_t *view, dns_stats_t *stats);
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews * Set a statistics counter set of rdata type, 'stats', for 'view'. Once the
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews * statistic set is installed, view's resolver will count outgoing queries
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews * per rdata type.
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews * \li 'view' is valid and is not frozen.
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews *\li stats is a valid statistics created by dns_rdatatypestats_create().
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrewsdns_view_getresquerystats(dns_view_t *view, dns_stats_t **statsp);
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews * Get the rdatatype statistics counter set for 'view'. If a statistics set is
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews * set '*statsp' will be attached to the set; otherwise, '*statsp' will be
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews * untouched.
8907d8fa04fdaa65baf0bc6b01230b2ebde93106Mark Andrews * \li 'view' is valid and is not frozen.
ddad35552931651426ad70912d29d9ab7d2a8d80Automatic Updater *\li 'statsp' != NULL && '*statsp' != NULL
7781f25078c491a9650dec555bdc86cb0ed49861Tatuya JINMEI 神明達哉 * Check if the view shares the cache created by another view.
7781f25078c491a9650dec555bdc86cb0ed49861Tatuya JINMEI 神明達哉 * \li 'view' is valid.
7781f25078c491a9650dec555bdc86cb0ed49861Tatuya JINMEI 神明達哉 *\li #ISC_TRUE if the cache is shared.
7d6d9c22404af9e81614e0a143f8bab65a97e8d4Francis Dupont *\li #ISC_FALSE otherwise.
b8a9632333a92d73a503afe1aaa7990016c8bee9Evan Hunt isc_taskmgr_t *taskmgr, isc_timermgr_t *timermgr);
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * Initialize the negative trust anchor table for the view.
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * \li 'view' is valid.
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt *\li ISC_R_SUCCESS
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt *\li Any other result indicates failure
0cfb24736841b3e98bb25853229a0efabab88bddEvan Huntdns_view_getntatable(dns_view_t *view, dns_ntatable_t **ntp);
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * Get the negative trust anchor table for this view. Returns
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * ISC_R_NOTFOUND if the table not been initialized for the view.
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * '*ntp' is attached on success; the caller is responsible for
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * detaching it with dns_ntatable_detach().
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * \li 'view' is valid.
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * \li 'nta' is not NULL and '*nta' is NULL.
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt *\li ISC_R_SUCCESS
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt *\li ISC_R_NOTFOUND
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Huntdns_view_initsecroots(dns_view_t *view, isc_mem_t *mctx);
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * Initialize security roots for the view, detaching any previously
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * existing security roots first. (Note that secroots_priv is
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Hunt * NULL until this function is called, so any function using
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * security roots must check that they have been initialized first.
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * One way to do this is use dns_view_getsecroots() and check its
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * return value.)
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Hunt * \li 'view' is valid.
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Hunt *\li ISC_R_SUCCESS
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Hunt *\li Any other result indicates failure
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Huntdns_view_getsecroots(dns_view_t *view, dns_keytable_t **ktp);
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Hunt * Get the security roots for this view. Returns ISC_R_NOTFOUND if
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Hunt * the security roots keytable has not been initialized for the view.
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Hunt * '*ktp' is attached on success; the caller is responsible for
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Hunt * detaching it with dns_keytable_detach().
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Hunt * \li 'view' is valid.
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Hunt * \li 'ktp' is not NULL and '*ktp' is NULL.
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Hunt *\li ISC_R_SUCCESS
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Hunt *\li ISC_R_NOTFOUND
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Huntdns_view_issecuredomain(dns_view_t *view, dns_name_t *name,
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * Is 'name' at or beneath a trusted key, and not covered by a valid
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * negative trust anchor? Put answer in '*secure_domain'.
b8a9632333a92d73a503afe1aaa7990016c8bee9Evan Hunt * If 'checknta' is ISC_FALSE, ignore the NTA table in determining
b8a9632333a92d73a503afe1aaa7990016c8bee9Evan Hunt * whether this is a secure domain.
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Hunt * \li 'view' is valid.
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Hunt *\li ISC_R_SUCCESS
95f2377b4f180a564d35343c8d150e8f03c98a52Evan Hunt *\li Any other value indicates failure
0cfb24736841b3e98bb25853229a0efabab88bddEvan Huntdns_view_ntacovers(dns_view_t *view, isc_stdtime_t now,
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * Is there a current negative trust anchor above 'name' and below 'anchor'?
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt * \li 'view' is valid.
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt *\li ISC_R_TRUE
0cfb24736841b3e98bb25853229a0efabab88bddEvan Hunt *\li ISC_R_FALSE
44f175a90a855326725439b2f1178f0dcca8f67dMark Andrewsdns_view_untrust(dns_view_t *view, dns_name_t *keyname,
515c7f3c43f76d7b439905b18009105364b36100Automatic Updater dns_rdata_dnskey_t *dnskey, isc_mem_t *mctx);
44f175a90a855326725439b2f1178f0dcca8f67dMark Andrews * Remove keys that match 'keyname' and 'dnskey' from the views trust
132a57117978816eebf6f8c33b39bdcfcd62fd7aEvan Hunt * (NOTE: If the configuration specifies that there should be a
132a57117978816eebf6f8c33b39bdcfcd62fd7aEvan Hunt * trust anchor at 'keyname', but no keys are left after this
132a57117978816eebf6f8c33b39bdcfcd62fd7aEvan Hunt * operation, that is an error. We fail closed, inserting a NULL
132a57117978816eebf6f8c33b39bdcfcd62fd7aEvan Hunt * key so as to prevent validation until a legimitate key has been
132a57117978816eebf6f8c33b39bdcfcd62fd7aEvan Hunt * provided.)
44f175a90a855326725439b2f1178f0dcca8f67dMark Andrews * \li 'view' is valid.
44f175a90a855326725439b2f1178f0dcca8f67dMark Andrews * \li 'keyname' is valid.
44f175a90a855326725439b2f1178f0dcca8f67dMark Andrews * \li 'mctx' is valid.
44f175a90a855326725439b2f1178f0dcca8f67dMark Andrews * \li 'dnskey' is valid.
cfd262045c23cadb8415f0111f56995258f17361Evan Huntdns_view_setnewzones(dns_view_t *view, isc_boolean_t allow, void *cfgctx,
3b38e4b8344cb3bb28f2b116d2e39f8371ef8e34Mukund Sivaraman void (*cfg_destroy)(void **), isc_uint64_t mapsize);
cfd262045c23cadb8415f0111f56995258f17361Evan Hunt * Set whether or not to allow zones to be created or deleted at runtime.
cfd262045c23cadb8415f0111f56995258f17361Evan Hunt * If 'allow' is ISC_TRUE, determines the filename into which new zone
cfd262045c23cadb8415f0111f56995258f17361Evan Hunt * configuration will be written. Preserves the configuration context
cfd262045c23cadb8415f0111f56995258f17361Evan Hunt * (a pointer to which is passed in 'cfgctx') for use when parsing new
cfd262045c23cadb8415f0111f56995258f17361Evan Hunt * zone configuration. 'cfg_destroy' points to a callback routine to
cfd262045c23cadb8415f0111f56995258f17361Evan Hunt * destroy the configuration context when the view is destroyed. (This
cfd262045c23cadb8415f0111f56995258f17361Evan Hunt * roundabout method is used in order to avoid libdns having a dependency
cfd262045c23cadb8415f0111f56995258f17361Evan Hunt * on libisccfg and libbind9.)
cfd262045c23cadb8415f0111f56995258f17361Evan Hunt * If 'allow' is ISC_FALSE, removes any existing references to
cfd262045c23cadb8415f0111f56995258f17361Evan Hunt * configuration context and frees any memory.
cfd262045c23cadb8415f0111f56995258f17361Evan Hunt * \li 'view' is valid.
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt * \li ISC_R_SUCCESS
801707fe19600313a0b1f7845a518100f69e58b6Evan Hunt * \li ISC_R_NOSPACE
abff0f462a758383d012887d3a97da4dac0c5a94Evan Huntdns_view_searchdlz(dns_view_t *view, dns_name_t *name,
abff0f462a758383d012887d3a97da4dac0c5a94Evan Hunt unsigned int minlabels,
abff0f462a758383d012887d3a97da4dac0c5a94Evan Hunt * Search through the DLZ database(s) in view->dlz_searched to find
abff0f462a758383d012887d3a97da4dac0c5a94Evan Hunt * one that can answer a query for 'name', using the DLZ driver's
abff0f462a758383d012887d3a97da4dac0c5a94Evan Hunt * findzone method. If successful, '*dbp' is set to point to the
abff0f462a758383d012887d3a97da4dac0c5a94Evan Hunt * DLZ database.
abff0f462a758383d012887d3a97da4dac0c5a94Evan Hunt * \li ISC_R_SUCCESS
abff0f462a758383d012887d3a97da4dac0c5a94Evan Hunt * \li ISC_R_NOTFOUND
abff0f462a758383d012887d3a97da4dac0c5a94Evan Hunt * \li 'view' is valid.
abff0f462a758383d012887d3a97da4dac0c5a94Evan Hunt * \li 'name' is not NULL.
abff0f462a758383d012887d3a97da4dac0c5a94Evan Hunt * \li 'dbp' is not NULL and *dbp is NULL.
a8783019814daa36dd57afe3f527462822834c3bEvan Hunt * Get the view's servfail-ttl. zero => no servfail caching.
a8783019814daa36dd57afe3f527462822834c3bEvan Hunt *\li 'view' to be valid.
a8783019814daa36dd57afe3f527462822834c3bEvan Huntdns_view_setfailttl(dns_view_t *view, isc_uint32_t failttl);
a8783019814daa36dd57afe3f527462822834c3bEvan Hunt * Set the view's servfail-ttl. zero => no servfail caching.
a8783019814daa36dd57afe3f527462822834c3bEvan Hunt *\li 'view' to be valid.
a6f0e9c985220f0e4509777e6528afb64e0ad576Mukund Sivaraman * Save NTA for names in this view to a file.
a6f0e9c985220f0e4509777e6528afb64e0ad576Mukund Sivaraman *\li 'view' to be valid.
a6f0e9c985220f0e4509777e6528afb64e0ad576Mukund Sivaraman * Loads NTA for names in this view from a file.
a6f0e9c985220f0e4509777e6528afb64e0ad576Mukund Sivaraman *\li 'view' to be valid.
2732d4922c2e72a399204320791acfd2fd3d6c7cMark Andrews * Commit dns_zone_setview() calls previously made for all zones in this
2732d4922c2e72a399204320791acfd2fd3d6c7cMark Andrews *\li 'view' to be valid.
2732d4922c2e72a399204320791acfd2fd3d6c7cMark Andrews * Revert dns_zone_setview() calls previously made for all zones in this
2732d4922c2e72a399204320791acfd2fd3d6c7cMark Andrews *\li 'view' to be valid.
f94f59d746daffc38356d0a019b64eb01d2341c0Bob Halley#endif /* DNS_VIEW_H */