/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2007 The OpenLDAP Foundation.
+ * Copyright 1998-2009 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include <sasl.h>
#endif
-#define SASL_MAX_BUFF_SIZE 65536
+#define SASL_MAX_BUFF_SIZE (0xffffff)
#define SASL_MIN_BUFF_SIZE 4096
#endif
+/* for struct timeval */
+#include <ac/time.h>
+
#undef TV2MILLISEC
#define TV2MILLISEC(tv) (((tv)->tv_sec * 1000) + ((tv)->tv_usec/1000))
#ifdef LDAP_DEBUG
+#define DebugTest( level ) \
+ ( ldap_debug & level )
+
#define Debug( level, fmt, arg1, arg2, arg3 ) \
do { if ( ldap_debug & level ) \
ldap_log_printf( NULL, (level), (fmt), (arg1), (arg2), (arg3) ); \
#else
+#define DebugTest( level ) (0 == 1)
#define Debug( level, fmt, arg1, arg2, arg3 ) ((void)0)
#define LDAP_Debug( subsystem, level, fmt, arg1, arg2, arg3 ) ((void)0)
#define LDAP_BOOL_RESTART 1
#define LDAP_BOOL_TLS 3
#define LDAP_BOOL_CONNECT_ASYNC 4
+#define LDAP_BOOL_SASL_NOCANON 5
#define LDAP_BOOLEANS unsigned long
#define LDAP_BOOL(n) ((LDAP_BOOLEANS)1 << (n))
char *lt_cacertfile;
char *lt_cacertdir;
char *lt_ciphersuite;
+ char *lt_crlfile;
+ char *lt_randfile; /* OpenSSL only */
+ int lt_protocol_min;
};
#endif
+typedef struct ldaplist {
+ struct ldaplist *ll_next;
+ void *ll_data;
+} ldaplist;
+
/*
* structure representing get/set'able options
* which have global defaults.
#endif
/* per API call timeout */
- struct timeval *ldo_tm_api;
- struct timeval *ldo_tm_net;
+ struct timeval ldo_tm_api;
+ struct timeval ldo_tm_net;
ber_int_t ldo_version;
ber_int_t ldo_deref;
#define ldo_tls_cacertfile ldo_tls_info.lt_cacertfile
#define ldo_tls_cacertdir ldo_tls_info.lt_cacertdir
#define ldo_tls_ciphersuite ldo_tls_info.lt_ciphersuite
+#define ldo_tls_protocol_min ldo_tls_info.lt_protocol_min
+#define ldo_tls_crlfile ldo_tls_info.lt_crlfile
+#define ldo_tls_randfile ldo_tls_info.lt_randfile
int ldo_tls_mode;
int ldo_tls_require_cert;
+ int ldo_tls_impl;
#ifdef HAVE_OPENSSL_CRL
int ldo_tls_crlcheck;
#endif
struct sasl_security_properties ldo_sasl_secprops;
#endif
+#ifdef HAVE_GSSAPI
+ unsigned gssapi_flags;
+
+ unsigned ldo_gssapi_flags;
+#define LDAP_GSSAPI_OPT_DO_NOT_FREE_GSS_CONTEXT 0x0001
+#define LDAP_GSSAPI_OPT_ALLOW_REMOTE_PRINCIPAL 0x0002
+ unsigned ldo_gssapi_options;
+#endif
+
+ /*
+ * Per connection tcp-keepalive settings (Linux only,
+ * ignored where unsupported)
+ */
+ ber_int_t ldo_keepalive_idle;
+ ber_int_t ldo_keepalive_probes;
+ ber_int_t ldo_keepalive_interval;
+
int ldo_refhoplimit; /* limit on referral nesting */
/* LDAPv3 server and client controls */
LDAP_URLLIST_PROC *ldo_urllist_proc;
void *ldo_urllist_params;
+ /* LDAP connection callback stack */
+ ldaplist *ldo_conn_cbs;
+
LDAP_BOOLEANS ldo_booleans; /* boolean options */
};
#ifdef HAVE_CYRUS_SASL
void *lconn_sasl_authctx; /* context for bind */
void *lconn_sasl_sockctx; /* for security layer */
+#endif
+#ifdef HAVE_GSSAPI
+ void *lconn_gss_ctx; /* gss_ctx_id_t */
#endif
int lconn_refcnt;
time_t lconn_created; /* time */
#define LDAP_CONNST_CONNECTING 2
#define LDAP_CONNST_CONNECTED 3
LDAPURLDesc *lconn_server;
-#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
- char *lconn_krbinstance;
-#endif
BerElement *lconn_ber; /* ber receiving on this conn. */
struct ldap_conn *lconn_next;
#ifdef HAVE_CYRUS_SASL
LDAP_V( ldap_pvt_thread_mutex_t ) ldap_int_sasl_mutex;
#endif
+#ifdef HAVE_GSSAPI
+LDAP_V( ldap_pvt_thread_mutex_t ) ldap_int_gssapi_mutex;
+#endif
#endif
#ifdef LDAP_R_COMPILE
*/
LDAP_F (int) ldap_int_next_line_tokens LDAP_P(( char **bufp, ber_len_t *blenp, char ***toksp ));
-#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
-/*
- * in kerberos.c
- */
-LDAP_F (char *) ldap_get_kerberosv4_credentials LDAP_P((
- LDAP *ld,
- LDAP_CONST char *who,
- LDAP_CONST char *service,
- ber_len_t *len ));
-
-#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND */
-
/*
* in open.c
LDAP_F (int) ldap_int_timeval_dup( struct timeval **dest,
const struct timeval *tm );
LDAP_F (int) ldap_connect_to_host( LDAP *ld, Sockbuf *sb,
- int proto, const char *host, int port, int async );
+ int proto, LDAPURLDesc *srv, int async );
LDAP_F (int) ldap_int_poll( LDAP *ld, ber_socket_t s,
struct timeval *tvp );
-#if defined(LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND) || \
- defined(HAVE_TLS) || defined(HAVE_CYRUS_SASL)
+#if defined(HAVE_TLS) || defined(HAVE_CYRUS_SASL)
LDAP_V (char *) ldap_int_hostname;
LDAP_F (char *) ldap_host_connected_to( Sockbuf *sb,
const char *host );
LDAP_F (int) ldap_is_read_ready( LDAP *ld, Sockbuf *sb );
LDAP_F (int) ldap_is_write_ready( LDAP *ld, Sockbuf *sb );
+LDAP_F (int) ldap_int_connect_cbs( LDAP *ld, Sockbuf *sb,
+ ber_socket_t *s, LDAPURLDesc *srv, struct sockaddr *addr );
+
/*
* in os-local.c
*/
#ifdef LDAP_PF_LOCAL
LDAP_F (int) ldap_connect_to_path( LDAP *ld, Sockbuf *sb,
- const char *path, int async );
+ LDAPURLDesc *srv, int async );
#endif /* LDAP_PF_LOCAL */
/*
LDAPControl **cctrls,
ber_int_t timelimit,
ber_int_t sizelimit,
+ ber_int_t deref,
ber_int_t *msgidp));
LDAP_F (LDAPURLDesc *) ldap_url_duplist LDAP_P((
LDAPURLDesc *ludlist ));
-LDAP_F (int) ldap_url_parselist LDAP_P((
- LDAPURLDesc **ludlist,
- const char *url ));
-
LDAP_F (int) ldap_url_parsehosts LDAP_P((
LDAPURLDesc **ludlist,
const char *hosts,
LDAP_F (char **) ldap_value_dup LDAP_P((
char *const *vals ));
+/*
+ * in gssapi.c
+ */
+#ifdef HAVE_GSSAPI
+LDAP_F(int) ldap_int_gssapi_get_option LDAP_P(( LDAP *ld, int option, void *arg ));
+LDAP_F(int) ldap_int_gssapi_set_option LDAP_P(( LDAP *ld, int option, void *arg ));
+LDAP_F(int) ldap_int_gssapi_config LDAP_P(( struct ldapoptions *lo, int option, const char *arg ));
+LDAP_F(void) ldap_int_gssapi_close LDAP_P(( LDAP *ld, LDAPConn *lc ));
+#endif
+
LDAP_END_DECL
#endif /* _LDAP_INT_H */