]> git.sur5r.net Git - openldap/blob - servers/slapd/back-bdb/proto-bdb.h
Experiment with busy loop protection...
[openldap] / servers / slapd / back-bdb / proto-bdb.h
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 2000 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6
7 #ifndef _PROTO_BDB_H
8 #define _PROTO_BDB_H
9
10 LDAP_BEGIN_DECL
11
12 /*
13  * alias.c
14  */
15 Entry *bdb_deref_internal_r LDAP_P((
16         BackendDB *be,
17         Entry *e,
18         const char *dn,
19         int *err,
20         Entry **matched,
21         const char **text ));
22
23 #define deref_entry_r( be, e, err, matched, text ) \
24         bdb_deref_internal_r( be, e, NULL, err, matched, text )
25 #define deref_dn_r( be, dn, err, matched, text ) \
26         bdb_deref_internal_r( be, NULL, dn, err, matched, text)
27
28 /*
29  * attr.c
30  */
31
32 void bdb_attr_mask( struct bdb_info *bdb,
33 #ifdef SLAPD_USE_AD
34         AttributeDescription *desc,
35 #else
36     const char *desc,
37 #endif
38         slap_mask_t *indexmask );
39
40 int bdb_attr_index_config LDAP_P(( struct bdb_info *bdb,
41         const char *fname, int lineno,
42         int argc, char **argv ));
43
44 void bdb_attr_index_destroy LDAP_P(( Avlnode *tree ));
45
46 /*
47  * dbcache.c
48  */
49 int
50 bdb_db_cache(
51     Backend     *be,
52     const char *name,
53         DB **db );
54
55 /*
56  * dn2entry.c
57  */
58 int bdb_dn2entry LDAP_P(( BackendDB *be, DB_TXN *tid,
59         const char *dn, Entry **e, Entry **matched, int flags ));
60
61 /*
62  * dn2id.c
63  */
64 int bdb_dn2id(
65         BackendDB *be,
66         DB_TXN *tid,
67         const char *dn,
68         ID *id );
69
70 int bdb_dn2id_matched(
71         BackendDB *be,
72         DB_TXN *tid,
73         const char *dn,
74         ID *id,
75         char **matchedDN );
76
77 int bdb_dn2id_add(
78         BackendDB *be,
79         DB_TXN *tid,
80         const char *dn,
81         ID id );
82
83 int bdb_dn2id_delete(
84         BackendDB *be,
85         DB_TXN *tid,
86         const char *dn,
87         ID id );
88
89 int bdb_dn2id_children(
90         BackendDB *be,
91         DB_TXN *tid,
92         const char *dn );
93
94 int
95 bdb_dn2idl(
96         BackendDB       *be,
97         const char      *dn,
98         int prefix,
99         ID *ids );
100
101 /*
102  * entry.c
103  */
104 int bdb_entry_return( BackendDB *be, Entry *e );
105
106 /*
107  * error.c
108  */
109 void bdb_errcall( const char *pfx, char * msg );
110
111 /*
112  * filterentry.c
113  */
114 int bdb_filter_candidates(
115         Backend *be,
116         Filter  *f,
117         ID *ids );
118
119 /*
120  * id2entry
121  */
122 int bdb_id2entry_add(
123         BackendDB *be,
124         DB_TXN *tid,
125         Entry *e );
126
127 int bdb_id2entry_update(
128         BackendDB *be,
129         DB_TXN *tid,
130         Entry *e );
131
132 int bdb_id2entry_delete(
133         BackendDB *be,
134         DB_TXN *tid,
135         ID id );
136
137 int bdb_id2entry(
138         BackendDB *be,
139         DB_TXN *tid,
140         ID id,
141         Entry **e );
142
143 /*
144  * idl.c
145  */
146 unsigned bdb_idl_search( ID *ids, ID id );
147
148 int bdb_idl_fetch_key(
149         BackendDB *be,
150         DB *db,
151         DB_TXN *txn,
152         DBT *key,
153         ID *ids );
154
155 int bdb_idl_insert_key(
156         BackendDB *be,
157         DB *db,
158         DB_TXN *txn,
159         DBT *key,
160         ID id );
161
162 int bdb_idl_delete_key(
163         BackendDB *be,
164         DB *db,
165         DB_TXN *txn,
166         DBT *key,
167         ID id );
168
169 int
170 bdb_idl_notin(
171     ID  *a,
172     ID  *b,
173         ID      *ids );
174
175 int
176 bdb_idl_intersection(
177         ID *a,
178         ID *b,
179         ID *ids );
180
181 int
182 bdb_idl_union(
183         ID *a,
184         ID *b,
185         ID *ids );
186
187 ID bdb_idl_first( ID *ids, ID *cursor );
188 ID bdb_idl_next( ID *ids, ID *cursor );
189
190
191 /*
192  * index.c
193  */
194 extern int
195 bdb_index_param LDAP_P((
196         Backend *be,
197         AttributeDescription *desc,
198         int ftype,
199         DB **db,
200         slap_mask_t *mask,
201         struct berval **prefix ));
202
203 extern int
204 bdb_index_values LDAP_P((
205         Backend *be,
206         DB_TXN *txn,
207         AttributeDescription *desc,
208         struct berval **vals,
209         ID id,
210         int op ));
211
212 int bdb_index_entry LDAP_P(( Backend *be, DB_TXN *t,
213         int r, Entry *e, Attribute *ap ));
214
215 #define bdb_index_entry_add(be,t,e,ap) \
216         bdb_index_entry((be),(t),SLAP_INDEX_ADD_OP,(e),(ap))
217 #define bdb_index_entry_del(be,t,e,ap) \
218         bdb_index_entry((be),(t),SLAP_INDEX_DELETE_OP,(e),(ap))
219
220 /*
221  * key.c
222  */
223 extern int
224 bdb_key_read(
225     Backend     *be,
226         DB *db,
227         DB_TXN *txn,
228     struct berval *k,
229         ID *ids );
230
231 extern int
232 bdb_key_change(
233     Backend      *be,
234     DB *db,
235         DB_TXN *txn,
236     struct berval *k,
237     ID id,
238     int op );
239         
240 /*
241  * nextid.c
242  */
243 int bdb_next_id( BackendDB *be, DB_TXN *tid, ID *id );
244 int bdb_last_id( BackendDB *be, DB_TXN *tid );
245
246 /*
247  * modify.c
248  */
249 int bdb_modify_internal(
250         BackendDB *be,
251         Connection *conn,
252         Operation *op,
253         DB_TXN *tid,
254         Modifications *modlist,
255         Entry *e,
256         const char **text,
257         char *textbuf,
258         size_t textlen );
259
260 /*
261  * passwd.c
262  */
263 int
264 bdb_exop_passwd(
265         Backend         *be,
266         Connection              *conn,
267         Operation               *op,
268         const char              *reqoid,
269         struct berval   *reqdata,
270         char                    **rspoid,
271         struct berval   **rspdata,
272         LDAPControl             *** rspctrls,
273         const char              **text,
274         struct berval   *** refs );
275
276 /*
277  * tools.c
278  */
279 int bdb_tool_entry_open( BackendDB *be, int mode );
280 int bdb_tool_entry_close( BackendDB *be );
281 ID bdb_tool_entry_next( BackendDB *be );
282 Entry* bdb_tool_entry_get( BackendDB *be, ID id );
283 ID bdb_tool_entry_put( BackendDB *be, Entry *e );
284 int bdb_tool_entry_reindex( BackendDB *be, ID id );
285
286
287 LDAP_END_DECL
288
289 #endif /* _PROTO_BDB_H */