Back to index

openldap  2.4.31
slapi-plugin.h
Go to the documentation of this file.
00001 /* $OpenLDAP$ */
00002 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00003  *
00004  * Copyright 1998-2012 The OpenLDAP Foundation.
00005  * Portions Copyright 1997,2002,2003 IBM Corporation.
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted only as authorized by the OpenLDAP
00010  * Public License.
00011  *
00012  * A copy of this license is available in file LICENSE in the
00013  * top-level directory of the distribution or, alternatively, at
00014  * <http://www.OpenLDAP.org/license.html>.
00015  */
00016 
00017 /*
00018  * This header is used in development of SLAPI plugins for
00019  * OpenLDAP slapd(8) and other directory servers supporting
00020  * this interface.  Your portability mileage may vary.
00021  */
00022 
00023 #ifndef _SLAPI_PLUGIN_H
00024 #define _SLAPI_PLUGIN_H
00025 
00026 #include <ldap.h>
00027 
00028 typedef struct slapi_pblock        Slapi_PBlock;
00029 typedef struct slapi_entry         Slapi_Entry;
00030 typedef struct slapi_attr          Slapi_Attr;
00031 typedef struct slapi_value         Slapi_Value;
00032 typedef struct slapi_valueset             Slapi_ValueSet;
00033 typedef struct slapi_filter        Slapi_Filter;
00034 typedef struct BackendDB           Slapi_Backend;
00035 typedef struct Operation           Slapi_Operation;
00036 typedef struct Connection          Slapi_Connection;
00037 typedef struct slapi_dn                   Slapi_DN;
00038 typedef struct slapi_rdn           Slapi_RDN;
00039 typedef struct slapi_mod           Slapi_Mod;
00040 typedef struct slapi_mods          Slapi_Mods;
00041 typedef struct slapi_componentid   Slapi_ComponentId;
00042 
00043 #define SLAPI_ATTR_UNIQUEID "entryUUID"
00044 #define SLAPI_ATTR_OBJECTCLASS     "objectClass"
00045 
00046 /* pblock routines */
00047 int slapi_pblock_get( Slapi_PBlock *pb, int arg, void *value );
00048 int slapi_pblock_set( Slapi_PBlock *pb, int arg, void *value );
00049 Slapi_PBlock *slapi_pblock_new( void );
00050 void slapi_pblock_destroy( Slapi_PBlock *pb );
00051 
00052 /* entry/attr/dn routines */
00053 Slapi_Entry *slapi_str2entry( char *s, int flags );
00054 #define SLAPI_STR2ENTRY_REMOVEDUPVALS     1
00055 #define SLAPI_STR2ENTRY_ADDRDNVALS 2
00056 #define SLAPI_STR2ENTRY_BIGENTRY   4
00057 #define SLAPI_STR2ENTRY_TOMBSTONE_CHECK   8
00058 #define SLAPI_STR2ENTRY_IGNORE_STATE      16
00059 #define SLAPI_STR2ENTRY_INCLUDE_VERSION_STR      32
00060 #define SLAPI_STR2ENTRY_EXPAND_OBJECTCLASSES     64
00061 #define SLAPI_STR2ENTRY_NOT_WELL_FORMED_LDIF     128
00062 char *slapi_entry2str( Slapi_Entry *e, int *len );
00063 char *slapi_entry_get_dn( Slapi_Entry *e );
00064 int slapi_x_entry_get_id( Slapi_Entry *e );
00065 void slapi_entry_set_dn( Slapi_Entry *e, char *dn );
00066 Slapi_Entry *slapi_entry_dup( Slapi_Entry *e );
00067 int slapi_entry_attr_delete( Slapi_Entry *e, char *type );
00068 Slapi_Entry *slapi_entry_alloc();
00069 void slapi_entry_free( Slapi_Entry *e );
00070 int slapi_entry_attr_merge( Slapi_Entry *e, char *type, struct berval **vals );
00071 int slapi_entry_attr_find( Slapi_Entry *e, char *type, Slapi_Attr **attr );
00072 char *slapi_entry_attr_get_charptr( const Slapi_Entry *e, const char *type );
00073 int slapi_entry_attr_get_int( const Slapi_Entry *e, const char *type );
00074 long slapi_entry_attr_get_long( const Slapi_Entry *e, const char *type );
00075 unsigned int slapi_entry_attr_get_uint( const Slapi_Entry *e, const char *type );
00076 unsigned long slapi_entry_attr_get_ulong( const Slapi_Entry *e, const char *type );
00077 int slapi_attr_get_values( Slapi_Attr *attr, struct berval ***vals );
00078 char *slapi_dn_normalize( char *dn );
00079 char *slapi_dn_normalize_case( char *dn );
00080 int slapi_dn_issuffix( char *dn, char *suffix );
00081 char *slapi_dn_beparent( Slapi_PBlock *pb, const char *dn );
00082 int slapi_dn_isbesuffix( Slapi_PBlock *pb, char *dn );
00083 char *slapi_dn_parent( const char *dn );
00084 int slapi_dn_isparent( const char *parentdn, const char *childdn );
00085 char *slapi_dn_ignore_case( char *dn );
00086 int slapi_rdn2typeval( char *rdn, char **type, struct berval *bv );
00087 char *slapi_dn_plus_rdn(const char *dn, const char *rdn);
00088 
00089 /* DS 5.x SLAPI */
00090 int slapi_access_allowed( Slapi_PBlock *pb, Slapi_Entry *e, char *attr, struct berval *val, int access );
00091 int slapi_acl_check_mods( Slapi_PBlock *pb, Slapi_Entry *e, LDAPMod **mods, char **errbuf );
00092 Slapi_Attr *slapi_attr_new( void );
00093 Slapi_Attr *slapi_attr_init( Slapi_Attr *a, const char *type );
00094 void slapi_attr_free( Slapi_Attr **a );
00095 Slapi_Attr *slapi_attr_dup( const Slapi_Attr *attr );
00096 int slapi_attr_add_value( Slapi_Attr *a, const Slapi_Value *v );
00097 int slapi_attr_type2plugin( const char *type, void **pi );
00098 int slapi_attr_get_type( const Slapi_Attr *attr, char **type );
00099 int slapi_attr_get_oid_copy( const Slapi_Attr *attr, char **oidp );
00100 int slapi_attr_get_flags( const Slapi_Attr *attr, unsigned long *flags );
00101 int slapi_attr_flag_is_set( const Slapi_Attr *attr, unsigned long flag );
00102 int slapi_attr_value_cmp( const Slapi_Attr *attr, const struct berval *v1, const struct berval *v2 );
00103 int slapi_attr_value_find( const Slapi_Attr *a, struct berval *v );
00104 #define SLAPI_TYPE_CMP_EXACT       0
00105 #define SLAPI_TYPE_CMP_BASE 1
00106 #define SLAPI_TYPE_CMP_SUBTYPE     2
00107 int slapi_attr_type_cmp( const char *t1, const char *t2, int opt );
00108 int slapi_attr_types_equivalent( const char *t1, const char *t2 );
00109 int slapi_attr_first_value( Slapi_Attr *a, Slapi_Value **v );
00110 int slapi_attr_next_value( Slapi_Attr *a, int hint, Slapi_Value **v );
00111 int slapi_attr_get_numvalues( const Slapi_Attr *a, int *numValues );
00112 int slapi_attr_get_valueset( const Slapi_Attr *a, Slapi_ValueSet **vs );
00113 int slapi_attr_get_bervals_copy( Slapi_Attr *a, struct berval ***vals );
00114 int slapi_entry_attr_hasvalue( Slapi_Entry *e, const char *type, const char *value );
00115 int slapi_entry_attr_merge_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals );
00116 void slapi_entry_attr_set_charptr(Slapi_Entry* e, const char *type, const char *value);
00117 void slapi_entry_attr_set_int( Slapi_Entry* e, const char *type, int l);
00118 void slapi_entry_attr_set_uint( Slapi_Entry* e, const char *type, unsigned int l);
00119 void slapi_entry_attr_set_long(Slapi_Entry* e, const char *type, long l);
00120 void slapi_entry_attr_set_ulong(Slapi_Entry* e, const char *type, unsigned long l);
00121 int slapi_entry_has_children(const Slapi_Entry *e);
00122 size_t slapi_entry_size(Slapi_Entry *e);
00123 int slapi_is_rootdse( const char *dn );
00124 int slapi_entry_attr_merge_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals );
00125 int slapi_entry_add_values_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals );
00126 int slapi_entry_add_valueset(Slapi_Entry *e, const char *type, Slapi_ValueSet *vs);
00127 int slapi_entry_delete_values_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals );
00128 int slapi_entry_merge_values_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals );
00129 int slapi_entry_attr_replace_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals );
00130 int slapi_entry_add_value(Slapi_Entry *e, const char *type, const Slapi_Value *value);
00131 int slapi_entry_add_string(Slapi_Entry *e, const char *type, const char *value);
00132 int slapi_entry_delete_string(Slapi_Entry *e, const char *type, const char *value);
00133 int slapi_entry_first_attr( const Slapi_Entry *e, Slapi_Attr **attr );
00134 int slapi_entry_next_attr( const Slapi_Entry *e, Slapi_Attr *prevattr, Slapi_Attr **attr );
00135 const char *slapi_entry_get_uniqueid( const Slapi_Entry *e );
00136 void slapi_entry_set_uniqueid( Slapi_Entry *e, char *uniqueid );
00137 int slapi_entry_schema_check( Slapi_PBlock *pb, Slapi_Entry *e );
00138 int slapi_entry_rdn_values_present( const Slapi_Entry *e );
00139 int slapi_entry_add_rdn_values( Slapi_Entry *e );
00140 char *slapi_attr_syntax_normalize( const char *s );
00141 
00142 Slapi_Value *slapi_value_new( void );
00143 Slapi_Value *slapi_value_new_berval(const struct berval *bval);
00144 Slapi_Value *slapi_value_new_value(const Slapi_Value *v);
00145 Slapi_Value *slapi_value_new_string(const char *s);
00146 Slapi_Value *slapi_value_init(Slapi_Value *v);
00147 Slapi_Value *slapi_value_init_berval(Slapi_Value *v, struct berval *bval);
00148 Slapi_Value *slapi_value_init_string(Slapi_Value *v, const char *s);
00149 Slapi_Value *slapi_value_dup(const Slapi_Value *v);
00150 void slapi_value_free(Slapi_Value **value);
00151 const struct berval *slapi_value_get_berval( const Slapi_Value *value );
00152 Slapi_Value *slapi_value_set_berval( Slapi_Value *value, const struct berval *bval );
00153 Slapi_Value *slapi_value_set_value( Slapi_Value *value, const Slapi_Value *vfrom);
00154 Slapi_Value *slapi_value_set( Slapi_Value *value, void *val, unsigned long len);
00155 int slapi_value_set_string(Slapi_Value *value, const char *strVal);
00156 int slapi_value_set_int(Slapi_Value *value, int intVal);
00157 const char*slapi_value_get_string(const Slapi_Value *value);
00158 int slapi_value_get_int(const Slapi_Value *value); 
00159 unsigned int slapi_value_get_uint(const Slapi_Value *value); 
00160 long slapi_value_get_long(const Slapi_Value *value); 
00161 unsigned long slapi_value_get_ulong(const Slapi_Value *value); 
00162 size_t slapi_value_get_length(const Slapi_Value *value);
00163 int slapi_value_compare(const Slapi_Attr *a, const Slapi_Value *v1, const Slapi_Value *v2);
00164 
00165 Slapi_ValueSet *slapi_valueset_new( void );
00166 void slapi_valueset_free(Slapi_ValueSet *vs);
00167 void slapi_valueset_init(Slapi_ValueSet *vs);
00168 void slapi_valueset_done(Slapi_ValueSet *vs);
00169 void slapi_valueset_add_value(Slapi_ValueSet *vs, const Slapi_Value *addval);
00170 int slapi_valueset_first_value( Slapi_ValueSet *vs, Slapi_Value **v );
00171 int slapi_valueset_next_value( Slapi_ValueSet *vs, int index, Slapi_Value **v);
00172 int slapi_valueset_count( const Slapi_ValueSet *vs);
00173 void slapi_valueset_set_valueset(Slapi_ValueSet *vs1, const Slapi_ValueSet *vs2);
00174 
00175 /* DNs */
00176 Slapi_DN *slapi_sdn_new( void );
00177 Slapi_DN *slapi_sdn_new_dn_byval( const char *dn );
00178 Slapi_DN *slapi_sdn_new_ndn_byval( const char *ndn );
00179 Slapi_DN *slapi_sdn_new_dn_byref( const char *dn );
00180 Slapi_DN *slapi_sdn_new_ndn_byref( const char *ndn );
00181 Slapi_DN *slapi_sdn_new_dn_passin( const char *dn );
00182 Slapi_DN *slapi_sdn_set_dn_byval( Slapi_DN *sdn, const char *dn );
00183 Slapi_DN *slapi_sdn_set_dn_byref( Slapi_DN *sdn, const char *dn );
00184 Slapi_DN *slapi_sdn_set_dn_passin( Slapi_DN *sdn, const char *dn );
00185 Slapi_DN *slapi_sdn_set_ndn_byval( Slapi_DN *sdn, const char *ndn );
00186 Slapi_DN *slapi_sdn_set_ndn_byref( Slapi_DN *sdn, const char *ndn );
00187 void slapi_sdn_done( Slapi_DN *sdn );
00188 void slapi_sdn_free( Slapi_DN **sdn );
00189 const char * slapi_sdn_get_dn( const Slapi_DN *sdn );
00190 const char * slapi_sdn_get_ndn( const Slapi_DN *sdn );
00191 void slapi_sdn_get_parent( const Slapi_DN *sdn,Slapi_DN *sdn_parent );
00192 void slapi_sdn_get_backend_parent( const Slapi_DN *sdn, Slapi_DN *sdn_parent, const Slapi_Backend *backend );
00193 Slapi_DN * slapi_sdn_dup( const Slapi_DN *sdn );
00194 void slapi_sdn_copy( const Slapi_DN *from, Slapi_DN *to );
00195 int slapi_sdn_compare( const Slapi_DN *sdn1, const Slapi_DN *sdn2 );
00196 int slapi_sdn_isempty( const Slapi_DN *sdn );
00197 int slapi_sdn_issuffix(const Slapi_DN *sdn, const Slapi_DN *suffixsdn );
00198 int slapi_sdn_isparent( const Slapi_DN *parent, const Slapi_DN *child );
00199 int slapi_sdn_isgrandparent( const Slapi_DN *parent, const Slapi_DN *child );
00200 int slapi_sdn_get_ndn_len( const Slapi_DN *sdn );
00201 int slapi_sdn_scope_test( const Slapi_DN *dn, const Slapi_DN *base, int scope );
00202 void slapi_sdn_get_rdn( const Slapi_DN *sdn,Slapi_RDN *rdn );
00203 Slapi_DN *slapi_sdn_set_rdn( Slapi_DN *sdn, const Slapi_RDN *rdn );
00204 Slapi_DN *slapi_sdn_set_parent( Slapi_DN *sdn, const Slapi_DN *parentdn );
00205 int slapi_sdn_is_rdn_component( const Slapi_DN *rdn, const Slapi_Attr *a, const Slapi_Value *v );
00206 char * slapi_moddn_get_newdn( Slapi_DN *dn_olddn, char *newrdn, char *newsuperiordn );
00207 
00208 /* RDNs */
00209 Slapi_RDN *slapi_rdn_new( void );
00210 Slapi_RDN *slapi_rdn_new_dn( const char *dn );
00211 Slapi_RDN *slapi_rdn_new_sdn( const Slapi_DN *sdn );
00212 Slapi_RDN *slapi_rdn_new_rdn( const Slapi_RDN *fromrdn ); 
00213 void slapi_rdn_init( Slapi_RDN *rdn );
00214 void slapi_rdn_init_dn( Slapi_RDN *rdn, const char *dn );
00215 void slapi_rdn_init_sdn( Slapi_RDN *rdn, const Slapi_DN *sdn );
00216 void slapi_rdn_init_rdn( Slapi_RDN *rdn, const Slapi_RDN *fromrdn ); 
00217 void slapi_rdn_set_dn( Slapi_RDN *rdn, const char *dn );
00218 void slapi_rdn_set_sdn( Slapi_RDN *rdn, const Slapi_DN *sdn );
00219 void slapi_rdn_set_rdn( Slapi_RDN *rdn, const Slapi_RDN *fromrdn );
00220 void slapi_rdn_free( Slapi_RDN **rdn );
00221 void slapi_rdn_done( Slapi_RDN *rdn );
00222 int slapi_rdn_get_first( Slapi_RDN *rdn, char **type, char **value );
00223 int slapi_rdn_get_next( Slapi_RDN *rdn, int index, char **type, char **value );
00224 int slapi_rdn_get_index( Slapi_RDN *rdn, const char *type, const char *value, size_t length );
00225 int slapi_rdn_get_index_attr( Slapi_RDN *rdn, const char *type, char **value );
00226 int slapi_rdn_contains( Slapi_RDN *rdn, const char *type, const char *value,size_t length );
00227 int slapi_rdn_contains_attr( Slapi_RDN *rdn, const char *type, char **value );
00228 int slapi_rdn_add( Slapi_RDN *rdn, const char *type, const char *value );
00229 int slapi_rdn_remove_index( Slapi_RDN *rdn, int atindex );
00230 int slapi_rdn_remove( Slapi_RDN *rdn, const char *type, const char *value, size_t length );
00231 int slapi_rdn_remove_attr( Slapi_RDN *rdn, const char *type );
00232 int slapi_rdn_isempty( const Slapi_RDN *rdn );
00233 int slapi_rdn_get_num_components( Slapi_RDN *rdn );
00234 int slapi_rdn_compare( Slapi_RDN *rdn1, Slapi_RDN *rdn2 );
00235 const char *slapi_rdn_get_rdn( const Slapi_RDN *rdn );
00236 const char *slapi_rdn_get_nrdn( const Slapi_RDN *rdn );
00237 Slapi_DN *slapi_sdn_add_rdn( Slapi_DN *sdn, const Slapi_RDN *rdn );
00238 
00239 /* locks and synchronization */
00240 typedef struct slapi_mutex  Slapi_Mutex;
00241 typedef struct slapi_condvar       Slapi_CondVar;
00242 Slapi_Mutex *slapi_new_mutex( void );
00243 void slapi_destroy_mutex( Slapi_Mutex *mutex );
00244 void slapi_lock_mutex( Slapi_Mutex *mutex );
00245 int slapi_unlock_mutex( Slapi_Mutex *mutex );
00246 Slapi_CondVar *slapi_new_condvar( Slapi_Mutex *mutex );
00247 void slapi_destroy_condvar( Slapi_CondVar *cvar );
00248 int slapi_wait_condvar( Slapi_CondVar *cvar, struct timeval *timeout );
00249 int slapi_notify_condvar( Slapi_CondVar *cvar, int notify_all );
00250 
00251 /* thread-safe LDAP connections */
00252 LDAP *slapi_ldap_init( char *ldaphost, int ldapport, int secure, int shared );
00253 void slapi_ldap_unbind( LDAP *ld );
00254 
00255 char *slapi_ch_malloc( unsigned long size );
00256 void slapi_ch_free( void **ptr );
00257 void slapi_ch_free_string( char **ptr );
00258 char *slapi_ch_calloc( unsigned long nelem, unsigned long size );
00259 char *slapi_ch_realloc( char *block, unsigned long size );
00260 char *slapi_ch_strdup( const char *s );
00261 void slapi_ch_array_free( char **arrayp );
00262 struct berval *slapi_ch_bvdup(const struct berval *v);
00263 struct berval **slapi_ch_bvecdup(const struct berval **v);
00264 
00265 /* LDAP V3 routines */
00266 int slapi_control_present( LDAPControl **controls, char *oid,
00267        struct berval **val, int *iscritical);
00268 void slapi_register_supported_control(char *controloid,
00269        unsigned long controlops);
00270 #define SLAPI_OPERATION_BIND            0x00000001L
00271 #define SLAPI_OPERATION_UNBIND          0x00000002L
00272 #define SLAPI_OPERATION_SEARCH          0x00000004L
00273 #define SLAPI_OPERATION_MODIFY          0x00000008L
00274 #define SLAPI_OPERATION_ADD             0x00000010L
00275 #define SLAPI_OPERATION_DELETE          0x00000020L
00276 #define SLAPI_OPERATION_MODDN           0x00000040L
00277 #define SLAPI_OPERATION_MODRDN          SLAPI_OPERATION_MODDN
00278 #define SLAPI_OPERATION_COMPARE         0x00000080L
00279 #define SLAPI_OPERATION_ABANDON         0x00000100L
00280 #define SLAPI_OPERATION_EXTENDED        0x00000200L
00281 #define SLAPI_OPERATION_ANY             0xFFFFFFFFL
00282 #define SLAPI_OPERATION_NONE            0x00000000L
00283 int slapi_get_supported_controls(char ***ctrloidsp, unsigned long **ctrlopsp);
00284 LDAPControl *slapi_dup_control(LDAPControl *ctrl);
00285 void slapi_register_supported_saslmechanism(char *mechanism);
00286 char **slapi_get_supported_saslmechanisms();
00287 char **slapi_get_supported_extended_ops(void);
00288 
00289 /* operation */
00290 int slapi_op_abandoned( Slapi_PBlock *pb );
00291 unsigned long slapi_op_get_type(Slapi_Operation * op);
00292 void slapi_operation_set_flag(Slapi_Operation *op, unsigned long flag);
00293 void slapi_operation_clear_flag(Slapi_Operation *op, unsigned long flag);
00294 int slapi_operation_is_flag_set(Slapi_Operation *op, unsigned long flag);
00295 char *slapi_op_type_to_string(unsigned long type);
00296 
00297 /* send ldap result back */
00298 void slapi_send_ldap_result( Slapi_PBlock *pb, int err, char *matched,
00299        char *text, int nentries, struct berval **urls );
00300 int slapi_send_ldap_search_entry( Slapi_PBlock *pb, Slapi_Entry *e,
00301        LDAPControl **ectrls, char **attrs, int attrsonly );
00302 int slapi_send_ldap_search_reference( Slapi_PBlock *pb, Slapi_Entry *e,
00303        struct berval **urls, LDAPControl **ectrls, struct berval **v2refs );
00304 
00305 /* filter routines */
00306 Slapi_Filter *slapi_str2filter( char *str );
00307 Slapi_Filter *slapi_filter_dup( Slapi_Filter *f );
00308 void slapi_filter_free( Slapi_Filter *f, int recurse );
00309 int slapi_filter_get_choice( Slapi_Filter *f);
00310 int slapi_filter_get_ava( Slapi_Filter *f, char **type, struct berval **bval );
00311 Slapi_Filter *slapi_filter_list_first( Slapi_Filter *f );
00312 Slapi_Filter *slapi_filter_list_next( Slapi_Filter *f, Slapi_Filter *fprev );
00313 int slapi_filter_get_attribute_type( Slapi_Filter *f, char **type ); 
00314 int slapi_x_filter_set_attribute_type( Slapi_Filter *f, const char *type );
00315 int slapi_filter_get_subfilt( Slapi_Filter *f, char **type, char **initial,
00316        char ***any, char **final );
00317 Slapi_Filter *slapi_filter_join( int ftype, Slapi_Filter *f1, Slapi_Filter *f2);
00318 int slapi_x_filter_append( int choice, Slapi_Filter **pContainingFilter,
00319        Slapi_Filter **pNextFilter, Slapi_Filter *filterToAppend );
00320 int slapi_filter_test( Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Filter *f,
00321        int verify_access );
00322 int slapi_filter_test_simple( Slapi_Entry *e, Slapi_Filter *f );
00323 typedef int (*FILTER_APPLY_FN)( Slapi_Filter *f, void *arg );
00324 int slapi_filter_apply( Slapi_Filter *f, FILTER_APPLY_FN fn, void *arg, int *error_code );
00325 #define SLAPI_FILTER_SCAN_STOP                   -1 /* set by callback */
00326 #define SLAPI_FILTER_SCAN_ERROR                  -2 /* set by callback */
00327 #define SLAPI_FILTER_SCAN_NOMORE          0 /* set by callback */
00328 #define SLAPI_FILTER_SCAN_CONTINUE        1 /* set by callback */
00329 #define SLAPI_FILTER_UNKNOWN_FILTER_TYPE  2 /* set by slapi_filter_apply() */
00330 
00331 /* internal add/delete/search/modify routines */
00332 Slapi_PBlock *slapi_search_internal( char *base, int scope, char *filter, 
00333        LDAPControl **controls, char **attrs, int attrsonly );
00334 Slapi_PBlock *slapi_modify_internal( char *dn, LDAPMod **mods,
00335         LDAPControl **controls, int log_change );
00336 Slapi_PBlock *slapi_add_internal( char * dn, LDAPMod **attrs,
00337        LDAPControl **controls, int log_changes );
00338 Slapi_PBlock *slapi_add_entry_internal( Slapi_Entry * e,
00339        LDAPControl **controls, int log_change );
00340 Slapi_PBlock *slapi_delete_internal( char * dn,  LDAPControl **controls,
00341        int log_change );
00342 Slapi_PBlock *slapi_modrdn_internal( char * olddn, char * newrdn,
00343        int deloldrdn, LDAPControl **controls,
00344        int log_change );
00345 Slapi_PBlock *slapi_rename_internal( const char * olddn, const char *newrdn,
00346        const char *newsuperior, int delolrdn,
00347        LDAPControl **controls, int log_change );
00348 void slapi_free_search_results_internal(Slapi_PBlock *pb);
00349 
00350 /* new internal add/delete/search/modify routines */
00351 typedef void (*plugin_result_callback)( int rc, void *callback_data );
00352 typedef int (*plugin_referral_entry_callback)( char * referral,
00353        void *callback_data );
00354 typedef int (*plugin_search_entry_callback)( Slapi_Entry *e,
00355        void *callback_data );
00356 void slapi_free_search_results_internal( Slapi_PBlock *pb );
00357 
00358 #define SLAPI_OP_FLAG_NEVER_CHAIN  0x0800
00359 
00360 int slapi_search_internal_pb( Slapi_PBlock *pb );
00361 int slapi_search_internal_callback_pb( Slapi_PBlock *pb, void *callback_data,
00362        plugin_result_callback prc, plugin_search_entry_callback psec,
00363        plugin_referral_entry_callback prec );
00364 int slapi_add_internal_pb( Slapi_PBlock *pb );
00365 int slapi_modify_internal_pb( Slapi_PBlock *pb );
00366 int slapi_modrdn_internal_pb( Slapi_PBlock *pb );
00367 int slapi_delete_internal_pb( Slapi_PBlock *pb );
00368 
00369 int slapi_seq_internal_callback_pb(Slapi_PBlock *pb, void *callback_data,
00370         plugin_result_callback res_callback,
00371         plugin_search_entry_callback srch_callback,
00372         plugin_referral_entry_callback ref_callback);
00373 
00374 void slapi_search_internal_set_pb( Slapi_PBlock *pb, const char *base,
00375        int scope, const char *filter, char **attrs, int attrsonly,
00376        LDAPControl **controls, const char *uniqueid,
00377        Slapi_ComponentId *plugin_identity, int operation_flags );
00378 void slapi_add_entry_internal_set_pb( Slapi_PBlock *pb, Slapi_Entry *e,
00379        LDAPControl **controls, Slapi_ComponentId *plugin_identity,
00380        int operation_flags );
00381 int slapi_add_internal_set_pb( Slapi_PBlock *pb, const char *dn,
00382        LDAPMod **attrs, LDAPControl **controls,
00383        Slapi_ComponentId *plugin_identity, int operation_flags );
00384 void slapi_modify_internal_set_pb( Slapi_PBlock *pb, const char *dn,
00385        LDAPMod **mods, LDAPControl **controls, const char *uniqueid,
00386        Slapi_ComponentId *plugin_identity, int operation_flags );
00387 void slapi_rename_internal_set_pb( Slapi_PBlock *pb, const char *olddn,
00388        const char *newrdn, const char *newsuperior, int deloldrdn,
00389        LDAPControl **controls, const char *uniqueid,
00390        Slapi_ComponentId *plugin_identity, int operation_flags );
00391 void slapi_delete_internal_set_pb( Slapi_PBlock *pb, const char *dn,
00392        LDAPControl **controls, const char *uniqueid,
00393        Slapi_ComponentId *plugin_identity, int operation_flags );
00394 void slapi_seq_internal_set_pb( Slapi_PBlock *pb, char *ibase, int type,
00395        char *attrname, char *val, char **attrs, int attrsonly,
00396        LDAPControl **controls, Slapi_ComponentId *plugin_identity,
00397        int operation_flags );
00398 
00399 /* connection related routines */
00400 int slapi_is_connection_ssl(Slapi_PBlock *pPB, int *isSSL);
00401 int slapi_get_client_port(Slapi_PBlock *pPB, int *fromPort);
00402 
00403 /* computed attributes */
00404 typedef struct _computed_attr_context computed_attr_context;
00405 typedef int (*slapi_compute_output_t)(computed_attr_context *c, Slapi_Attr *a, Slapi_Entry *e);
00406 typedef int (*slapi_compute_callback_t)(computed_attr_context *c, char *type, Slapi_Entry *e, slapi_compute_output_t outputfn);
00407 typedef int (*slapi_search_rewrite_callback_t)(Slapi_PBlock *pb);
00408 int slapi_compute_add_evaluator(slapi_compute_callback_t function);
00409 int slapi_compute_add_search_rewriter(slapi_search_rewrite_callback_t function);
00410 int compute_rewrite_search_filter(Slapi_PBlock *pb);
00411 int compute_evaluator(computed_attr_context *c, char *type, Slapi_Entry *e, slapi_compute_output_t outputfn);
00412 int slapi_x_compute_get_pblock(computed_attr_context *c, Slapi_PBlock **pb);
00413 
00414 /* backend routines */
00415 void slapi_be_set_readonly( Slapi_Backend *be, int readonly );
00416 int slapi_be_get_readonly( Slapi_Backend *be );
00417 const char *slapi_x_be_get_updatedn( Slapi_Backend *be );
00418 Slapi_Backend *slapi_be_select( const Slapi_DN *sdn );
00419 
00420 /* ACL plugins; only SLAPI_PLUGIN_ACL_ALLOW_ACCESS supported now */
00421 typedef int (*slapi_acl_callback_t)(Slapi_PBlock *pb,
00422        Slapi_Entry *e,
00423        const char *attr,
00424        struct berval *berval,
00425        int access,
00426        void *state);
00427 
00428 /* object extensions */
00429 typedef void *(*slapi_extension_constructor_fnptr)(void *object, void *parent);
00430 
00431 typedef void (*slapi_extension_destructor_fnptr)(void *extension,
00432        void *object, void *parent);
00433 
00434 int slapi_register_object_extension( const char *pluginname,
00435        const char *objectname, slapi_extension_constructor_fnptr constructor,
00436        slapi_extension_destructor_fnptr destructor, int *objecttype,
00437        int *extensionhandle);
00438 
00439 #define SLAPI_EXT_CONNECTION    "Connection"
00440 #define SLAPI_EXT_OPERATION     "Operation"
00441 #define SLAPI_EXT_ENTRY         "Entry"
00442 #define SLAPI_EXT_MTNODE        "Mapping Tree Node"
00443 
00444 void *slapi_get_object_extension(int objecttype, void *object,
00445        int extensionhandle);
00446 void slapi_set_object_extension(int objecttype, void *object,
00447        int extensionhandle, void *extension);
00448 
00449 int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags );
00450 
00451 /* parameters currently supported */
00452 
00453 /*
00454  * Attribute flags returned by slapi_attr_get_flags()
00455  */
00456 #define SLAPI_ATTR_FLAG_SINGLE            0x0001
00457 #define SLAPI_ATTR_FLAG_OPATTR            0x0002
00458 #define SLAPI_ATTR_FLAG_READONLY   0x0004
00459 #define SLAPI_ATTR_FLAG_STD_ATTR   SLAPI_ATTR_FLAG_READONLY
00460 #define SLAPI_ATTR_FLAG_OBSOLETE   0x0040
00461 #define SLAPI_ATTR_FLAG_COLLECTIVE 0x0080
00462 #define SLAPI_ATTR_FLAG_NOUSERMOD  0x0100
00463 
00464 /*
00465  * Backend flags returned by slapi_x_backend_get_flags()
00466  */
00467 #define SLAPI_BACKEND_FLAG_NOLASTMOD             0x0001U
00468 #define SLAPI_BACKEND_FLAG_NO_SCHEMA_CHECK       0x0002U
00469 #define SLAPI_BACKEND_FLAG_GLUE_INSTANCE  0x0010U       /* a glue backend */
00470 #define SLAPI_BACKEND_FLAG_GLUE_SUBORDINATE      0x0020U       /* child of a glue hierarchy */
00471 #define SLAPI_BACKEND_FLAG_GLUE_LINKED           0x0040U       /* child is connected to parent */
00472 #define SLAPI_BACKEND_FLAG_OVERLAY        0x0080U       /* this db struct is an overlay */
00473 #define SLAPI_BACKEND_FLAG_GLOBAL_OVERLAY 0x0100U       /* this db struct is a global overlay */
00474 #define SLAPI_BACKEND_FLAG_SHADOW         0x8000U /* a shadow */
00475 #define SLAPI_BACKEND_FLAG_SYNC_SHADOW           0x1000U /* a sync shadow */
00476 #define SLAPI_BACKEND_FLAG_SLURP_SHADOW          0x2000U /* a slurp shadow */
00477 
00478 /*
00479  * ACL levels
00480  */
00481 #define SLAPI_ACL_COMPARE       0x01
00482 #define SLAPI_ACL_SEARCH        0x02
00483 #define SLAPI_ACL_READ          0x04
00484 #define SLAPI_ACL_WRITE         0x08
00485 #define SLAPI_ACL_DELETE        0x10    
00486 #define SLAPI_ACL_ADD           0x20
00487 #define SLAPI_ACL_SELF          0x40
00488 #define SLAPI_ACL_PROXY         0x80
00489 #define SLAPI_ACL_ALL           0x7f
00490 
00491 /* plugin types supported */
00492 
00493 #define SLAPI_PLUGIN_DATABASE           1
00494 #define SLAPI_PLUGIN_EXTENDEDOP         2
00495 #define SLAPI_PLUGIN_PREOPERATION       3
00496 #define SLAPI_PLUGIN_POSTOPERATION      4
00497 #define SLAPI_PLUGIN_MATCHINGRULE       5
00498 #define SLAPI_PLUGIN_SYNTAX             6
00499 #define SLAPI_PLUGIN_AUDIT              7   
00500 
00501 /* misc params */
00502 
00503 #define SLAPI_BACKEND                            130
00504 #define SLAPI_CONNECTION                  131
00505 #define SLAPI_OPERATION                          132
00506 #define SLAPI_REQUESTOR_ISROOT                   133
00507 #define SLAPI_BE_MONITORDN                134
00508 #define SLAPI_BE_TYPE                     135
00509 #define SLAPI_BE_READONLY                 136
00510 #define SLAPI_BE_LASTMOD                         137
00511 #define SLAPI_CONN_ID                            139
00512 
00513 /* operation params */
00514 #define SLAPI_OPINITIATED_TIME                   140
00515 #define SLAPI_REQUESTOR_DN                141
00516 #define SLAPI_IS_REPLICATED_OPERATION            142
00517 #define SLAPI_REQUESTOR_ISUPDATEDN        SLAPI_IS_REPLICATED_OPERATION
00518 
00519 /* connection  structure params*/
00520 #define SLAPI_CONN_DN                            143
00521 #define SLAPI_CONN_AUTHTYPE                      144
00522 #define SLAPI_CONN_CLIENTIP               145
00523 #define SLAPI_CONN_SERVERIP               146
00524 /* OpenLDAP extensions */
00525 #define SLAPI_X_CONN_CLIENTPATH                  1300
00526 #define SLAPI_X_CONN_SERVERPATH                  1301
00527 #define SLAPI_X_CONN_IS_UDP               1302
00528 #define SLAPI_X_CONN_SSF                  1303
00529 #define SLAPI_X_CONN_SASL_CONTEXT         1304
00530 #define SLAPI_X_OPERATION_DELETE_GLUE_PARENT     1305
00531 #define SLAPI_X_RELAX                     1306
00532 #define SLAPI_X_MANAGEDIT                 SLAPI_X_RELAX
00533 #define SLAPI_X_OPERATION_NO_SCHEMA_CHECK 1307
00534 #define SLAPI_X_ADD_STRUCTURAL_CLASS             1308
00535 #define SLAPI_X_OPERATION_NO_SUBORDINATE_GLUE    1309
00536 
00537 /*  Authentication types */
00538 #define SLAPD_AUTH_NONE   "none"
00539 #define SLAPD_AUTH_SIMPLE "simple"
00540 #define SLAPD_AUTH_SSL    "SSL"
00541 #define SLAPD_AUTH_SASL   "SASL " 
00542 
00543 /* plugin configuration parmams */
00544 #define SLAPI_PLUGIN                      3
00545 #define SLAPI_PLUGIN_PRIVATE                     4
00546 #define SLAPI_PLUGIN_TYPE                 5
00547 #define SLAPI_PLUGIN_ARGV                 6
00548 #define SLAPI_PLUGIN_ARGC                 7
00549 #define SLAPI_PLUGIN_VERSION                     8
00550 #define SLAPI_PLUGIN_OPRETURN                    9
00551 #define SLAPI_PLUGIN_OBJECT               10
00552 #define SLAPI_PLUGIN_DESTROY_FN                  11
00553 #define SLAPI_PLUGIN_DESCRIPTION          12
00554 #define SLAPI_PLUGIN_IDENTITY                    13
00555 
00556 /* internal opreations params */
00557 #define SLAPI_PLUGIN_INTOP_RESULT         15
00558 #define SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES 16
00559 #define SLAPI_PLUGIN_INTOP_SEARCH_REFERRALS      17
00560 
00561 /* transaction arguments */
00562 #define SLAPI_PARENT_TXN                  190
00563 #define SLAPI_TXN                         191
00564 
00565 /* function pointer params for backends */
00566 #define SLAPI_PLUGIN_DB_BIND_FN                  200
00567 #define SLAPI_PLUGIN_DB_UNBIND_FN         201
00568 #define SLAPI_PLUGIN_DB_SEARCH_FN         202
00569 #define SLAPI_PLUGIN_DB_COMPARE_FN        203
00570 #define SLAPI_PLUGIN_DB_MODIFY_FN         204
00571 #define SLAPI_PLUGIN_DB_MODRDN_FN         205
00572 #define SLAPI_PLUGIN_DB_ADD_FN                   206
00573 #define SLAPI_PLUGIN_DB_DELETE_FN         207
00574 #define SLAPI_PLUGIN_DB_ABANDON_FN        208
00575 #define SLAPI_PLUGIN_DB_CONFIG_FN         209
00576 #define SLAPI_PLUGIN_CLOSE_FN                    210
00577 #define SLAPI_PLUGIN_DB_FLUSH_FN          211
00578 #define SLAPI_PLUGIN_START_FN                    212
00579 #define SLAPI_PLUGIN_DB_SEQ_FN                   213
00580 #define SLAPI_PLUGIN_DB_ENTRY_FN          214
00581 #define SLAPI_PLUGIN_DB_REFERRAL_FN              215
00582 #define SLAPI_PLUGIN_DB_RESULT_FN         216
00583 #define SLAPI_PLUGIN_DB_LDIF2DB_FN        217
00584 #define SLAPI_PLUGIN_DB_DB2LDIF_FN        218
00585 #define SLAPI_PLUGIN_DB_BEGIN_FN          219
00586 #define SLAPI_PLUGIN_DB_COMMIT_FN         220
00587 #define SLAPI_PLUGIN_DB_ABORT_FN          221
00588 #define SLAPI_PLUGIN_DB_ARCHIVE2DB_FN            222
00589 #define SLAPI_PLUGIN_DB_DB2ARCHIVE_FN            223
00590 #define SLAPI_PLUGIN_DB_NEXT_SEARCH_ENTRY_FN     224
00591 #define SLAPI_PLUGIN_DB_FREE_RESULT_SET_FN       225
00592 #define       SLAPI_PLUGIN_DB_SIZE_FN                   226
00593 #define       SLAPI_PLUGIN_DB_TEST_FN                   227
00594 
00595 
00596 /*  functions pointers for LDAP V3 extended ops */
00597 #define SLAPI_PLUGIN_EXT_OP_FN                   300
00598 #define SLAPI_PLUGIN_EXT_OP_OIDLIST              301
00599 
00600 /* preoperation */
00601 #define SLAPI_PLUGIN_PRE_BIND_FN          401
00602 #define SLAPI_PLUGIN_PRE_UNBIND_FN        402
00603 #define SLAPI_PLUGIN_PRE_SEARCH_FN        403
00604 #define SLAPI_PLUGIN_PRE_COMPARE_FN              404
00605 #define SLAPI_PLUGIN_PRE_MODIFY_FN        405
00606 #define SLAPI_PLUGIN_PRE_MODRDN_FN        406
00607 #define SLAPI_PLUGIN_PRE_ADD_FN                  407
00608 #define SLAPI_PLUGIN_PRE_DELETE_FN        408
00609 #define SLAPI_PLUGIN_PRE_ABANDON_FN              409
00610 #define SLAPI_PLUGIN_PRE_ENTRY_FN         410
00611 #define SLAPI_PLUGIN_PRE_REFERRAL_FN             411
00612 #define SLAPI_PLUGIN_PRE_RESULT_FN        412
00613 
00614 /* internal preoperation */
00615 #define SLAPI_PLUGIN_INTERNAL_PRE_ADD_FN  420
00616 #define SLAPI_PLUGIN_INTERNAL_PRE_MODIFY_FN      421
00617 #define SLAPI_PLUGIN_INTERNAL_PRE_MODRDN_FN      422
00618 #define SLAPI_PLUGIN_INTERNAL_PRE_DELETE_FN      423
00619 
00620 /* backend preoperation */
00621 #define SLAPI_PLUGIN_BE_PRE_ADD_FN        450
00622 #define SLAPI_PLUGIN_BE_PRE_MODIFY_FN            451
00623 #define SLAPI_PLUGIN_BE_PRE_MODRDN_FN            452
00624 #define SLAPI_PLUGIN_BE_PRE_DELETE_FN            453
00625 
00626 /* postoperation */
00627 #define SLAPI_PLUGIN_POST_BIND_FN         501
00628 #define SLAPI_PLUGIN_POST_UNBIND_FN              502
00629 #define SLAPI_PLUGIN_POST_SEARCH_FN              503
00630 #define SLAPI_PLUGIN_POST_COMPARE_FN             504
00631 #define SLAPI_PLUGIN_POST_MODIFY_FN              505
00632 #define SLAPI_PLUGIN_POST_MODRDN_FN              506
00633 #define SLAPI_PLUGIN_POST_ADD_FN          507
00634 #define SLAPI_PLUGIN_POST_DELETE_FN              508
00635 #define SLAPI_PLUGIN_POST_ABANDON_FN             509
00636 #define SLAPI_PLUGIN_POST_ENTRY_FN        510
00637 #define SLAPI_PLUGIN_POST_REFERRAL_FN            511
00638 #define SLAPI_PLUGIN_POST_RESULT_FN              512
00639 
00640 /* internal postoperation */
00641 #define SLAPI_PLUGIN_INTERNAL_POST_ADD_FN 520
00642 #define SLAPI_PLUGIN_INTERNAL_POST_MODIFY_FN     521
00643 #define SLAPI_PLUGIN_INTERNAL_POST_MODRDN_FN     522
00644 #define SLAPI_PLUGIN_INTERNAL_POST_DELETE_FN     523
00645 
00646 /* backend postoperation */
00647 #define SLAPI_PLUGIN_BE_POST_ADD_FN              550
00648 #define SLAPI_PLUGIN_BE_POST_MODIFY_FN           551
00649 #define SLAPI_PLUGIN_BE_POST_MODRDN_FN           552
00650 #define SLAPI_PLUGIN_BE_POST_DELETE_FN           553
00651 
00652 #define SLAPI_OPERATION_TYPE                     590
00653 #define SLAPI_OPERATION_MSGID                    591
00654 
00655 #define SLAPI_PLUGIN_MR_FILTER_CREATE_FN  600
00656 #define SLAPI_PLUGIN_MR_INDEXER_CREATE_FN 601
00657 #define SLAPI_PLUGIN_MR_FILTER_MATCH_FN          602
00658 #define SLAPI_PLUGIN_MR_FILTER_INDEX_FN          603
00659 #define SLAPI_PLUGIN_MR_FILTER_RESET_FN          604
00660 #define SLAPI_PLUGIN_MR_INDEX_FN          605
00661 #define SLAPI_PLUGIN_MR_OID               610
00662 #define SLAPI_PLUGIN_MR_TYPE                     611
00663 #define SLAPI_PLUGIN_MR_VALUE                    612
00664 #define SLAPI_PLUGIN_MR_VALUES                   613
00665 #define SLAPI_PLUGIN_MR_KEYS                     614
00666 #define SLAPI_PLUGIN_MR_FILTER_REUSABLE          615
00667 #define SLAPI_PLUGIN_MR_QUERY_OPERATOR           616
00668 #define SLAPI_PLUGIN_MR_USAGE                    617
00669 
00670 #define SLAPI_MATCHINGRULE_NAME                  1
00671 #define SLAPI_MATCHINGRULE_OID                   2
00672 #define SLAPI_MATCHINGRULE_DESC                  3
00673 #define SLAPI_MATCHINGRULE_SYNTAX         4
00674 #define SLAPI_MATCHINGRULE_OBSOLETE              5
00675 
00676 #define SLAPI_OP_LESS                                   1
00677 #define SLAPI_OP_LESS_OR_EQUAL                          2
00678 #define SLAPI_OP_EQUAL                                  3
00679 #define SLAPI_OP_GREATER_OR_EQUAL                4
00680 #define SLAPI_OP_GREATER                         5
00681 #define SLAPI_OP_SUBSTRING                       6
00682 
00683 #define SLAPI_PLUGIN_MR_USAGE_INDEX              0
00684 #define SLAPI_PLUGIN_MR_USAGE_SORT        1
00685 
00686 #define SLAPI_PLUGIN_SYNTAX_FILTER_AVA           700
00687 #define SLAPI_PLUGIN_SYNTAX_FILTER_SUB           701
00688 #define SLAPI_PLUGIN_SYNTAX_VALUES2KEYS          702
00689 #define SLAPI_PLUGIN_SYNTAX_ASSERTION2KEYS_AVA   703
00690 #define SLAPI_PLUGIN_SYNTAX_ASSERTION2KEYS_SUB   704
00691 #define SLAPI_PLUGIN_SYNTAX_NAMES         705
00692 #define SLAPI_PLUGIN_SYNTAX_OID                  706
00693 #define SLAPI_PLUGIN_SYNTAX_FLAGS         707
00694 #define SLAPI_PLUGIN_SYNTAX_COMPARE              708
00695 
00696 #define SLAPI_PLUGIN_SYNTAX_FLAG_ORKEYS                 1
00697 #define SLAPI_PLUGIN_SYNTAX_FLAG_ORDERING        2
00698 
00699 #define SLAPI_PLUGIN_ACL_INIT                    730
00700 #define SLAPI_PLUGIN_ACL_SYNTAX_CHECK            731
00701 #define SLAPI_PLUGIN_ACL_ALLOW_ACCESS            732
00702 #define SLAPI_PLUGIN_ACL_MODS_ALLOWED            733
00703 #define SLAPI_PLUGIN_ACL_MODS_UPDATE             734
00704 
00705 #define SLAPI_OPERATION_AUTHTYPE                741
00706 #define SLAPI_OPERATION_ID                      742
00707 #define SLAPI_CONN_CERT                         743
00708 #define SLAPI_CONN_AUTHMETHOD                   746
00709 #define SLAPI_IS_INTERNAL_OPERATION              748
00710 
00711 #define SLAPI_RESULT_CODE                       881
00712 #define SLAPI_RESULT_TEXT                       882
00713 #define SLAPI_RESULT_MATCHED                    883
00714 
00715 /* managedsait control */
00716 #define SLAPI_MANAGEDSAIT                 1000
00717 
00718 /* audit plugin defines */
00719 #define SLAPI_PLUGIN_AUDIT_DATA                1100
00720 #define SLAPI_PLUGIN_AUDIT_FN                  1101
00721 
00722 /* backend_group extension */
00723 #define SLAPI_X_PLUGIN_PRE_GROUP_FN              1202 
00724 #define SLAPI_X_PLUGIN_POST_GROUP_FN             1203
00725 
00726 #define SLAPI_X_GROUP_ENTRY               1250 /* group entry */
00727 #define SLAPI_X_GROUP_ATTRIBUTE                  1251 /* member attribute */
00728 #define SLAPI_X_GROUP_OPERATION_DN        1252 /* asserted value */
00729 #define SLAPI_X_GROUP_TARGET_ENTRY        1253 /* target entry */
00730 
00731 /* internal preoperation extensions */
00732 #define SLAPI_PLUGIN_INTERNAL_PRE_BIND_FN 1260
00733 #define SLAPI_PLUGIN_INTERNAL_PRE_UNBIND_FN      1261
00734 #define SLAPI_PLUGIN_INTERNAL_PRE_SEARCH_FN      1262
00735 #define SLAPI_PLUGIN_INTERNAL_PRE_COMPARE_FN     1263
00736 #define SLAPI_PLUGIN_INTERNAL_PRE_ABANDON_FN     1264
00737 
00738 /* internal postoperation extensions */
00739 #define SLAPI_PLUGIN_INTERNAL_POST_BIND_FN       1270
00740 #define SLAPI_PLUGIN_INTERNAL_POST_UNBIND_FN     1271
00741 #define SLAPI_PLUGIN_INTERNAL_POST_SEARCH_FN     1272
00742 #define SLAPI_PLUGIN_INTERNAL_POST_COMPARE_FN    1273
00743 #define SLAPI_PLUGIN_INTERNAL_POST_ABANDON_FN    1274
00744 
00745 /* config stuff */
00746 #define SLAPI_CONFIG_FILENAME                    40
00747 #define SLAPI_CONFIG_LINENO               41
00748 #define SLAPI_CONFIG_ARGC                 42
00749 #define SLAPI_CONFIG_ARGV                 43
00750 
00751 /*  operational params */
00752 #define SLAPI_TARGET_ADDRESS                     48
00753 #define SLAPI_TARGET_UNIQUEID                    49
00754 #define SLAPI_TARGET_DN                          50
00755 
00756 /* server LDAPv3 controls  */
00757 #define SLAPI_REQCONTROLS                 51
00758 #define SLAPI_RESCONTROLS                 55
00759 #define SLAPI_ADD_RESCONTROL                     56     
00760 #define SLAPI_CONTROLS_ARG                58
00761 
00762 /* add params */
00763 #define SLAPI_ADD_TARGET                  SLAPI_TARGET_DN
00764 #define SLAPI_ADD_ENTRY                          60
00765 #define SLAPI_ADD_EXISTING_DN_ENTRY              61
00766 #define SLAPI_ADD_PARENT_ENTRY                   62
00767 #define SLAPI_ADD_PARENT_UNIQUEID         63
00768 #define SLAPI_ADD_EXISTING_UNIQUEID_ENTRY 64
00769 
00770 /* bind params */
00771 #define SLAPI_BIND_TARGET                 SLAPI_TARGET_DN
00772 #define SLAPI_BIND_METHOD                 70
00773 #define SLAPI_BIND_CREDENTIALS                   71     
00774 #define SLAPI_BIND_SASLMECHANISM          72     
00775 #define SLAPI_BIND_RET_SASLCREDS          73     
00776 
00777 /* compare params */
00778 #define SLAPI_COMPARE_TARGET                     SLAPI_TARGET_DN
00779 #define SLAPI_COMPARE_TYPE                80
00780 #define SLAPI_COMPARE_VALUE               81
00781 
00782 /* delete params */
00783 #define SLAPI_DELETE_TARGET               SLAPI_TARGET_DN
00784 #define SLAPI_DELETE_EXISTING_ENTRY              SLAPI_ADD_EXISTING_DN_ENTRY
00785 
00786 /* modify params */
00787 #define SLAPI_MODIFY_TARGET               SLAPI_TARGET_DN
00788 #define SLAPI_MODIFY_MODS                 90
00789 #define SLAPI_MODIFY_EXISTING_ENTRY              SLAPI_ADD_EXISTING_DN_ENTRY
00790 
00791 /* modrdn params */
00792 #define SLAPI_MODRDN_TARGET               SLAPI_TARGET_DN
00793 #define SLAPI_MODRDN_NEWRDN               100
00794 #define SLAPI_MODRDN_DELOLDRDN                   101
00795 #define SLAPI_MODRDN_NEWSUPERIOR          102    /* v3 only */
00796 #define SLAPI_MODRDN_EXISTING_ENTRY             SLAPI_ADD_EXISTING_DN_ENTRY
00797 #define SLAPI_MODRDN_PARENT_ENTRY         104
00798 #define SLAPI_MODRDN_NEWPARENT_ENTRY             105
00799 #define SLAPI_MODRDN_TARGET_ENTRY         106
00800 #define SLAPI_MODRDN_NEWSUPERIOR_ADDRESS  107
00801 
00802 /* search params */
00803 #define SLAPI_SEARCH_TARGET               SLAPI_TARGET_DN
00804 #define SLAPI_SEARCH_SCOPE                110
00805 #define SLAPI_SEARCH_DEREF                111
00806 #define SLAPI_SEARCH_SIZELIMIT                   112
00807 #define SLAPI_SEARCH_TIMELIMIT                   113
00808 #define SLAPI_SEARCH_FILTER               114
00809 #define SLAPI_SEARCH_STRFILTER                   115
00810 #define SLAPI_SEARCH_ATTRS                116
00811 #define SLAPI_SEARCH_ATTRSONLY                   117
00812 
00813 /* abandon params */
00814 #define SLAPI_ABANDON_MSGID               120
00815 
00816 /* extended operation params */
00817 #define SLAPI_EXT_OP_REQ_OID                     160
00818 #define SLAPI_EXT_OP_REQ_VALUE            161    
00819 
00820 /* extended operation return codes */
00821 #define SLAPI_EXT_OP_RET_OID                     162    
00822 #define SLAPI_EXT_OP_RET_VALUE            163    
00823 
00824 #define SLAPI_PLUGIN_EXTENDED_SENT_RESULT -1
00825 
00826 #define SLAPI_FAIL_DISKFULL        -2
00827 #define SLAPI_FAIL_GENERAL         -1
00828 #define SLAPI_PLUGIN_EXTENDED_NOT_HANDLED -2
00829 #define SLAPI_BIND_SUCCESS         0
00830 #define SLAPI_BIND_FAIL                   2
00831 #define SLAPI_BIND_ANONYMOUS              3
00832 
00833 /* Search result params */
00834 #define SLAPI_SEARCH_RESULT_SET                  193
00835 #define       SLAPI_SEARCH_RESULT_ENTRY          194
00836 #define       SLAPI_NENTRIES                            195
00837 #define SLAPI_SEARCH_REFERRALS                   196
00838 
00839 /* filter types */
00840 #ifndef LDAP_FILTER_AND
00841 #define LDAP_FILTER_AND         0xa0L
00842 #endif
00843 #ifndef LDAP_FILTER_OR
00844 #define LDAP_FILTER_OR          0xa1L
00845 #endif
00846 #ifndef LDAP_FILTER_NOT
00847 #define LDAP_FILTER_NOT         0xa2L
00848 #endif
00849 #ifndef LDAP_FILTER_EQUALITY
00850 #define LDAP_FILTER_EQUALITY    0xa3L
00851 #endif
00852 #ifndef LDAP_FILTER_SUBSTRINGS
00853 #define LDAP_FILTER_SUBSTRINGS  0xa4L
00854 #endif
00855 #ifndef LDAP_FILTER_GE
00856 #define LDAP_FILTER_GE          0xa5L
00857 #endif
00858 #ifndef LDAP_FILTER_LE
00859 #define LDAP_FILTER_LE          0xa6L
00860 #endif
00861 #ifndef LDAP_FILTER_PRESENT
00862 #define LDAP_FILTER_PRESENT     0x87L
00863 #endif
00864 #ifndef LDAP_FILTER_APPROX
00865 #define LDAP_FILTER_APPROX      0xa8L
00866 #endif
00867 #ifndef LDAP_FILTER_EXT_MATCH
00868 #define LDAP_FILTER_EXT_MATCH   0xa9L
00869 #endif
00870 
00871 int slapi_log_error( int severity, char *subsystem, char *fmt, ... );
00872 #define SLAPI_LOG_FATAL                 0
00873 #define SLAPI_LOG_TRACE                 1
00874 #define SLAPI_LOG_PACKETS               2
00875 #define SLAPI_LOG_ARGS                  3
00876 #define SLAPI_LOG_CONNS                 4
00877 #define SLAPI_LOG_BER                   5
00878 #define SLAPI_LOG_FILTER                6
00879 #define SLAPI_LOG_CONFIG                7
00880 #define SLAPI_LOG_ACL                   8
00881 #define SLAPI_LOG_SHELL                 9
00882 #define SLAPI_LOG_PARSE                 10
00883 #define SLAPI_LOG_HOUSE                 11
00884 #define SLAPI_LOG_REPL                  12
00885 #define SLAPI_LOG_CACHE                 13
00886 #define SLAPI_LOG_PLUGIN                14
00887 #define SLAPI_LOG_TIMING                15
00888 
00889 #define SLAPI_PLUGIN_DESCRIPTION   12
00890 typedef struct slapi_plugindesc {
00891         char    *spd_id;
00892         char    *spd_vendor;
00893         char    *spd_version;
00894         char    *spd_description;
00895 } Slapi_PluginDesc;
00896 
00897 #define SLAPI_PLUGIN_VERSION_01         "01"
00898 #define SLAPI_PLUGIN_VERSION_02         "02"
00899 #define SLAPI_PLUGIN_VERSION_03         "03"
00900 #define SLAPI_PLUGIN_CURRENT_VERSION    SLAPI_PLUGIN_VERSION_03
00901 
00902 #endif /* _SLAPI_PLUGIN_H */
00903