X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fslapi%2Fslapi.h;h=9bbaeb81953aebde0f10521e1d4809dd2def1ac4;hb=b0b3eff457f0e431c4fd094d3d9cfeb6383df91d;hp=e0c36c1eb48224648f34a5eeae87cddee2d8a67e;hpb=faf8d43a6f4735ba2292683ec0bb2e4ca13f8370;p=openldap diff --git a/servers/slapd/slapi/slapi.h b/servers/slapd/slapi/slapi.h index e0c36c1eb4..9bbaeb8195 100644 --- a/servers/slapd/slapi/slapi.h +++ b/servers/slapd/slapi/slapi.h @@ -1,15 +1,27 @@ -/* - * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved. - * COPYING RESTRICTIONS APPLY, see COPYRIGHT file +/* $OpenLDAP$ */ +/* This work is part of OpenLDAP Software . + * + * Copyright 2002-2003 The OpenLDAP Foundation. + * Portions Copyright 1997,2002-2003 IBM Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . */ -/* - * (C) Copyright IBM Corp. 1997,2002 - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is - * given to IBM Corporation. This software is provided ``as is'' - * without express or implied warranty. +/* 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 */ +#ifdef LDAP_SLAPI /* SLAPI is OPTIONAL */ + #ifndef _SLAPI_H #define _SLAPI_H @@ -17,27 +29,180 @@ LDAP_BEGIN_DECL -typedef struct slapi_pblock Slapi_PBlock; -typedef struct slap_entry Slapi_Entry; -typedef struct slap_attr Slapi_Attr; -typedef struct berval Slapi_Value; -typedef BerVarray Slapi_ValueSet; -typedef Filter Slapi_Filter; +/* + * Quick 'n' dirty to make struct slapi_* in slapi-plugin.h opaque + */ +#define slapi_entry slap_entry +#define slapi_attr slap_attr +#define slapi_value berval +#define slapi_valueset berval* +#define slapi_filter slap_filter LDAP_END_DECL -#include -#ifndef NO_PBLOCK_CLASS -#include -#endif /* NO_PBLOCK_CLASS */ -#include -#include -#if 0 /* unused (yet?) */ -#include -#endif /* 0 */ +#include LDAP_BEGIN_DECL +/* + * Was: slapi_common.h + */ + +/* a little naif ... */ +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#if 0 /* unused (yet?) */ +#define dn_normalize_case dn_normalize +#define SLAPD_NO_MEMORY 7 +#define ANYBODY_STRING "CN=ANYBODY" + +extern int slap_debug; + +extern int dn_check(char *, int *); + +typedef struct strlist { + char *string; + struct strlist *next; +} StrList; +#endif + +extern struct berval *ns_get_supported_extop( int ); + +/* + * Was: slapi_utils.h + */ +typedef struct _Audit_record Audit_record; + +#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 ); + +#if 0 /* unused (yet?) */ +#define DOMAIN "Domain" +#define TCPIPPATH "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters" +#endif + +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 { + /* slap_send_search_entry() argblock */ + Slapi_PBlock *cac_pb; + AttributeName *cac_attrs; + int cac_attrsonly : 1; + int cac_userattrs : 1; + int cac_opattrs : 1; + AccessControlState cac_acl_state; + /* private data */ + void *cac_private; +}; + +/* for slapi_attr_type_cmp() */ +#define SLAPI_TYPE_CMP_EXACT 0 +#define SLAPI_TYPE_CMP_BASE 1 +#define SLAPI_TYPE_CMP_SUBTYPE 2 + +typedef enum slapi_extension_e { + SLAPI_X_EXT_CONNECTION = 0, + SLAPI_X_EXT_OPERATION = 1, + SLAPI_X_EXT_MAX = 2 +} slapi_extension_t; + +/* + * Was: slapi_pblock.h + */ + +#ifndef NO_PBLOCK_CLASS /* where's this test from? */ + +#if 0 /* unused (yet?) */ +#define CMP_EQUAL 0 +#define CMP_GREATER 1 +#define CMP_LOWER (-1) +#endif +#define PBLOCK_ERROR (-1) +#define INVALID_PARAM PBLOCK_ERROR +#define PBLOCK_MAX_PARAMS 100 + +struct slapi_pblock { + ldap_pvt_thread_mutex_t pblockMutex; + int ckParams; + int numParams; + int curParams[PBLOCK_MAX_PARAMS]; + void *curVals[PBLOCK_MAX_PARAMS]; +}; + +#endif /* !NO_PBLOCK_CLASS */ + +/* + * Was: plugin.h + */ + +#define SLAPI_PLUGIN_IS_POST_FN(x) ((x) >= SLAPI_PLUGIN_POST_BIND_FN && (x) <= SLAPI_PLUGIN_POST_RESULT_FN) + +/* + * Was: slapi_cl.h + */ + +#if 0 +#define TIME_SIZE 20 +#define OBJECTCLASS "objectclass" +#define TOP "top" +#define CHANGE_TIME "changetime" +#define CHANGE_TYPE "changetype" +#define CHANGE_TARGETDN "targetdn" +#define CHANGES "changes" +#define CHANGE_NUMBER "changenumber" +/* + * FIXME: I get complaints like "ADD" being redefined - first definition + * being in "/usr/include/arpa/nameser.h:552" + */ +#undef ADD +#define ADD "add: " +#define ADDLEN 5 +#define DEL "delete: " +#define DELLEN 8 +#define REPLACE "replace: " +#define REPLEN 9 +#define MOD "modify" +#define MODRDN "modrdn" +#define CHANGE_LOGENTRY "changelogentry" +#define IBM_CHANGE_LOGENTRY "ibm-changelog" +#define CL_NEWRDN "newrdn" +#define CL_DELRDN "deleteoldrdn" +#define CHANGE_INITIATOR "ibm-changeInitiatorsName" + +extern void slapi_register_changelog_suffix(char *suffix); +extern char **slapi_get_changelog_suffixes(); +extern void slapi_update_changelog_counters(long curNum, long numEntries); +extern char *slapi_get_cl_firstNum(); +extern char *slapi_get_cl_lastNum(); +extern int slapi_add_to_changelog(Slapi_Entry *ent, char *suffix, char *chNum, Operation* op); +extern int slapi_delete_changelog(char *dn, char *suffix, char *chNum, Operation* op); +extern int slapi_modify_changelog(char *dn,LDAPMod *mods,char *suffix, char *chNum, Operation* op); +extern int slapi_modifyrdn_changelog(char *olddn, char *newRdn, int delRdn, char *suffix, char *chNum, Operation* op); +extern Backend * slapi_cl_get_be(char *dn); +#endif + + /* * Attribute flags returned by slapi_attr_get_flags() */ @@ -111,9 +276,14 @@ LDAP_BEGIN_DECL #define SLAPI_REQUESTOR_ISUPDATEDN 142 #define SLAPI_IS_REPLICATED_OPERATION SLAPI_REQUESTOR_ISUPDATEDN #define SLAPI_CONN_DN 143 +#define SLAPI_CONN_AUTHTYPE 144 #define SLAPI_CONN_CLIENTIP 145 #define SLAPI_CONN_SERVERIP 146 -#define SLAPI_CONN_AUTHTYPE 144 +#define SLAPI_X_CONN_CLIENTPATH 1300 +#define SLAPI_X_CONN_SERVERPATH 1301 +#define SLAPI_X_CONN_IS_UDP 1302 +#define SLAPI_X_CONN_SSF 1303 +#define SLAPI_X_CONN_SASL_CONTEXT 1304 #define SLAPD_AUTH_NONE "none" #define SLAPD_AUTH_SIMPLE "simple" @@ -221,6 +391,12 @@ LDAP_BEGIN_DECL #define SLAPI_PLUGIN_MR_USAGE_INDEX 0 #define SLAPI_PLUGIN_MR_USAGE_SORT 1 +#define SLAPI_MATCHINGRULE_NAME 1 +#define SLAPI_MATCHINGRULE_OID 2 +#define SLAPI_MATCHINGRULE_DESC 3 +#define SLAPI_MATCHINGRULE_SYNTAX 4 +#define SLAPI_MATCHINGRULE_OBSOLETE 5 + #define SLAPI_PLUGIN_SYNTAX_FILTER_AVA 700 #define SLAPI_PLUGIN_SYNTAX_FILTER_SUB 701 #define SLAPI_PLUGIN_SYNTAX_VALUES2KEYS 702 @@ -231,6 +407,12 @@ LDAP_BEGIN_DECL #define SLAPI_PLUGIN_SYNTAX_FLAGS 707 #define SLAPI_PLUGIN_SYNTAX_COMPARE 708 +#define SLAPI_PLUGIN_ACL_INIT 730 +#define SLAPI_PLUGIN_ACL_SYNTAX_CHECK 731 +#define SLAPI_PLUGIN_ACL_ALLOW_ACCESS 732 +#define SLAPI_PLUGIN_ACL_MODS_ALLOWED 733 +#define SLAPI_PLUGIN_ACL_MODS_UPDATE 734 + #define SLAPI_OPERATION_AUTHTYPE 741 #define SLAPI_OPERATION_ID 742 #define SLAPI_CONN_CERT 743 @@ -264,6 +446,8 @@ LDAP_BEGIN_DECL #define SLAPI_ENTRY_POST_OP 53 #define SLAPI_RESCONTROLS 55 +/* This is the spelling in the SunOne 5.2 docs */ +#define SLAPI_RES_CONTROLS SLAPI_RESCONTROLS #define SLAPI_ADD_RESCONTROL 56 #define SLAPI_ADD_TARGET SLAPI_TARGET_DN @@ -366,5 +550,7 @@ LDAP_BEGIN_DECL LDAP_END_DECL -#endif /* _SLAPI_H */ +#include "proto-slapi.h" +#endif /* _SLAPI_H */ +#endif /* LDAP_SLAPI */