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