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 */
30 void ldap_add_request_to_cache( LDAP *ld, unsigned long msgtype,
31 BerElement *request );
32 void ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result );
33 int ldap_check_cache( LDAP *ld, unsigned long msgtype, BerElement *request );
34 #else /* NEEDPROTOS */
35 void ldap_add_request_to_cache();
36 void ldap_add_result_to_cache();
37 int ldap_check_cache();
38 #endif /* NEEDPROTOS */
46 char *ldap_get_kerberosv4_credentials( LDAP *ld, char *who, char *service,
48 #else /* NEEDPROTOS */
49 char *ldap_get_kerberosv4_credentials();
50 #endif /* NEEDPROTOS */
59 int open_ldap_connection( LDAP *ld, Sockbuf *sb, char *host, int defport,
60 char **krbinstancep, int async );
61 #else /* NEEDPROTOS */
62 int open_ldap_connection();
63 #endif /* NEEDPROTOS */
70 int ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address, int port,
72 void ldap_close_connection( Sockbuf *sb );
73 #else /* NEEDPROTOS */
74 int ldap_connect_to_host();
75 void ldap_close_connection();
76 #endif /* NEEDPROTOS */
80 char *ldap_host_connected_to( Sockbuf *sb );
81 #else /* NEEDPROTOS */
82 char *host_connected_to();
83 #endif /* NEEDPROTOS */
88 int do_ldap_select( LDAP *ld, struct timeval *timeout );
89 void *ldap_new_select_info( void );
90 void ldap_free_select_info( void *sip );
91 void ldap_mark_select_write( LDAP *ld, Sockbuf *sb );
92 void ldap_mark_select_read( LDAP *ld, Sockbuf *sb );
93 void ldap_mark_select_clear( LDAP *ld, Sockbuf *sb );
94 int ldap_is_read_ready( LDAP *ld, Sockbuf *sb );
95 int ldap_is_write_ready( LDAP *ld, Sockbuf *sb );
96 #else /* NEEDPROTOS */
98 void *ldap_new_select_info();
99 void ldap_free_select_info();
100 void ldap_mark_select_write();
101 void ldap_mark_select_read();
102 void ldap_mark_select_clear();
103 int ldap_is_read_ready();
104 int ldap_is_write_ready();
105 #endif /* NEEDPROTOS */
106 #endif /* LDAP_REFERRALS */
113 int ldap_send_initial_request( LDAP *ld, unsigned long msgtype,
114 char *dn, BerElement *ber );
115 BerElement *ldap_alloc_ber_with_options( LDAP *ld );
116 void ldap_set_ber_options( LDAP *ld, BerElement *ber );
117 #else /* NEEDPROTOS */
118 int ldap_send_initial_request();
119 BerElement *ldap_alloc_ber_with_options();
120 void ldap_set_ber_options();
121 #endif /* NEEDPROTOS */
123 #if defined( LDAP_REFERRALS ) || defined( LDAP_DNS )
125 int ldap_send_server_request( LDAP *ld, BerElement *ber, int msgid,
126 LDAPRequest *parentreq, LDAPServer *srvlist, LDAPConn *lc,
128 LDAPConn *ldap_new_connection( LDAP *ld, LDAPServer **srvlistp, int use_ldsb,
129 int connect, int bind );
130 LDAPRequest *ldap_find_request_by_msgid( LDAP *ld, int msgid );
131 void ldap_free_request( LDAP *ld, LDAPRequest *lr );
132 void ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind );
133 void ldap_dump_connection( LDAP *ld, LDAPConn *lconns, int all );
134 void ldap_dump_requests_and_responses( LDAP *ld );
135 #else /* NEEDPROTOS */
136 int ldap_send_server_request();
137 LDAPConn *ldap_new_connection();
138 LDAPRequest *ldap_find_request_by_msgid();
139 void ldap_free_request();
140 void ldap_free_connection();
141 void ldap_dump_connection();
142 void ldap_dump_requests_and_responses();
143 #endif /* NEEDPROTOS */
144 #endif /* LDAP_REFERRALS || LDAP_DNS */
146 #ifdef LDAP_REFERRALS
148 int ldap_chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp );
149 int ldap_append_referral( LDAP *ld, char **referralsp, char *s );
150 #else /* NEEDPROTOS */
151 int ldap_chase_referrals();
152 int ldap_append_referral();
153 #endif /* NEEDPROTOS */
154 #endif /* LDAP_REFERRALS */
161 BerElement *ldap_build_search_req( LDAP *ld, char *base, int scope,
162 char *filter, char **attrs, int attrsonly );
163 #else /* NEEDPROTOS */
164 BerElement *ldap_build_search_req();
165 #endif /* NEEDPROTOS */
172 int ldap_ld_free( LDAP *ld, int close );
173 int ldap_send_unbind( LDAP *ld, Sockbuf *sb );
174 #else /* NEEDPROTOS */
176 int ldap_send_unbind();
177 #endif /* NEEDPROTOS */
185 char **ldap_getdxbyname( char *domain );
186 #else /* NEEDPROTOS */
187 char **ldap_getdxbyname();
188 #endif /* NEEDPROTOS */
189 #endif /* LDAP_DNS */
191 #if defined( STR_TRANSLATION ) && defined( LDAP_DEFAULT_CHARSET )
195 * added-in this stuff so that libldap.a would build, i.e. refs to
196 * these routines from open.c would resolve.
197 * hodges@stanford.edu 5-Feb-96
199 #if LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET
202 int ldap_t61_to_8859( char **bufp, unsigned long *buflenp, int free_input );
204 int ldap_8859_to_t61( char **bufp, unsigned long *buflenp, int free_input );
205 #else /* NEEDPROTOS */
207 int ldap_t61_to_8859();
209 int ldap_8859_to_t61();
210 #endif /* NEEDPROTOS */
211 #endif /* LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET */
212 #endif /* STR_TRANSLATION && LDAP_DEFAULT_CHARSET */