]> git.sur5r.net Git - openldap/blob - servers/slapd/slapi/slapi.h
d8c9e938b46d8590177dc5d920ba9494df1d1211
[openldap] / servers / slapd / slapi / slapi.h
1 /*
2  * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
3  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
4  */
5 /*
6  * (C) Copyright IBM Corp. 1997,2002
7  * Redistribution and use in source and binary forms are permitted
8  * provided that this notice is preserved and that due credit is 
9  * given to IBM Corporation. This software is provided ``as is'' 
10  * without express or implied warranty.
11  */
12
13 #ifndef _SLAPI_H
14 #define _SLAPI_H
15
16 #include <ibm_pblock_params.h> 
17
18 LDAP_BEGIN_DECL
19
20 typedef struct  slapi_pblock    Slapi_PBlock;
21 typedef struct  slap_entry      Slapi_Entry;
22 typedef struct  slap_attr       Slapi_Attr;
23 typedef struct  slap_attr *     Slapi_AttrSet;
24 typedef struct  berval          Slapi_Value;
25 typedef BerVarray               Slapi_ValueSet;
26 typedef Filter                  Slapi_Filter;
27
28 LDAP_END_DECL
29
30 #include <slapi_utils.h>
31 #ifndef NO_PBLOCK_CLASS
32 #include <slapi_pblock.h>
33 #endif /* NO_PBLOCK_CLASS */
34 #include <plugin.h>
35 #include <slapi_ops.h>
36 #if 0 /* unused (yet?) */
37 #include <slapi_cl.h>
38 #endif /* 0 */
39
40 LDAP_BEGIN_DECL
41
42 /*
43  * Attribute flags returned by slapi_attr_get_flags()
44  */
45 #define SLAPI_ATTR_FLAG_SINGLE          0x0001
46 #define SLAPI_ATTR_FLAG_OPATTR          0x0002
47 #define SLAPI_ATTR_FLAG_READONLY        0x0004
48 #define SLAPI_ATTR_FLAG_STD_ATTR        SLAPI_ATTR_FLAG_READONLY
49 #define SLAPI_ATTR_FLAG_OBSOLETE        0x0040
50 #define SLAPI_ATTR_FLAG_COLLECTIVE      0x0080
51 #define SLAPI_ATTR_FLAG_NOUSERMOD       0x0100
52
53 /*
54  * ACL levels
55  */
56 #define SLAPI_ACL_COMPARE       0x01
57 #define SLAPI_ACL_SEARCH        0x02
58 #define SLAPI_ACL_READ          0x04
59 #define SLAPI_ACL_WRITE         0x08
60 #define SLAPI_ACL_DELETE        0x10
61 #define SLAPI_ACL_ADD           0x20
62 #define SLAPI_ACL_SELF          0x40
63 #define SLAPI_ACL_PROXY         0x80
64 #define SLAPI_ACL_ALL           0x7f
65
66 /*
67  * Plugin types universally supported by SLAPI
68  * implementations
69  */
70 #define SLAPI_PLUGIN_DATABASE           1
71 #define SLAPI_PLUGIN_EXTENDEDOP         2
72 #define SLAPI_PLUGIN_PREOPERATION       3
73 #define SLAPI_PLUGIN_POSTOPERATION      4
74 #define SLAPI_PLUGIN_MATCHINGRULE       5
75 #define SLAPI_PLUGIN_SYNTAX             6
76 /* XXX this is SLAPI_PLUGIN_ACL in SunDS */
77 #define SLAPI_PLUGIN_AUDIT              7
78 /*
79  * The following plugin types are reserved for future
80  * Sun ONE DS compatability.
81  */
82 #define SLAPI_PLUGIN_BEPREOPERATION             8       
83 #define SLAPI_PLUGIN_BEPOSTOPERATION            9       
84 #define SLAPI_PLUGIN_ENTRY                      10      
85 #define SLAPI_PLUGIN_TYPE_OBJECT                11      
86 #define SLAPI_PLUGIN_INTERNAL_PREOPERATION      12      
87 #define SLAPI_PLUGIN_INTERNAL_POSTOPERATION     13
88 #define SLAPI_PLUGIN_PWD_STORAGE_SCHEME         14
89 #define SLAPI_PLUGIN_VATTR_SP                   15
90 #define SLAPI_PLUGIN_REVER_PWD_STORAGE_SCHEME   16
91 /*
92  * Because the Sun ONE DS virtual attribute service
93  * is quite complicated, we've added a "lightweight"
94  * virtual attribute service. Virtual attribute
95  * plugins are called for each search result; 
96  * they should examine the list of attributes
97  * requested to minimise the performance impact.
98  */
99 #define SLAPI_PLUGIN_OPATTR_SP                  17
100
101 #define SLAPI_PLUGIN_EXTENDED_SENT_RESULT       -1
102 #define SLAPI_PLUGIN_EXTENDED_NOT_HANDLED       -2
103
104 #define SLAPI_BIND_SUCCESS              0
105 #define SLAPI_BIND_FAIL                 2
106 #define SLAPI_BIND_ANONYMOUS            3
107
108 #define SLAPI_BACKEND                           130
109 #define SLAPI_CONNECTION                        131
110 #define SLAPI_OPERATION                         132
111 #define SLAPI_REQUESTOR_ISROOT                  133
112 #define SLAPI_BE_MONITORDN                      134
113 #define SLAPI_BE_TYPE                           135
114 #define SLAPI_BE_READONLY                       136
115 #define SLAPI_BE_LASTMOD                        137
116 #define SLAPI_OPERATION_PARAMETERS              138
117 #define SLAPI_CONN_ID                           139
118
119 #define SLAPI_OPINITIATED_TIME                  140
120 #define SLAPI_REQUESTOR_DN                      141
121 #define SLAPI_REQUESTOR_ISUPDATEDN              142
122 #define SLAPI_IS_REPLICATED_OPERATION           SLAPI_REQUESTOR_ISUPDATEDN
123 #define SLAPI_CONN_DN                           143
124 #define SLAPI_CONN_CLIENTIP                     145
125 #define SLAPI_CONN_SERVERIP                     146
126 #define SLAPI_CONN_AUTHTYPE                     144
127
128 #define SLAPD_AUTH_NONE   "none"
129 #define SLAPD_AUTH_SIMPLE "simple"
130 #define SLAPD_AUTH_SSL    "SSL"
131 #define SLAPD_AUTH_SASL   "SASL "
132
133 #define SLAPI_PLUGIN                            3
134 #define SLAPI_PLUGIN_PRIVATE                    4
135 #define SLAPI_PLUGIN_TYPE                       5
136 #define SLAPI_PLUGIN_ARGV                       6
137 #define SLAPI_PLUGIN_ARGC                       7
138 #define SLAPI_PLUGIN_VERSION                    8
139
140 #define SLAPI_PLUGIN_OPRETURN                   9
141 #define SLAPI_PLUGIN_OBJECT                     10
142 #define SLAPI_PLUGIN_DESTROY_FN                 11
143
144 #define SLAPI_PLUGIN_DESCRIPTION                12
145
146 #define SLAPI_PLUGIN_INTOP_RESULT               15
147 #define SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES       16
148 #define SLAPI_PLUGIN_INTOP_SEARCH_REFERRALS     17
149
150 #define SLAPI_PLUGIN_DB_BIND_FN                 200
151 #define SLAPI_PLUGIN_DB_UNBIND_FN               201
152 #define SLAPI_PLUGIN_DB_SEARCH_FN               202
153 #define SLAPI_PLUGIN_DB_COMPARE_FN              203
154 #define SLAPI_PLUGIN_DB_MODIFY_FN               204
155 #define SLAPI_PLUGIN_DB_MODRDN_FN               205
156 #define SLAPI_PLUGIN_DB_ADD_FN                  206
157 #define SLAPI_PLUGIN_DB_DELETE_FN               207
158 #define SLAPI_PLUGIN_DB_ABANDON_FN              208
159 #define SLAPI_PLUGIN_DB_CONFIG_FN               209
160 #define SLAPI_PLUGIN_CLOSE_FN                   210
161 #define SLAPI_PLUGIN_DB_FLUSH_FN                211
162 #define SLAPI_PLUGIN_START_FN                   212
163 #define SLAPI_PLUGIN_DB_SEQ_FN                  213
164 #define SLAPI_PLUGIN_DB_ENTRY_FN                214
165 #define SLAPI_PLUGIN_DB_REFERRAL_FN             215
166 #define SLAPI_PLUGIN_DB_RESULT_FN               216
167 #define SLAPI_PLUGIN_DB_LDIF2DB_FN              217
168 #define SLAPI_PLUGIN_DB_DB2LDIF_FN              218
169 #define SLAPI_PLUGIN_DB_BEGIN_FN                219
170 #define SLAPI_PLUGIN_DB_COMMIT_FN               220
171 #define SLAPI_PLUGIN_DB_ABORT_FN                221
172 #define SLAPI_PLUGIN_DB_ARCHIVE2DB_FN           222
173 #define SLAPI_PLUGIN_DB_DB2ARCHIVE_FN           223
174 #define SLAPI_PLUGIN_DB_NEXT_SEARCH_ENTRY_FN    224
175 #define SLAPI_PLUGIN_DB_FREE_RESULT_SET_FN      225
176 #define SLAPI_PLUGIN_DB_SIZE_FN                 226
177 #define SLAPI_PLUGIN_DB_TEST_FN                 227
178 #define SLAPI_PLUGIN_DB_NO_ACL                  250
179
180 #define SLAPI_PLUGIN_EXT_OP_FN                  300
181 #define SLAPI_PLUGIN_EXT_OP_OIDLIST             301
182 #define SLAPI_PLUGIN_PRE_BIND_FN                401
183 #define SLAPI_PLUGIN_PRE_UNBIND_FN              402
184 #define SLAPI_PLUGIN_PRE_SEARCH_FN              403
185 #define SLAPI_PLUGIN_PRE_COMPARE_FN             404
186 #define SLAPI_PLUGIN_PRE_MODIFY_FN              405
187 #define SLAPI_PLUGIN_PRE_MODRDN_FN              406
188 #define SLAPI_PLUGIN_PRE_ADD_FN                 407
189 #define SLAPI_PLUGIN_PRE_DELETE_FN              408
190 #define SLAPI_PLUGIN_PRE_ABANDON_FN             409
191 #define SLAPI_PLUGIN_PRE_ENTRY_FN               410
192 #define SLAPI_PLUGIN_PRE_REFERRAL_FN            411
193 #define SLAPI_PLUGIN_PRE_RESULT_FN              412
194 #define SLAPI_PLUGIN_POST_BIND_FN               501
195 #define SLAPI_PLUGIN_POST_UNBIND_FN             502
196 #define SLAPI_PLUGIN_POST_SEARCH_FN             503
197 #define SLAPI_PLUGIN_POST_COMPARE_FN            504
198 #define SLAPI_PLUGIN_POST_MODIFY_FN             505
199 #define SLAPI_PLUGIN_POST_MODRDN_FN             506
200 #define SLAPI_PLUGIN_POST_ADD_FN                507
201 #define SLAPI_PLUGIN_POST_DELETE_FN             508
202 #define SLAPI_PLUGIN_POST_ABANDON_FN            509
203 #define SLAPI_PLUGIN_POST_ENTRY_FN              510
204 #define SLAPI_PLUGIN_POST_REFERRAL_FN           511
205 #define SLAPI_PLUGIN_POST_RESULT_FN             512
206
207 #define SLAPI_OPERATION_TYPE                    590
208
209 #define SLAPI_PLUGIN_MR_FILTER_CREATE_FN        600
210 #define SLAPI_PLUGIN_MR_INDEXER_CREATE_FN       601
211 #define SLAPI_PLUGIN_MR_FILTER_MATCH_FN         602
212 #define SLAPI_PLUGIN_MR_FILTER_INDEX_FN         603
213 #define SLAPI_PLUGIN_MR_FILTER_RESET_FN         604
214 #define SLAPI_PLUGIN_MR_INDEX_FN                605
215 #define SLAPI_PLUGIN_MR_OID                     610
216 #define SLAPI_PLUGIN_MR_TYPE                    611
217 #define SLAPI_PLUGIN_MR_VALUE                   612
218 #define SLAPI_PLUGIN_MR_VALUES                  613
219 #define SLAPI_PLUGIN_MR_KEYS                    614
220 #define SLAPI_PLUGIN_MR_FILTER_REUSABLE         615
221 #define SLAPI_PLUGIN_MR_QUERY_OPERATOR          616
222 #define SLAPI_PLUGIN_MR_USAGE                   617
223
224 #define SLAPI_OP_LESS                                   1
225 #define SLAPI_OP_LESS_OR_EQUAL                          2
226 #define SLAPI_OP_EQUAL                                  3
227 #define SLAPI_OP_GREATER_OR_EQUAL                       4
228 #define SLAPI_OP_GREATER                                5
229 #define SLAPI_OP_SUBSTRING                              6
230
231 #define SLAPI_PLUGIN_MR_USAGE_INDEX             0
232 #define SLAPI_PLUGIN_MR_USAGE_SORT              1
233
234 #define SLAPI_PLUGIN_SYNTAX_FILTER_AVA          700
235 #define SLAPI_PLUGIN_SYNTAX_FILTER_SUB          701
236 #define SLAPI_PLUGIN_SYNTAX_VALUES2KEYS         702
237 #define SLAPI_PLUGIN_SYNTAX_ASSERTION2KEYS_AVA  703
238 #define SLAPI_PLUGIN_SYNTAX_ASSERTION2KEYS_SUB  704
239 #define SLAPI_PLUGIN_SYNTAX_NAMES               705
240 #define SLAPI_PLUGIN_SYNTAX_OID                 706
241 #define SLAPI_PLUGIN_SYNTAX_FLAGS               707
242 #define SLAPI_PLUGIN_SYNTAX_COMPARE             708
243
244 #define SLAPI_OPERATION_AUTHTYPE                741
245 #define SLAPI_OPERATION_ID                      742
246 #define SLAPI_CONN_CERT                         743
247 #define SLAPI_CONN_AUTHMETHOD                   746
248
249 #define SLAPI_RESULT_CODE                       881
250 #define SLAPI_RESULT_TEXT                       882
251 #define SLAPI_RESULT_MATCHED                    883
252
253 /* Virtual attribute service provider */
254 #define SLAPI_PLUGIN_OPATTR_COALESCE_DATA       900
255 /* Pointer to a Slapi_AttrSet */
256 #define SLAPI_PLUGIN_OPATTR_COALESCE_FN         901
257
258 #define SLAPI_PLUGIN_SYNTAX_FLAG_ORKEYS                 1
259 #define SLAPI_PLUGIN_SYNTAX_FLAG_ORDERING               2
260
261 #define SLAPI_PLUGIN_AUDIT_DATA                 1100
262 #define SLAPI_PLUGIN_AUDIT_FN                   1101
263
264 #define SLAPI_MANAGEDSAIT                       1000
265
266 #define SLAPI_CONFIG_FILENAME                   40
267 #define SLAPI_CONFIG_LINENO                     41
268 #define SLAPI_CONFIG_ARGC                       42
269 #define SLAPI_CONFIG_ARGV                       43
270
271 #define SLAPI_TARGET_DN                         50
272 #define SLAPI_REQCONTROLS                       51
273
274 #define SLAPI_ENTRY_PRE_OP                      52
275 #define SLAPI_ENTRY_POST_OP                     53
276
277 #define SLAPI_RESCONTROLS                       55
278 #define SLAPI_ADD_RESCONTROL                    56
279
280 #define SLAPI_ADD_TARGET                        SLAPI_TARGET_DN
281 #define SLAPI_ADD_ENTRY                         60
282
283 #define SLAPI_BIND_TARGET                       SLAPI_TARGET_DN
284 #define SLAPI_BIND_METHOD                       70
285 #define SLAPI_BIND_CREDENTIALS                  71
286 #define SLAPI_BIND_SASLMECHANISM                72
287 #define SLAPI_BIND_RET_SASLCREDS                73
288
289 #define SLAPI_COMPARE_TARGET                    SLAPI_TARGET_DN
290 #define SLAPI_COMPARE_TYPE                      80
291 #define SLAPI_COMPARE_VALUE                     81
292
293 #define SLAPI_DELETE_TARGET                     SLAPI_TARGET_DN
294
295 #define SLAPI_MODIFY_TARGET                     SLAPI_TARGET_DN
296 #define SLAPI_MODIFY_MODS                       90
297
298 #define SLAPI_MODRDN_TARGET                     SLAPI_TARGET_DN
299 #define SLAPI_MODRDN_NEWRDN                     100
300 #define SLAPI_MODRDN_DELOLDRDN                  101
301 #define SLAPI_MODRDN_NEWSUPERIOR                102
302
303 #define SLAPI_SEARCH_TARGET                     SLAPI_TARGET_DN
304 #define SLAPI_SEARCH_SCOPE                      110
305 #define SLAPI_SEARCH_DEREF                      111
306 #define SLAPI_SEARCH_SIZELIMIT                  112
307 #define SLAPI_SEARCH_TIMELIMIT                  113
308 #define SLAPI_SEARCH_FILTER                     114
309 #define SLAPI_SEARCH_STRFILTER                  115
310 #define SLAPI_SEARCH_ATTRS                      116
311 #define SLAPI_SEARCH_ATTRSONLY                  117
312
313 #define SLAPI_ABANDON_MSGID                     120
314
315 #define SLAPI_SEQ_TYPE                          150
316 #define SLAPI_SEQ_ATTRNAME                      151
317 #define SLAPI_SEQ_VAL                           152
318
319 #define SLAPI_EXT_OP_REQ_OID                    160
320 #define SLAPI_EXT_OP_REQ_VALUE                  161
321 #define SLAPI_EXT_OP_RET_OID                    162
322 #define SLAPI_EXT_OP_RET_VALUE                  163
323
324 #define SLAPI_MR_FILTER_ENTRY                   170     
325 #define SLAPI_MR_FILTER_TYPE                    171
326 #define SLAPI_MR_FILTER_VALUE                   172
327 #define SLAPI_MR_FILTER_OID                     173
328 #define SLAPI_MR_FILTER_DNATTRS                 174
329
330 #define SLAPI_LDIF2DB_FILE                      180
331 #define SLAPI_LDIF2DB_REMOVEDUPVALS             185
332
333 #define SLAPI_DB2LDIF_PRINTKEY                  183
334
335 #define SLAPI_PARENT_TXN                        190
336 #define SLAPI_TXN                               191
337
338 #define SLAPI_SEARCH_RESULT_SET                 193
339 #define SLAPI_SEARCH_RESULT_ENTRY               194
340 #define SLAPI_NENTRIES                          195
341 #define SLAPI_SEARCH_REFERRALS                  196
342
343 #define SLAPI_CHANGENUMBER                      197
344 #define SLAPI_LOG_OPERATION                     198
345
346 #define SLAPI_DBSIZE                            199
347
348 #define SLAPI_LOG_FATAL                         0
349 #define SLAPI_LOG_TRACE                         1
350 #define SLAPI_LOG_PACKETS                       2
351 #define SLAPI_LOG_ARGS                          3
352 #define SLAPI_LOG_CONNS                         4
353 #define SLAPI_LOG_BER                           5
354 #define SLAPI_LOG_FILTER                        6
355 #define SLAPI_LOG_CONFIG                        7
356 #define SLAPI_LOG_ACL                           8
357 #define SLAPI_LOG_SHELL                         9
358 #define SLAPI_LOG_PARSE                         10
359 #define SLAPI_LOG_HOUSE                         11
360 #define SLAPI_LOG_REPL                          12
361 #define SLAPI_LOG_CACHE                         13
362 #define SLAPI_LOG_PLUGIN                        14
363
364 #define SLAPI_OPERATION_BIND                    0x00000001L
365 #define SLAPI_OPERATION_UNBIND                  0x00000002L
366 #define SLAPI_OPERATION_SEARCH                  0x00000004L
367 #define SLAPI_OPERATION_MODIFY                  0x00000008L
368 #define SLAPI_OPERATION_ADD                     0x00000010L
369 #define SLAPI_OPERATION_DELETE                  0x00000020L
370 #define SLAPI_OPERATION_MODDN                   0x00000040L
371 #define SLAPI_OPERATION_MODRDN                  SLAPI_OPERATION_MODDN
372 #define SLAPI_OPERATION_COMPARE                 0x00000080L
373 #define SLAPI_OPERATION_ABANDON                 0x00000100L
374 #define SLAPI_OPERATION_EXTENDED                0x00000200L
375 #define SLAPI_OPERATION_ANY                     0xFFFFFFFFL
376 #define SLAPI_OPERATION_NONE                    0x00000000L
377
378 LDAP_END_DECL
379
380 #endif /* _SLAPI_H */
381