2 * Copyright (c) 1995 Regents of the University of Michigan.
5 * ldap-int.h - defines & prototypes internal to the LDAP library
9 #define LDAP_URL_PREFIX "ldap://"
10 #define LDAP_URL_PREFIX_LEN 7
11 #define LDAP_URL_URLCOLON "URL:"
12 #define LDAP_URL_URLCOLON_LEN 4
15 #define LDAP_REF_STR "Referral:\n"
16 #define LDAP_REF_STR_LEN 10
17 #define LDAP_LDAP_REF_STR LDAP_URL_PREFIX
18 #define LDAP_LDAP_REF_STR_LEN LDAP_URL_PREFIX_LEN
20 #define LDAP_DX_REF_STR "dx://"
21 #define LDAP_DX_REF_STR_LEN 5
23 #endif /* LDAP_REFERRALS */
29 void ldap_add_request_to_cache LDAP_P(( LDAP *ld, unsigned long msgtype,
30 BerElement *request ));
31 void ldap_add_result_to_cache LDAP_P(( LDAP *ld, LDAPMessage *result ));
32 int ldap_check_cache LDAP_P(( LDAP *ld, unsigned long msgtype, BerElement *request ));
39 char *ldap_get_kerberosv4_credentials LDAP_P(( LDAP *ld, char *who, char *service,
42 #endif /* HAVE_KERBEROS */
48 int open_ldap_connection( LDAP *ld, Sockbuf *sb, char *host, int defport,
49 char **krbinstancep, int async );
55 int ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address, int port,
57 void ldap_close_connection( Sockbuf *sb );
60 char *ldap_host_connected_to( Sockbuf *sb );
61 #endif /* HAVE_KERBEROS */
64 int do_ldap_select( LDAP *ld, struct timeval *timeout );
65 void *ldap_new_select_info( void );
66 void ldap_free_select_info( void *sip );
67 void ldap_mark_select_write( LDAP *ld, Sockbuf *sb );
68 void ldap_mark_select_read( LDAP *ld, Sockbuf *sb );
69 void ldap_mark_select_clear( LDAP *ld, Sockbuf *sb );
70 int ldap_is_read_ready( LDAP *ld, Sockbuf *sb );
71 int ldap_is_write_ready( LDAP *ld, Sockbuf *sb );
72 #endif /* LDAP_REFERRALS */
78 int ldap_send_initial_request( LDAP *ld, unsigned long msgtype,
79 char *dn, BerElement *ber );
80 BerElement *ldap_alloc_ber_with_options( LDAP *ld );
81 void ldap_set_ber_options( LDAP *ld, BerElement *ber );
83 #if defined( LDAP_REFERRALS ) || defined( LDAP_DNS )
84 int ldap_send_server_request( LDAP *ld, BerElement *ber, int msgid,
85 LDAPRequest *parentreq, LDAPServer *srvlist, LDAPConn *lc,
87 LDAPConn *ldap_new_connection( LDAP *ld, LDAPServer **srvlistp, int use_ldsb,
88 int connect, int bind );
89 LDAPRequest *ldap_find_request_by_msgid( LDAP *ld, int msgid );
90 void ldap_free_request( LDAP *ld, LDAPRequest *lr );
91 void ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind );
92 void ldap_dump_connection( LDAP *ld, LDAPConn *lconns, int all );
93 void ldap_dump_requests_and_responses( LDAP *ld );
94 #endif /* LDAP_REFERRALS || LDAP_DNS */
97 int ldap_chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp );
98 int ldap_append_referral( LDAP *ld, char **referralsp, char *s );
99 #endif /* LDAP_REFERRALS */
105 BerElement *ldap_build_search_req( LDAP *ld, char *base, int scope,
106 char *filter, char **attrs, int attrsonly );
112 int ldap_ld_free( LDAP *ld, int close );
113 int ldap_send_unbind( LDAP *ld, Sockbuf *sb );
119 char **ldap_getdxbyname( char *domain );
120 #endif /* LDAP_DNS */
122 #if defined( STR_TRANSLATION ) && defined( LDAP_DEFAULT_CHARSET )
126 * added-in this stuff so that libldap.a would build, i.e. refs to
127 * these routines from open.c would resolve.
128 * hodges@stanford.edu 5-Feb-96
130 #if LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET
132 int ldap_t61_to_8859( char **bufp, unsigned long *buflenp, int free_input );
134 int ldap_8859_to_t61( char **bufp, unsigned long *buflenp, int free_input );
135 #endif /* LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET */
136 #endif /* STR_TRANSLATION && LDAP_DEFAULT_CHARSET */