1N/A/*
1N/A * Copyright 2001-2003 Sun Microsystems, Inc. All rights reserved.
1N/A * Use is subject to license terms.
1N/A */
1N/A
1N/A#pragma ident "%Z%%M% %I% %E% SMI"
1N/A
1N/A#ifndef _SOLARISINT_H
1N/A#define _SOLARISINT_H
1N/A
1N/A#ifdef __cplusplus
1N/Aextern "C" {
1N/A#endif
1N/A
1N/A#include <stdio.h>
1N/A#include <ctype.h>
1N/A#include <stdarg.h>
1N/A#include <stdlib.h>
1N/A
1N/A#include "ldap.h"
1N/A
1N/A/*
1N/A * These were moved from lber.h. This should have been ifdef'd with
1N/A * _SOLARIS_SDK but since we do not want to expose these in lber.h its
1N/A * not possible to ifndef it there.
1N/A */
1N/A
1N/A/* BerElement set/get options */
1N/A#define LBER_OPT_REMAINING_BYTES 0x01
1N/A#define LBER_OPT_TOTAL_BYTES 0x02
1N/A#define LBER_OPT_USE_DER 0x04
1N/A#define LBER_OPT_TRANSLATE_STRINGS 0x08
1N/A#define LBER_OPT_BYTES_TO_WRITE 0x10
1N/A#define LBER_OPT_MEMALLOC_FN_PTRS 0x20
1N/A#define LBER_OPT_DEBUG_LEVEL 0x40
1N/A/*
1N/A * LBER_USE_DER is defined for compatibility with the C LDAP API RFC.
1N/A * In our implementation, we recognize it (instead of the numerically
1N/A * identical LBER_OPT_REMAINING_BYTES) in calls to ber_alloc_t() and
1N/A * ber_init_w_nullchar() only. Callers of ber_set_option() or
1N/A * ber_get_option() must use LBER_OPT_USE_DER instead. Sorry!
1N/A */
1N/A#define LBER_USE_DER 0x01
1N/A
1N/A/* Sockbuf set/get options */
1N/A#define LBER_SOCKBUF_OPT_TO_FILE 0x001
1N/A#define LBER_SOCKBUF_OPT_TO_FILE_ONLY 0x002
1N/A#define LBER_SOCKBUF_OPT_MAX_INCOMING_SIZE 0x004
1N/A#define LBER_SOCKBUF_OPT_NO_READ_AHEAD 0x008
1N/A#define LBER_SOCKBUF_OPT_DESC 0x010
1N/A#define LBER_SOCKBUF_OPT_COPYDESC 0x020
1N/A#define LBER_SOCKBUF_OPT_READ_FN 0x040
1N/A#define LBER_SOCKBUF_OPT_WRITE_FN 0x080
1N/A#define LBER_SOCKBUF_OPT_EXT_IO_FNS 0x100
1N/A
1N/A#ifndef _SOLARIS_SDK
1N/A/*
1N/A * The following is not used by solaris. Just kept to stay in sync with
1N/A * iplanet and also a place holder (0x200)
1N/A */
1N/A#define LBER_SOCKBUF_OPT_VALID_TAG 0x200
1N/A#endif /* !_SOLARIS_SDK */
1N/A
1N/A/*
1N/A * Socket buffer structure associated to the LDAP connection
1N/A */
1N/A#define LDAP_X_OPT_SOCKBUF (LDAP_OPT_PRIVATE_EXTENSION_BASE + 0x0F02)
1N/A /* 0x4000 + 0x0F02 = 0x4F02 = 20226 - API extension */
1N/A
1N/A
1N/A#define LBER_OPT_ON ((void *) 1)
1N/A#define LBER_OPT_OFF ((void *) 0)
1N/A
1N/A/* Used in various functions */
1N/A#define LBER_FUNC_VALUE -1
1N/A
1N/Astruct lextiof_socket_private; /* Defined by the extended I/O */
1N/A /* callback functions */
1N/Astruct lextiof_session_private; /* Defined by the extended I/O */
1N/A /* callback functions */
1N/A
1N/A/* This is modeled after the PRIOVec that is passed to the NSPR
1N/A writev function! The void* is a char* in that struct */
1N/Atypedef struct ldap_x_iovec {
1N/A char *ldapiov_base;
1N/A int ldapiov_len;
1N/A} ldap_x_iovec;
1N/A
1N/A/*
1N/A * libldap read and write I/O function callbacks. The rest of the I/O callback
1N/A * types are defined in ldap.h
1N/A */
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_IOF_READ_CALLBACK)( LBER_SOCKET s,
1N/A void *buf, int bufsize );
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_IOF_WRITE_CALLBACK)( LBER_SOCKET s,
1N/A const void *buf, int len );
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_X_EXTIOF_READ_CALLBACK)( int s,
1N/A void *buf, int bufsize, struct lextiof_socket_private *arg );
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_X_EXTIOF_WRITE_CALLBACK)( int s,
1N/A const void *buf, int len, struct lextiof_socket_private *arg );
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_X_EXTIOF_WRITEV_CALLBACK)(int s,
1N/A const ldap_x_iovec iov[], int iovcnt, struct lextiof_socket_private *socketarg);
1N/A
1N/A
1N/A/*
1N/A * Structure for use with LBER_SOCKBUF_OPT_EXT_IO_FNS:
1N/A */
1N/Astruct lber_x_ext_io_fns {
1N/A /* lbextiofn_size should always be set to LBER_X_EXTIO_FNS_SIZE */
1N/A int lbextiofn_size;
1N/A LDAP_X_EXTIOF_READ_CALLBACK *lbextiofn_read;
1N/A LDAP_X_EXTIOF_WRITE_CALLBACK *lbextiofn_write;
1N/A struct lextiof_socket_private *lbextiofn_socket_arg;
1N/A LDAP_X_EXTIOF_WRITEV_CALLBACK *lbextiofn_writev;
1N/A};
1N/A#define LBER_X_EXTIO_FNS_SIZE sizeof(struct lber_x_ext_io_fns)
1N/A
1N/A/*
1N/A * liblber memory allocation callback functions. These are global to all
1N/A * Sockbufs and BerElements. Install your own functions by using a call
1N/A * like this: ber_set_option( NULL, LBER_OPT_MEMALLOC_FN_PTRS, &memalloc_fns );
1N/A */
1N/Atypedef void * (LDAP_C LDAP_CALLBACK LDAP_MALLOC_CALLBACK)( size_t size );
1N/Atypedef void * (LDAP_C LDAP_CALLBACK LDAP_CALLOC_CALLBACK)( size_t nelem,
1N/A size_t elsize );
1N/Atypedef void * (LDAP_C LDAP_CALLBACK LDAP_REALLOC_CALLBACK)( void *ptr,
1N/A size_t size );
1N/Atypedef void (LDAP_C LDAP_CALLBACK LDAP_FREE_CALLBACK)( void *ptr );
1N/A
1N/Astruct lber_memalloc_fns {
1N/A LDAP_MALLOC_CALLBACK *lbermem_malloc;
1N/A LDAP_CALLOC_CALLBACK *lbermem_calloc;
1N/A LDAP_REALLOC_CALLBACK *lbermem_realloc;
1N/A LDAP_FREE_CALLBACK *lbermem_free;
1N/A};
1N/A
1N/A/*
1N/A * Functions marked as Project Private in PSARC case and moved
1N/A * from lber.h
1N/A */
1N/Atypedef struct sockbuf Sockbuf;
1N/A
1N/ALDAP_API(void) LDAP_CALL ber_special_free(void* buf, BerElement *ber);
1N/ALDAP_API(void*) LDAP_CALL ber_special_alloc(size_t size, BerElement **ppBer);
1N/ALDAP_API(ber_uint_t) LDAP_CALL ber_get_next_buffer( void *buffer,
1N/A size_t buffer_size, ber_len_t *len, BerElement *ber,
1N/A ber_uint_t *Bytes_Scanned );
1N/ALDAP_API(ber_uint_t) LDAP_CALL ber_get_next_buffer_ext( void *buffer,
1N/A size_t buffer_size, ber_len_t *len, BerElement *ber,
1N/A ber_len_t *Bytes_Scanned, Sockbuf *sb );
1N/ALDAP_API(void) LDAP_CALL ber_init_w_nullchar( BerElement *ber, int options );
1N/ALDAP_API(int) LDAP_CALL ber_set_option( BerElement *ber, int option,
1N/A void *value );
1N/ALDAP_API(int) LDAP_CALL ber_get_option( BerElement *ber, int option,
1N/A void *value );
1N/ALDAP_API(Sockbuf*) LDAP_CALL ber_sockbuf_alloc( void );
1N/ALDAP_API(void) LDAP_CALL ber_sockbuf_free( Sockbuf* p );
1N/ALDAP_API(int) LDAP_CALL ber_sockbuf_set_option( Sockbuf *sb, int option,
1N/A void *value );
1N/ALDAP_API(int) LDAP_CALL ber_sockbuf_get_option( Sockbuf *sb, int option,
1N/A void *value );
1N/ALDAP_API(int) LDAP_CALL ber_flush( Sockbuf *sb, BerElement *ber, int freeit );
1N/ALDAP_API(ber_tag_t) LDAP_CALL ber_get_next( Sockbuf *sb, ber_len_t *len,
1N/A BerElement *ber );
1N/A
1N/A/*
1N/A * The following was moved from ldap.h
1N/A */
1N/A
1N/A/*
1N/A * These extended I/O function callbacks echo the BSD socket API but accept
1N/A * an extra pointer parameter at the end of their argument list that can
1N/A * be used by client applications for their own needs. For some of the calls,
1N/A * the pointer is a session argument of type struct lextiof_session_private *
1N/A * that is associated with the LDAP session handle (LDAP *). For others, the
1N/A * pointer is a socket specific struct lextiof_socket_private * argument that
1N/A * is associated with a particular socket (a TCP connection).
1N/A *
1N/A * The lextiof_session_private and lextiof_socket_private structures are not
1N/A * defined by the LDAP C API; users of this extended I/O interface should
1N/A * define these themselves.
1N/A *
1N/A * The combination of the integer socket number (i.e., lpoll_fd, which is
1N/A * the value returned by the CONNECT callback) and the application specific
1N/A * socket argument (i.e., lpoll_socketarg, which is the value set in *sockargpp
1N/A * by the CONNECT callback) must be unique.
1N/A *
1N/A * The types for the extended READ and WRITE callbacks are actually in lber.h.
1N/A *
1N/A * The CONNECT callback gets passed both the session argument (sessionarg)
1N/A * and a pointer to a socket argument (socketargp) so it has the
1N/A * opportunity to set the socket-specific argument. The CONNECT callback
1N/A * also takes a timeout parameter whose value can be set by calling
1N/A * ldap_set_option( ld, LDAP_X_OPT_..., &val ). The units used for the
1N/A * timeout parameter are milliseconds.
1N/A *
1N/A * A POLL interface is provided instead of a select() one. The timeout is
1N/A * in milliseconds.
1N/A
1N/A * A NEWHANDLE callback function is also provided. It is called right
1N/A * after the LDAP session handle is created, e.g., during ldap_init().
1N/A * If the NEWHANDLE callback returns anything other than LDAP_SUCCESS,
1N/A * the session handle allocation fails.
1N/A *
1N/A * A DISPOSEHANDLE callback function is also provided. It is called right
1N/A * before the LDAP session handle and its contents are destroyed, e.g.,
1N/A * during ldap_unbind().
1N/A */
1N/A
1N/A/* LDAP poll()-like descriptor:
1N/A */
1N/Atypedef struct ldap_x_pollfd { /* used by LDAP_X_EXTIOF_POLL_CALLBACK */
1N/A int lpoll_fd; /* integer file descriptor / socket */
1N/A struct lextiof_socket_private
1N/A *lpoll_socketarg;
1N/A /* pointer socket and for use by */
1N/A /* application */
1N/A short lpoll_events; /* requested event */
1N/A short lpoll_revents; /* returned event */
1N/A} LDAP_X_PollFD;
1N/A
1N/A/* Event flags for lpoll_events and lpoll_revents:
1N/A */
1N/A#define LDAP_X_POLLIN 0x01 /* regular data ready for reading */
1N/A#define LDAP_X_POLLPRI 0x02 /* high priority data available */
1N/A#define LDAP_X_POLLOUT 0x04 /* ready for writing */
1N/A#define LDAP_X_POLLERR 0x08 /* error occurred -- only in lpoll_revents */
1N/A#define LDAP_X_POLLHUP 0x10 /* connection closed -- only in lpoll_revents */
1N/A#define LDAP_X_POLLNVAL 0x20 /* invalid lpoll_fd -- only in lpoll_revents */
1N/A
1N/A/* Options passed to LDAP_X_EXTIOF_CONNECT_CALLBACK to modify socket behavior:
1N/A */
1N/A#define LDAP_X_EXTIOF_OPT_NONBLOCKING 0x01 /* turn on non-blocking mode */
1N/A#define LDAP_X_EXTIOF_OPT_SECURE 0x02 /* turn on 'secure' mode */
1N/A
1N/A/* extended I/O callback function prototypes:
1N/A */
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_X_EXTIOF_CONNECT_CALLBACK )(
1N/A const char *hostlist, int port, /* host byte order */
1N/A int timeout /* milliseconds */,
1N/A unsigned long options, /* bitmapped options */
1N/A struct lextiof_session_private *sessionarg,
1N/A struct lextiof_socket_private **socketargp
1N/A#ifdef _SOLARIS_SDK
1N/A , void **datapriv );
1N/A#else
1N/A );
1N/A#endif
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_X_EXTIOF_CLOSE_CALLBACK )(
1N/A int s, struct lextiof_socket_private *socketarg );
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_X_EXTIOF_POLL_CALLBACK)(
1N/A LDAP_X_PollFD fds[], int nfds, int timeout /* milliseconds */,
1N/A struct lextiof_session_private *sessionarg );
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_X_EXTIOF_NEWHANDLE_CALLBACK)(
1N/A LDAP *ld, struct lextiof_session_private *sessionarg );
1N/Atypedef void (LDAP_C LDAP_CALLBACK LDAP_X_EXTIOF_DISPOSEHANDLE_CALLBACK)(
1N/A LDAP *ld, struct lextiof_session_private *sessionarg );
1N/A
1N/A
1N/A/* Structure to hold extended I/O function pointers:
1N/A */
1N/Astruct ldap_x_ext_io_fns {
1N/A /* lextiof_size should always be set to LDAP_X_EXTIO_FNS_SIZE */
1N/A int lextiof_size;
1N/A LDAP_X_EXTIOF_CONNECT_CALLBACK *lextiof_connect;
1N/A LDAP_X_EXTIOF_CLOSE_CALLBACK *lextiof_close;
1N/A LDAP_X_EXTIOF_READ_CALLBACK *lextiof_read;
1N/A LDAP_X_EXTIOF_WRITE_CALLBACK *lextiof_write;
1N/A LDAP_X_EXTIOF_POLL_CALLBACK *lextiof_poll;
1N/A LDAP_X_EXTIOF_NEWHANDLE_CALLBACK *lextiof_newhandle;
1N/A LDAP_X_EXTIOF_DISPOSEHANDLE_CALLBACK *lextiof_disposehandle;
1N/A void *lextiof_session_arg;
1N/A LDAP_X_EXTIOF_WRITEV_CALLBACK *lextiof_writev;
1N/A};
1N/A#define LDAP_X_EXTIO_FNS_SIZE sizeof(struct ldap_x_ext_io_fns)
1N/A
1N/A
1N/A/*
1N/A * Utility functions for parsing space-separated host lists (useful for
1N/A * implementing an extended I/O CONNECT callback function).
1N/A */
1N/Astruct ldap_x_hostlist_status;
1N/ALDAP_API(int) LDAP_CALL ldap_x_hostlist_first( const char *hostlist,
1N/A int defport, char **hostp, int *portp /* host byte order */,
1N/A struct ldap_x_hostlist_status **statusp );
1N/ALDAP_API(int) LDAP_CALL ldap_x_hostlist_next( char **hostp,
1N/A int *portp /* host byte order */, struct ldap_x_hostlist_status *status );
1N/ALDAP_API(void) LDAP_CALL ldap_x_hostlist_statusfree(
1N/A struct ldap_x_hostlist_status *status );
1N/A
1N/A
1N/A/*
1N/A * I/O callback functions (note that types for the read and write callbacks
1N/A * are actually in lber.h):
1N/A */
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_IOF_SELECT_CALLBACK)( int nfds,
1N/A fd_set *readfds, fd_set *writefds, fd_set *errorfds,
1N/A struct timeval *timeout );
1N/Atypedef LBER_SOCKET (LDAP_C LDAP_CALLBACK LDAP_IOF_SOCKET_CALLBACK)(
1N/A int domain, int type, int protocol );
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_IOF_IOCTL_CALLBACK)( LBER_SOCKET s,
1N/A int option, ... );
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_IOF_CONNECT_CALLBACK )(
1N/A LBER_SOCKET s, struct sockaddr *name, int namelen );
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_IOF_CLOSE_CALLBACK )(
1N/A LBER_SOCKET s );
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_IOF_SSL_ENABLE_CALLBACK )(
1N/A LBER_SOCKET s );
1N/A
1N/A
1N/A/*
1N/A * Structure to hold I/O function pointers:
1N/A */
1N/Astruct ldap_io_fns {
1N/A LDAP_IOF_READ_CALLBACK *liof_read;
1N/A LDAP_IOF_WRITE_CALLBACK *liof_write;
1N/A LDAP_IOF_SELECT_CALLBACK *liof_select;
1N/A LDAP_IOF_SOCKET_CALLBACK *liof_socket;
1N/A LDAP_IOF_IOCTL_CALLBACK *liof_ioctl;
1N/A LDAP_IOF_CONNECT_CALLBACK *liof_connect;
1N/A LDAP_IOF_CLOSE_CALLBACK *liof_close;
1N/A LDAP_IOF_SSL_ENABLE_CALLBACK *liof_ssl_enable;
1N/A};
1N/A
1N/A/********* the functions in the following section are experimental ***********/
1N/A
1N/A#define LDAP_OPT_PREFERRED_LANGUAGE 0x14 /* 20 - API extension */
1N/A
1N/A/*
1N/A * SSL option (an API extension):
1N/A */
1N/A#define LDAP_OPT_SSL 0x0A /* 10 - API extension */
1N/A
1N/A/*
1N/A * Referral hop limit (an API extension):
1N/A */
1N/A#define LDAP_OPT_REFERRAL_HOP_LIMIT 0x10 /* 16 - API extension */
1N/A
1N/A/*
1N/A * DNS resolver callbacks (an API extension --LDAP_API_FEATURE_X_DNS_FUNCTIONS).
1N/A * Note that gethostbyaddr() is not currently used.
1N/A */
1N/A#define LDAP_OPT_DNS_FN_PTRS 0x60 /* 96 - API extension */
1N/A
1N/Atypedef struct LDAPHostEnt {
1N/A char *ldaphe_name; /* official name of host */
1N/A char **ldaphe_aliases; /* alias list */
1N/A int ldaphe_addrtype; /* host address type */
1N/A int ldaphe_length; /* length of address */
1N/A char **ldaphe_addr_list; /* list of addresses from name server */
1N/A} LDAPHostEnt;
1N/A
1N/Atypedef LDAPHostEnt * (LDAP_C LDAP_CALLBACK LDAP_DNSFN_GETHOSTBYNAME)(
1N/A const char *name, LDAPHostEnt *result, char *buffer,
1N/A int buflen, int *statusp, void *extradata);
1N/Atypedef LDAPHostEnt * (LDAP_C LDAP_CALLBACK LDAP_DNSFN_GETHOSTBYADDR)(
1N/A const char *addr, int length, int type, LDAPHostEnt *result,
1N/A char *buffer, int buflen, int *statusp, void *extradata);
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_DNSFN_GETPEERNAME)(
1N/A LDAP *ld, struct sockaddr *netaddr, char *buffer, int buflen);
1N/A
1N/Astruct ldap_dns_fns {
1N/A void *lddnsfn_extradata;
1N/A int lddnsfn_bufsize;
1N/A LDAP_DNSFN_GETHOSTBYNAME *lddnsfn_gethostbyname;
1N/A LDAP_DNSFN_GETHOSTBYADDR *lddnsfn_gethostbyaddr;
1N/A LDAP_DNSFN_GETPEERNAME *lddnsfn_getpeername;
1N/A};
1N/A
1N/A/*
1N/A * Generalized cache callback interface:
1N/A */
1N/A#define LDAP_OPT_CACHE_FN_PTRS 0x0D /* 13 - API extension */
1N/A#define LDAP_OPT_CACHE_STRATEGY 0x0E /* 14 - API extension */
1N/A#define LDAP_OPT_CACHE_ENABLE 0x0F /* 15 - API extension */
1N/A
1N/A/* cache strategies */
1N/A#define LDAP_CACHE_CHECK 0
1N/A#define LDAP_CACHE_POPULATE 1
1N/A#define LDAP_CACHE_LOCALDB 2
1N/A
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_CF_BIND_CALLBACK)(LDAP *ld, int msgid,
1N/A ber_tag_t tag, const char *dn, const struct berval *creds,
1N/A int method);
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_CF_UNBIND_CALLBACK)(LDAP *ld,
1N/A int unused0, unsigned long unused1);
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_CF_SEARCH_CALLBACK)(LDAP *ld,
1N/A int msgid, ber_tag_t tag, const char *base, int scope,
1N/A const char LDAP_CALLBACK *filter, char **attrs, int attrsonly);
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_CF_COMPARE_CALLBACK)(LDAP *ld,
1N/A int msgid, ber_tag_t tag, const char *dn, const char *attr,
1N/A const struct berval *value);
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_CF_ADD_CALLBACK)(LDAP *ld,
1N/A int msgid, ber_tag_t tag, const char *dn, LDAPMod **attrs);
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_CF_DELETE_CALLBACK)(LDAP *ld,
1N/A int msgid, ber_tag_t tag, const char *dn);
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_CF_MODIFY_CALLBACK)(LDAP *ld,
1N/A int msgid, ber_tag_t tag, const char *dn, LDAPMod **mods);
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_CF_MODRDN_CALLBACK)(LDAP *ld,
1N/A int msgid, ber_tag_t tag, const char *dn, const char *newrdn,
1N/A int deleteoldrdn);
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_CF_RESULT_CALLBACK)(LDAP *ld,
1N/A int msgid, int all, struct timeval *timeout, LDAPMessage **result);
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_CF_FLUSH_CALLBACK)(LDAP *ld,
1N/A const char *dn, const char *filter);
1N/A
1N/Astruct ldap_cache_fns {
1N/A void *lcf_private;
1N/A LDAP_CF_BIND_CALLBACK *lcf_bind;
1N/A LDAP_CF_UNBIND_CALLBACK *lcf_unbind;
1N/A LDAP_CF_SEARCH_CALLBACK *lcf_search;
1N/A LDAP_CF_COMPARE_CALLBACK *lcf_compare;
1N/A LDAP_CF_ADD_CALLBACK *lcf_add;
1N/A LDAP_CF_DELETE_CALLBACK *lcf_delete;
1N/A LDAP_CF_MODIFY_CALLBACK *lcf_modify;
1N/A LDAP_CF_MODRDN_CALLBACK *lcf_modrdn;
1N/A LDAP_CF_RESULT_CALLBACK *lcf_result;
1N/A LDAP_CF_FLUSH_CALLBACK *lcf_flush;
1N/A};
1N/A
1N/Aint LDAP_CALL ldap_cache_flush(LDAP *ld, const char *dn,
1N/A const char *filter);
1N/A
1N/A/*
1N/A * Memory allocation callback functions (an API extension --
1N/A * LDAP_API_FEATURE_X_MEMALLOC_FUNCTIONS). These are global and can
1N/A * not be set on a per-LDAP session handle basis. Install your own
1N/A * functions by making a call like this:
1N/A * ldap_set_option( NULL, LDAP_OPT_MEMALLOC_FN_PTRS, &memalloc_fns );
1N/A *
1N/A * look in lber.h for the function typedefs themselves.
1N/A */
1N/A#define LDAP_OPT_MEMALLOC_FN_PTRS 0x61 /* 97 - API extension */
1N/A
1N/Astruct ldap_memalloc_fns {
1N/A LDAP_MALLOC_CALLBACK *ldapmem_malloc;
1N/A LDAP_CALLOC_CALLBACK *ldapmem_calloc;
1N/A LDAP_REALLOC_CALLBACK *ldapmem_realloc;
1N/A LDAP_FREE_CALLBACK *ldapmem_free;
1N/A};
1N/A
1N/A
1N/A/*
1N/A * Memory allocation functions (an API extension)
1N/A */
1N/Avoid *ldap_x_malloc( size_t size );
1N/Avoid *ldap_x_calloc( size_t nelem, size_t elsize );
1N/Avoid *ldap_x_realloc( void *ptr, size_t size );
1N/Avoid ldap_x_free( void *ptr );
1N/A
1N/A/*
1N/A * Extra thread callback functions (an API extension --
1N/A * LDAP_API_FEATURE_X_EXTHREAD_FUNCTIONS)
1N/A */
1N/A#define LDAP_OPT_EXTRA_THREAD_FN_PTRS 0x65 /* 101 - API extension */
1N/A
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_TF_MUTEX_TRYLOCK_CALLBACK)( void *m );
1N/Atypedef void *(LDAP_C LDAP_CALLBACK LDAP_TF_SEMA_ALLOC_CALLBACK)( void );
1N/Atypedef void (LDAP_C LDAP_CALLBACK LDAP_TF_SEMA_FREE_CALLBACK)( void *s );
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_TF_SEMA_WAIT_CALLBACK)( void *s );
1N/Atypedef int (LDAP_C LDAP_CALLBACK LDAP_TF_SEMA_POST_CALLBACK)( void *s );
1N/Atypedef void *(LDAP_C LDAP_CALLBACK LDAP_TF_THREADID_CALLBACK)(void);
1N/A
1N/Astruct ldap_extra_thread_fns {
1N/A LDAP_TF_MUTEX_TRYLOCK_CALLBACK *ltf_mutex_trylock;
1N/A LDAP_TF_SEMA_ALLOC_CALLBACK *ltf_sema_alloc;
1N/A LDAP_TF_SEMA_FREE_CALLBACK *ltf_sema_free;
1N/A LDAP_TF_SEMA_WAIT_CALLBACK *ltf_sema_wait;
1N/A LDAP_TF_SEMA_POST_CALLBACK *ltf_sema_post;
1N/A LDAP_TF_THREADID_CALLBACK *ltf_threadid_fn;
1N/A};
1N/A
1N/A
1N/A/*
1N/A * Debugging level (an API extension)
1N/A */
1N/A#define LDAP_OPT_DEBUG_LEVEL 0x6E /* 110 - API extension */
1N/A/* On UNIX, there's only one copy of ldap_debug */
1N/A/* On NT, each dll keeps its own module_ldap_debug, which */
1N/A/* points to the process' ldap_debug and needs initializing after load */
1N/A#ifdef _WIN32
1N/Aextern int *module_ldap_debug;
1N/Atypedef void (*set_debug_level_fn_t)(int*);
1N/A#endif
1N/A
1N/A/************************ end of experimental section ************************/
1N/A
1N/A
1N/ALDAP_API(int) LDAP_CALL ldap_keysort_entries( LDAP *ld, LDAPMessage **chain,
1N/A void *arg, LDAP_KEYGEN_CALLBACK *gen, LDAP_KEYCMP_CALLBACK *cmp,
1N/A LDAP_KEYFREE_CALLBACK *fre );
1N/A
1N/A/*
1N/A * utility routines
1N/A */
1N/ALDAP_API(int) LDAP_CALL ldap_charray_add( char ***a, char *s );
1N/ALDAP_API(int) LDAP_CALL ldap_charray_merge( char ***a, char **s );
1N/ALDAP_API(void) LDAP_CALL ldap_charray_free( char **array );
1N/ALDAP_API(int) LDAP_CALL ldap_charray_inlist( char **a, char *s );
1N/ALDAP_API(char **) LDAP_CALL ldap_charray_dup( char **a );
1N/ALDAP_API(char **) LDAP_CALL ldap_str2charray( char *str, char *brkstr );
1N/ALDAP_API(int) LDAP_CALL ldap_charray_position( char **a, char *s );
1N/A
1N/A/*
1N/A * UTF-8 routines (should these move into libnls?)
1N/A */
1N/A/* number of bytes in character */
1N/ALDAP_API(int) LDAP_CALL ldap_utf8len( const char* );
1N/A/* find next character */
1N/ALDAP_API(char*) LDAP_CALL ldap_utf8next( char* );
1N/A/* find previous character */
1N/ALDAP_API(char*) LDAP_CALL ldap_utf8prev( char* );
1N/A/* copy one character */
1N/ALDAP_API(int) LDAP_CALL ldap_utf8copy( char* dst, const char* src );
1N/A/* total number of characters */
1N/ALDAP_API(size_t) LDAP_CALL ldap_utf8characters( const char* );
1N/A/* get one UCS-4 character, and move *src to the next character */
1N/ALDAP_API(unsigned long) LDAP_CALL ldap_utf8getcc( const char** src );
1N/A/* UTF-8 aware strtok_r() */
1N/ALDAP_API(char*) LDAP_CALL ldap_utf8strtok_r( char* src, const char* brk, char** next);
1N/A
1N/A/* like isalnum(*s) in the C locale */
1N/ALDAP_API(int) LDAP_CALL ldap_utf8isalnum( char* s );
1N/A/* like isalpha(*s) in the C locale */
1N/ALDAP_API(int) LDAP_CALL ldap_utf8isalpha( char* s );
1N/A/* like isdigit(*s) in the C locale */
1N/ALDAP_API(int) LDAP_CALL ldap_utf8isdigit( char* s );
1N/A/* like isxdigit(*s) in the C locale */
1N/ALDAP_API(int) LDAP_CALL ldap_utf8isxdigit(char* s );
1N/A/* like isspace(*s) in the C locale */
1N/ALDAP_API(int) LDAP_CALL ldap_utf8isspace( char* s );
1N/A
1N/A#define LDAP_UTF8LEN(s) ((0x80 & *(unsigned char*)(s)) ? ldap_utf8len (s) : 1)
1N/A#define LDAP_UTF8NEXT(s) ((0x80 & *(unsigned char*)(s)) ? ldap_utf8next(s) : (s)+1)
1N/A#define LDAP_UTF8INC(s) ((0x80 & *(unsigned char*)(s)) ? s=ldap_utf8next(s) : ++s)
1N/A
1N/A#define LDAP_UTF8PREV(s) ldap_utf8prev(s)
1N/A#define LDAP_UTF8DEC(s) (s=ldap_utf8prev(s))
1N/A
1N/A#define LDAP_UTF8COPY(d,s) ((0x80 & *(unsigned char*)(s)) ? ldap_utf8copy(d,s) : ((*(d) = *(s)), 1))
1N/A#define LDAP_UTF8GETCC(s) ((0x80 & *(unsigned char*)(s)) ? ldap_utf8getcc (&s) : *s++)
1N/A#define LDAP_UTF8GETC(s) ((0x80 & *(unsigned char*)(s)) ? ldap_utf8getcc ((const char**)&s) : *s++)
1N/A
1N/A#ifdef __cplusplus
1N/A}
1N/A#endif
1N/A#endif /* _SOLARISINT_H */
1N/A