]> git.sur5r.net Git - openldap/blob - libraries/libldap/ldap-int.h
More files that didn't get merged properly.
[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 LDAP_BEGIN_DECL
26 /*
27  * in cache.c
28  */
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 ));
33
34
35 #ifdef HAVE_KERBEROS
36 /*
37  * in kerberos.c
38  */
39 char *ldap_get_kerberosv4_credentials LDAP_P(( LDAP *ld, char *who, char *service,
40         int *len ));
41
42 #endif /* HAVE_KERBEROS */
43
44
45 /*
46  * in open.c
47  */
48 int open_ldap_connection( LDAP *ld, Sockbuf *sb, char *host, int defport,
49         char **krbinstancep, int async );
50
51
52 /*
53  * in os-ip.c
54  */
55 int ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address, int port,
56         int async );
57 void ldap_close_connection( Sockbuf *sb );
58
59 #ifdef HAVE_KERBEROS
60 char *ldap_host_connected_to( Sockbuf *sb );
61 #endif /* HAVE_KERBEROS */
62
63 #ifdef LDAP_REFERRALS
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 */
73
74
75 /*
76  * in request.c
77  */
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 );
82
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,
86         int bind );
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 */
95
96 #ifdef LDAP_REFERRALS
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 */
100
101
102 /*
103  * in search.c
104  */
105 BerElement *ldap_build_search_req( LDAP *ld, char *base, int scope,
106         char *filter, char **attrs, int attrsonly );
107
108
109 /*
110  * in unbind.c
111  */
112 int ldap_ld_free( LDAP *ld, int close );
113 int ldap_send_unbind( LDAP *ld, Sockbuf *sb );
114
115 #ifdef LDAP_DNS
116 /*
117  * in getdxbyname.c
118  */
119 char **ldap_getdxbyname( char *domain );
120 #endif /* LDAP_DNS */
121
122 #if defined( STR_TRANSLATION ) && defined( LDAP_DEFAULT_CHARSET )
123 /*
124  * in charset.c
125  *
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
129  */
130 #if LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET
131 extern 
132 int ldap_t61_to_8859( char **bufp, unsigned long *buflenp, int free_input );
133 extern 
134 int ldap_8859_to_t61( char **bufp, unsigned long *buflenp, int free_input );
135 #endif /* LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET */
136
137 LDAP_END_DECL
138 #endif /* STR_TRANSLATION && LDAP_DEFAULT_CHARSET */