Remove building with NOCRYPTO option
[minix.git] / external / bsd / bind / dist / contrib / dlz / modules / include / dlz_dbi.h
bloba4d008e2a2a54d206c6ee8421bda97a8da462c57
1 /* $NetBSD: dlz_dbi.h,v 1.1.1.3 2014/12/10 03:34:31 christos Exp $ */
3 /*
4 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the
8 * above copyright notice and this permission notice appear in all
9 * copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
12 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
13 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
14 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
15 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
16 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
17 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
18 * USE OR PERFORMANCE OF THIS SOFTWARE.
20 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
21 * conceived and contributed by Rob Butler.
23 * Permission to use, copy, modify, and distribute this software for any
24 * purpose with or without fee is hereby granted, provided that the
25 * above copyright notice and this permission notice appear in all
26 * copies.
28 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
29 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
30 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
31 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
32 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
33 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
34 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
35 * USE OR PERFORMANCE OF THIS SOFTWARE.
38 #include <dlz_minimal.h>
39 #include <dlz_list.h>
40 #include <dlz_pthread.h>
42 #ifndef DLZ_DBI_H
43 #define DLZ_DBI_H 1
46 * Types
48 #define REQUIRE_CLIENT 0x01
49 #define REQUIRE_QUERY 0x02
50 #define REQUIRE_RECORD 0x04
51 #define REQUIRE_ZONE 0x08
53 typedef struct query_segment query_segment_t;
54 typedef DLZ_LIST(query_segment_t) query_list_t;
55 typedef struct dbinstance dbinstance_t;
56 typedef DLZ_LIST(dbinstance_t) db_list_t;
57 typedef struct driverinstance driverinstance_t;
59 /*%
60 * a query segment is all the text between our special tokens
61 * special tokens are %zone%, %record%, %client%
63 struct query_segment {
64 void *cmd;
65 unsigned int strlen;
66 isc_boolean_t direct;
67 DLZ_LINK(query_segment_t) link;
70 /*%
71 * a database instance contains everything we need for running
72 * a query against the database. Using it each separate thread
73 * can dynamically construct a query and execute it against the
74 * database. The "instance_lock" and locking code in the driver's
75 * make sure no two threads try to use the same DBI at a time.
77 struct dbinstance {
78 void *dbconn;
79 query_list_t *allnodes_q;
80 query_list_t *allowxfr_q;
81 query_list_t *authority_q;
82 query_list_t *findzone_q;
83 query_list_t *lookup_q;
84 query_list_t *countzone_q;
85 char *query_buf;
86 char *zone;
87 char *record;
88 char *client;
89 dlz_mutex_t lock;
90 DLZ_LINK(dbinstance_t) link;
94 * Method declarations
97 void
98 destroy_querylist(query_list_t **querylist);
100 isc_result_t
101 build_querylist(const char *query_str, char **zone, char **record,
102 char **client, query_list_t **querylist, unsigned int flags,
103 log_t log);
105 char *
106 build_querystring(query_list_t *querylist);
108 isc_result_t
109 build_dbinstance(const char *allnodes_str, const char *allowxfr_str,
110 const char *authority_str, const char *findzone_str,
111 const char *lookup_str, const char *countzone_str,
112 dbinstance_t **dbi, log_t log);
114 void
115 destroy_dbinstance(dbinstance_t *dbi);
117 char *
118 get_parameter_value(const char *input, const char* key);
120 #endif /* DLZ_DBI_H */