4fe0dcdfe5cf48716004d2179f909f46754f1ef4
[ddiss/samba.git] / source3 / include / smb_ldap.h
1 #ifndef _SMB_LDAP_H
2 #define _SMB_LDAP_H
3
4 /*
5    Unix SMB/CIFS implementation.
6
7    (C) 2011 Samba Team.
8
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 3 of the License, or
12    (at your option) any later version.
13
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18
19    You should have received a copy of the GNU General Public License
20    along with this program.  If not, see <http://www.gnu.org/licenses/>.
21 */
22
23 #if HAVE_LBER_H
24 #include <lber.h>
25 #if defined(HPUX) && !defined(_LBER_TYPES_H)
26 /* Define ber_tag_t and ber_int_t for using
27  * HP LDAP-UX Integration products' LDAP libraries.
28 */
29 #ifndef ber_tag_t
30 typedef unsigned long ber_tag_t;
31 typedef int ber_int_t;
32 #endif
33 #endif /* defined(HPUX) && !defined(_LBER_TYPES_H) */
34 #ifndef LBER_USE_DER
35 #define LBER_USE_DER 0x01
36 #endif
37 #endif /* HAVE_LBER_H */
38
39 #if HAVE_LDAP_H
40 #include <ldap.h>
41 #ifndef LDAP_CONST
42 #define LDAP_CONST const
43 #endif
44 #ifndef LDAP_OPT_SUCCESS
45 #define LDAP_OPT_SUCCESS 0
46 #endif
47 /* Solaris 8 and maybe other LDAP implementations spell this "..._INPROGRESS": */
48 #if defined(LDAP_SASL_BIND_INPROGRESS) && !defined(LDAP_SASL_BIND_IN_PROGRESS)
49 #define LDAP_SASL_BIND_IN_PROGRESS LDAP_SASL_BIND_INPROGRESS
50 #endif
51 /* Solaris 8 defines SSL_LDAP_PORT, not LDAPS_PORT and it only does so if
52    LDAP_SSL is defined - but SSL is not working. We just want the
53    port number! Let's just define LDAPS_PORT correct. */
54 #if !defined(LDAPS_PORT)
55 #define LDAPS_PORT 636
56 #endif
57
58 /* function declarations not included in proto.h */
59 LDAP *ldap_open_with_timeout(const char *server, int port, unsigned int to);
60
61 #endif /* HAVE_LDAP_H */
62
63 #ifndef HAVE_LDAP
64 #define LDAP void
65 #define LDAPMessage void
66 #define LDAPMod void
67 #define LDAP_CONST const
68 #define LDAPControl void
69 struct berval;
70 struct ldapsam_privates;
71 #endif /* HAVE_LDAP */
72
73 #ifndef LDAP_OPT_SUCCESS
74 #define LDAP_OPT_SUCCESS 0
75 #endif
76
77 #endif /* _SMB_LDAP_H */