]> git.sur5r.net Git - openldap/blob - servers/slapd/back-bdb2/proto-back-bdb2.h
Import experimental referral implementation from OPENLDAP_DEVEL_REFERRALS.
[openldap] / servers / slapd / back-bdb2 / proto-back-bdb2.h
1 #ifndef _PROTO_BACK_BDB2
2 #define _PROTO_BACK_BDB2
3
4 #include <ldap_cdefs.h>
5
6 #include <ac/time.h>            /* Needed in add.c compare.c struct timeval */
7
8 #include "external.h"
9
10 LDAP_BEGIN_DECL
11
12 /*
13  * add.c
14  */
15 int bdb2i_release_add_lock LDAP_P(());
16
17 /*
18  * alias.c
19  */
20
21 Entry * bdb2i_deref_r LDAP_P((
22         Backend *be,
23         Entry *e,
24         char *dn,
25         int *err,
26         Entry **matched,
27         char **text ));
28
29 #define deref_entry_r( be, e, err, matched, text ) \
30         bdb2i_deref_r( be, e, NULL, err, matched, text )
31 #define deref_dn_r( be, dn, err, matched, text ) \
32         bdb2i_deref_r( be, NULL, dn, err, matched, text )
33
34 /*
35  * attr.c
36  */
37
38 void bdb2i_attr_masks LDAP_P(( struct ldbminfo *li, char *type, int *indexmask,
39  int *syntaxmask ));
40 void bdb2i_attr_index_config LDAP_P(( struct ldbminfo *li, char *fname,
41  int lineno, int argc, char **argv, int init ));
42
43 /*
44  * cache.c
45  */
46
47 int bdb2i_cache_add_entry_rw LDAP_P(( struct cache *cache, Entry *e, int rw ));
48 int bdb2i_cache_update_entry LDAP_P(( struct cache *cache, Entry *e ));
49 void bdb2i_cache_return_entry_rw LDAP_P(( struct cache *cache, Entry *e,
50  int rw ));
51 #define bdb2i_cache_return_entry_r(c, e) bdb2i_cache_return_entry_rw((c), (e), 0)
52 #define bdb2i_cache_return_entry_w(c, e) bdb2i_cache_return_entry_rw((c), (e), 1)
53
54 ID bdb2i_cache_find_entry_dn2id LDAP_P(( BackendDB *be, struct cache *cache,
55  char *dn ));
56 Entry * bdb2i_cache_find_entry_id LDAP_P(( struct cache *cache, ID id, int rw ));
57 int bdb2i_cache_delete_entry LDAP_P(( struct cache *cache, Entry *e ));
58
59 /*
60  * dbcache.c
61  */
62
63 struct dbcache * bdb2i_cache_open LDAP_P(( BackendDB *be, char *name, char *suffix,
64  int flags ));
65 void bdb2i_cache_close LDAP_P(( BackendDB *be, struct dbcache *db ));
66 void bdb2i_cache_really_close LDAP_P(( BackendDB *be, struct dbcache *db ));
67 void bdb2i_cache_flush_all LDAP_P(( BackendDB *be ));
68 Datum bdb2i_cache_fetch LDAP_P(( struct dbcache *db, Datum key ));
69 int bdb2i_cache_store LDAP_P(( struct dbcache *db, Datum key, Datum data, int flags ));
70 int bdb2i_cache_delete LDAP_P(( struct dbcache *db, Datum key ));
71
72 /*
73  * dn2id.c
74  */
75
76 int bdb2i_dn2id_add LDAP_P(( BackendDB *be, char *dn, ID id ));
77 ID bdb2i_dn2id LDAP_P(( BackendDB *be, char *dn ));
78 int bdb2i_dn2id_delete LDAP_P(( BackendDB *be, char *dn ));
79
80 Entry * bdb2i_dn2entry_rw LDAP_P((
81         BackendDB *be,
82         char *dn,
83         Entry **matched,
84         int rw ));
85
86 #define bdb2i_dn2entry_r(be, dn, m) bdb2i_dn2entry_rw((be), (dn), (m), 0)
87 #define bdb2i_dn2entry_w(be, dn, m) bdb2i_dn2entry_rw((be), (dn), (m), 1)
88
89 /*
90  * entry.c
91  */
92 int bdb2_back_entry_release_rw LDAP_P(( BackendDB *be, Entry *e, int rw ));
93
94 /*
95  * filterindex.c
96  */
97
98 ID_BLOCK * bdb2i_filter_candidates LDAP_P(( BackendDB *be, Filter *f ));
99
100 /*
101  * id2children.c
102  */
103
104 int bdb2i_id2children_add LDAP_P(( BackendDB *be, Entry *p, Entry *e ));
105 int bdb2i_id2children_remove LDAP_P(( BackendDB *be, Entry *p, Entry *e ));
106 int bdb2i_has_children LDAP_P(( BackendDB *be, Entry *p ));
107
108 /*
109  * id2entry.c
110  */
111
112 int bdb2i_id2entry_add LDAP_P(( BackendDB *be, Entry *e ));
113 int bdb2i_id2entry_delete LDAP_P(( BackendDB *be, Entry *e ));
114
115 Entry * bdb2i_id2entry_rw LDAP_P(( BackendDB *be, ID id, int rw )); 
116 #define bdb2i_id2entry_r(be, id)  bdb2i_id2entry_rw((be), (id), 0)
117 #define bdb2i_id2entry_w(be, id)  bdb2i_id2entry_rw((be), (id), 1)
118
119 /*
120  * idl.c
121  */
122
123 ID_BLOCK * bdb2i_idl_alloc LDAP_P(( unsigned int nids ));
124 ID_BLOCK * bdb2i_idl_allids LDAP_P(( BackendDB *be ));
125 void bdb2i_idl_free LDAP_P(( ID_BLOCK *idl ));
126 ID_BLOCK * bdb2i_idl_fetch LDAP_P(( BackendDB *be, struct dbcache *db, Datum key ));
127 int bdb2i_idl_insert_key LDAP_P(( BackendDB *be, struct dbcache *db, Datum key, ID id ));
128 int bdb2i_idl_insert LDAP_P(( ID_BLOCK **idl, ID id, unsigned int maxids ));
129 int bdb2i_idl_delete_key LDAP_P(( BackendDB *be, struct dbcache *db, Datum key, ID id ));
130 ID_BLOCK * bdb2i_idl_intersection LDAP_P(( BackendDB *be, ID_BLOCK *a, ID_BLOCK *b ));
131 ID_BLOCK * bdb2i_idl_union LDAP_P(( BackendDB *be, ID_BLOCK *a, ID_BLOCK *b ));
132 ID_BLOCK * bdb2i_idl_notin LDAP_P(( BackendDB *be, ID_BLOCK *a, ID_BLOCK *b ));
133 ID bdb2i_idl_firstid LDAP_P(( ID_BLOCK *idl ));
134 ID bdb2i_idl_nextid LDAP_P(( ID_BLOCK *idl, ID id ));
135
136 /*
137  * index.c
138  */
139
140 int bdb2i_index_add_entry LDAP_P(( BackendDB *be, Entry *e ));
141 int bdb2i_index_add_mods LDAP_P(( BackendDB *be, LDAPModList *ml, ID id ));
142 ID_BLOCK * bdb2i_index_read LDAP_P(( BackendDB *be, char *type, int indextype, char *val ));
143 int bdb2i_index_add_values LDAP_P(( BackendDB *be, char *type, struct berval **vals, ID  id ));
144
145 /*
146  * kerberos.c
147  */
148
149 #ifdef HAVE_KERBEROS
150 /* bdb2i_krbv4_ldap_auth LDAP_P(( BackendDB *be, struct berval *cred, AUTH_DAT *ad )); */
151 #endif
152
153 /*
154  * modify.c
155  * These prototypes are placed here because they are used by modify and
156  * modify rdn which are implemented in different files. 
157  *
158  * We need bdb2i_back_modify_internal here because of LDAP modrdn & modify use 
159  * it. If we do not add this, there would be a bunch of code replication 
160  * here and there and of course the likelihood of bugs increases.
161  * Juan C. Gomez (gomez@engr.sgi.com) 05/18/99
162  *
163  */
164
165 int bdb2i_add_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
166 int bdb2i_delete_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
167 int bdb2i_replace_values LDAP_P(( Entry *e, LDAPMod *mod, char *dn ));
168 int bdb2i_back_modify_internal LDAP_P((Backend *be, Connection *conn, Operation *op,
169                                  char *dn, LDAPModList *mods, Entry *e));
170 /*
171  * nextid.c
172  */
173
174 ID bdb2i_next_id LDAP_P(( BackendDB *be ));
175 void bdb2i_next_id_return LDAP_P(( BackendDB *be, ID id ));
176 ID bdb2i_next_id_get LDAP_P(( BackendDB *be ));
177 int bdb2i_next_id_save LDAP_P(( BackendDB *be ));
178
179 /*
180  *  startup.c
181  */
182
183 int bdb2i_back_startup     LDAP_P(( BackendInfo *bi ));
184 int bdb2i_back_shutdown    LDAP_P(( BackendInfo *bi ));
185 int bdb2i_back_db_startup  LDAP_P(( BackendDB *be ));
186 int bdb2i_back_db_shutdown LDAP_P(( BackendDB *be ));
187
188 /*
189  *  timing.c
190  */
191
192 void bdb2i_uncond_start_timing LDAP_P(( struct timeval *time1 ));
193 #define bdb2i_start_timing(bi,time1)  if ( with_timing( bi )) bdb2i_uncond_start_timing( (time1) )
194 void bdb2i_uncond_stop_timing LDAP_P(( struct timeval time1,
195   char *func, Connection *conn, Operation *op, int level ));
196 #define bdb2i_stop_timing(bi,time1,func,conn,op)  if ( with_timing( bi )) bdb2i_uncond_stop_timing( (time1), (func), (conn), (op), LDAP_DEBUG_ANY )
197
198 /*
199  * porter.c
200  */
201
202 int bdb2i_enter_backend_rw  LDAP_P(( DB_LOCK *lock, int writer ));
203 #define bdb2i_enter_backend_r(lock)  bdb2i_enter_backend_rw((lock), 0 )
204 #define bdb2i_enter_backend_w(lock)  bdb2i_enter_backend_rw((lock), 1 )
205 int bdb2i_leave_backend_rw LDAP_P(( DB_LOCK lock, int writer ));
206 #define bdb2i_leave_backend_r(lock)  bdb2i_leave_backend_rw((lock), 0 )
207 #define bdb2i_leave_backend_w(lock)  bdb2i_leave_backend_rw((lock), 1 )
208
209 /*
210  *  txn.c
211  */
212
213 int bdb2i_txn_head_init  LDAP_P(( BDB2_TXN_HEAD *head ));
214 void bdb2i_txn_attr_config LDAP_P((
215  struct ldbminfo  *li,
216  char *attr,
217  int open ));
218 int bdb2i_txn_open_files LDAP_P(( BackendDB *be ));
219 void bdb2i_txn_close_files LDAP_P(( BackendDB *be ));
220 BDB2_TXN_FILES *bdb2i_get_db_file_cache LDAP_P((
221  struct ldbminfo *li,
222  char *name ));
223 int bdb2i_check_additional_attr_index LDAP_P(( struct ldbminfo *li ));
224 void bdb2i_check_default_attr_index_add LDAP_P((
225  struct ldbminfo *li,
226  Entry *e ));
227 void bdb2i_check_default_attr_index_mod LDAP_P((
228  struct ldbminfo *li,
229  LDAPModList *modlist ));
230 ID bdb2i_get_nextid  LDAP_P(( BackendDB *be ));
231 int bdb2i_put_nextid LDAP_P(( BackendDB *be, ID id ));
232 LDBM bdb2i_db_open LDAP_P(( char *name, int type, int rw, int mode,
233  int dbcachesize ));
234 int bdb2i_db_store   LDAP_P(( LDBM ldbm, Datum key, Datum data, int flags ));
235 int bdb2i_db_delete  LDAP_P(( LDBM ldbm, Datum key ));
236 Datum bdb2i_db_fetch LDAP_P(( LDBM ldbm, Datum key ));
237 Datum bdb2i_db_firstkey LDAP_P(( LDBM ldbm, DBC **dbch ));
238 Datum bdb2i_db_nextkey  LDAP_P(( LDBM ldbm, Datum key, DBC *dbcp ));
239 int bdb2i_start_transction   LDAP_P(( DB_TXNMGR *txmgr ));
240 int bdb2i_finish_transaction LDAP_P(( ));
241 int bdb2i_set_txn_checkpoint LDAP_P(( DB_TXNMGR *txmgr, int forced ));
242
243
244 LDAP_END_DECL
245 #endif