X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fslapi-plugin.h;h=b3589058f2b6a441e4ab567ad74f8b279e38aa6d;hb=de01a6e3d791d3458549d2ceeccf4d7e0477ff78;hp=4dcab395fbfa7120594129f60192f5af5b8e8002;hpb=ac93f86303c541d7ca7493ac92ee4439e148dde4;p=openldap diff --git a/include/slapi-plugin.h b/include/slapi-plugin.h index 4dcab395fb..b3589058f2 100644 --- a/include/slapi-plugin.h +++ b/include/slapi-plugin.h @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2005 The OpenLDAP Foundation. + * Copyright 1998-2007 The OpenLDAP Foundation. * Portions Copyright 1997,2002,2003 IBM Corporation. * All rights reserved. * @@ -79,6 +79,7 @@ char *slapi_dn_normalize( char *dn ); char *slapi_dn_normalize_case( char *dn ); int slapi_dn_issuffix( char *dn, char *suffix ); char *slapi_dn_beparent( Slapi_PBlock *pb, const char *dn ); +int slapi_dn_isbesuffix( Slapi_PBlock *pb, char *dn ); char *slapi_dn_parent( const char *dn ); int slapi_dn_isparent( const char *parentdn, const char *childdn ); char *slapi_dn_ignore_case( char *dn ); @@ -144,7 +145,7 @@ Slapi_Value *slapi_value_new_value(const Slapi_Value *v); Slapi_Value *slapi_value_new_string(const char *s); Slapi_Value *slapi_value_init(Slapi_Value *v); Slapi_Value *slapi_value_init_berval(Slapi_Value *v, struct berval *bval); -Slapi_Value *slapi_value_init_string(Slapi_Value *v,const char *s); +Slapi_Value *slapi_value_init_string(Slapi_Value *v, const char *s); Slapi_Value *slapi_value_dup(const Slapi_Value *v); void slapi_value_free(Slapi_Value **value); const struct berval *slapi_value_get_berval( const Slapi_Value *value ); @@ -159,7 +160,7 @@ unsigned int slapi_value_get_uint(const Slapi_Value *value); long slapi_value_get_long(const Slapi_Value *value); unsigned long slapi_value_get_ulong(const Slapi_Value *value); size_t slapi_value_get_length(const Slapi_Value *value); -int slapi_value_compare(const Slapi_Attr *a,const Slapi_Value *v1,const Slapi_Value *v2); +int slapi_value_compare(const Slapi_Attr *a, const Slapi_Value *v1, const Slapi_Value *v2); Slapi_ValueSet *slapi_valueset_new( void ); void slapi_valueset_free(Slapi_ValueSet *vs); @@ -171,6 +172,70 @@ int slapi_valueset_next_value( Slapi_ValueSet *vs, int index, Slapi_Value **v); int slapi_valueset_count( const Slapi_ValueSet *vs); void slapi_valueset_set_valueset(Slapi_ValueSet *vs1, const Slapi_ValueSet *vs2); +/* DNs */ +Slapi_DN *slapi_sdn_new( void ); +Slapi_DN *slapi_sdn_new_dn_byval( const char *dn ); +Slapi_DN *slapi_sdn_new_ndn_byval( const char *ndn ); +Slapi_DN *slapi_sdn_new_dn_byref( const char *dn ); +Slapi_DN *slapi_sdn_new_ndn_byref( const char *ndn ); +Slapi_DN *slapi_sdn_new_dn_passin( const char *dn ); +Slapi_DN *slapi_sdn_set_dn_byval( Slapi_DN *sdn, const char *dn ); +Slapi_DN *slapi_sdn_set_dn_byref( Slapi_DN *sdn, const char *dn ); +Slapi_DN *slapi_sdn_set_dn_passin( Slapi_DN *sdn, const char *dn ); +Slapi_DN *slapi_sdn_set_ndn_byval( Slapi_DN *sdn, const char *ndn ); +Slapi_DN *slapi_sdn_set_ndn_byref( Slapi_DN *sdn, const char *ndn ); +void slapi_sdn_done( Slapi_DN *sdn ); +void slapi_sdn_free( Slapi_DN **sdn ); +const char * slapi_sdn_get_dn( const Slapi_DN *sdn ); +const char * slapi_sdn_get_ndn( const Slapi_DN *sdn ); +void slapi_sdn_get_parent( const Slapi_DN *sdn,Slapi_DN *sdn_parent ); +void slapi_sdn_get_backend_parent( const Slapi_DN *sdn, Slapi_DN *sdn_parent, const Slapi_Backend *backend ); +Slapi_DN * slapi_sdn_dup( const Slapi_DN *sdn ); +void slapi_sdn_copy( const Slapi_DN *from, Slapi_DN *to ); +int slapi_sdn_compare( const Slapi_DN *sdn1, const Slapi_DN *sdn2 ); +int slapi_sdn_isempty( const Slapi_DN *sdn ); +int slapi_sdn_issuffix(const Slapi_DN *sdn, const Slapi_DN *suffixsdn ); +int slapi_sdn_isparent( const Slapi_DN *parent, const Slapi_DN *child ); +int slapi_sdn_isgrandparent( const Slapi_DN *parent, const Slapi_DN *child ); +int slapi_sdn_get_ndn_len( const Slapi_DN *sdn ); +int slapi_sdn_scope_test( const Slapi_DN *dn, const Slapi_DN *base, int scope ); +void slapi_sdn_get_rdn( const Slapi_DN *sdn,Slapi_RDN *rdn ); +Slapi_DN *slapi_sdn_set_rdn( Slapi_DN *sdn, const Slapi_RDN *rdn ); +Slapi_DN *slapi_sdn_set_parent( Slapi_DN *sdn, const Slapi_DN *parentdn ); +int slapi_sdn_is_rdn_component( const Slapi_DN *rdn, const Slapi_Attr *a, const Slapi_Value *v ); +char * slapi_moddn_get_newdn( Slapi_DN *dn_olddn, char *newrdn, char *newsuperiordn ); + +/* RDNs */ +Slapi_RDN *slapi_rdn_new( void ); +Slapi_RDN *slapi_rdn_new_dn( const char *dn ); +Slapi_RDN *slapi_rdn_new_sdn( const Slapi_DN *sdn ); +Slapi_RDN *slapi_rdn_new_rdn( const Slapi_RDN *fromrdn ); +void slapi_rdn_init( Slapi_RDN *rdn ); +void slapi_rdn_init_dn( Slapi_RDN *rdn, const char *dn ); +void slapi_rdn_init_sdn( Slapi_RDN *rdn, const Slapi_DN *sdn ); +void slapi_rdn_init_rdn( Slapi_RDN *rdn, const Slapi_RDN *fromrdn ); +void slapi_rdn_set_dn( Slapi_RDN *rdn, const char *dn ); +void slapi_rdn_set_sdn( Slapi_RDN *rdn, const Slapi_DN *sdn ); +void slapi_rdn_set_rdn( Slapi_RDN *rdn, const Slapi_RDN *fromrdn ); +void slapi_rdn_free( Slapi_RDN **rdn ); +void slapi_rdn_done( Slapi_RDN *rdn ); +int slapi_rdn_get_first( Slapi_RDN *rdn, char **type, char **value ); +int slapi_rdn_get_next( Slapi_RDN *rdn, int index, char **type, char **value ); +int slapi_rdn_get_index( Slapi_RDN *rdn, const char *type, const char *value, size_t length ); +int slapi_rdn_get_index_attr( Slapi_RDN *rdn, const char *type, char **value ); +int slapi_rdn_contains( Slapi_RDN *rdn, const char *type, const char *value,size_t length ); +int slapi_rdn_contains_attr( Slapi_RDN *rdn, const char *type, char **value ); +int slapi_rdn_add( Slapi_RDN *rdn, const char *type, const char *value ); +int slapi_rdn_remove_index( Slapi_RDN *rdn, int atindex ); +int slapi_rdn_remove( Slapi_RDN *rdn, const char *type, const char *value, size_t length ); +int slapi_rdn_remove_attr( Slapi_RDN *rdn, const char *type ); +int slapi_rdn_isempty( const Slapi_RDN *rdn ); +int slapi_rdn_get_num_components( Slapi_RDN *rdn ); +int slapi_rdn_compare( Slapi_RDN *rdn1, Slapi_RDN *rdn2 ); +const char *slapi_rdn_get_rdn( const Slapi_RDN *rdn ); +const char *slapi_rdn_get_nrdn( const Slapi_RDN *rdn ); +Slapi_DN *slapi_sdn_add_rdn( Slapi_DN *sdn, const Slapi_RDN *rdn ); + /* locks and synchronization */ typedef struct slapi_mutex Slapi_Mutex; typedef struct slapi_condvar Slapi_CondVar; @@ -192,7 +257,7 @@ void slapi_ch_free( void **ptr ); void slapi_ch_free_string( char **ptr ); char *slapi_ch_calloc( unsigned long nelem, unsigned long size ); char *slapi_ch_realloc( char *block, unsigned long size ); -char *slapi_ch_strdup( char *s ); +char *slapi_ch_strdup( const char *s ); void slapi_ch_array_free( char **arrayp ); struct berval *slapi_ch_bvdup(const struct berval *v); struct berval **slapi_ch_bvecdup(const struct berval **v); @@ -221,6 +286,13 @@ void slapi_register_supported_saslmechanism(char *mechanism); char **slapi_get_supported_saslmechanisms(); char **slapi_get_supported_extended_ops(void); +/* operation */ +int slapi_op_abandoned( Slapi_PBlock *pb ); +unsigned long slapi_op_get_type(Slapi_Operation * op); +void slapi_operation_set_flag(Slapi_Operation *op, unsigned long flag); +void slapi_operation_clear_flag(Slapi_Operation *op, unsigned long flag); +int slapi_operation_is_flag_set(Slapi_Operation *op, unsigned long flag); +char *slapi_op_type_to_string(unsigned long type); /* send ldap result back */ void slapi_send_ldap_result( Slapi_PBlock *pb, int err, char *matched, @@ -283,7 +355,6 @@ typedef int (*plugin_search_entry_callback)( Slapi_Entry *e, void *callback_data ); void slapi_free_search_results_internal( Slapi_PBlock *pb ); -#define SLAPI_OP_FLAG_LOG_CHANGE 0x0001 #define SLAPI_OP_FLAG_NEVER_CHAIN 0x0800 int slapi_search_internal_pb( Slapi_PBlock *pb ); @@ -340,6 +411,12 @@ int compute_rewrite_search_filter(Slapi_PBlock *pb); int compute_evaluator(computed_attr_context *c, char *type, Slapi_Entry *e, slapi_compute_output_t outputfn); int slapi_x_compute_get_pblock(computed_attr_context *c, Slapi_PBlock **pb); +/* backend routines */ +void slapi_be_set_readonly( Slapi_Backend *be, int readonly ); +int slapi_be_get_readonly( Slapi_Backend *be ); +const char *slapi_x_be_get_updatedn( Slapi_Backend *be ); +Slapi_Backend *slapi_be_select( const Slapi_DN *sdn ); + /* ACL plugins; only SLAPI_PLUGIN_ACL_ALLOW_ACCESS supported now */ typedef int (*slapi_acl_callback_t)(Slapi_PBlock *pb, Slapi_Entry *e, @@ -436,7 +513,8 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags ); /* operation params */ #define SLAPI_OPINITIATED_TIME 140 #define SLAPI_REQUESTOR_DN 141 -#define SLAPI_REQUESTOR_ISUPDATEDN 142 +#define SLAPI_IS_REPLICATED_OPERATION 142 +#define SLAPI_REQUESTOR_ISUPDATEDN SLAPI_IS_REPLICATED_OPERATION /* connection structure params*/ #define SLAPI_CONN_DN 143 @@ -449,6 +527,12 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags ); #define SLAPI_X_CONN_IS_UDP 1302 #define SLAPI_X_CONN_SSF 1303 #define SLAPI_X_CONN_SASL_CONTEXT 1304 +#define SLAPI_X_OPERATION_DELETE_GLUE_PARENT 1305 +#define SLAPI_X_RELAX 1306 +#define SLAPI_X_MANAGEDIT SLAPI_X_RELAX +#define SLAPI_X_OPERATION_NO_SCHEMA_CHECK 1307 +#define SLAPI_X_ADD_STRUCTURAL_CLASS 1308 +#define SLAPI_X_OPERATION_NO_SUBORDINATE_GLUE 1309 /* Authentication types */ #define SLAPD_AUTH_NONE "none" @@ -474,6 +558,10 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags ); #define SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES 16 #define SLAPI_PLUGIN_INTOP_SEARCH_REFERRALS 17 +/* transaction arguments */ +#define SLAPI_PARENT_TXN 190 +#define SLAPI_TXN 191 + /* function pointer params for backends */ #define SLAPI_PLUGIN_DB_BIND_FN 200 #define SLAPI_PLUGIN_DB_UNBIND_FN 201 @@ -562,6 +650,7 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags ); #define SLAPI_PLUGIN_BE_POST_DELETE_FN 553 #define SLAPI_OPERATION_TYPE 590 +#define SLAPI_OPERATION_MSGID 591 #define SLAPI_PLUGIN_MR_FILTER_CREATE_FN 600 #define SLAPI_PLUGIN_MR_INDEXER_CREATE_FN 601 @@ -617,6 +706,7 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags ); #define SLAPI_OPERATION_ID 742 #define SLAPI_CONN_CERT 743 #define SLAPI_CONN_AUTHMETHOD 746 +#define SLAPI_IS_INTERNAL_OPERATION 748 #define SLAPI_RESULT_CODE 881 #define SLAPI_RESULT_TEXT 882 @@ -638,6 +728,20 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags ); #define SLAPI_X_GROUP_OPERATION_DN 1252 /* asserted value */ #define SLAPI_X_GROUP_TARGET_ENTRY 1253 /* target entry */ +/* internal preoperation extensions */ +#define SLAPI_PLUGIN_INTERNAL_PRE_BIND_FN 1260 +#define SLAPI_PLUGIN_INTERNAL_PRE_UNBIND_FN 1261 +#define SLAPI_PLUGIN_INTERNAL_PRE_SEARCH_FN 1262 +#define SLAPI_PLUGIN_INTERNAL_PRE_COMPARE_FN 1263 +#define SLAPI_PLUGIN_INTERNAL_PRE_ABANDON_FN 1264 + +/* internal postoperation extensions */ +#define SLAPI_PLUGIN_INTERNAL_POST_BIND_FN 1270 +#define SLAPI_PLUGIN_INTERNAL_POST_UNBIND_FN 1271 +#define SLAPI_PLUGIN_INTERNAL_POST_SEARCH_FN 1272 +#define SLAPI_PLUGIN_INTERNAL_POST_COMPARE_FN 1273 +#define SLAPI_PLUGIN_INTERNAL_POST_ABANDON_FN 1274 + /* config stuff */ #define SLAPI_CONFIG_FILENAME 40 #define SLAPI_CONFIG_LINENO 41 @@ -648,11 +752,12 @@ int slapi_x_backend_get_flags( const Slapi_Backend *be, unsigned long *flags ); #define SLAPI_TARGET_ADDRESS 48 #define SLAPI_TARGET_UNIQUEID 49 #define SLAPI_TARGET_DN 50 -#define SLAPI_REQCONTROLS 51 /* server LDAPv3 controls */ +#define SLAPI_REQCONTROLS 51 #define SLAPI_RESCONTROLS 55 #define SLAPI_ADD_RESCONTROL 56 +#define SLAPI_CONTROLS_ARG 58 /* add params */ #define SLAPI_ADD_TARGET SLAPI_TARGET_DN