s3: Fix the build on FreeBSD 8
[Samba/gebeck_regimport.git] / source3 / include / smb_ldap.h
blob389a7342273f18e43d06844fb9ae41c376e2ac8b
1 #ifndef _SMB_LDAP_H
2 #define _SMB_LDAP_H
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 */
20 #if HAVE_LDAP_H
21 #include <ldap.h>
22 #ifndef LDAP_CONST
23 #define LDAP_CONST const
24 #endif
26 #ifdef HAVE_LDAP_PVT_H
27 #include <ldap_pvt.h>
28 #endif /* HAVE_LDAP_PVT_H */
30 #ifdef HAVE_LDAP_INIT_FD
31 int ldap_init_fd(ber_socket_t fd, int proto, char *uri, LDAP **ldp);
32 #endif
34 /* function declarations not included in proto.h */
35 LDAP *ldap_open_with_timeout(const char *server,
36 struct sockaddr_storage *ss,
37 int port, unsigned int to);
39 #ifndef LDAP_OPT_SUCCESS
40 #define LDAP_OPT_SUCCESS 0
41 #endif
42 /* Solaris 8 and maybe other LDAP implementations spell this "..._INPROGRESS": */
43 #if defined(LDAP_SASL_BIND_INPROGRESS) && !defined(LDAP_SASL_BIND_IN_PROGRESS)
44 #define LDAP_SASL_BIND_IN_PROGRESS LDAP_SASL_BIND_INPROGRESS
45 #endif
46 /* Solaris 8 defines SSL_LDAP_PORT, not LDAPS_PORT and it only does so if
47 LDAP_SSL is defined - but SSL is not working. We just want the
48 port number! Let's just define LDAPS_PORT correct. */
49 #if !defined(LDAPS_PORT)
50 #define LDAPS_PORT 636
51 #endif
53 #endif /* HAVE_LDAP_H */
55 #ifndef HAVE_LDAP
56 #define LDAP void
57 #define LDAPMessage void
58 #define LDAPMod void
59 #define LDAP_CONST const
60 #define LDAPControl void
61 struct berval;
62 struct ldapsam_privates;
63 #endif /* HAVE_LDAP */
65 #ifndef LDAP_OPT_SUCCESS
66 #define LDAP_OPT_SUCCESS 0
67 #endif
69 #endif /* _SMB_LDAP_H */