eudora-mac/Include/ldap.h

1 line
22 KiB
C
Raw Normal View History

2018-05-23 09:59:15 +00:00
/* Copyright (c) 2017, Computer History Museum All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Computer History Museum nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _LDAP_H #define _LDAP_H #ifdef __cplusplus extern "C" { #endif #if PRAGMA_IMPORT_SUPPORTED #pragma import on #endif #if defined( _WINDOWS ) || defined( _WIN32 ) #include <winsock.h> #elif defined(macintosh) #include <utime.h> #if !defined(FD_SET) #define NBBY 8 typedef long fd_mask; #define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ #ifndef howmany #define howmany(x, y) (((x)+((y)-1))/(y)) #endif #define FD_SETSIZE 64 typedef struct fd_set{ fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; } fd_set; #define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) #define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) #define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) #define FD_ZERO(p) memset (p, 0, sizeof(*(p))) #endif /* !FD_SET */ #else #include <sys/time.h> #include <sys/types.h> #include <sys/socket.h> #endif #ifdef _AIX #include <sys/select.h> #endif /* _AIX */ #include "lber.h" #define LDAP_PORT 389 #define LDAPS_PORT 636 #define LDAP_PORT_MAX 65535 #define LDAP_VERSION1 1 #define LDAP_VERSION2 2 #define LDAP_VERSION LDAP_VERSION2 #define LDAP_OPT_DESC 1 #define LDAP_OPT_DEREF 2 #define LDAP_OPT_SIZELIMIT 3 #define LDAP_OPT_TIMELIMIT 4 #define LDAP_OPT_THREAD_FN_PTRS 5 #define LDAP_OPT_REBIND_FN 6 #define LDAP_OPT_REBIND_ARG 7 #define LDAP_OPT_REFERRALS 8 #define LDAP_OPT_RESTART 9 #define LDAP_OPT_SSL 10 #define LDAP_OPT_IO_FN_PTRS 11 #define LDAP_OPT_REFERRAL_HOP_LIMIT 16 /* for on/off options */ #define LDAP_OPT_ON ((void *)1) #define LDAP_OPT_OFF ((void *)0) extern int ldap_debug; typedef struct ldap LDAP; /* opaque connection handle */ typedef struct ldapmsg LDAPMessage; /* opaque result/entry handle */ #define NULLMSG ((LDAPMessage *)0) /* structure representing an LDAP modification */ typedef struct ldapmod { int mod_op; /* kind of mod + form of values*/ #define LDAP_MOD_ADD 0x00 #define LDAP_MOD_DELETE 0x01 #define LDAP_MOD_REPLACE 0x02 #define LDAP_MOD_BVALUES 0x80 char *mod_type; /* attribute name to modify */ union { char **modv_strvals; struct berval **modv_bvals; } mod_vals; /* values to add/delete/replace */