Lines Matching +defs:have +defs:db

41 #include <dns/db.h>
150 /*% Does the rdataset 'r' have an attached 'No QNAME Proof'? */
197 * SAVE and RESTORE have the same semantics as:
216 validate(ns_client_t *client, dns_db_t *db, dns_name_t *name,
220 query_findclosestnsec3(dns_name_t *qname, dns_db_t *db,
333 * 3. Identify authoritative data sources which may have an answer;
796 dns_db_closeversion(dbversion->db, &dbversion->version, false);
797 dns_db_detach(&dbversion->db);
825 if (client->query.redirect.db != NULL) {
827 dns_db_detachnode(client->query.redirect.db,
830 dns_db_detach(&client->query.redirect.db);
947 * The view's cache ACLs have not yet been evaluated.
1014 dns_zone_t *zone, dns_db_t *db,
1021 REQUIRE(db != NULL);
1039 client->query.authdbset && db != client->query.authdb)
1066 dbversion = ns_client_findversion(client, db);
1068 CTRACE(ISC_LOG_ERROR, "unable to get db version");
1135 * don't have to check again.
1187 dns_db_t *db = NULL;
1207 result = dns_zone_getdb(zone, &db);
1214 result = query_validatezonedb(client, name, qtype, options, zone, db,
1223 *dbp = db;
1234 if (db != NULL) {
1235 dns_db_detach(&db);
1297 /* It's possible to have a separate log channel for rpz passthru. */
1418 dns_db_t *db = NULL;
1426 dns_db_attach(client->view->cachedb, &db);
1430 dns_db_detach(&db);
1434 * If query_checkcacheaccess() succeeded, transfer ownership of 'db'.
1435 * Otherwise, 'db' will be NULL due to the dns_db_detach() call above.
1437 *dbp = db;
1586 * Look up data for given 'name' and 'type' in given 'version' of 'db' for
1609 query_additionalauthfind(dns_db_t *db, dns_dbversion_t *version,
1627 result = dns_db_findext(db, name, version, type,
1642 dns_db_detachnode(db, &node);
1651 if (sigrdataset != NULL && !dns_db_issecure(db) &&
1692 dns_db_t *db = NULL;
1708 dns_db_attach(client->query.authdb, &db);
1713 result = query_additionalauthfind(db, version, name, type, client,
1724 dns_db_detach(&db);
1727 &db, &version);
1735 result = query_additionalauthfind(db, version, name, type,
1741 dns_db_detach(&db);
1746 *dbp = db;
1747 db = NULL;
1760 dns_db_t *db = NULL;
1822 result = query_additionalauth(qctx, name, type, &db, &node, fname,
1837 result = query_getcachedb(client, name, qtype, &db, options);
1852 result = dns_db_findext(db, name, version, type,
1873 dns_db_detachnode(db, &node);
1875 dns_db_detach(&db);
1909 dns_db_attach(client->query.gluedb, &db);
1912 result = dns_db_findext(db, name, version, type,
1924 * We have found a potential additional data rdataset, or
1937 * If we have an rdataset, add it to the additional data
1992 result = dns_db_findrdataset(db, node, version, dns_rdatatype_a,
2013 invalid = !validate(client, db, fname, rdataset,
2060 result = dns_db_findrdataset(db, node, version,
2082 invalid = !validate(client, db, fname, rdataset,
2130 * We may have added our rdatasets to an existing name, if so, then
2167 dns_db_detachnode(db, &node);
2169 if (db != NULL) {
2170 dns_db_detach(&db);
2232 result = dns_db_addglue(qctx->db, dbversion->version, rdataset,
2275 * when it returns the name will either have been kept or released.
2336 * We have a signature. Add it to the response.
2346 * Mark the RRsets as secure. Update the cache (db) to reflect the
2350 mark_secure(ns_client_t *client, dns_db_t *db, dns_name_t *name,
2367 result = dns_db_findnodeext(db, name, true, &cm, &ci, &node);
2376 (void)dns_db_addrdataset(db, node, NULL, client->now, rdataset, 0,
2378 (void)dns_db_addrdataset(db, node, NULL, client->now, sigrdataset, 0,
2380 dns_db_detachnode(db, &node);
2387 * Return false if we have exhausted all the possible keys.
2390 get_key(ns_client_t *client, dns_db_t *db, dns_rdata_rrsig_t *rrsig,
2402 result = dns_db_findnodeext(db, &rrsig->signer, false, &cm, &ci,
2408 result = dns_db_findrdataset(db, node, NULL,
2411 dns_db_detachnode(db, &node);
2477 validate(ns_client_t *client, dns_db_t *db, dns_name_t *name,
2506 if (!get_key(client, db, &rrsig, &keyrdataset, &key)) {
2512 mark_secure(client, db, name, &rrsig, rdataset,
2553 dns_db_detachnode(fresp->db, &fresp->node);
2555 if (fresp->db != NULL) {
2556 dns_db_detach(&fresp->db);
2623 dns_db_t *db = NULL;
2687 dns_db_attach(qctx.client->view->cachedb, &db);
2688 (void)dns_db_findext(db, qctx.client->query.qname, NULL,
2693 dns_db_detachnode(db, &qctx.node);
2695 dns_db_detach(&db);
2881 rpz_clean(&st->m.zone, &st->m.db, &st->m.node, &st->m.rdataset);
2910 rpz_clean(NULL, &st->r.db, NULL, NULL);
2918 rpz_clean(&st->q.zone, &st->q.db, &st->q.node, NULL);
2959 zbits = st->have.client_ip;
2962 zbits = st->have.qname;
2966 zbits = st->have.ipv4;
2968 zbits = st->have.ipv6;
2970 zbits = st->have.ip;
2974 zbits = st->have.nsdname;
2978 zbits = st->have.nsipv4;
2980 zbits = st->have.nsipv6;
2982 zbits = st->have.nsip;
3053 RESTORE(*dbp, st->r.db);
3368 * DNAME policy RRs have very few if any uses that are not
3374 * with a single policy zone when we have no summary database.
3404 SAVE(st->m.db, *dbp);
3749 * replace what we already have.
4231 dns_rpz_have_t have;
4262 have = rpzs->have;
4287 st->have = have;
4376 allowed = st->have.qname_skip_recurse;
4452 * and if we have not already checked them.
4476 * that could override what we already have.
4504 dns_db_t *db = NULL;
4507 DNS_RPZ_TYPE_NSDNAME, &db, NULL,
4509 if (db != NULL) {
4510 dns_db_detach(&db);
4672 rpz_clean(NULL, &st->r.db, NULL, &st->r.ns_rdataset);
4698 * We do not know if there are signatures if we have not recursed
4880 query_findclosestnsec3(dns_name_t *qname, dns_db_t *db,
4900 result = dns_db_getnsec3parameters(db, version, &hash, NULL,
4922 dns_db_origin(db), hash, iterations, salt,
4929 result = dns_db_findext(db, dns_fixedname_name(&fixed), version,
4945 dns_name_issubdomain(&name, dns_db_origin(db)))
4984 dns64_ttl(dns_db_t *db, dns_dbversion_t *version) {
4994 result = dns_db_getoriginnode(db, &node);
4999 result = dns_db_findrdataset(db, node, version, dns_rdatatype_soa, 0, 0,
5019 dns_db_detachnode(db, &node);
5092 dns_db_t *db = NULL;
5156 result = dns_zone_getdb(client->view->redirect, &db);
5161 dbversion = ns_client_findversion(client, db);
5163 dns_db_detach(&db);
5170 result = dns_db_findext(db, client->query.qname, dbversion->version,
5186 dns_db_detachnode(db, &node);
5188 dns_db_detach(&db);
5206 dns_db_attachnode(db, node, nodep);
5207 dns_db_attach(db, dbp);
5208 dns_db_detachnode(db, &node);
5209 dns_db_detach(&db);
5222 dns_db_t *db = NULL;
5306 (dns_getdb_options_t){ 0 }, &zone, &db, &version,
5318 result = dns_db_findext(db, redirectname, version, qtype, 0,
5337 dns_db_detachnode(db, &node);
5339 dns_db_detach(&db);
5360 dns_db_detachnode(db, &node);
5362 dns_db_detach(&db);
5391 dns_db_attachnode(db, node, nodep);
5392 dns_db_attach(db, dbp);
5393 dns_db_detachnode(db, &node);
5394 dns_db_detach(&db);
5463 if (qctx->db != NULL && qctx->node != NULL) {
5464 dns_db_detachnode(qctx->db, &qctx->node);
5485 if (qctx->db != NULL) {
5487 dns_db_detach(&qctx->db);
5544 INITANDSAVE(tgt->db, src->db);
5711 * cookie was bad then send back BADCOOKIE before we have
5777 qctx->qtype, qctx->options, &qctx->zone, &qctx->db,
5805 if (qctx->db != NULL) {
5806 dns_db_detach(&qctx->db);
5813 RESTORE(qctx->db, tdb);
5888 dns_db_attach(qctx->db, &qctx->client->query.authdb);
5958 (!qctx->is_zone || dns_db_issecure(qctx->db)))
5967 * Depending on the db lookup result, we can respond to the
6063 result = dns_db_findext(qctx->db, rpzqname, qctx->version, qctx->type,
6189 * We have nothing useful in cache to return
6195 &qctx->db);
6249 * that have the 'attr' attribute set.
6326 * that a lookup due to stale-answer-client-timeout may have set.
6602 * have been received.
6664 RESTORE(qctx->db, qctx->rpz_st->q.db);
6670 dns_db_detachnode(qctx->fresp->db, &qctx->fresp->node);
6672 SAVE(qctx->rpz_st->r.db, qctx->fresp->db);
6696 RESTORE(qctx->db, qctx->client->query.redirect.db);
6708 dns_db_detachnode(qctx->fresp->db, &qctx->fresp->node);
6710 if (qctx->fresp->db != NULL) {
6711 dns_db_detach(&qctx->fresp->db);
6718 SAVE(qctx->db, qctx->fresp->db);
6984 * decide what to do on failure of this function, but hooks don't have
7008 * identical queries have failed recently. If we find a match, and it was
7153 if (qctx->db != NULL) {
7154 constname = dns_db_origin(qctx->db);
7191 * is off or not requested and the hints have not
7299 SAVE(qctx->rpz_st->q.db, qctx->db);
7329 rpz_clean(&qctx->zone, &qctx->db, &qctx->node, NULL);
7339 RESTORE(qctx->db, qctx->rpz_st->m.db);
7608 * We only care about the query if 'result' indicates we have a cached
7671 &qctx->zone, &qctx->db, &qctx->version,
7906 result = dns_db_allrdatasets(qctx->db, qctx->node, qctx->version, 0, 0,
7918 * release fname, since we may have to call query_addrrset()
7919 * more than once. That means we have to call ns_client_keepname()
7945 * original type requested) might have been RRSIG or
7949 !dns_db_issecure(qctx->db) &&
8085 dns_db_issecure(qctx->db))
8100 * deliberately hidden: something must have gone wrong.
8249 * for which we have an answer (either positive or negative).
8275 dns_db_detachnode(qctx->db, &qctx->node);
8307 dns_db_origin(qctx->db)))
8319 dns_db_attach(qctx->db, &qctx->client->query.gluedb);
8341 * to be the final answer to the client's query, but we have no way of
8383 * will either have been kept or released.
8691 if (qctx->db != NULL) {
8692 dns_db_detach(&qctx->db);
8696 * If the cache doesn't even have the root NS,
8706 dns_db_attach(qctx->view->hints, &qctx->db);
8707 result = dns_db_findext(qctx->db, dns_rootname, NULL,
8712 /* We have no hints. */
8722 * We don't have any root server hints, but
8723 * we may have working forwarders, so try to
8771 * We have a delegation but recursion is not allowed, so return the delegation
8794 if (!dns_db_iscache(qctx->db) && qctx->client->query.gluedb == NULL) {
8795 dns_db_attach(qctx->db, &qctx->client->query.gluedb);
8827 * see if we have a better answer; if that is not allowed, return the
8869 dns_db_detachnode(qctx->db, &qctx->node);
8871 if (qctx->db != NULL) {
8872 dns_db_detach(&qctx->db);
8879 RESTORE(qctx->db, tdb);
8893 * We might have a better answer or delegation in the
8902 SAVE(qctx->zdb, qctx->db);
8908 dns_db_attach(qctx->view->cachedb, &qctx->db);
8977 dns_db_detachnode(qctx->db, &qctx->node);
8978 dns_db_detach(&qctx->db);
8979 RESTORE(qctx->db, qctx->zdb);
9016 * We have a delegation and recursion is allowed,
9104 result = dns_db_findrdataset(qctx->db, qctx->node, qctx->version,
9112 qctx->db, qctx->node, qctx->version, dns_rdatatype_nsec,
9126 * we have other problems.
9162 if (!dns_db_iszone(qctx->db)) {
9178 query_findclosestnsec3(name, qctx->db, qctx->version, client, rdataset,
9201 query_findclosestnsec3(dns_fixedname_name(&fixed), qctx->db,
9279 * zero, we need to work out whether we have just
9295 dns64_ttl(qctx->db, qctx->version);
9304 dns_db_detachnode(qctx->db, &qctx->node);
9345 * Look for a NSEC3 record if we don't have a NSEC record.
9362 query_findclosestnsec3(qname, qctx->db, qctx->version,
9415 found, qctx->db, qctx->version,
9564 * resolver and not have it cached.
9629 &qctx->node, &qctx->db, &qctx->version, qctx->type);
9647 &qctx->node, &qctx->db, &qctx->version, qctx->type,
9656 SAVE(qctx->client->query.redirect.db, qctx->db);
10055 dns_db_t *db = NULL;
10102 * If we have no signer name, stop immediately.
10134 * Check that we have the correct NOQNAME NSEC record.
10166 dns_db_attach(qctx->db, &db);
10167 result = dns_db_findext(db, signer, qctx->version,
10184 dns_db_attach(qctx->db, &db);
10185 result = dns_db_findext(db, wild, qctx->version, qctx->type,
10199 * We don't yet have code to handle synthesis and type ANY or dns64
10256 * We now have the proof that we have an NXDOMAIN. Apply
10282 dns_db_detachnode(db, &node);
10291 result = dns_db_findext(db, signer, qctx->version, dns_rdatatype_soa,
10316 if (db != NULL) {
10318 dns_db_detachnode(db, &node);
10320 dns_db_detach(&db);
10336 dns_db_detachnode(qctx->db, &qctx->node);
10390 * If we have a zero ttl from the cache, refetch.
10458 * Keep a copy of the rdataset. We have to do this because
10558 * we're going to have to split qname later on.
10565 * Keep a copy of the rdataset. We have to do this because
10811 dns_name_clone(dns_db_origin(qctx->db), name);
10814 if (WANTDNSSEC(client) && dns_db_issecure(qctx->db)) {
10821 result = dns_db_getoriginnode(qctx->db, &node);
10823 result = dns_db_findrdataset(qctx->db, node, qctx->version,
10832 result = dns_db_findext(qctx->db, name, qctx->version,
10896 dns_db_detachnode(qctx->db, &node);
10932 dns_name_clone(dns_db_origin(qctx->db), name);
10935 if (WANTDNSSEC(client) && dns_db_issecure(qctx->db)) {
10942 result = dns_db_getoriginnode(qctx->db, &node);
10944 result = dns_db_findrdataset(qctx->db, node, qctx->version,
10949 result = dns_db_findext(qctx->db, name, NULL, dns_rdatatype_ns,
10980 dns_db_detachnode(qctx->db, &node);
10993 dns_db_t *db = NULL, *zdb = NULL;
11021 (dns_getdb_options_t){ 0 }, &zone, &db,
11034 dns_db_detach(&db);
11045 dns_db_attach(client->view->cachedb, &db);
11072 db, client->query.qname, version, dns_rdatatype_ns,
11080 dns_db_detachnode(db, &node);
11081 SAVE(zdb, db);
11086 dns_db_attach(client->view->cachedb, &db);
11092 db, client->query.qname, client->query.dboptions,
11107 * have a zone delegation, so use it.
11130 dns_db_detachnode(db, &node);
11132 dns_db_detach(&db);
11134 RESTORE(db, zdb);
11145 !validate(client, db, fname, rdataset, sigrdataset) &&
11153 !validate(client, db, fname, rdataset, sigrdataset) &&
11192 dns_db_detachnode(db, &node);
11194 if (db != NULL) {
11195 dns_db_detach(&db);
11241 * a wildcard proof then it will have been copied to
11305 result = dns_db_findext(qctx->db, name, qctx->version,
11309 dns_db_detachnode(qctx->db, &node);
11333 result = dns_db_findext(qctx->db, cname, qctx->version,
11347 query_findclosestnsec3(cname, qctx->db, qctx->version, client,
11388 query_findclosestnsec3(wname, qctx->db, qctx->version, client,
11430 query_findclosestnsec3(wname, qctx->db, qctx->version, client,
11534 if (qctx->need_wildcardproof && dns_db_issecure(qctx->db)) {
11742 * If we don't have any answer to give the client,
11799 * If we reached this point then it means that we have found a
12009 * We don't have a cache. Turn off cache support and