⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ldap.h

📁 IBM Lotus C++ API 7.0a for IBM Lotus Notes/Domino Directory Release --------- ------------------
💻 H
📖 第 1 页 / 共 3 页
字号:

#if defined(OS400) && (__OS400_TGTVRM__ >= 510)
#pragma datamodel(P128)
#endif

/*********************************************************************/
/*                                                                   */
/* Licensed Materials - Property of IBM                              */
/*                                                                   */
/* L-GHUS-5VMPGW, L-GHUS-5S3PEE                                      */
/* (C) Copyright IBM Corp. 2002, 2005  All Rights Reserved           */
/*                                                                   */
/* US Government Users Restricted Rights - Use, duplication or       */
/* disclosure restricted by GSA ADP Schedule Contract with           */
/* IBM Corp.                                                         */
/*                                                                   */
/*********************************************************************/




#ifndef _LDAP_H
#define _LDAP_H

#ifdef __cplusplus
extern "C" {
#endif


#ifndef GLOBAL_DEFS
#include "global.h"
#endif

#ifndef FILE_DEFS
#include "osfile.h"
#endif

#ifndef NIF_DEFS
#include "nif.h"
#endif

#ifndef DNAME_DEFS
#include "dname.h"
#endif

#ifndef _LBER_H
#include "lber.h"
#endif


/*  Maximum number referalls */

#define LDAP_MAXREFERRALS 		32


#define LDAP_PORT				389
#define LDAP_SSLPORT_DEFAULT 	636
#define LDAP_SPORT				636
#define LDAP_VERSION1			1
#define LDAP_VERSION2			2
#define LDAP_VERSION3			3
#define LDAP_VERSION			LDAP_VERSION3
#define LDAP_LOCAL_HOST			"LocalHost"


#define LDAP_MAX_ATTR_LEN		100
#define LDAP_MAX_URL_LEN		256
#define LDAP_ALL_OPERATIONAL_ATTRS	"+"
#define LDAP_ALL_USER_ATTRS			"*"
#define LDAP_NO_ATTRS				"1.1"

#define LDAP_DEBUG_API			0x0200	 /*   512			1023		*/

/* 
*  Specific LDAP instantiations of BER types we know about
*/

/* general stuff */

#define LDAP_TAG_MESSAGE			0x30L	/* tag is 16 + constructed bit */
#define LDAP_TAG_MSGID				0x02L

/* Possible operations a client can invoke */

#define LDAP_REQ_BIND				0x60L	/* application + constructed */
#define LDAP_REQ_UNBIND				0x42L	/* application + primitive   */
#define LDAP_REQ_SEARCH				0x63L	/* application + constructed */
#define LDAP_REQ_MODIFY				0x66L	/* application + constructed */
#define LDAP_REQ_ADD				0x68L	/* application + constructed */
#define LDAP_REQ_DELETE				0x4aL	/* application + primitive   */
#define LDAP_REQ_MODRDN				0x6cL	/* application + constructed */
#define LDAP_REQ_MODDN				0x6cL	/* application + constructed */
#define LDAP_REQ_COMPARE			0x6eL	/* application + constructed */
#define LDAP_REQ_ABANDON			0x50L	/* application + primitive   */
#define LDAP_REQ_EXTENDED			0x77L	/* application + constructed */


/* Possible result types a server can return */

#define LDAP_RES_BIND				0x61L	/* application + constructed */
#define LDAP_RES_SEARCH_ENTRY		0x64L	/* application + constructed */
#define LDAP_RES_SEARCH_REFERENCE	0x73L	/* application + constructed */
#define LDAP_RES_SEARCH_RESULT		0x65L	/* application + constructed */
#define LDAP_RES_MODIFY				0x67L	/* application + constructed */
#define LDAP_RES_ADD				0x69L	/* application + constructed */
#define LDAP_RES_DELETE				0x6bL	/* application + constructed */
#define LDAP_RES_MODRDN				0x6dL	/* application + constructed */
#define LDAP_RES_MODDN				0x6dL	/* application + constructed */
#define LDAP_RES_COMPARE			0x6fL	/* application + constructed */
#define LDAP_RES_EXTENDED			0x78L	/* application + constructed */
#define LDAP_RES_ANY				(-1L)


/* Authentication methods available */

#define LDAP_AUTH_NONE				0x00L	/* no authentication		  */
#define LDAP_AUTH_SIMPLE			0x80L	/* context specific + primitive   */
#define LDAP_AUTH_KRBV4				0xffL	/* means do both of the following */
#define LDAP_AUTH_KRBV41			0x81L	/* context specific + primitive   */
#define LDAP_AUTH_KRBV42			0x82L	/* context specific + primitive   */
#define LDAP_AUTH_SASL				0xa3L	/* context specific + constructed */

/* sasl methods */
#define LDAP_SASL_SIMPLE			((char *)0) 
#define LDAP_SASL_EXTERNAL			"EXTERNAL"

/* Filter types */

#define LDAP_FILTER_AND				0xa0L	/* context specific + constructed */
#define LDAP_FILTER_OR				0xa1L	/* context specific + constructed */
#define LDAP_FILTER_NOT				0xa2L	/* context specific + constructed */
#define LDAP_FILTER_EQUALITY		0xa3L	/* context specific + constructed */
#define LDAP_FILTER_SUBSTRINGS		0xa4L	/* context specific + constructed */
#define LDAP_FILTER_GE				0xa5L	/* context specific + constructed */
#define LDAP_FILTER_LE				0xa6L	/* context specific + constructed */
#define LDAP_FILTER_PRESENT			0x87L	/* context specific + primitive   */
#define LDAP_FILTER_APPROX			0xa8L	/* context specific + constructed */
#define LDAP_FILTER_EXTENSIBLE		0xa9L	/* context specific + constructed */


/* Substring filter component types */

#define LDAP_SUBSTRING_INITIAL		0x80L	/* context specific */
#define LDAP_SUBSTRING_ANY			0x81L	/* context specific */
#define LDAP_SUBSTRING_FINAL		0x82L	/* context specific */


/* Search scopes */

#define LDAP_SCOPE_BASE				0x00
#define LDAP_SCOPE_ONELEVEL			0x01
#define LDAP_SCOPE_SUBTREE			0x02

/* Optional referral field in an LDAPResult message (LDAPv3 only) */

#define LDAP_TAG_REFERRAL			0xa3	/* context specific + constructed */

/* Optional controls field in an LDAPMessage message (LDAPv3 only) */

#define LDAP_TAG_CONTROLS			0xa0	/* context specific + constructed */

/* Optional serverSaslCreds field in BindResponse message (LDAPv3 only) */

#define LDAP_TAG_SERVER_SASL_CREDS	0x87	/* context specific + primitive */

/* Optional newSuperior field in ModifyDNRequest message (LDAPv3 only) */

#define LDAP_TAG_NEW_SUPERIOR		0x80    /* context specific + primitive */

/* Fields for ExtendedRequest/Responce messages (LDAPv3 only) */

#define LDAP_TAG_REQUEST_NAME		0x80 	/* context specific + primitive */
#define LDAP_TAG_REQUEST_VALUE		0x81 	/* context specific + primitive */
#define LDAP_TAG_RESPONSE_NAME		0x8a 	/* context specific + primitive */
#define LDAP_TAG_RESPONSE			0x8b 	/* context specific + primitive */

/* For modifications */
typedef union mod_vals_u
		{
		char			**modv_strvals;
		struct berval	**modv_bvals;
		} mod_vals_u_t;

typedef struct ldapmod 
	{
	int				mod_op;

#define LDAP_MOD_ADD				0x00
#define LDAP_MOD_DELETE				0x01
#define LDAP_MOD_REPLACE			0x02
#define LDAP_MOD_BVALUES			0x80

	char			*mod_type;
	mod_vals_u_t	mod_vals;
#define mod_values	mod_vals.modv_strvals
#define mod_bvalues	mod_vals.modv_bvals

	struct ldapmod	*mod_next;
	} LDAPMod;


/* 
*   Possible error codes that can be returned.
*   Note: When adding additional error codes, please add them to error.cpp too.
*/

#define LDAP_SUCCESS					0x00
#define LDAP_OPERATIONS_ERROR			0x01
#define LDAP_PROTOCOL_ERROR				0x02
#define LDAP_TIMELIMIT_EXCEEDED			0x03
#define LDAP_SIZELIMIT_EXCEEDED			0x04
#define LDAP_COMPARE_FALSE				0x05
#define LDAP_COMPARE_TRUE				0x06
#define LDAP_STRONG_AUTH_NOT_SUPPORTED	0x07
#define LDAP_STRONG_AUTH_REQUIRED		0x08

/*
*   Note: The error code below was never officially supported in LDAPv2, 
*   nor is it supported in LDAPv3.  However, we'll keep it around since 
*   practically all clients which bind v2 expect UMich-style referrals.
*/

#define LDAP_PARTIAL_RESULTS			0x09

/* Error new in LDAPv3 */

#define LDAP_REFERRAL					0x0a
#define LDAP_ADMINLIMIT_EXCEEDED		0x0b    /* for alliance support      */
#define LDAP_UNAVAILABLE_CRITICAL_EXTENSION 0x0c
#define LDAP_CONFIDENTIALITY_REQUIRED	0x0d
#define LDAP_SASL_BIND_IN_PROGRESS		0x0e

/*  Errors that indicate an attribute problem */

#define LDAP_NO_SUCH_ATTRIBUTE			0x10
#define LDAP_UNDEFINED_TYPE				0x11
#define LDAP_INAPPROPRIATE_MATCHING		0x12
#define LDAP_CONSTRAINT_VIOLATION		0x13
#define LDAP_TYPE_OR_VALUE_EXISTS		0x14
#define LDAP_INVALID_SYNTAX				0x15

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -