/* ldap-int.h - defines & prototypes internal to the LDAP library */
/* $OpenLDAP$ */
/*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
/* Portions
#include "../liblber/lber-int.h"
+#ifdef LDAP_R_COMPILE
+#include <ldap_pvt_thread.h>
+#endif
+
#ifdef HAVE_CYRUS_SASL
/* the need for this should be removed */
#include <sasl.h>
#undef Debug
#define Debug( level, fmt, arg1, arg2, arg3 ) \
- ldap_log_printf( NULL, (level), (fmt), (arg1), (arg2), (arg3) )
+ do { if ( ldap_debug & level ) \
+ ldap_log_printf( NULL, (level), (fmt), (arg1), (arg2), (arg3) ); \
+ } while ( 0 )
#define LDAP_Debug( subsystem, level, fmt, arg1, arg2, arg3 )\
ldap_log_printf( NULL, (level), (fmt), (arg1), (arg2), (arg3) )
#define LDAPS_URL_PREFIX_LEN (sizeof(LDAPS_URL_PREFIX)-1)
#define LDAPI_URL_PREFIX "ldapi://"
#define LDAPI_URL_PREFIX_LEN (sizeof(LDAPI_URL_PREFIX)-1)
+#ifdef LDAP_CONNECTIONLESS
+#define LDAPC_URL_PREFIX "cldap://"
+#define LDAPC_URL_PREFIX_LEN (sizeof(LDAPC_URL_PREFIX)-1)
+#endif
#define LDAP_URL_URLCOLON "URL:"
#define LDAP_URL_URLCOLON_LEN (sizeof(LDAP_URL_URLCOLON)-1)
#define LDAP_UNINITIALIZED 0x0
#define LDAP_INITIALIZED 0x1
#define LDAP_VALID_SESSION 0x2
+#ifdef LDAP_CONNECTIONLESS
+#define LDAP_IS_UDP(ld) ((ld)->ld_options.ldo_is_udp)
+ void* ldo_peer; /* struct sockaddr* */
+ char* ldo_cldapdn;
+ int ldo_is_udp;
+#endif
int ldo_debug;
/* per API call timeout */
#endif
BerElement *lconn_ber; /* ber receiving on this conn. */
- struct ldap_conn *lconn_next;
+ struct ldap_conn *lconn_next;
} LDAPConn;
BerElement *lr_ber; /* ber encoded request contents */
LDAPConn *lr_conn; /* connection used to send request */
struct ldapreq *lr_parent; /* request that spawned this referral */
+ struct ldapreq *lr_child; /* first child request */
struct ldapreq *lr_refnext; /* next referral spawned */
struct ldapreq *lr_prev; /* previous request */
struct ldapreq *lr_next; /* next request */
#define LDAP_VALID(ld) ( (ld)->ld_valid == LDAP_VALID_SESSION )
#ifdef LDAP_R_COMPILE
-#include <ldap_pvt_thread.h>
-
#ifdef HAVE_RES_QUERY
LDAP_V ( ldap_pvt_thread_mutex_t ) ldap_int_resolv_mutex;
#endif
/* memory.c */
/* simple macros to realloc for now */
-#define LDAP_INT_MALLOC(s) (LBER_MALLOC((s)))
-#define LDAP_INT_CALLOC(n,s) (LBER_CALLOC((n),(s)))
-#define LDAP_INT_REALLOC(p,s) (LBER_REALLOC((p),(s)))
-#define LDAP_INT_FREE(p) (LBER_FREE((p)))
-#define LDAP_INT_VFREE(v) (LBER_VFREE((void **)(v)))
-#define LDAP_INT_STRDUP(s) (LBER_STRDUP((s)))
-
#define LDAP_MALLOC(s) (LBER_MALLOC((s)))
#define LDAP_CALLOC(n,s) (LBER_CALLOC((n),(s)))
#define LDAP_REALLOC(p,s) (LBER_REALLOC((p),(s)))
#define LDAP_FREE(p) (LBER_FREE((p)))
#define LDAP_VFREE(v) (LBER_VFREE((void **)(v)))
#define LDAP_STRDUP(s) (LBER_STRDUP((s)))
+#define LDAP_STRNDUP(s,l) (LBER_STRNDUP((s),(l)))
+
+/*
+ * in error.c
+ */
+LDAP_F (void) ldap_int_error_init( void );
/*
* in unit-int.c
LDAPControl *const *ctrls,
BerElement *ber ));
+LDAP_F (int) ldap_int_client_controls LDAP_P((
+ LDAP *ld,
+ LDAPControl **ctrlp ));
/*
* in dsparse.c
/*
* in os-ip.c
*/
-LDAP_F (int) ldap_int_tblsize;
+LDAP_V (int) ldap_int_tblsize;
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, unsigned long address, int port,
#endif
LDAP_F (void) ldap_int_ip_init( void );
-LDAP_F (int) do_ldap_select( LDAP *ld, struct timeval *timeout );
+LDAP_F (int) ldap_int_select( LDAP *ld, struct timeval *timeout );
LDAP_F (void *) ldap_new_select_info( void );
LDAP_F (void) ldap_free_select_info( void *sip );
LDAP_F (void) ldap_mark_select_write( LDAP *ld, Sockbuf *sb );
ber_int_t timelimit,
ber_int_t sizelimit ));
-/*
- * in string.c
- */
- /* see <ac/string.h> */
+LDAP_F( int ) ldap_int_put_filter LDAP_P((
+ BerElement *ber,
+ const char *str ));
/*
* in unbind.c
LDAP_F (int) ldap_int_sasl_close LDAP_P(( LDAP *ld, LDAPConn *conn ));
LDAP_F (int) ldap_int_sasl_external LDAP_P((
- LDAP *ld, const char* authid, ber_len_t ssf ));
+ LDAP *ld, LDAPConn *conn,
+ const char* authid, ber_len_t ssf ));
LDAP_F (int) ldap_int_sasl_get_option LDAP_P(( LDAP *ld,
int option, void *arg ));
LDAP_SASL_INTERACT_PROC *interact,
void *defaults ));
+/* in schema.c */
+LDAP_F (char *) ldap_int_parse_numericoid LDAP_P((
+ const char **sp,
+ int *code,
+ const int flags ));
/*
* in tls.c
int option, const char *arg ));
LDAP_F (int) ldap_int_tls_start LDAP_P(( LDAP *ld,
- LDAPConn *conn ));
+ LDAPConn *conn, LDAPURLDesc *srv ));
LDAP_END_DECL