IP : 18.188.15.159Hostname : host45.registrar-servers.comKernel : Linux host45.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64Disable Function : None :) OS : Linux
PATH:
/
home/
./
../
./
../
sbin/
../
lib64/
cifs-utils/
../
../
./
include/
ldap.h/
/
/* $OpenLDAP$ */ /* This work is part of OpenLDAP Software <http://www.openldap.org/>. * * Copyright 1998-2018 The OpenLDAP Foundation. * 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 file LICENSE in the * top-level directory of the distribution or, alternatively, at * <http://www.OpenLDAP.org/license.html>. */ /* Portions Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that this notice is preserved and that due credit is given * to the University of Michigan at Ann Arbor. The name of the University * may not be used to endorse or promote products derived from this * software without specific prior written permission. This software * is provided ``as is'' without express or implied warranty. */
#ifndef _LDAP_H #define _LDAP_H
/* pull in lber */ #include <lber.h>
/* include version and API feature defines */ #include <ldap_features.h>
/* * We use 3000+n here because it is above 1823 (for RFC 1823), * above 2000+rev of IETF LDAPEXT draft (now quite dated), * yet below allocations for new RFCs (just in case there is * someday an RFC produced). */ #define LDAP_API_VERSION 3001 #define LDAP_VENDOR_NAME "OpenLDAP"
/* OpenLDAP API Features */ #define LDAP_API_FEATURE_X_OPENLDAP LDAP_VENDOR_VERSION
#if defined( LDAP_API_FEATURE_X_OPENLDAP_REENTRANT ) || \ ( defined( LDAP_THREAD_SAFE ) && \ defined( LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE ) ) /* -lldap may or may not be thread safe */ /* -lldap_r, if available, is always thread safe */ # define LDAP_API_FEATURE_THREAD_SAFE 1 # define LDAP_API_FEATURE_SESSION_THREAD_SAFE 1 # define LDAP_API_FEATURE_OPERATION_THREAD_SAFE 1 #endif #if defined( LDAP_THREAD_SAFE ) && \ defined( LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE ) /* #define LDAP_API_FEATURE_SESSION_SAFE 1 */ /* #define LDAP_API_OPERATION_SESSION_SAFE 1 */ #endif
#define LDAP_PORT 389 /* ldap:/// default LDAP port */ #define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */
/* * LDAP_OPTions * 0x0000 - 0x0fff reserved for api options * 0x1000 - 0x3fff reserved for api extended options * 0x4000 - 0x7fff reserved for private and experimental options */
#define LDAP_OPT_API_INFO 0x0000 #define LDAP_OPT_DESC 0x0001 /* historic */ #define LDAP_OPT_DEREF 0x0002 #define LDAP_OPT_SIZELIMIT 0x0003 #define LDAP_OPT_TIMELIMIT 0x0004 /* 0x05 - 0x07 not defined */ #define LDAP_OPT_REFERRALS 0x0008 #define LDAP_OPT_RESTART 0x0009 /* 0x0a - 0x10 not defined */ #define LDAP_OPT_PROTOCOL_VERSION 0x0011 #define LDAP_OPT_SERVER_CONTROLS 0x0012 #define LDAP_OPT_CLIENT_CONTROLS 0x0013 /* 0x14 not defined */ #define LDAP_OPT_API_FEATURE_INFO 0x0015 /* 0x16 - 0x2f not defined */ #define LDAP_OPT_HOST_NAME 0x0030 #define LDAP_OPT_RESULT_CODE 0x0031 #define LDAP_OPT_ERROR_NUMBER LDAP_OPT_RESULT_CODE #define LDAP_OPT_DIAGNOSTIC_MESSAGE 0x0032 #define LDAP_OPT_ERROR_STRING LDAP_OPT_DIAGNOSTIC_MESSAGE #define LDAP_OPT_MATCHED_DN 0x0033 /* 0x0034 - 0x3fff not defined */ /* 0x0091 used by Microsoft for LDAP_OPT_AUTO_RECONNECT */ #define LDAP_OPT_SSPI_FLAGS 0x0092 /* 0x0093 used by Microsoft for LDAP_OPT_SSL_INFO */ /* 0x0094 used by Microsoft for LDAP_OPT_REF_DEREF_CONN_PER_MSG */ #define LDAP_OPT_SIGN 0x0095 #define LDAP_OPT_ENCRYPT 0x0096 #define LDAP_OPT_SASL_METHOD 0x0097 /* 0x0098 used by Microsoft for LDAP_OPT_AREC_EXCLUSIVE */ #define LDAP_OPT_SECURITY_CONTEXT 0x0099 /* 0x009A used by Microsoft for LDAP_OPT_ROOTDSE_CACHE */ /* 0x009B - 0x3fff not defined */
/* API Extensions */ #define LDAP_OPT_API_EXTENSION_BASE 0x4000 /* API extensions */
/* Private API Extensions -- reserved for application use */ #define LDAP_OPT_PRIVATE_EXTENSION_BASE 0x7000 /* Private API inclusive */
/* * ldap_get_option() and ldap_set_option() return values. * As later versions may return other values indicating * failure, current applications should only compare returned * value against LDAP_OPT_SUCCESS. */ #define LDAP_OPT_SUCCESS 0 #define LDAP_OPT_ERROR (-1)
typedef struct ldapapiinfo { int ldapai_info_version; /* version of LDAPAPIInfo */ #define LDAP_API_INFO_VERSION (1) int ldapai_api_version; /* revision of API supported */ int ldapai_protocol_version; /* highest LDAP version supported */ char **ldapai_extensions; /* names of API extensions */ char *ldapai_vendor_name; /* name of supplier */ int ldapai_vendor_version; /* supplier-specific version * 100 */ } LDAPAPIInfo;
typedef struct ldap_apifeature_info { int ldapaif_info_version; /* version of LDAPAPIFeatureInfo */ #define LDAP_FEATURE_INFO_VERSION (1) /* apifeature_info struct version */ char* ldapaif_name; /* LDAP_API_FEATURE_* (less prefix) */ int ldapaif_version; /* value of LDAP_API_FEATURE_... */ } LDAPAPIFeatureInfo;
/* * LDAP Control structure */ typedef struct ldapcontrol { char * ldctl_oid; /* numericoid of control */ struct berval ldctl_value; /* encoded value of control */ char ldctl_iscritical; /* criticality */ } LDAPControl;
/* LDAP Don't Use Copy Control (RFC 6171) */ #define LDAP_CONTROL_DONTUSECOPY "1.3.6.1.1.22"
/* Password policy Controls *//* work in progress */ /* ITS#3458: released; disabled by default */ #define LDAP_CONTROL_PASSWORDPOLICYREQUEST "1.3.6.1.4.1.42.2.27.8.5.1" #define LDAP_CONTROL_PASSWORDPOLICYRESPONSE "1.3.6.1.4.1.42.2.27.8.5.1"
/* various works in progress */ #define LDAP_CONTROL_NOOP "1.3.6.1.4.1.4203.666.5.2" #define LDAP_CONTROL_NO_SUBORDINATES "1.3.6.1.4.1.4203.666.5.11" #define LDAP_CONTROL_RELAX "1.3.6.1.4.1.4203.666.5.12" #define LDAP_CONTROL_MANAGEDIT LDAP_CONTROL_RELAX #define LDAP_CONTROL_SLURP "1.3.6.1.4.1.4203.666.5.13" #define LDAP_CONTROL_VALSORT "1.3.6.1.4.1.4203.666.5.14" #define LDAP_CONTROL_X_DEREF "1.3.6.1.4.1.4203.666.5.16" #define LDAP_CONTROL_X_WHATFAILED "1.3.6.1.4.1.4203.666.5.17"
/* LDAP Chaining Behavior Control *//* work in progress */ /* <draft-sermersheim-ldap-chaining>; * see also LDAP_NO_REFERRALS_FOUND, LDAP_CANNOT_CHAIN */ #define LDAP_CONTROL_X_CHAINING_BEHAVIOR "1.3.6.1.4.1.4203.666.11.3"
/* for the LDAP No-Op control */ #define LDAP_X_NO_OPERATION 0x410e
/* for the Chaining Behavior control (consecutive result codes requested; * see <draft-sermersheim-ldap-chaining> ) */ #ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR #define LDAP_X_NO_REFERRALS_FOUND 0x4110 #define LDAP_X_CANNOT_CHAIN 0x4111 #endif
/* for Distributed Procedures (see <draft-sermersheim-ldap-distproc>) */ #ifdef LDAP_X_DISTPROC_BASE #define LDAP_X_INVALIDREFERENCE 0x4112 #endif
/* API Error Codes * * Based on draft-ietf-ldap-c-api-xx * but with new negative code values */ #define LDAP_API_ERROR(n) ((n)<0) #define LDAP_API_RESULT(n) ((n)<=0)
/* * This structure represents both ldap messages and ldap responses. * These are really the same, except in the case of search responses, * where a response has multiple messages. */
typedef struct ldapmsg LDAPMessage;
/* for modifications */ typedef struct ldapmod { int mod_op;
#define LDAP_MOD_OP (0x0007) #define LDAP_MOD_ADD (0x0000) #define LDAP_MOD_DELETE (0x0001) #define LDAP_MOD_REPLACE (0x0002) #define LDAP_MOD_INCREMENT (0x0003) /* OpenLDAP extension */ #define LDAP_MOD_BVALUES (0x0080) /* IMPORTANT: do not use code 0x1000 (or above), * it is used internally by the backends! * (see ldap/servers/slapd/slap.h) */
/* * structure representing an ldap session which can * encompass connections to multiple servers (in the * face of referrals). */ typedef struct ldap LDAP;
/* * Called when an entry is returned by ldap_result(). * If phase is LDAP_SYNC_CAPI_ADD or LDAP_SYNC_CAPI_MODIFY, * the entry has been either added or modified, and thus * the complete view of the entry should be in the LDAPMessage. * If phase is LDAP_SYNC_CAPI_PRESENT or LDAP_SYNC_CAPI_DELETE, * only the DN should be in the LDAPMessage. */ typedef int (*ldap_sync_search_entry_f) LDAP_P(( ldap_sync_t *ls, LDAPMessage *msg, struct berval *entryUUID, ldap_sync_refresh_t phase ));
/* * Called when a reference is returned; the client should know * what to do with it. */ typedef int (*ldap_sync_search_reference_f) LDAP_P(( ldap_sync_t *ls, LDAPMessage *msg ));
/* * Called when specific intermediate/final messages are returned. * If phase is LDAP_SYNC_CAPI_PRESENTS or LDAP_SYNC_CAPI_DELETES, * a "presents" or "deletes" phase begins. * If phase is LDAP_SYNC_CAPI_DONE, a special "presents" phase * with refreshDone set to "TRUE" has been returned, to indicate * that the refresh phase of a refreshAndPersist is complete. * In the above cases, syncUUIDs is NULL. * * If phase is LDAP_SYNC_CAPI_PRESENTS_IDSET or * LDAP_SYNC_CAPI_DELETES_IDSET, syncUUIDs is an array of UUIDs * that are either present or have been deleted. */ typedef int (*ldap_sync_intermediate_f) LDAP_P(( ldap_sync_t *ls, LDAPMessage *msg, BerVarray syncUUIDs, ldap_sync_refresh_t phase ));
/* * Called when a searchResultDone is returned. In refreshAndPersist, * this can only occur if the search for any reason is being terminated * by the server. */ typedef int (*ldap_sync_search_result_f) LDAP_P(( ldap_sync_t *ls, LDAPMessage *msg, int refreshDeletes ));
/* * This structure contains all information about the persistent search; * the caller is responsible for connecting, setting version, binding, tls... */ struct ldap_sync_t { /* conf search params */ char *ls_base; int ls_scope; char *ls_filter; char **ls_attrs; int ls_timelimit; int ls_sizelimit;
/* Called after a connection is established */ typedef int (ldap_conn_add_f) LDAP_P(( LDAP *ld, Sockbuf *sb, LDAPURLDesc *srv, struct sockaddr *addr, struct ldap_conncb *ctx )); /* Called before a connection is closed */ typedef void (ldap_conn_del_f) LDAP_P(( LDAP *ld, Sockbuf *sb, struct ldap_conncb *ctx ));
/* Callbacks are pushed on a stack. Last one pushed is first one executed. The * delete callback is called with a NULL Sockbuf just before freeing the LDAP handle. */ typedef struct ldap_conncb { ldap_conn_add_f *lc_add; ldap_conn_del_f *lc_del; void *lc_arg; } ldap_conncb;
/* * The API draft spec says we should declare (or cause to be declared) * 'struct timeval'. We don't. See IETF LDAPext discussions. */ struct timeval;
/* * in options.c: */ LDAP_F( int ) ldap_get_option LDAP_P(( LDAP *ld, int option, void *outvalue));
LDAP_F( int ) ldap_set_option LDAP_P(( LDAP *ld, int option, LDAP_CONST void *invalue));
#if LDAP_DEPRECATED LDAP_F( int ) ldap_add LDAP_P(( /* deprecated, use ldap_add_ext */ LDAP *ld, LDAP_CONST char *dn, LDAPMod **attrs ));
LDAP_F( int ) ldap_add_s LDAP_P(( /* deprecated, use ldap_add_ext_s */ LDAP *ld, LDAP_CONST char *dn, LDAPMod **attrs )); #endif
/* * in sasl.c: */ LDAP_F( int ) ldap_sasl_bind LDAP_P(( LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *mechanism, struct berval *cred, LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp ));
/* Interaction flags (should be passed about in a control) * Automatic (default): use defaults, prompt otherwise * Interactive: prompt always * Quiet: never prompt */ #define LDAP_SASL_AUTOMATIC 0U #define LDAP_SASL_INTERACTIVE 1U #define LDAP_SASL_QUIET 2U
/* * V3 SASL Interaction Function Callback Prototype * when using Cyrus SASL, interact is pointer to sasl_interact_t * should likely passed in a control (and provided controls) */ typedef int (LDAP_SASL_INTERACT_PROC) LDAP_P(( LDAP *ld, unsigned flags, void* defaults, void *interact ));