2003-11-30 01:52:05 +08:00
|
|
|
/* $OpenLDAP$ */
|
2003-11-27 00:05:06 +08:00
|
|
|
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
|
|
|
|
*
|
2005-01-02 04:49:32 +08:00
|
|
|
* Copyright 2002-2005 The OpenLDAP Foundation.
|
2003-11-27 00:05:06 +08:00
|
|
|
* Portions Copyright 1997,2002-2003 IBM Corporation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
2003-11-20 13:11:37 +08:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted only as authorized by the OpenLDAP
|
2003-11-27 00:05:06 +08:00
|
|
|
* Public License.
|
|
|
|
*
|
|
|
|
* A copy of this license is available in the file LICENSE in the
|
|
|
|
* top-level directory of the distribution or, alternatively, at
|
|
|
|
* <http://www.OpenLDAP.org/license.html>.
|
|
|
|
*/
|
|
|
|
/* ACKNOWLEDGEMENTS:
|
|
|
|
* This work was initially developed by IBM Corporation for use in
|
|
|
|
* IBM products and subsequently ported to OpenLDAP Software by
|
|
|
|
* Steve Omrani. Additional significant contributors include:
|
|
|
|
* Luke Howard
|
2002-12-08 01:19:29 +08:00
|
|
|
*/
|
|
|
|
|
2003-02-08 03:06:15 +08:00
|
|
|
#ifdef LDAP_SLAPI /* SLAPI is OPTIONAL */
|
|
|
|
|
2002-12-08 01:19:29 +08:00
|
|
|
#ifndef _SLAPI_H
|
|
|
|
#define _SLAPI_H
|
|
|
|
|
2003-01-28 00:39:22 +08:00
|
|
|
LDAP_BEGIN_DECL
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Quick 'n' dirty to make struct slapi_* in slapi-plugin.h opaque
|
|
|
|
*/
|
2003-01-27 22:44:39 +08:00
|
|
|
#define slapi_entry slap_entry
|
|
|
|
#define slapi_attr slap_attr
|
2003-01-28 00:39:22 +08:00
|
|
|
#define slapi_value berval
|
2005-07-22 17:35:27 +08:00
|
|
|
#define slapi_valueset berval *
|
2003-01-27 22:44:39 +08:00
|
|
|
#define slapi_filter slap_filter
|
2003-01-28 00:39:22 +08:00
|
|
|
|
|
|
|
LDAP_END_DECL
|
|
|
|
|
2003-01-27 22:44:39 +08:00
|
|
|
#include <slapi-plugin.h>
|
|
|
|
|
2003-01-21 04:16:42 +08:00
|
|
|
LDAP_BEGIN_DECL
|
|
|
|
|
2005-07-22 02:07:16 +08:00
|
|
|
#define SLAPI_OVERLAY_NAME "slapi"
|
|
|
|
|
2005-07-22 15:54:17 +08:00
|
|
|
#define SLAPI_OPERATION_PBLOCK(_op) ((_op)->o_callback->sc_private)
|
2005-07-22 13:33:47 +08:00
|
|
|
#define SLAPI_CONNECTION_PBLOCK(_conn) ((_conn)->c_pb);
|
|
|
|
#define SLAPI_BACKEND_PBLOCK(_be) ((_be)->be_pb)
|
|
|
|
|
|
|
|
#define SLAPI_OPERATION_EXTENSIONS(_op) ((_op)->o_hdr->oh_extensions)
|
|
|
|
#define SLAPI_CONNECTION_EXTENSIONS(_conn) ((_conn)->c_extensions)
|
2005-07-22 13:26:15 +08:00
|
|
|
|
2003-01-27 22:44:39 +08:00
|
|
|
#define SLAPI_CONTROL_MANAGEDSAIT_OID LDAP_CONTROL_MANAGEDSAIT
|
|
|
|
#define SLAPI_CONTROL_SORTEDSEARCH_OID LDAP_CONTROL_SORTREQUEST
|
|
|
|
#define SLAPI_CONTROL_PAGED_RESULTS_OID LDAP_CONTROL_PAGEDRESULTS
|
|
|
|
|
|
|
|
typedef int (*SLAPI_FUNC)( Slapi_PBlock *pb );
|
|
|
|
|
|
|
|
typedef struct _slapi_control {
|
|
|
|
int s_ctrl_num;
|
|
|
|
char **s_ctrl_oids;
|
|
|
|
unsigned long *s_ctrl_ops;
|
|
|
|
} Slapi_Control;
|
|
|
|
|
|
|
|
typedef struct _ExtendedOp {
|
|
|
|
struct berval ext_oid;
|
|
|
|
SLAPI_FUNC ext_func;
|
|
|
|
Backend *ext_be;
|
|
|
|
struct _ExtendedOp *ext_next;
|
|
|
|
} ExtendedOp;
|
|
|
|
|
|
|
|
/* Computed attribute support */
|
|
|
|
struct _computed_attr_context {
|
|
|
|
Slapi_PBlock *cac_pb;
|
2005-07-22 00:35:20 +08:00
|
|
|
Operation *cac_op;
|
|
|
|
void *cac_private;
|
2003-01-27 22:44:39 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/* for slapi_attr_type_cmp() */
|
|
|
|
#define SLAPI_TYPE_CMP_EXACT 0
|
|
|
|
#define SLAPI_TYPE_CMP_BASE 1
|
|
|
|
#define SLAPI_TYPE_CMP_SUBTYPE 2
|
|
|
|
|
2003-07-04 03:04:18 +08:00
|
|
|
typedef enum slapi_extension_e {
|
|
|
|
SLAPI_X_EXT_CONNECTION = 0,
|
|
|
|
SLAPI_X_EXT_OPERATION = 1,
|
|
|
|
SLAPI_X_EXT_MAX = 2
|
|
|
|
} slapi_extension_t;
|
2003-01-27 22:44:39 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Was: slapi_pblock.h
|
|
|
|
*/
|
2003-01-21 04:16:42 +08:00
|
|
|
|
2003-01-28 00:39:22 +08:00
|
|
|
#ifndef NO_PBLOCK_CLASS /* where's this test from? */
|
2003-01-27 22:44:39 +08:00
|
|
|
|
2005-02-20 10:13:14 +08:00
|
|
|
typedef enum slapi_pblock_class_e {
|
|
|
|
PBLOCK_CLASS_INVALID = 0,
|
|
|
|
PBLOCK_CLASS_INTEGER,
|
|
|
|
PBLOCK_CLASS_LONG_INTEGER,
|
|
|
|
PBLOCK_CLASS_POINTER,
|
|
|
|
PBLOCK_CLASS_FUNCTION_POINTER
|
|
|
|
} slapi_pblock_class_t;
|
|
|
|
|
|
|
|
#define PBLOCK_SUCCESS (0)
|
2003-01-27 22:44:39 +08:00
|
|
|
#define PBLOCK_ERROR (-1)
|
|
|
|
#define PBLOCK_MAX_PARAMS 100
|
|
|
|
|
2005-07-25 18:53:45 +08:00
|
|
|
union slapi_pblock_value {
|
|
|
|
int pv_integer;
|
|
|
|
long pv_long_integer;
|
|
|
|
void *pv_pointer;
|
2005-07-25 19:13:15 +08:00
|
|
|
int (*pv_function_pointer)();
|
2005-07-25 18:53:45 +08:00
|
|
|
};
|
|
|
|
|
2003-01-27 22:44:39 +08:00
|
|
|
struct slapi_pblock {
|
2005-07-25 19:13:15 +08:00
|
|
|
ldap_pvt_thread_mutex_t pb_mutex;
|
|
|
|
int pb_nParams;
|
|
|
|
int pb_params[PBLOCK_MAX_PARAMS];
|
|
|
|
union slapi_pblock_value pb_values[PBLOCK_MAX_PARAMS];
|
2005-07-25 12:19:33 +08:00
|
|
|
/* native types */
|
2005-07-25 19:13:15 +08:00
|
|
|
Connection *pb_conn;
|
|
|
|
Operation *pb_op;
|
|
|
|
SlapReply pb_rs;
|
|
|
|
int pb_intop;
|
|
|
|
char pb_textbuf[ SLAP_TEXT_BUFLEN ];
|
2003-01-27 22:44:39 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* !NO_PBLOCK_CLASS */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Was: plugin.h
|
|
|
|
*/
|
|
|
|
|
2005-07-23 21:14:13 +08:00
|
|
|
#define SLAPI_PLUGIN_IS_POST_FN(x) ((x) >= SLAPI_PLUGIN_POST_BIND_FN && (x) <= SLAPI_PLUGIN_BE_POST_DELETE_FN)
|
2003-01-27 22:44:39 +08:00
|
|
|
|
2005-07-25 17:54:13 +08:00
|
|
|
#define SLAPI_IBM_PBLOCK -3
|
2003-01-22 21:06:46 +08:00
|
|
|
|
2002-12-08 01:19:29 +08:00
|
|
|
#define SLAPI_ENTRY_PRE_OP 52
|
|
|
|
#define SLAPI_ENTRY_POST_OP 53
|
|
|
|
|
2003-12-04 08:52:03 +08:00
|
|
|
/* This is the spelling in the SunOne 5.2 docs */
|
|
|
|
#define SLAPI_RES_CONTROLS SLAPI_RESCONTROLS
|
2002-12-08 01:19:29 +08:00
|
|
|
|
|
|
|
#define SLAPI_ABANDON_MSGID 120
|
|
|
|
|
2005-07-25 17:54:13 +08:00
|
|
|
#define SLAPI_OPERATION_PARAMETERS 138
|
|
|
|
|
2002-12-08 01:19:29 +08:00
|
|
|
#define SLAPI_SEQ_TYPE 150
|
|
|
|
#define SLAPI_SEQ_ATTRNAME 151
|
|
|
|
#define SLAPI_SEQ_VAL 152
|
|
|
|
|
|
|
|
#define SLAPI_MR_FILTER_ENTRY 170
|
|
|
|
#define SLAPI_MR_FILTER_TYPE 171
|
|
|
|
#define SLAPI_MR_FILTER_VALUE 172
|
|
|
|
#define SLAPI_MR_FILTER_OID 173
|
|
|
|
#define SLAPI_MR_FILTER_DNATTRS 174
|
|
|
|
|
|
|
|
#define SLAPI_LDIF2DB_FILE 180
|
|
|
|
#define SLAPI_LDIF2DB_REMOVEDUPVALS 185
|
|
|
|
|
|
|
|
#define SLAPI_DB2LDIF_PRINTKEY 183
|
|
|
|
|
|
|
|
#define SLAPI_CHANGENUMBER 197
|
|
|
|
#define SLAPI_LOG_OPERATION 198
|
|
|
|
|
|
|
|
#define SLAPI_DBSIZE 199
|
|
|
|
|
2005-07-25 17:54:13 +08:00
|
|
|
#define SLAPI_PLUGIN_DB_TEST_FN 227
|
|
|
|
#define SLAPI_PLUGIN_DB_NO_ACL 250
|
|
|
|
|
|
|
|
/* OpenLDAP private parametrs */
|
|
|
|
#define SLAPI_PLUGIN_COMPUTE_EVALUATOR_FN 1200
|
|
|
|
#define SLAPI_PLUGIN_COMPUTE_SEARCH_REWRITER_FN 1201
|
|
|
|
|
2005-07-25 12:19:33 +08:00
|
|
|
#define SLAPI_X_CONFIG_ARGV 1400
|
|
|
|
#define SLAPI_X_INTOP_FLAGS 1401
|
|
|
|
#define SLAPI_X_INTOP_RESULT_CALLBACK 1402
|
|
|
|
#define SLAPI_X_INTOP_SEARCH_ENTRY_CALLBACK 1403
|
|
|
|
#define SLAPI_X_INTOP_REFERRAL_ENTRY_CALLBACK 1404
|
|
|
|
#define SLAPI_X_INTOP_CALLBACK_DATA 1405
|
|
|
|
#define SLAPI_X_OLD_RESCONTROLS 1406
|
|
|
|
|
2005-07-22 17:35:27 +08:00
|
|
|
LDAP_SLAPI_V (ldap_pvt_thread_mutex_t) slapi_hn_mutex;
|
|
|
|
LDAP_SLAPI_V (ldap_pvt_thread_mutex_t) slapi_time_mutex;
|
|
|
|
LDAP_SLAPI_V (ldap_pvt_thread_mutex_t) slapi_printmessage_mutex;
|
|
|
|
LDAP_SLAPI_V (char *) slapi_log_file;
|
|
|
|
LDAP_SLAPI_V (int) slapi_log_level;
|
2003-01-21 04:16:42 +08:00
|
|
|
|
2003-01-27 22:44:39 +08:00
|
|
|
#include "proto-slapi.h"
|
|
|
|
|
2002-12-08 01:19:29 +08:00
|
|
|
#endif /* _SLAPI_H */
|
2003-02-08 03:06:15 +08:00
|
|
|
#endif /* LDAP_SLAPI */
|