Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:36:01

0001 /* $OpenLDAP$ */
0002 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
0003  *
0004  * Copyright 1998-2024 The OpenLDAP Foundation.
0005  * Portions Copyright 1997,2002,2003 IBM Corporation.
0006  * All rights reserved.
0007  *
0008  * Redistribution and use in source and binary forms, with or without
0009  * modification, are permitted only as authorized by the OpenLDAP
0010  * Public License.
0011  *
0012  * A copy of this license is available in file LICENSE in the
0013  * top-level directory of the distribution or, alternatively, at
0014  * <http://www.OpenLDAP.org/license.html>.
0015  */
0016 
0017 /*
0018  * This header is used in development of SLAPI plugins for
0019  * OpenLDAP slapd(8) and other directory servers supporting
0020  * this interface.  Your portability mileage may vary.
0021  */
0022 
0023 #ifndef _SLAPI_PLUGIN_H
0024 #define _SLAPI_PLUGIN_H
0025 
0026 #include <ldap.h>
0027 
0028 typedef struct slapi_pblock     Slapi_PBlock;
0029 typedef struct slapi_entry      Slapi_Entry;
0030 typedef struct slapi_attr       Slapi_Attr;
0031 typedef struct slapi_value      Slapi_Value;
0032 typedef struct slapi_valueset       Slapi_ValueSet;
0033 typedef struct slapi_filter     Slapi_Filter;
0034 typedef struct BackendDB        Slapi_Backend;
0035 typedef struct Operation        Slapi_Operation;
0036 typedef struct Connection       Slapi_Connection;
0037 typedef struct slapi_dn         Slapi_DN;
0038 typedef struct slapi_rdn        Slapi_RDN;
0039 typedef struct slapi_mod        Slapi_Mod;
0040 typedef struct slapi_mods       Slapi_Mods;
0041 typedef struct slapi_componentid    Slapi_ComponentId;
0042 
0043 #define SLAPI_ATTR_UNIQUEID "entryUUID"
0044 #define SLAPI_ATTR_OBJECTCLASS  "objectClass"
0045 
0046 /* pblock routines */
0047 int slapi_pblock_get( Slapi_PBlock *pb, int arg, void *value );
0048 int slapi_pblock_set( Slapi_PBlock *pb, int arg, void *value );
0049 Slapi_PBlock *slapi_pblock_new( void );
0050 void slapi_pblock_destroy( Slapi_PBlock *pb );
0051 
0052 /* entry/attr/dn routines */
0053 Slapi_Entry *slapi_str2entry( char *s, int flags );
0054 #define SLAPI_STR2ENTRY_REMOVEDUPVALS   1
0055 #define SLAPI_STR2ENTRY_ADDRDNVALS  2
0056 #define SLAPI_STR2ENTRY_BIGENTRY    4
0057 #define SLAPI_STR2ENTRY_TOMBSTONE_CHECK 8
0058 #define SLAPI_STR2ENTRY_IGNORE_STATE    16
0059 #define SLAPI_STR2ENTRY_INCLUDE_VERSION_STR 32
0060 #define SLAPI_STR2ENTRY_EXPAND_OBJECTCLASSES    64
0061 #define SLAPI_STR2ENTRY_NOT_WELL_FORMED_LDIF    128
0062 char *slapi_entry2str( Slapi_Entry *e, int *len );
0063 char *slapi_entry_get_dn( Slapi_Entry *e );
0064 int slapi_x_entry_get_id( Slapi_Entry *e );
0065 void slapi_entry_set_dn( Slapi_Entry *e, char *dn );
0066 Slapi_Entry *slapi_entry_dup( Slapi_Entry *e );
0067 int slapi_entry_attr_delete( Slapi_Entry *e, char *type );
0068 Slapi_Entry *slapi_entry_alloc();
0069 void slapi_entry_free( Slapi_Entry *e );
0070 int slapi_entry_attr_merge( Slapi_Entry *e, char *type, struct berval **vals );
0071 int slapi_entry_attr_find( Slapi_Entry *e, char *type, Slapi_Attr **attr );
0072 char *slapi_entry_attr_get_charptr( const Slapi_Entry *e, const char *type );
0073 int slapi_entry_attr_get_int( const Slapi_Entry *e, const char *type );
0074 long slapi_entry_attr_get_long( const Slapi_Entry *e, const char *type );
0075 unsigned int slapi_entry_attr_get_uint( const Slapi_Entry *e, const char *type );
0076 unsigned long slapi_entry_attr_get_ulong( const Slapi_Entry *e, const char *type );
0077 int slapi_attr_get_values( Slapi_Attr *attr, struct berval ***vals );
0078 char *slapi_dn_normalize( char *dn );
0079 char *slapi_dn_normalize_case( char *dn );
0080 int slapi_dn_issuffix( char *dn, char *suffix );
0081 char *slapi_dn_beparent( Slapi_PBlock *pb, const char *dn );
0082 int slapi_dn_isbesuffix( Slapi_PBlock *pb, char *dn );
0083 char *slapi_dn_parent( const char *dn );
0084 int slapi_dn_isparent( const char *parentdn, const char *childdn );
0085 char *slapi_dn_ignore_case( char *dn );
0086 int slapi_rdn2typeval( char *rdn, char **type, struct berval *bv );
0087 char *slapi_dn_plus_rdn(const char *dn, const char *rdn);
0088 
0089 /* DS 5.x SLAPI */
0090 int slapi_access_allowed( Slapi_PBlock *pb, Slapi_Entry *e, char *attr, struct berval *val, int access );
0091 int slapi_acl_check_mods( Slapi_PBlock *pb, Slapi_Entry *e, LDAPMod **mods, char **errbuf );
0092 Slapi_Attr *slapi_attr_new( void );
0093 Slapi_Attr *slapi_attr_init( Slapi_Attr *a, const char *type );
0094 void slapi_attr_free( Slapi_Attr **a );
0095 Slapi_Attr *slapi_attr_dup( const Slapi_Attr *attr );
0096 int slapi_attr_add_value( Slapi_Attr *a, const Slapi_Value *v );
0097 int slapi_attr_type2plugin( const char *type, void **pi );
0098 int slapi_attr_get_type( const Slapi_Attr *attr, char **type );
0099 int slapi_attr_get_oid_copy( const Slapi_Attr *attr, char **oidp );
0100 int slapi_attr_get_flags( const Slapi_Attr *attr, unsigned long *flags );
0101 int slapi_attr_flag_is_set( const Slapi_Attr *attr, unsigned long flag );
0102 int slapi_attr_value_cmp( const Slapi_Attr *attr, const struct berval *v1, const struct berval *v2 );
0103 int slapi_attr_value_find( const Slapi_Attr *a, struct berval *v );
0104 #define SLAPI_TYPE_CMP_EXACT    0
0105 #define SLAPI_TYPE_CMP_BASE 1
0106 #define SLAPI_TYPE_CMP_SUBTYPE  2
0107 int slapi_attr_type_cmp( const char *t1, const char *t2, int opt );
0108 int slapi_attr_types_equivalent( const char *t1, const char *t2 );
0109 int slapi_attr_first_value( Slapi_Attr *a, Slapi_Value **v );
0110 int slapi_attr_next_value( Slapi_Attr *a, int hint, Slapi_Value **v );
0111 int slapi_attr_get_numvalues( const Slapi_Attr *a, int *numValues );
0112 int slapi_attr_get_valueset( const Slapi_Attr *a, Slapi_ValueSet **vs );
0113 int slapi_attr_get_bervals_copy( Slapi_Attr *a, struct berval ***vals );
0114 int slapi_entry_attr_hasvalue( Slapi_Entry *e, const char *type, const char *value );
0115 int slapi_entry_attr_merge_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals );
0116 void slapi_entry_attr_set_charptr(Slapi_Entry* e, const char *type, const char *value);
0117 void slapi_entry_attr_set_int( Slapi_Entry* e, const char *type, int l);
0118 void slapi_entry_attr_set_uint( Slapi_Entry* e, const char *type, unsigned int l);
0119 void slapi_entry_attr_set_long(Slapi_Entry* e, const char *type, long l);
0120 void slapi_entry_attr_set_ulong(Slapi_Entry* e, const char *type, unsigned long l);
0121 int slapi_entry_has_children(const Slapi_Entry *e);
0122 size_t slapi_entry_size(Slapi_Entry *e);
0123 int slapi_is_rootdse( const char *dn );
0124 int slapi_entry_attr_merge_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals );
0125 int slapi_entry_add_values_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals );
0126 int slapi_entry_add_valueset(Slapi_Entry *e, const char *type, Slapi_ValueSet *vs);
0127 int slapi_entry_delete_values_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals );
0128 int slapi_entry_merge_values_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals );
0129 int slapi_entry_attr_replace_sv( Slapi_Entry *e, const char *type, Slapi_Value **vals );
0130 int slapi_entry_add_value(Slapi_Entry *e, const char *type, const Slapi_Value *value);
0131 int slapi_entry_add_string(Slapi_Entry *e, const char *type, const char *value);
0132 int slapi_entry_delete_string(Slapi_Entry *e, const char *type, const char *value);
0133 int slapi_entry_first_attr( const Slapi_Entry *e, Slapi_Attr **attr );
0134 int slapi_entry_next_attr( const Slapi_Entry *e, Slapi_Attr *prevattr, Slapi_Attr **attr );
0135 const char *slapi_entry_get_uniqueid( const Slapi_Entry *e );
0136 void slapi_entry_set_uniqueid( Slapi_Entry *e, char *uniqueid );
0137 int slapi_entry_schema_check( Slapi_PBlock *pb, Slapi_Entry *e );
0138 int slapi_entry_rdn_values_present( const Slapi_Entry *e );
0139 int slapi_entry_add_rdn_values( Slapi_Entry *e );
0140 char *slapi_attr_syntax_normalize( const char *s );
0141 
0142 Slapi_Value *slapi_value_new( void );
0143 Slapi_Value *slapi_value_new_berval(const struct berval *bval);
0144 Slapi_Value *slapi_value_new_value(const Slapi_Value *v);
0145 Slapi_Value *slapi_value_new_string(const char *s);
0146 Slapi_Value *slapi_value_init(Slapi_Value *v);
0147 Slapi_Value *slapi_value_init_berval(Slapi_Value *v, struct berval *bval);
0148 Slapi_Value *slapi_value_init_string(Slapi_Value *v, const char *s);
0149 Slapi_Value *slapi_value_dup(const Slapi_Value *v);
0150 void slapi_value_free(Slapi_Value **value);
0151 const struct berval *slapi_value_get_berval( const Slapi_Value *value );
0152 Slapi_Value *slapi_value_set_berval( Slapi_Value *value, const struct berval *bval );
0153 Slapi_Value *slapi_value_set_value( Slapi_Value *value, const Slapi_Value *vfrom);
0154 Slapi_Value *slapi_value_set( Slapi_Value *value, void *val, unsigned long len);
0155 int slapi_value_set_string(Slapi_Value *value, const char *strVal);
0156 int slapi_value_set_int(Slapi_Value *value, int intVal);
0157 const char*slapi_value_get_string(const Slapi_Value *value);
0158 int slapi_value_get_int(const Slapi_Value *value); 
0159 unsigned int slapi_value_get_uint(const Slapi_Value *value); 
0160 long slapi_value_get_long(const Slapi_Value *value); 
0161 unsigned long slapi_value_get_ulong(const Slapi_Value *value); 
0162 size_t slapi_value_get_length(const Slapi_Value *value);
0163 int slapi_value_compare(const Slapi_Attr *a, const Slapi_Value *v1, const Slapi_Value *v2);
0164 
0165 Slapi_ValueSet *slapi_valueset_new( void );
0166 void slapi_valueset_free(Slapi_ValueSet *vs);
0167 void slapi_valueset_init(Slapi_ValueSet *vs);
0168 void slapi_valueset_done(Slapi_ValueSet *vs);
0169 void slapi_valueset_add_value(Slapi_ValueSet *vs, const Slapi_Value *addval);
0170 int slapi_valueset_first_value( Slapi_ValueSet *vs, Slapi_Value **v );
0171 int slapi_valueset_next_value( Slapi_ValueSet *vs, int index, Slapi_Value **v);
0172 int slapi_valueset_count( const Slapi_ValueSet *vs);
0173 void slapi_valueset_set_valueset(Slapi_ValueSet *vs1, const Slapi_ValueSet *vs2);
0174 
0175 /* DNs */
0176 Slapi_DN *slapi_sdn_new( void );
0177 Slapi_DN *slapi_sdn_new_dn_byval( const char *dn );
0178 Slapi_DN *slapi_sdn_new_ndn_byval( const char *ndn );
0179 Slapi_DN *slapi_sdn_new_dn_byref( const char *dn );
0180 Slapi_DN *slapi_sdn_new_ndn_byref( const char *ndn );
0181 Slapi_DN *slapi_sdn_new_dn_passin( const char *dn );
0182 Slapi_DN *slapi_sdn_set_dn_byval( Slapi_DN *sdn, const char *dn );
0183 Slapi_DN *slapi_sdn_set_dn_byref( Slapi_DN *sdn, const char *dn );
0184 Slapi_DN *slapi_sdn_set_dn_passin( Slapi_DN *sdn, const char *dn );
0185 Slapi_DN *slapi_sdn_set_ndn_byval( Slapi_DN *sdn, const char *ndn );
0186 Slapi_DN *slapi_sdn_set_ndn_byref( Slapi_DN *sdn, const char *ndn );
0187 void slapi_sdn_done( Slapi_DN *sdn );
0188 void slapi_sdn_free( Slapi_DN **sdn );
0189 const char * slapi_sdn_get_dn( const Slapi_DN *sdn );
0190 const char * slapi_sdn_get_ndn( const Slapi_DN *sdn );
0191 void slapi_sdn_get_parent( const Slapi_DN *sdn,Slapi_DN *sdn_parent );
0192 void slapi_sdn_get_backend_parent( const Slapi_DN *sdn, Slapi_DN *sdn_parent, const Slapi_Backend *backend );
0193 Slapi_DN * slapi_sdn_dup( const Slapi_DN *sdn );
0194 void slapi_sdn_copy( const Slapi_DN *from, Slapi_DN *to );
0195 int slapi_sdn_compare( const Slapi_DN *sdn1, const Slapi_DN *sdn2 );
0196 int slapi_sdn_isempty( const Slapi_DN *sdn );
0197 int slapi_sdn_issuffix(const Slapi_DN *sdn, const Slapi_DN *suffixsdn );
0198 int slapi_sdn_isparent( const Slapi_DN *parent, const Slapi_DN *child );
0199 int slapi_sdn_isgrandparent( const Slapi_DN *parent, const Slapi_DN *child );
0200 int slapi_sdn_get_ndn_len( const Slapi_DN *sdn );
0201 int slapi_sdn_scope_test( const Slapi_DN *dn, const Slapi_DN *base, int scope );
0202 void slapi_sdn_get_rdn( const Slapi_DN *sdn,Slapi_RDN *rdn );
0203 Slapi_DN *slapi_sdn_set_rdn( Slapi_DN *sdn, const Slapi_RDN *rdn );
0204 Slapi_DN *slapi_sdn_set_parent( Slapi_DN *sdn, const Slapi_DN *parentdn );
0205 int slapi_sdn_is_rdn_component( const Slapi_DN *rdn, const Slapi_Attr *a, const Slapi_Value *v );
0206 char * slapi_moddn_get_newdn( Slapi_DN *dn_olddn, char *newrdn, char *newsuperiordn );
0207 
0208 /* RDNs */
0209 Slapi_RDN *slapi_rdn_new( void );
0210 Slapi_RDN *slapi_rdn_new_dn( const char *dn );
0211 Slapi_RDN *slapi_rdn_new_sdn( const Slapi_DN *sdn );
0212 Slapi_RDN *slapi_rdn_new_rdn( const Slapi_RDN *fromrdn ); 
0213 void slapi_rdn_init( Slapi_RDN *rdn );
0214 void slapi_rdn_init_dn( Slapi_RDN *rdn, const char *dn );
0215 void slapi_rdn_init_sdn( Slapi_RDN *rdn, const Slapi_DN *sdn );
0216 void slapi_rdn_init_rdn( Slapi_RDN *rdn, const Slapi_RDN *fromrdn ); 
0217 void slapi_rdn_set_dn( Slapi_RDN *rdn, const char *dn );
0218 void slapi_rdn_set_sdn( Slapi_RDN *rdn, const Slapi_DN *sdn );
0219 void slapi_rdn_set_rdn( Slapi_RDN *rdn, const Slapi_RDN *fromrdn );
0220 void slapi_rdn_free( Slapi_RDN **rdn );
0221 void slapi_rdn_done( Slapi_RDN *rdn );
0222 int slapi_rdn_get_first( Slapi_RDN *rdn, char **type, char **value );
0223 int slapi_rdn_get_next( Slapi_RDN *rdn, int index, char **type, char **value );
0224 int slapi_rdn_get_index( Slapi_RDN *rdn, const char *type, const char *value, size_t length );
0225 int slapi_rdn_get_index_attr( Slapi_RDN *rdn, const char *type, char **value );
0226 int slapi_rdn_contains( Slapi_RDN *rdn, const char *type, const char *value,size_t length );
0227 int slapi_rdn_contains_attr( Slapi_RDN *rdn, const char *type, char **value );
0228 int slapi_rdn_add( Slapi_RDN *rdn, const char *type, const char *value );
0229 int slapi_rdn_remove_index( Slapi_RDN *rdn, int atindex );
0230 int slapi_rdn_remove( Slapi_RDN *rdn, const char *type, const char *value, size_t length );
0231 int slapi_rdn_remove_attr( Slapi_RDN *rdn, const char *type );
0232 int slapi_rdn_isempty( const Slapi_RDN *rdn );
0233 int slapi_rdn_get_num_components( Slapi_RDN *rdn );
0234 int slapi_rdn_compare( Slapi_RDN *rdn1, Slapi_RDN *rdn2 );
0235 const char *slapi_rdn_get_rdn( const Slapi_RDN *rdn );
0236 const char *slapi_rdn_get_nrdn( const Slapi_RDN *rdn );
0237 Slapi_DN *slapi_sdn_add_rdn( Slapi_DN *sdn, const Slapi_RDN *rdn );
0238 
0239 /* locks and synchronization */
0240 typedef struct slapi_mutex  Slapi_Mutex;
0241 typedef struct slapi_condvar    Slapi_CondVar;
0242 Slapi_Mutex *slapi_new_mutex( void );
0243 void slapi_destroy_mutex( Slapi_Mutex *mutex );
0244 void slapi_lock_mutex( Slapi_Mutex *mutex );
0245 int slapi_unlock_mutex( Slapi_Mutex *mutex );
0246 Slapi_CondVar *slapi_new_condvar( Slapi_Mutex *mutex );
0247 void slapi_destroy_condvar( Slapi_CondVar *cvar );
0248 int slapi_wait_condvar( Slapi_CondVar *cvar, struct timeval *timeout );
0249 int slapi_notify_condvar( Slapi_CondVar *cvar, int notify_all );
0250 
0251 /* thread-safe LDAP connections */
0252 LDAP *slapi_ldap_init( char *ldaphost, int ldapport, int secure, int shared );
0253 void slapi_ldap_unbind( LDAP *ld );
0254 
0255 char *slapi_ch_malloc( unsigned long size );
0256 void slapi_ch_free( void **ptr );
0257 void slapi_ch_free_string( char **ptr );
0258 char *slapi_ch_calloc( unsigned long nelem, unsigned long size );
0259 char *slapi_ch_realloc( char *block, unsigned long size );
0260 char *slapi_ch_strdup( const char *s );
0261 void slapi_ch_array_free( char **arrayp );
0262 struct berval *slapi_ch_bvdup(const struct berval *v);
0263 struct berval **slapi_ch_bvecdup(const struct berval **v);
0264 
0265 /* LDAP V3 routines */
0266 int slapi_control_present( LDAPControl **controls, char *oid,
0267     struct berval **val, int *iscritical);
0268 void slapi_register_supported_control(char *controloid,
0269     unsigned long controlops);
0270 #define SLAPI_OPERATION_BIND            0x00000001L
0271 #define SLAPI_OPERATION_UNBIND          0x00000002L
0272 #define SLAPI_OPERATION_SEARCH          0x00000004L
0273 #define SLAPI_OPERATION_MODIFY          0x00000008L
0274 #define SLAPI_OPERATION_ADD             0x00000010L
0275 #define SLAPI_OPERATION_DELETE          0x00000020L
0276 #define SLAPI_OPERATION_MODDN           0x00000040L
0277 #define SLAPI_OPERATION_MODRDN          SLAPI_OPERATION_MODDN
0278 #define SLAPI_OPERATION_COMPARE         0x00000080L
0279 #define SLAPI_OPERATION_ABANDON         0x00000100L
0280 #define SLAPI_OPERATION_EXTENDED        0x00000200L
0281 #define SLAPI_OPERATION_ANY             0xFFFFFFFFL
0282 #define SLAPI_OPERATION_NONE            0x00000000L
0283 int slapi_get_supported_controls(char ***ctrloidsp, unsigned long **ctrlopsp);
0284 LDAPControl *slapi_dup_control(LDAPControl *ctrl);
0285 void slapi_register_supported_saslmechanism(char *mechanism);
0286 char **slapi_get_supported_saslmechanisms();
0287 char **slapi_get_supported_extended_ops(void);
0288 
0289 /* operation */
0290 int slapi_op_abandoned( Slapi_PBlock *pb );
0291 unsigned long slapi_op_get_type(Slapi_Operation * op);
0292 void slapi_operation_set_flag(Slapi_Operation *op, unsigned long flag);
0293 void slapi_operation_clear_flag(Slapi_Operation *op, unsigned long flag);
0294 int slapi_operation_is_flag_set(Slapi_Operation *op, unsigned long flag);
0295 char *slapi_op_type_to_string(unsigned long type);
0296 
0297 /* send ldap result back */
0298 void slapi_send_ldap_result( Slapi_PBlock *pb, int err, char *matched,
0299     char *text, int nentries, struct berval **urls );
0300 int slapi_send_ldap_search_entry( Slapi_PBlock *pb, Slapi_Entry *e,
0301     LDAPControl **ectrls, char **attrs, int attrsonly );
0302 int slapi_send_ldap_search_reference( Slapi_PBlock *pb, Slapi_Entry *e,
0303     struct berval **urls, LDAPControl **ectrls, struct berval **v2refs );
0304 
0305 /* filter routines */
0306 Slapi_Filter *slapi_str2filter( char *str );
0307 Slapi_Filter *slapi_filter_dup( Slapi_Filter *f );
0308 void slapi_filter_free( Slapi_Filter *f, int recurse );
0309 int slapi_filter_get_choice( Slapi_Filter *f);
0310 int slapi_filter_get_ava( Slapi_Filter *f, char **type, struct berval **bval );
0311 Slapi_Filter *slapi_filter_list_first( Slapi_Filter *f );
0312 Slapi_Filter *slapi_filter_list_next( Slapi_Filter *f, Slapi_Filter *fprev );
0313 int slapi_filter_get_attribute_type( Slapi_Filter *f, char **type ); 
0314 int slapi_x_filter_set_attribute_type( Slapi_Filter *f, const char *type );
0315 int slapi_filter_get_subfilt( Slapi_Filter *f, char **type, char **initial,
0316     char ***any, char **final );
0317 Slapi_Filter *slapi_filter_join( int ftype, Slapi_Filter *f1, Slapi_Filter *f2);
0318 int slapi_x_filter_append( int choice, Slapi_Filter **pContainingFilter,
0319     Slapi_Filter **pNextFilter, Slapi_Filter *filterToAppend );
0320 int slapi_filter_test( Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Filter *f,
0321     int verify_access );
0322 int slapi_filter_test_simple( Slapi_Entry *e, Slapi_Filter *f );
0323 typedef int (*FILTER_APPLY_FN)( Slapi_Filter *f, void *arg );
0324 int slapi_filter_apply( Slapi_Filter *f, FILTER_APPLY_FN fn, void *arg, int *error_code );
0325 #define SLAPI_FILTER_SCAN_STOP          -1 /* set by callback */
0326 #define SLAPI_FILTER_SCAN_ERROR         -2 /* set by callback */
0327 #define SLAPI_FILTER_SCAN_NOMORE        0 /* set by callback */
0328 #define SLAPI_FILTER_SCAN_CONTINUE      1 /* set by callback */
0329 #define SLAPI_FILTER_UNKNOWN_FILTER_TYPE    2 /* set by slapi_filter_apply() */
0330 
0331 /* internal add/delete/search/modify routines */
0332 Slapi_PBlock *slapi_search_internal( char *base, int scope, char *filter, 
0333     LDAPControl **controls, char **attrs, int attrsonly );
0334 Slapi_PBlock *slapi_modify_internal( char *dn, LDAPMod **mods,
0335         LDAPControl **controls, int log_change );
0336 Slapi_PBlock *slapi_add_internal( char * dn, LDAPMod **attrs,
0337     LDAPControl **controls, int log_changes );
0338 Slapi_PBlock *slapi_add_entry_internal( Slapi_Entry * e,
0339     LDAPControl **controls, int log_change );
0340 Slapi_PBlock *slapi_delete_internal( char * dn,  LDAPControl **controls,
0341     int log_change );
0342 Slapi_PBlock *slapi_modrdn_internal( char * olddn, char * newrdn,
0343     int deloldrdn, LDAPControl **controls,
0344     int log_change );
0345 Slapi_PBlock *slapi_rename_internal( const char * olddn, const char *newrdn,
0346     const char *newsuperior, int deloldrdn,
0347     LDAPControl **controls, int log_change );
0348 void slapi_free_search_results_internal(Slapi_PBlock *pb);
0349 
0350 /* new internal add/delete/search/modify routines */
0351 typedef void (*plugin_result_callback)( int rc, void *callback_data );
0352 typedef int (*plugin_referral_entry_callback)( char * referral,
0353     void *callback_data );
0354 typedef int (*plugin_search_entry_callback)( Slapi_Entry *e,
0355     void *callback_data );
0356 void slapi_free_search_results_internal( Slapi_PBlock *pb );
0357 
0358 #define SLAPI_OP_FLAG_NEVER_CHAIN   0x0800
0359 
0360 int slapi_search_internal_pb( Slapi_PBlock *pb );
0361 int slapi_search_internal_callback_pb( Slapi_PBlock *pb, void *callback_data,
0362     plugin_result_callback prc, plugin_search_entry_callback psec,
0363     plugin_referral_entry_callback prec );
0364 int slapi_add_internal_pb( Slapi_PBlock *pb );
0365 int slapi_modify_internal_pb( Slapi_PBlock *pb );
0366 int slapi_modrdn_internal_pb( Slapi_PBlock *pb );
0367 int slapi_delete_internal_pb( Slapi_PBlock *pb );
0368 
0369 int slapi_seq_internal_callback_pb(Slapi_PBlock *pb, void *callback_data,
0370         plugin_result_callback res_callback,
0371         plugin_search_entry_callback srch_callback,
0372         plugin_referral_entry_callback ref_callback);
0373 
0374 void slapi_search_internal_set_pb( Slapi_PBlock *pb, const char *base,
0375     int scope, const char *filter, char **attrs, int attrsonly,
0376     LDAPControl **controls, const char *uniqueid,
0377     Slapi_ComponentId *plugin_identity, int operation_flags );
0378 void slapi_add_entry_internal_set_pb( Slapi_PBlock *pb, Slapi_Entry *e,
0379     LDAPControl **controls, Slapi_ComponentId *plugin_identity,
0380     int operation_flags );
0381 int slapi_add_internal_set_pb( Slapi_PBlock *pb, const char *dn,
0382     LDAPMod **attrs, LDAPControl **controls,
0383     Slapi_ComponentId *plugin_identity, int operation_flags );
0384 void slapi_modify_internal_set_pb( Slapi_PBlock *pb, const char *dn,
0385     LDAPMod **mods, LDAPControl **controls, const char *uniqueid,
0386     Slapi_ComponentId *plugin_identity, int operation_flags );
0387 void slapi_rename_internal_set_pb( Slapi_PBlock *pb, const char *olddn,
0388     const char *newrdn, const char *newsuperior, int deloldrdn,
0389     LDAPControl **controls, const char *uniqueid,
0390     Slapi_ComponentId *plugin_identity, int operation_flags );
0391 void slapi_delete_internal_set_pb( Slapi_PBlock *pb, const char *dn,
0392     LDAPControl **controls, const char *uniqueid,
0393     Slapi_ComponentId *plugin_identity, int operation_flags );
0394 void slapi_seq_internal_set_pb( Slapi_PBlock *pb, char *ibase, int type,
0395     char *attrname, char *val, char **attrs, int attrsonly,
0396     LDAPControl **controls, Slapi_ComponentId *plugin_identity,
0397     int operation_flags );
0398 
0399 /* connection related routines */
0400 int slapi_is_connection_ssl(Slapi_PBlock *pPB, int *isSSL);
0401 int slapi_get_client_port(Slapi_PBlock *pPB, int *fromPort);
0402 int slapi_get_client_ip(Slapi_PBlock *pb, char **clientIP);
0403 void slapi_free_client_ip(char **clientIP);
0404 
0405 /* computed attributes */
0406 typedef struct _computed_attr_context computed_attr_context;
0407 typedef int (*slapi_compute_output_t)(computed_attr_context *c, Slapi_Attr *a, Slapi_Entry *e);
0408 typedef int (*slapi_compute_callback_t)(computed_attr_context *c, char *type, Slapi_Entry *e, slapi_compute_output_t outputfn);
0409 typedef int (*slapi_search_rewrite_callback_t)(Slapi_PBlock *pb);
0410 int slapi_compute_add_evaluator(slapi_compute_callback_t function);
0411 int slapi_compute_add_search_rewriter(slapi_search_rewrite_callback_t function);
0412 int compute_rewrite_search_filter(Slapi_PBlock *pb);
0413 int compute_evaluator(computed_attr_context *c, char *type, Slapi_Entry *e, slapi_compute_output_t outputfn);
0414 int slapi_x_compute_get_pblock(computed_attr_context *c, Slapi_PBlock **pb);
0415 
0416 /* backend routines */
0417 void slapi_be_set_readonly( Slapi_Backend *be, int readonly );
0418 int slapi_be_get_readonly( Slapi_Backend *be );
0419 const char *slapi_x_be_get_updatedn( Slapi_Backend *be );
0420 Slapi_Backend *slapi_be_select( const Slapi_DN *sdn );
0421 
0422 /* ACL plugins; only SLAPI_PLUGIN_ACL_ALLOW_ACCESS supported now */
0423 typedef int (*slapi_acl_callback_t)(Slapi_PBlock *pb,
0424     Slapi_Entry *e,
0425     const char *attr,
0426     struct berval *berval,
0427     int access,
0428     void *state);
0429 
0430 /* object extensions */
0431 typedef void *(*slapi_extension_constructor_fnptr)(void *object, void *parent);
0432 
0433 typedef void (*slapi_extension_destructor_fnptr)(void *extension,
0434     void *object, void *parent);
0435 
0436 int slapi_register_object_extension( const char *pluginname,
0437     const char *objectname, slapi_extension_constructor_fnptr constructor,
0438     slapi_extension_destructor_fnptr destructor, int *objecttype,
0439     int *extensionhandle);
0440 
0441 #define SLAPI_EXT_CONNECTION    "Connection"
0442 #define SLAPI_EXT_OPERATION     "Operation"
0443 #define SLAPI_EXT_ENTRY         "Entry"
0444 #define SLAPI_EXT_MTNODE        "Mapping Tree Node"
0445 
0446 void *slapi_get_object_extension(int objecttype, void *object,
0447     int extensionhandle);
0448 void slapi_set_object_extension(int objecttype, void *object,
0449     int extensionhandle, void *extension);
0450 
0451 int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags );
0452 
0453 /* parameters currently supported */
0454 
0455 /*
0456  * Attribute flags returned by slapi_attr_get_flags()
0457  */
0458 #define SLAPI_ATTR_FLAG_SINGLE      0x0001
0459 #define SLAPI_ATTR_FLAG_OPATTR      0x0002
0460 #define SLAPI_ATTR_FLAG_READONLY    0x0004
0461 #define SLAPI_ATTR_FLAG_STD_ATTR    SLAPI_ATTR_FLAG_READONLY
0462 #define SLAPI_ATTR_FLAG_OBSOLETE    0x0040
0463 #define SLAPI_ATTR_FLAG_COLLECTIVE  0x0080
0464 #define SLAPI_ATTR_FLAG_NOUSERMOD   0x0100
0465 
0466 /*
0467  * Backend flags returned by slapi_x_backend_get_flags()
0468  */
0469 #define SLAPI_BACKEND_FLAG_NOLASTMOD        0x0001U
0470 #define SLAPI_BACKEND_FLAG_NO_SCHEMA_CHECK  0x0002U
0471 #define SLAPI_BACKEND_FLAG_GLUE_INSTANCE    0x0010U /* a glue backend */
0472 #define SLAPI_BACKEND_FLAG_GLUE_SUBORDINATE 0x0020U /* child of a glue hierarchy */
0473 #define SLAPI_BACKEND_FLAG_GLUE_LINKED      0x0040U /* child is connected to parent */
0474 #define SLAPI_BACKEND_FLAG_OVERLAY      0x0080U /* this db struct is an overlay */
0475 #define SLAPI_BACKEND_FLAG_GLOBAL_OVERLAY   0x0100U /* this db struct is a global overlay */
0476 #define SLAPI_BACKEND_FLAG_SHADOW       0x8000U /* a shadow */
0477 #define SLAPI_BACKEND_FLAG_SYNC_SHADOW      0x1000U /* a sync shadow */
0478 #define SLAPI_BACKEND_FLAG_SLURP_SHADOW     0x2000U /* a slurp shadow */
0479 
0480 /*
0481  * ACL levels
0482  */
0483 #define SLAPI_ACL_COMPARE       0x01
0484 #define SLAPI_ACL_SEARCH        0x02
0485 #define SLAPI_ACL_READ          0x04
0486 #define SLAPI_ACL_WRITE         0x08
0487 #define SLAPI_ACL_DELETE        0x10    
0488 #define SLAPI_ACL_ADD           0x20
0489 #define SLAPI_ACL_SELF          0x40
0490 #define SLAPI_ACL_PROXY         0x80
0491 #define SLAPI_ACL_ALL           0x7f
0492 
0493 /* plugin types supported */
0494 
0495 #define SLAPI_PLUGIN_DATABASE           1
0496 #define SLAPI_PLUGIN_EXTENDEDOP         2
0497 #define SLAPI_PLUGIN_PREOPERATION       3
0498 #define SLAPI_PLUGIN_POSTOPERATION      4
0499 #define SLAPI_PLUGIN_MATCHINGRULE       5
0500 #define SLAPI_PLUGIN_SYNTAX             6
0501 #define SLAPI_PLUGIN_AUDIT              7   
0502 
0503 /* misc params */
0504 
0505 #define SLAPI_BACKEND               130
0506 #define SLAPI_CONNECTION            131
0507 #define SLAPI_OPERATION             132
0508 #define SLAPI_REQUESTOR_ISROOT          133
0509 #define SLAPI_BE_MONITORDN          134
0510 #define SLAPI_BE_TYPE                   135
0511 #define SLAPI_BE_READONLY               136
0512 #define SLAPI_BE_LASTMOD                137
0513 #define SLAPI_CONN_ID                   139
0514 
0515 /* operation params */
0516 #define SLAPI_OPINITIATED_TIME          140
0517 #define SLAPI_REQUESTOR_DN          141
0518 #define SLAPI_IS_REPLICATED_OPERATION       142
0519 #define SLAPI_REQUESTOR_ISUPDATEDN      SLAPI_IS_REPLICATED_OPERATION
0520 
0521 /* connection  structure params*/
0522 #define SLAPI_CONN_DN                   143
0523 #define SLAPI_CONN_AUTHTYPE             144
0524 #define SLAPI_CONN_CLIENTIP         145
0525 #define SLAPI_CONN_SERVERIP         146
0526 /* OpenLDAP extensions */
0527 #define SLAPI_X_CONN_CLIENTPATH         1300
0528 #define SLAPI_X_CONN_SERVERPATH         1301
0529 #define SLAPI_X_CONN_IS_UDP         1302
0530 #define SLAPI_X_CONN_SSF            1303
0531 #define SLAPI_X_CONN_SASL_CONTEXT       1304
0532 #define SLAPI_X_OPERATION_DELETE_GLUE_PARENT    1305
0533 #define SLAPI_X_RELAX           1306
0534 #define SLAPI_X_MANAGEDIT           SLAPI_X_RELAX
0535 #define SLAPI_X_OPERATION_NO_SCHEMA_CHECK   1307
0536 #define SLAPI_X_ADD_STRUCTURAL_CLASS        1308
0537 #define SLAPI_X_OPERATION_NO_SUBORDINATE_GLUE   1309
0538 
0539 /*  Authentication types */
0540 #define SLAPD_AUTH_NONE   "none"
0541 #define SLAPD_AUTH_SIMPLE "simple"
0542 #define SLAPD_AUTH_SSL    "SSL"
0543 #define SLAPD_AUTH_SASL   "SASL " 
0544 
0545 /* plugin configuration parmams */
0546 #define SLAPI_PLUGIN                3
0547 #define SLAPI_PLUGIN_PRIVATE            4
0548 #define SLAPI_PLUGIN_TYPE           5
0549 #define SLAPI_PLUGIN_ARGV           6
0550 #define SLAPI_PLUGIN_ARGC           7
0551 #define SLAPI_PLUGIN_VERSION            8
0552 #define SLAPI_PLUGIN_OPRETURN           9
0553 #define SLAPI_PLUGIN_OBJECT         10
0554 #define SLAPI_PLUGIN_DESTROY_FN         11
0555 #define SLAPI_PLUGIN_DESCRIPTION        12
0556 #define SLAPI_PLUGIN_IDENTITY           13
0557 
0558 /* internal operations params */
0559 #define SLAPI_PLUGIN_INTOP_RESULT       15
0560 #define SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES   16
0561 #define SLAPI_PLUGIN_INTOP_SEARCH_REFERRALS 17
0562 
0563 /* transaction arguments */
0564 #define SLAPI_PARENT_TXN            190
0565 #define SLAPI_TXN               191
0566 
0567 /* function pointer params for backends */
0568 #define SLAPI_PLUGIN_DB_BIND_FN         200
0569 #define SLAPI_PLUGIN_DB_UNBIND_FN       201
0570 #define SLAPI_PLUGIN_DB_SEARCH_FN       202
0571 #define SLAPI_PLUGIN_DB_COMPARE_FN      203
0572 #define SLAPI_PLUGIN_DB_MODIFY_FN       204
0573 #define SLAPI_PLUGIN_DB_MODRDN_FN       205
0574 #define SLAPI_PLUGIN_DB_ADD_FN          206
0575 #define SLAPI_PLUGIN_DB_DELETE_FN       207
0576 #define SLAPI_PLUGIN_DB_ABANDON_FN      208
0577 #define SLAPI_PLUGIN_DB_CONFIG_FN       209
0578 #define SLAPI_PLUGIN_CLOSE_FN           210
0579 #define SLAPI_PLUGIN_DB_FLUSH_FN        211
0580 #define SLAPI_PLUGIN_START_FN           212
0581 #define SLAPI_PLUGIN_DB_SEQ_FN          213
0582 #define SLAPI_PLUGIN_DB_ENTRY_FN        214
0583 #define SLAPI_PLUGIN_DB_REFERRAL_FN     215
0584 #define SLAPI_PLUGIN_DB_RESULT_FN       216
0585 #define SLAPI_PLUGIN_DB_LDIF2DB_FN      217
0586 #define SLAPI_PLUGIN_DB_DB2LDIF_FN      218
0587 #define SLAPI_PLUGIN_DB_BEGIN_FN        219
0588 #define SLAPI_PLUGIN_DB_COMMIT_FN       220
0589 #define SLAPI_PLUGIN_DB_ABORT_FN        221
0590 #define SLAPI_PLUGIN_DB_ARCHIVE2DB_FN       222
0591 #define SLAPI_PLUGIN_DB_DB2ARCHIVE_FN       223
0592 #define SLAPI_PLUGIN_DB_NEXT_SEARCH_ENTRY_FN    224
0593 #define SLAPI_PLUGIN_DB_FREE_RESULT_SET_FN  225
0594 #define SLAPI_PLUGIN_DB_SIZE_FN         226
0595 #define SLAPI_PLUGIN_DB_TEST_FN         227
0596 
0597 
0598 /*  functions pointers for LDAP V3 extended ops */
0599 #define SLAPI_PLUGIN_EXT_OP_FN          300
0600 #define SLAPI_PLUGIN_EXT_OP_OIDLIST     301
0601 
0602 /* preoperation */
0603 #define SLAPI_PLUGIN_PRE_BIND_FN        401
0604 #define SLAPI_PLUGIN_PRE_UNBIND_FN      402
0605 #define SLAPI_PLUGIN_PRE_SEARCH_FN      403
0606 #define SLAPI_PLUGIN_PRE_COMPARE_FN     404
0607 #define SLAPI_PLUGIN_PRE_MODIFY_FN      405
0608 #define SLAPI_PLUGIN_PRE_MODRDN_FN      406
0609 #define SLAPI_PLUGIN_PRE_ADD_FN         407
0610 #define SLAPI_PLUGIN_PRE_DELETE_FN      408
0611 #define SLAPI_PLUGIN_PRE_ABANDON_FN     409
0612 #define SLAPI_PLUGIN_PRE_ENTRY_FN       410
0613 #define SLAPI_PLUGIN_PRE_REFERRAL_FN        411
0614 #define SLAPI_PLUGIN_PRE_RESULT_FN      412
0615 
0616 /* internal preoperation */
0617 #define SLAPI_PLUGIN_INTERNAL_PRE_ADD_FN    420
0618 #define SLAPI_PLUGIN_INTERNAL_PRE_MODIFY_FN 421
0619 #define SLAPI_PLUGIN_INTERNAL_PRE_MODRDN_FN 422
0620 #define SLAPI_PLUGIN_INTERNAL_PRE_DELETE_FN 423
0621 
0622 /* backend preoperation */
0623 #define SLAPI_PLUGIN_BE_PRE_ADD_FN      450
0624 #define SLAPI_PLUGIN_BE_PRE_MODIFY_FN       451
0625 #define SLAPI_PLUGIN_BE_PRE_MODRDN_FN       452
0626 #define SLAPI_PLUGIN_BE_PRE_DELETE_FN       453
0627 
0628 /* postoperation */
0629 #define SLAPI_PLUGIN_POST_BIND_FN       501
0630 #define SLAPI_PLUGIN_POST_UNBIND_FN     502
0631 #define SLAPI_PLUGIN_POST_SEARCH_FN     503
0632 #define SLAPI_PLUGIN_POST_COMPARE_FN        504
0633 #define SLAPI_PLUGIN_POST_MODIFY_FN     505
0634 #define SLAPI_PLUGIN_POST_MODRDN_FN     506
0635 #define SLAPI_PLUGIN_POST_ADD_FN        507
0636 #define SLAPI_PLUGIN_POST_DELETE_FN     508
0637 #define SLAPI_PLUGIN_POST_ABANDON_FN        509
0638 #define SLAPI_PLUGIN_POST_ENTRY_FN      510
0639 #define SLAPI_PLUGIN_POST_REFERRAL_FN       511
0640 #define SLAPI_PLUGIN_POST_RESULT_FN     512
0641 
0642 /* internal postoperation */
0643 #define SLAPI_PLUGIN_INTERNAL_POST_ADD_FN   520
0644 #define SLAPI_PLUGIN_INTERNAL_POST_MODIFY_FN    521
0645 #define SLAPI_PLUGIN_INTERNAL_POST_MODRDN_FN    522
0646 #define SLAPI_PLUGIN_INTERNAL_POST_DELETE_FN    523
0647 
0648 /* backend postoperation */
0649 #define SLAPI_PLUGIN_BE_POST_ADD_FN     550
0650 #define SLAPI_PLUGIN_BE_POST_MODIFY_FN      551
0651 #define SLAPI_PLUGIN_BE_POST_MODRDN_FN      552
0652 #define SLAPI_PLUGIN_BE_POST_DELETE_FN      553
0653 
0654 #define SLAPI_OPERATION_TYPE            590
0655 #define SLAPI_OPERATION_MSGID           591
0656 
0657 #define SLAPI_PLUGIN_MR_FILTER_CREATE_FN    600
0658 #define SLAPI_PLUGIN_MR_INDEXER_CREATE_FN   601
0659 #define SLAPI_PLUGIN_MR_FILTER_MATCH_FN     602
0660 #define SLAPI_PLUGIN_MR_FILTER_INDEX_FN     603
0661 #define SLAPI_PLUGIN_MR_FILTER_RESET_FN     604
0662 #define SLAPI_PLUGIN_MR_INDEX_FN        605
0663 #define SLAPI_PLUGIN_MR_OID         610
0664 #define SLAPI_PLUGIN_MR_TYPE            611
0665 #define SLAPI_PLUGIN_MR_VALUE           612
0666 #define SLAPI_PLUGIN_MR_VALUES          613
0667 #define SLAPI_PLUGIN_MR_KEYS            614
0668 #define SLAPI_PLUGIN_MR_FILTER_REUSABLE     615
0669 #define SLAPI_PLUGIN_MR_QUERY_OPERATOR      616
0670 #define SLAPI_PLUGIN_MR_USAGE           617
0671 
0672 #define SLAPI_MATCHINGRULE_NAME         1
0673 #define SLAPI_MATCHINGRULE_OID          2
0674 #define SLAPI_MATCHINGRULE_DESC         3
0675 #define SLAPI_MATCHINGRULE_SYNTAX       4
0676 #define SLAPI_MATCHINGRULE_OBSOLETE     5
0677 
0678 #define SLAPI_OP_LESS                   1
0679 #define SLAPI_OP_LESS_OR_EQUAL              2
0680 #define SLAPI_OP_EQUAL                  3
0681 #define SLAPI_OP_GREATER_OR_EQUAL           4
0682 #define SLAPI_OP_GREATER                5
0683 #define SLAPI_OP_SUBSTRING              6
0684 
0685 #define SLAPI_PLUGIN_MR_USAGE_INDEX     0
0686 #define SLAPI_PLUGIN_MR_USAGE_SORT      1
0687 
0688 #define SLAPI_PLUGIN_SYNTAX_FILTER_AVA      700
0689 #define SLAPI_PLUGIN_SYNTAX_FILTER_SUB      701
0690 #define SLAPI_PLUGIN_SYNTAX_VALUES2KEYS     702
0691 #define SLAPI_PLUGIN_SYNTAX_ASSERTION2KEYS_AVA  703
0692 #define SLAPI_PLUGIN_SYNTAX_ASSERTION2KEYS_SUB  704
0693 #define SLAPI_PLUGIN_SYNTAX_NAMES       705
0694 #define SLAPI_PLUGIN_SYNTAX_OID         706
0695 #define SLAPI_PLUGIN_SYNTAX_FLAGS       707
0696 #define SLAPI_PLUGIN_SYNTAX_COMPARE     708
0697 
0698 #define SLAPI_PLUGIN_SYNTAX_FLAG_ORKEYS         1
0699 #define SLAPI_PLUGIN_SYNTAX_FLAG_ORDERING       2
0700 
0701 #define SLAPI_PLUGIN_ACL_INIT           730
0702 #define SLAPI_PLUGIN_ACL_SYNTAX_CHECK       731
0703 #define SLAPI_PLUGIN_ACL_ALLOW_ACCESS       732
0704 #define SLAPI_PLUGIN_ACL_MODS_ALLOWED       733
0705 #define SLAPI_PLUGIN_ACL_MODS_UPDATE        734
0706 
0707 #define SLAPI_OPERATION_AUTHTYPE                741
0708 #define SLAPI_OPERATION_ID                      742
0709 #define SLAPI_CONN_CERT                         743
0710 #define SLAPI_CONN_AUTHMETHOD                   746
0711 #define SLAPI_IS_INTERNAL_OPERATION         748
0712 
0713 #define SLAPI_RESULT_CODE                       881
0714 #define SLAPI_RESULT_TEXT                       882
0715 #define SLAPI_RESULT_MATCHED                    883
0716 
0717 /* managedsait control */
0718 #define SLAPI_MANAGEDSAIT               1000
0719 
0720 /* audit plugin defines */
0721 #define SLAPI_PLUGIN_AUDIT_DATA                1100
0722 #define SLAPI_PLUGIN_AUDIT_FN                  1101
0723 
0724 /* backend_group extension */
0725 #define SLAPI_X_PLUGIN_PRE_GROUP_FN     1202 
0726 #define SLAPI_X_PLUGIN_POST_GROUP_FN        1203
0727 
0728 #define SLAPI_X_GROUP_ENTRY         1250 /* group entry */
0729 #define SLAPI_X_GROUP_ATTRIBUTE         1251 /* member attribute */
0730 #define SLAPI_X_GROUP_OPERATION_DN      1252 /* asserted value */
0731 #define SLAPI_X_GROUP_TARGET_ENTRY      1253 /* target entry */
0732 
0733 /* internal preoperation extensions */
0734 #define SLAPI_PLUGIN_INTERNAL_PRE_BIND_FN   1260
0735 #define SLAPI_PLUGIN_INTERNAL_PRE_UNBIND_FN 1261
0736 #define SLAPI_PLUGIN_INTERNAL_PRE_SEARCH_FN 1262
0737 #define SLAPI_PLUGIN_INTERNAL_PRE_COMPARE_FN    1263
0738 #define SLAPI_PLUGIN_INTERNAL_PRE_ABANDON_FN    1264
0739 
0740 /* internal postoperation extensions */
0741 #define SLAPI_PLUGIN_INTERNAL_POST_BIND_FN  1270
0742 #define SLAPI_PLUGIN_INTERNAL_POST_UNBIND_FN    1271
0743 #define SLAPI_PLUGIN_INTERNAL_POST_SEARCH_FN    1272
0744 #define SLAPI_PLUGIN_INTERNAL_POST_COMPARE_FN   1273
0745 #define SLAPI_PLUGIN_INTERNAL_POST_ABANDON_FN   1274
0746 
0747 /* config stuff */
0748 #define SLAPI_CONFIG_FILENAME           40
0749 #define SLAPI_CONFIG_LINENO         41
0750 #define SLAPI_CONFIG_ARGC           42
0751 #define SLAPI_CONFIG_ARGV           43
0752 
0753 /*  operational params */
0754 #define SLAPI_TARGET_ADDRESS            48
0755 #define SLAPI_TARGET_UNIQUEID           49
0756 #define SLAPI_TARGET_DN             50
0757 
0758 /* server LDAPv3 controls  */
0759 #define SLAPI_REQCONTROLS           51
0760 #define SLAPI_RESCONTROLS           55
0761 #define SLAPI_ADD_RESCONTROL            56  
0762 #define SLAPI_CONTROLS_ARG          58
0763 
0764 /* add params */
0765 #define SLAPI_ADD_TARGET            SLAPI_TARGET_DN
0766 #define SLAPI_ADD_ENTRY             60
0767 #define SLAPI_ADD_EXISTING_DN_ENTRY     61
0768 #define SLAPI_ADD_PARENT_ENTRY          62
0769 #define SLAPI_ADD_PARENT_UNIQUEID       63
0770 #define SLAPI_ADD_EXISTING_UNIQUEID_ENTRY   64
0771 
0772 /* bind params */
0773 #define SLAPI_BIND_TARGET           SLAPI_TARGET_DN
0774 #define SLAPI_BIND_METHOD           70
0775 #define SLAPI_BIND_CREDENTIALS          71  
0776 #define SLAPI_BIND_SASLMECHANISM        72  
0777 #define SLAPI_BIND_RET_SASLCREDS        73  
0778 
0779 /* compare params */
0780 #define SLAPI_COMPARE_TARGET            SLAPI_TARGET_DN
0781 #define SLAPI_COMPARE_TYPE          80
0782 #define SLAPI_COMPARE_VALUE         81
0783 
0784 /* delete params */
0785 #define SLAPI_DELETE_TARGET         SLAPI_TARGET_DN
0786 #define SLAPI_DELETE_EXISTING_ENTRY     SLAPI_ADD_EXISTING_DN_ENTRY
0787 
0788 /* modify params */
0789 #define SLAPI_MODIFY_TARGET         SLAPI_TARGET_DN
0790 #define SLAPI_MODIFY_MODS           90
0791 #define SLAPI_MODIFY_EXISTING_ENTRY     SLAPI_ADD_EXISTING_DN_ENTRY
0792 
0793 /* modrdn params */
0794 #define SLAPI_MODRDN_TARGET         SLAPI_TARGET_DN
0795 #define SLAPI_MODRDN_NEWRDN         100
0796 #define SLAPI_MODRDN_DELOLDRDN          101
0797 #define SLAPI_MODRDN_NEWSUPERIOR        102 /* v3 only */
0798 #define SLAPI_MODRDN_EXISTING_ENTRY             SLAPI_ADD_EXISTING_DN_ENTRY
0799 #define SLAPI_MODRDN_PARENT_ENTRY       104
0800 #define SLAPI_MODRDN_NEWPARENT_ENTRY        105
0801 #define SLAPI_MODRDN_TARGET_ENTRY       106
0802 #define SLAPI_MODRDN_NEWSUPERIOR_ADDRESS    107
0803 
0804 /* search params */
0805 #define SLAPI_SEARCH_TARGET         SLAPI_TARGET_DN
0806 #define SLAPI_SEARCH_SCOPE          110
0807 #define SLAPI_SEARCH_DEREF          111
0808 #define SLAPI_SEARCH_SIZELIMIT          112
0809 #define SLAPI_SEARCH_TIMELIMIT          113
0810 #define SLAPI_SEARCH_FILTER         114
0811 #define SLAPI_SEARCH_STRFILTER          115
0812 #define SLAPI_SEARCH_ATTRS          116
0813 #define SLAPI_SEARCH_ATTRSONLY          117
0814 
0815 /* abandon params */
0816 #define SLAPI_ABANDON_MSGID         120
0817 
0818 /* extended operation params */
0819 #define SLAPI_EXT_OP_REQ_OID            160
0820 #define SLAPI_EXT_OP_REQ_VALUE      161 
0821 
0822 /* extended operation return codes */
0823 #define SLAPI_EXT_OP_RET_OID            162 
0824 #define SLAPI_EXT_OP_RET_VALUE      163 
0825 
0826 #define SLAPI_PLUGIN_EXTENDED_SENT_RESULT   -1
0827 
0828 #define SLAPI_FAIL_DISKFULL     -2
0829 #define SLAPI_FAIL_GENERAL      -1
0830 #define SLAPI_PLUGIN_EXTENDED_NOT_HANDLED -2
0831 #define SLAPI_BIND_SUCCESS      0
0832 #define SLAPI_BIND_FAIL         2
0833 #define SLAPI_BIND_ANONYMOUS        3
0834 
0835 /* Search result params */
0836 #define SLAPI_SEARCH_RESULT_SET         193
0837 #define SLAPI_SEARCH_RESULT_ENTRY       194
0838 #define SLAPI_NENTRIES              195
0839 #define SLAPI_SEARCH_REFERRALS          196
0840 
0841 /* filter types */
0842 #ifndef LDAP_FILTER_AND
0843 #define LDAP_FILTER_AND         0xa0L
0844 #endif
0845 #ifndef LDAP_FILTER_OR
0846 #define LDAP_FILTER_OR          0xa1L
0847 #endif
0848 #ifndef LDAP_FILTER_NOT
0849 #define LDAP_FILTER_NOT         0xa2L
0850 #endif
0851 #ifndef LDAP_FILTER_EQUALITY
0852 #define LDAP_FILTER_EQUALITY    0xa3L
0853 #endif
0854 #ifndef LDAP_FILTER_SUBSTRINGS
0855 #define LDAP_FILTER_SUBSTRINGS  0xa4L
0856 #endif
0857 #ifndef LDAP_FILTER_GE
0858 #define LDAP_FILTER_GE          0xa5L
0859 #endif
0860 #ifndef LDAP_FILTER_LE
0861 #define LDAP_FILTER_LE          0xa6L
0862 #endif
0863 #ifndef LDAP_FILTER_PRESENT
0864 #define LDAP_FILTER_PRESENT     0x87L
0865 #endif
0866 #ifndef LDAP_FILTER_APPROX
0867 #define LDAP_FILTER_APPROX      0xa8L
0868 #endif
0869 #ifndef LDAP_FILTER_EXT_MATCH
0870 #define LDAP_FILTER_EXT_MATCH   0xa9L
0871 #endif
0872 
0873 int slapi_log_error( int severity, char *subsystem, char *fmt, ... );
0874 #define SLAPI_LOG_FATAL                 0
0875 #define SLAPI_LOG_TRACE                 1
0876 #define SLAPI_LOG_PACKETS               2
0877 #define SLAPI_LOG_ARGS                  3
0878 #define SLAPI_LOG_CONNS                 4
0879 #define SLAPI_LOG_BER                   5
0880 #define SLAPI_LOG_FILTER                6
0881 #define SLAPI_LOG_CONFIG                7
0882 #define SLAPI_LOG_ACL                   8
0883 #define SLAPI_LOG_SHELL                 9
0884 #define SLAPI_LOG_PARSE                 10
0885 #define SLAPI_LOG_HOUSE                 11
0886 #define SLAPI_LOG_REPL                  12
0887 #define SLAPI_LOG_CACHE                 13
0888 #define SLAPI_LOG_PLUGIN                14
0889 #define SLAPI_LOG_TIMING                15
0890 
0891 #define SLAPI_PLUGIN_DESCRIPTION    12
0892 typedef struct slapi_plugindesc {
0893         char    *spd_id;
0894         char    *spd_vendor;
0895         char    *spd_version;
0896         char    *spd_description;
0897 } Slapi_PluginDesc;
0898 
0899 #define SLAPI_PLUGIN_VERSION_01         "01"
0900 #define SLAPI_PLUGIN_VERSION_02         "02"
0901 #define SLAPI_PLUGIN_VERSION_03         "03"
0902 #define SLAPI_PLUGIN_CURRENT_VERSION    SLAPI_PLUGIN_VERSION_03
0903 
0904 #endif /* _SLAPI_PLUGIN_H */
0905