s3-libads: Use ldap_init_fd() to connect to AD server in socket_wrapper
[kai/samba.git] / source3 / include / smb_ldap.h
1 #ifndef _SMB_LDAP_H
2 #define _SMB_LDAP_H
3
4 #if HAVE_LBER_H
5 #include <lber.h>
6 #if defined(HPUX) && !defined(_LBER_TYPES_H)
7 /* Define ber_tag_t and ber_int_t for using
8  * HP LDAP-UX Integration products' LDAP libraries.
9 */
10 #ifndef ber_tag_t
11 typedef unsigned long ber_tag_t;
12 typedef int ber_int_t;
13 #endif
14 #endif /* defined(HPUX) && !defined(_LBER_TYPES_H) */
15 #ifndef LBER_USE_DER
16 #define LBER_USE_DER 0x01
17 #endif
18 #endif /* HAVE_LBER_H */
19
20 #if HAVE_LDAP_H
21 #include <ldap.h>
22 #ifndef LDAP_CONST
23 #define LDAP_CONST const
24 #endif
25 #ifndef LDAP_OPT_SUCCESS
26 #define LDAP_OPT_SUCCESS 0
27 #endif
28 /* Solaris 8 and maybe other LDAP implementations spell this "..._INPROGRESS": */
29 #if defined(LDAP_SASL_BIND_INPROGRESS) && !defined(LDAP_SASL_BIND_IN_PROGRESS)
30 #define LDAP_SASL_BIND_IN_PROGRESS LDAP_SASL_BIND_INPROGRESS
31 #endif
32 /* Solaris 8 defines SSL_LDAP_PORT, not LDAPS_PORT and it only does so if
33    LDAP_SSL is defined - but SSL is not working. We just want the
34    port number! Let's just define LDAPS_PORT correct. */
35 #if !defined(LDAPS_PORT)
36 #define LDAPS_PORT 636
37 #endif
38
39 /* function declarations not included in proto.h */
40 LDAP *ldap_open_with_timeout(const char *server,
41                              struct sockaddr_storage *ss,
42                              int port, unsigned int to);
43
44 #ifdef HAVE_LDAP_PVT_H
45 #include <ldap_pvt.h>
46 #endif
47 int ldap_init_fd(ber_socket_t fd, int proto, char *uri, LDAP **ldp);
48
49 #endif /* HAVE_LDAP_H */
50
51 #ifndef HAVE_LDAP
52 #define LDAP void
53 #define LDAPMessage void
54 #define LDAPMod void
55 #define LDAP_CONST const
56 #define LDAPControl void
57 struct berval;
58 struct ldapsam_privates;
59 #endif /* HAVE_LDAP */
60
61 #ifndef LDAP_OPT_SUCCESS
62 #define LDAP_OPT_SUCCESS 0
63 #endif
64
65 #endif /* _SMB_LDAP_H */