]> git.sur5r.net Git - openldap/blob - libraries/libldap/ldap-int.h
c44c5910e8d386536f3dc665c6352f867db2fcaf
[openldap] / libraries / libldap / ldap-int.h
1 /*
2  *  Copyright (c) 1995 Regents of the University of Michigan.
3  *  All rights reserved.
4  *
5  *  ldap-int.h - defines & prototypes internal to the LDAP library
6  */
7
8
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
13
14 #ifdef LDAP_REFERRALS
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
19 #ifdef LDAP_DNS
20 #define LDAP_DX_REF_STR         "dx://"
21 #define LDAP_DX_REF_STR_LEN     5
22 #endif /* LDAP_DNS */
23 #endif /* LDAP_REFERRALS */
24
25
26 /*
27  * in cache.c
28  */
29 #ifdef NEEDPROTOS
30 void add_request_to_cache( LDAP *ld, unsigned long msgtype,
31         BerElement *request );
32 void add_result_to_cache( LDAP *ld, LDAPMessage *result );
33 int check_cache( LDAP *ld, unsigned long msgtype, BerElement *request );
34 #else /* NEEDPROTOS */
35 void add_request_to_cache();
36 void add_result_to_cache();
37 int check_cache();
38 #endif /* NEEDPROTOS */
39
40
41 #ifdef KERBEROS
42 /*
43  * in kerberos.c
44  */
45 #ifdef NEEDPROTOS
46 char *get_kerberosv4_credentials( LDAP *ld, char *who, char *service,
47         int *len );
48 #else /* NEEDPROTOS */
49 char *get_kerberosv4_credentials();
50 #endif /* NEEDPROTOS */
51
52 #endif /* KERBEROS */
53
54
55 /*
56  * in open.c
57  */
58 #ifdef 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 */
64
65
66 /*
67  * in os-ip.c
68  */
69 #ifdef NEEDPROTOS
70 int connect_to_host( Sockbuf *sb, char *host, unsigned long address, int port,
71         int async );
72 void close_connection( Sockbuf *sb );
73 #else /* NEEDPROTOS */
74 int connect_to_host();
75 void close_connection();
76 #endif /* NEEDPROTOS */
77
78 #ifdef KERBEROS
79 #ifdef NEEDPROTOS
80 char *host_connected_to( Sockbuf *sb );
81 #else /* NEEDPROTOS */
82 char *host_connected_to();
83 #endif /* NEEDPROTOS */
84 #endif /* KERBEROS */
85
86 #ifdef LDAP_REFERRALS
87 #ifdef NEEDPROTOS
88 int do_ldap_select( LDAP *ld, struct timeval *timeout );
89 void *new_select_info( void );
90 void free_select_info( void *sip );
91 void mark_select_write( LDAP *ld, Sockbuf *sb );
92 void mark_select_read( LDAP *ld, Sockbuf *sb );
93 void mark_select_clear( LDAP *ld, Sockbuf *sb );
94 int is_read_ready( LDAP *ld, Sockbuf *sb );
95 int is_write_ready( LDAP *ld, Sockbuf *sb );
96 #else /* NEEDPROTOS */
97 int do_ldap_select();
98 void *new_select_info();
99 void free_select_info();
100 void mark_select_write();
101 void mark_select_read();
102 void mark_select_clear();
103 int is_read_ready();
104 int is_write_ready();
105 #endif /* NEEDPROTOS */
106 #endif /* LDAP_REFERRALS */
107
108
109 /*
110  * in request.c
111  */
112 #ifdef NEEDPROTOS
113 int send_initial_request( LDAP *ld, unsigned long msgtype,
114         char *dn, BerElement *ber );
115 BerElement *alloc_ber_with_options( LDAP *ld );
116 void set_ber_options( LDAP *ld, BerElement *ber );
117 #else /* NEEDPROTOS */
118 int send_initial_request();
119 BerElement *alloc_ber_with_options();
120 void set_ber_options();
121 #endif /* NEEDPROTOS */
122
123 #if defined( LDAP_REFERRALS ) || defined( LDAP_DNS )
124 #ifdef NEEDPROTOS
125 int send_server_request( LDAP *ld, BerElement *ber, int msgid,
126         LDAPRequest *parentreq, LDAPServer *srvlist, LDAPConn *lc,
127         int bind );
128 LDAPConn *new_connection( LDAP *ld, LDAPServer **srvlistp, int use_ldsb,
129         int connect, int bind );
130 LDAPRequest *find_request_by_msgid( LDAP *ld, int msgid );
131 void free_request( LDAP *ld, LDAPRequest *lr );
132 void free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind );
133 void dump_connection( LDAP *ld, LDAPConn *lconns, int all );
134 void dump_requests_and_responses( LDAP *ld );
135 #else /* NEEDPROTOS */
136 int send_server_request();
137 LDAPConn *new_connection();
138 LDAPRequest *find_request_by_msgid();
139 void free_request();
140 void free_connection();
141 void dump_connection();
142 void dump_requests_and_responses();
143 #endif /* NEEDPROTOS */
144 #endif /* LDAP_REFERRALS || LDAP_DNS */
145
146 #ifdef LDAP_REFERRALS
147 #ifdef NEEDPROTOS
148 int chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp );
149 int append_referral( LDAP *ld, char **referralsp, char *s );
150 #else /* NEEDPROTOS */
151 int chase_referrals();
152 int append_referral();
153 #endif /* NEEDPROTOS */
154 #endif /* LDAP_REFERRALS */
155
156
157 /*
158  * in search.c
159  */
160 #ifdef NEEDPROTOS
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 */
166
167
168 /*
169  * in unbind.c
170  */
171 #ifdef NEEDPROTOS
172 int ldap_ld_free( LDAP *ld, int close );
173 int send_unbind( LDAP *ld, Sockbuf *sb );
174 #else /* NEEDPROTOS */
175 int ldap_ld_free();
176 int send_unbind();
177 #endif /* NEEDPROTOS */
178
179
180 #ifdef LDAP_DNS
181 /*
182  * in getdxbyname.c
183  */
184 #ifdef NEEDPROTOS
185 char **getdxbyname( char *domain );
186 #else /* NEEDPROTOS */
187 char **getdxbyname();
188 #endif /* NEEDPROTOS */
189 #endif /* LDAP_DNS */
190
191 #if defined( STR_TRANSLATION ) && defined( LDAP_DEFAULT_CHARSET )
192 /*
193  * in charset.c
194  *
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
198  */
199 #if LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET
200 #ifdef NEEDPROTOS
201 extern 
202 int ldap_t61_to_8859( char **bufp, unsigned long *buflenp, int free_input );
203 extern 
204 int ldap_8859_to_t61( char **bufp, unsigned long *buflenp, int free_input );
205 #else /* NEEDPROTOS */
206 extern
207 int ldap_t61_to_8859();
208 extern
209 int ldap_8859_to_t61();
210 #endif /* NEEDPROTOS */
211 #endif /* LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET */
212 #endif /* STR_TRANSLATION && LDAP_DEFAULT_CHARSET */