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 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();
38 #endif /* NEEDPROTOS */
46 char *get_kerberosv4_credentials( LDAP *ld, char *who, char *service,
48 #else /* NEEDPROTOS */
49 char *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 connect_to_host( Sockbuf *sb, char *host, unsigned long address, int port,
72 void close_connection( Sockbuf *sb );
73 #else /* NEEDPROTOS */
74 int connect_to_host();
75 void close_connection();
76 #endif /* NEEDPROTOS */
80 char *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 *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 */
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();
104 int is_write_ready();
105 #endif /* NEEDPROTOS */
106 #endif /* LDAP_REFERRALS */
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 */
123 #if defined( LDAP_REFERRALS ) || defined( LDAP_DNS )
125 int send_server_request( LDAP *ld, BerElement *ber, int msgid,
126 LDAPRequest *parentreq, LDAPServer *srvlist, LDAPConn *lc,
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();
140 void free_connection();
141 void dump_connection();
142 void dump_requests_and_responses();
143 #endif /* NEEDPROTOS */
144 #endif /* LDAP_REFERRALS || LDAP_DNS */
146 #ifdef LDAP_REFERRALS
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 */
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 send_unbind( LDAP *ld, Sockbuf *sb );
174 #else /* NEEDPROTOS */
177 #endif /* NEEDPROTOS */
185 char **getdxbyname( char *domain );
186 #else /* NEEDPROTOS */
187 char **getdxbyname();
188 #endif /* NEEDPROTOS */
189 #endif /* LDAP_DNS */