Back to index

openldap  2.4.31
slapi.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 2002-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 the file LICENSE in the
00013  * top-level directory of the distribution or, alternatively, at
00014  * <http://www.OpenLDAP.org/license.html>.
00015  */
00016 /* ACKNOWLEDGEMENTS:
00017  * This work was initially developed by IBM Corporation for use in
00018  * IBM products and subsequently ported to OpenLDAP Software by
00019  * Steve Omrani.  Additional significant contributors include:
00020  *   Luke Howard
00021  */
00022 
00023 #ifdef LDAP_SLAPI /* SLAPI is OPTIONAL */
00024 
00025 #ifndef _SLAPI_H
00026 #define _SLAPI_H
00027 
00028 LDAP_BEGIN_DECL
00029 
00030 /*
00031  * Quick 'n' dirty to make struct slapi_* in slapi-plugin.h opaque
00032  */
00033 #define slapi_entry  Entry
00034 #define slapi_attr   Attribute
00035 #define slapi_value  berval
00036 #define slapi_valueset      berval *
00037 #define slapi_filter Filter
00038 
00039 LDAP_END_DECL
00040 
00041 #include <slapi-plugin.h>
00042 
00043 LDAP_BEGIN_DECL
00044 
00045 #define SLAPI_OVERLAY_NAME                "slapi"
00046 
00047 #define SLAPI_OPERATION_PBLOCK(_op)              ((_op)->o_callback->sc_private)
00048 #define SLAPI_BACKEND_PBLOCK(_be)         ((_be)->be_pb)
00049 
00050 #define SLAPI_OPERATION_EXTENSIONS(_op)          ((_op)->o_hdr->oh_extensions)
00051 #define SLAPI_CONNECTION_EXTENSIONS(_conn)       ((_conn)->c_extensions)
00052 
00053 #define SLAPI_CONTROL_MANAGEDSAIT_OID            LDAP_CONTROL_MANAGEDSAIT
00054 #define SLAPI_CONTROL_SORTEDSEARCH_OID           LDAP_CONTROL_SORTREQUEST
00055 #define SLAPI_CONTROL_PAGED_RESULTS_OID          LDAP_CONTROL_PAGEDRESULTS
00056 
00057 typedef int (*SLAPI_FUNC)( Slapi_PBlock *pb );
00058 
00059 typedef struct _slapi_control {
00060         int                 s_ctrl_num;
00061         char                **s_ctrl_oids;
00062         unsigned long              *s_ctrl_ops;
00063 } Slapi_Control;
00064 
00065 typedef struct _ExtendedOp {
00066        struct berval        ext_oid;
00067         SLAPI_FUNC          ext_func;
00068         Backend                    *ext_be;
00069         struct _ExtendedOp  *ext_next;
00070 } ExtendedOp;
00071 
00072 /* Computed attribute support */
00073 struct _computed_attr_context {
00074        Slapi_PBlock  *cac_pb;
00075        Operation     *cac_op;
00076        void          *cac_private;
00077 };
00078 
00079 /* for slapi_attr_type_cmp() */
00080 #define SLAPI_TYPE_CMP_EXACT       0
00081 #define SLAPI_TYPE_CMP_BASE 1
00082 #define SLAPI_TYPE_CMP_SUBTYPE     2
00083 
00084 typedef enum slapi_extension_e {
00085        SLAPI_X_EXT_CONNECTION = 0,
00086        SLAPI_X_EXT_OPERATION = 1,
00087        SLAPI_X_EXT_MAX = 2
00088 } slapi_extension_t;
00089 
00090 struct slapi_dn {
00091        unsigned char flag;
00092        struct berval dn;
00093        struct berval ndn;
00094 };
00095 
00096 struct slapi_rdn {
00097        unsigned char flag;
00098        struct berval bv;
00099        LDAPRDN rdn;
00100 };
00101 
00102 /*
00103  * Was: slapi_pblock.h
00104  */
00105 
00106 #ifndef NO_PBLOCK_CLASS            /* where's this test from? */
00107 
00108 typedef enum slapi_pblock_class_e {
00109        PBLOCK_CLASS_INVALID = 0,
00110        PBLOCK_CLASS_INTEGER,
00111        PBLOCK_CLASS_LONG_INTEGER,
00112        PBLOCK_CLASS_POINTER,
00113        PBLOCK_CLASS_FUNCTION_POINTER
00114 } slapi_pblock_class_t;
00115 
00116 #define PBLOCK_SUCCESS                    (0)
00117 #define PBLOCK_ERROR               (-1)
00118 #define PBLOCK_MAX_PARAMS          100
00119 
00120 union slapi_pblock_value {
00121        int pv_integer;
00122        long pv_long_integer;
00123        void *pv_pointer;
00124        int (*pv_function_pointer)();
00125 };
00126 
00127 struct slapi_pblock {
00128        ldap_pvt_thread_mutex_t     pb_mutex;
00129        int                  pb_nParams;
00130        int                  pb_params[PBLOCK_MAX_PARAMS];
00131        union slapi_pblock_value pb_values[PBLOCK_MAX_PARAMS];
00132        /* native types */
00133        Connection           *pb_conn;
00134        Operation            *pb_op;
00135        SlapReply            *pb_rs;
00136        int                  pb_intop;
00137        char                 pb_textbuf[ SLAP_TEXT_BUFLEN ];
00138 };
00139 
00140 #endif /* !NO_PBLOCK_CLASS */
00141 
00142 /*
00143  * Was: plugin.h
00144  */
00145 
00146 #define SLAPI_PLUGIN_IS_POST_FN(x) ((x) >= SLAPI_PLUGIN_POST_BIND_FN && (x) <= SLAPI_PLUGIN_BE_POST_DELETE_FN)
00147 
00148 #define SLAPI_IBM_PBLOCK                  -3
00149 
00150 #define       SLAPI_ENTRY_PRE_OP                 52
00151 #define       SLAPI_ENTRY_POST_OP                53
00152 
00153 /* This is the spelling in the SunOne 5.2 docs */
00154 #define       SLAPI_RES_CONTROLS   SLAPI_RESCONTROLS
00155 
00156 #define SLAPI_ABANDON_MSGID               120
00157 
00158 #define SLAPI_OPERATION_PARAMETERS        138
00159 
00160 #define SLAPI_SEQ_TYPE                           150
00161 #define SLAPI_SEQ_ATTRNAME                151
00162 #define SLAPI_SEQ_VAL                            152
00163 
00164 #define SLAPI_MR_FILTER_ENTRY                    170    
00165 #define SLAPI_MR_FILTER_TYPE                     171
00166 #define SLAPI_MR_FILTER_VALUE                    172
00167 #define SLAPI_MR_FILTER_OID               173
00168 #define SLAPI_MR_FILTER_DNATTRS                  174
00169 
00170 #define SLAPI_LDIF2DB_FILE                180
00171 #define SLAPI_LDIF2DB_REMOVEDUPVALS              185
00172 
00173 #define SLAPI_DB2LDIF_PRINTKEY                   183
00174 
00175 #define       SLAPI_CHANGENUMBER                 197
00176 #define       SLAPI_LOG_OPERATION                198
00177 
00178 #define SLAPI_DBSIZE                      199
00179 
00180 #define       SLAPI_PLUGIN_DB_TEST_FN                   227
00181 #define SLAPI_PLUGIN_DB_NO_ACL                   250
00182 
00183 /* OpenLDAP private parametrs */
00184 #define SLAPI_PLUGIN_COMPUTE_EVALUATOR_FN 1200
00185 #define SLAPI_PLUGIN_COMPUTE_SEARCH_REWRITER_FN  1201
00186 
00187 #define SLAPI_X_CONFIG_ARGV               1400
00188 #define SLAPI_X_INTOP_FLAGS               1401
00189 #define SLAPI_X_INTOP_RESULT_CALLBACK            1402
00190 #define SLAPI_X_INTOP_SEARCH_ENTRY_CALLBACK      1403
00191 #define SLAPI_X_INTOP_REFERRAL_ENTRY_CALLBACK    1404
00192 #define SLAPI_X_INTOP_CALLBACK_DATA              1405
00193 #define SLAPI_X_OLD_RESCONTROLS                  1406
00194 
00195 LDAP_SLAPI_V (ldap_pvt_thread_mutex_t)    slapi_hn_mutex;
00196 LDAP_SLAPI_V (ldap_pvt_thread_mutex_t)    slapi_time_mutex;
00197 LDAP_SLAPI_V (ldap_pvt_thread_mutex_t)    slapi_printmessage_mutex; 
00198 LDAP_SLAPI_V (char *)                     slapi_log_file;
00199 LDAP_SLAPI_V (int)                 slapi_log_level;
00200 
00201 #include "proto-slapi.h"
00202 
00203 #endif /* _SLAPI_H */
00204 #endif /* LDAP_SLAPI */