/*
*/
#ifndef _LDAP_PRIVATE_H
#define _LDAP_PRIVATE_H
#include <signal.h>
#include <pthread.h> /* rri */
#ifdef _REENTRANT
#ifndef MAX_THREAD_ID
#endif /* MAX_THREAD_ID */
#else /* _REENTRANT */
#ifndef MAX_THREAD_ID
#endif /* MAX_THREAD_ID */
#endif /* _REENTRANT */
#define COMPAT20
#define COMPAT30
#define COMPAT
#endif
#ifdef LDAP_DNS
#endif /* LDAP_DNS */
/*
#define DBG_LOCK1(st) printf("%d> %s %d:%s\n", thr_self(), st, __LINE__, __FILE__);
#define DBG_LOCK2(ld,st) printf("%d> %s ld_lockcount=%d %d:%s\n", thr_self(), st, (ld)->ld_lockcount, __LINE__, __FILE__);
*/
DBG_LOCK1("waiting for response lock") \
DBG_LOCK1("got response lock") \
} else { \
(ld)->ld_response_lockcount++; \
}
if ((ld)->ld_response_lockcount==0) { \
(ld)->ld_response_lockthread = 0; \
DBG_LOCK1("freed response lock") \
} else { \
(ld)->ld_response_lockcount--; \
}
DBG_LOCK1("waiting for ldap lock") \
DBG_LOCK1("got ldap lock") \
} else { \
(ld)->ld_lockcount++; \
}
if ((ld)->ld_lockcount==0) { \
(ld)->ld_lockthread = 0; \
DBG_LOCK1("freed ldap lock") \
} else { \
(ld)->ld_lockcount--; \
}
/*
* structure representing a Ber Element
*/
typedef struct berelement {
char *ber_buf;
char *ber_ptr;
char *ber_end;
unsigned int ber_tag;
unsigned int ber_len;
int ber_usertag;
char ber_options;
char *ber_rwptr;
/*
* 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 {
typedef struct ldap_filt_list {
char *lfl_tag;
char *lfl_pattern;
char *lfl_delims;
typedef struct ldap_filt_desc {
char *lfd_curval;
char *lfd_curvalcopy;
char **lfd_curvalwords;
char *lfd_filtprefix;
char *lfd_filtsuffix;
/*
* structure for tracking LDAP server host, ports, DNs, etc.
*/
typedef struct ldap_server {
char *lsrv_host;
int lsrv_port;
} LDAPServer;
/*
* structure representing a Socket buffer
*/
typedef struct sockbuf {
#ifndef MACOS
int sb_sd;
#else /* MACOS */
void *sb_sd;
#endif /* MACOS */
/* sockaddrs */
int sb_fd;
int sb_max_incoming;
#ifdef LDAP_SSL
int sb_ssl_tls;
#endif /* LDAP_SSL */
} Sockbuf;
/*
* structure for representing an LDAP server connection
*/
typedef struct ldap_conn {
int lconn_refcnt;
int lconn_status;
char *lconn_krbinstance;
} LDAPConn;
/*
* Structure used to keep track of search references
*/
typedef struct ldap_reference {
char ** lref_refs;
} LDAPRef;
/*
* structure used to track outstanding requests
*/
typedef struct ldapreq {
followed fails. */
} LDAPRequest;
/*
* structure for client cache
*/
typedef struct ldapcache {
} LDAPCache;
/*
* structure representing an ldap connection
*/
typedef struct ldap {
char *ld_host;
int ld_version;
char ld_lberoptions;
int ld_deref;
int ld_timelimit;
int ld_sizelimit;
int ld_msgid;
/* it is OK to change these next four values directly */
/* LP TO CHANGE */
char ld_restart;
#ifdef LDAP_SSL
int ld_use_ssl;
char *ld_ssl_key;
#endif
/* do not mess with the rest though */
void *ld_rebind_extra_arg;
/* int (*ld_rebindproc)( struct ldap *ld, char **dnp, */
/* char **passwdp, int *authmethodp, int freeit ); */
/* routine to get info needed for re-bind */
/* KE: Lists of unsolicited notifications */
/* How long to wait for while connecting to a server */
int ld_connect_timeout;
} _struct_LDAP;
/*
* handy macro to check whether LDAP struct is set up for CLDAP or not
*/
#endif /* _LDAP_PRIVATE_H */