summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/ads.h2
-rw-r--r--source3/include/includes.h40
-rw-r--r--source3/include/smb_ldap.h58
-rw-r--r--source3/include/smbldap.h14
4 files changed, 63 insertions, 51 deletions
diff --git a/source3/include/ads.h b/source3/include/ads.h
index 6ef5455766..ee6e5b8649 100644
--- a/source3/include/ads.h
+++ b/source3/include/ads.h
@@ -6,6 +6,8 @@
basically this is a wrapper around ldap
*/
+#include "smb_ldap.h"
+
struct ads_struct;
struct ads_saslwrap_ops {
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 41483525fa..eafecb7fda 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -136,45 +136,7 @@
#undef HAVE_KRB5
#endif
-#if HAVE_LBER_H
-#include <lber.h>
-#if defined(HPUX) && !defined(_LBER_TYPES_H)
-/* Define ber_tag_t and ber_int_t for using
- * HP LDAP-UX Integration products' LDAP libraries.
-*/
-#ifndef ber_tag_t
-typedef unsigned long ber_tag_t;
-typedef int ber_int_t;
-#endif
-#endif /* defined(HPUX) && !defined(_LBER_TYPES_H) */
-#ifndef LBER_USE_DER
-#define LBER_USE_DER 0x01
-#endif
-#endif
-
-#if HAVE_LDAP_H
-#include <ldap.h>
-#ifndef LDAP_CONST
-#define LDAP_CONST const
-#endif
-#ifndef LDAP_OPT_SUCCESS
-#define LDAP_OPT_SUCCESS 0
-#endif
-/* Solaris 8 and maybe other LDAP implementations spell this "..._INPROGRESS": */
-#if defined(LDAP_SASL_BIND_INPROGRESS) && !defined(LDAP_SASL_BIND_IN_PROGRESS)
-#define LDAP_SASL_BIND_IN_PROGRESS LDAP_SASL_BIND_INPROGRESS
-#endif
-/* Solaris 8 defines SSL_LDAP_PORT, not LDAPS_PORT and it only does so if
- LDAP_SSL is defined - but SSL is not working. We just want the
- port number! Let's just define LDAPS_PORT correct. */
-#if !defined(LDAPS_PORT)
-#define LDAPS_PORT 636
-#endif
-
-/* function declarations not included in proto.h */
-LDAP *ldap_open_with_timeout(const char *server, int port, unsigned int to);
-
-#else
+#ifndef HAVE_LDAP_H
#undef HAVE_LDAP
#endif
diff --git a/source3/include/smb_ldap.h b/source3/include/smb_ldap.h
new file mode 100644
index 0000000000..45e586859d
--- /dev/null
+++ b/source3/include/smb_ldap.h
@@ -0,0 +1,58 @@
+#ifndef _SMB_LDAP_H
+#define _SMB_LDAP_H
+
+#if HAVE_LBER_H
+#include <lber.h>
+#if defined(HPUX) && !defined(_LBER_TYPES_H)
+/* Define ber_tag_t and ber_int_t for using
+ * HP LDAP-UX Integration products' LDAP libraries.
+*/
+#ifndef ber_tag_t
+typedef unsigned long ber_tag_t;
+typedef int ber_int_t;
+#endif
+#endif /* defined(HPUX) && !defined(_LBER_TYPES_H) */
+#ifndef LBER_USE_DER
+#define LBER_USE_DER 0x01
+#endif
+#endif /* HAVE_LBER_H */
+
+#if HAVE_LDAP_H
+#include <ldap.h>
+#ifndef LDAP_CONST
+#define LDAP_CONST const
+#endif
+#ifndef LDAP_OPT_SUCCESS
+#define LDAP_OPT_SUCCESS 0
+#endif
+/* Solaris 8 and maybe other LDAP implementations spell this "..._INPROGRESS": */
+#if defined(LDAP_SASL_BIND_INPROGRESS) && !defined(LDAP_SASL_BIND_IN_PROGRESS)
+#define LDAP_SASL_BIND_IN_PROGRESS LDAP_SASL_BIND_INPROGRESS
+#endif
+/* Solaris 8 defines SSL_LDAP_PORT, not LDAPS_PORT and it only does so if
+ LDAP_SSL is defined - but SSL is not working. We just want the
+ port number! Let's just define LDAPS_PORT correct. */
+#if !defined(LDAPS_PORT)
+#define LDAPS_PORT 636
+#endif
+
+/* function declarations not included in proto.h */
+LDAP *ldap_open_with_timeout(const char *server, int port, unsigned int to);
+
+#endif /* HAVE_LDAP_H */
+
+#ifndef HAVE_LDAP
+#define LDAP void
+#define LDAPMessage void
+#define LDAPMod void
+#define LDAP_CONST const
+#define LDAPControl void
+struct berval;
+struct ldapsam_privates;
+#endif /* HAVE_LDAP */
+
+#ifndef LDAP_OPT_SUCCESS
+#define LDAP_OPT_SUCCESS 0
+#endif
+
+#endif /* _SMB_LDAP_H */
diff --git a/source3/include/smbldap.h b/source3/include/smbldap.h
index 3427ab54f6..7872ce4d4b 100644
--- a/source3/include/smbldap.h
+++ b/source3/include/smbldap.h
@@ -23,6 +23,8 @@
struct smbldap_state;
+#include "smb_ldap.h"
+
#ifdef HAVE_LDAP
/* specify schema versions between 2.2. and 3.0 */
@@ -277,24 +279,12 @@ NTSTATUS smbldap_search_domain_info(struct smbldap_state *ldap_state,
LDAPMessage ** result, const char *domain_name,
bool try_add);
-#else
-#define LDAP void
-#define LDAPMessage void
-#define LDAPMod void
-#define LDAP_CONST const
-#define LDAPControl void
-struct berval;
-struct ldapsam_privates;
#endif /* HAVE_LDAP */
#define LDAP_DEFAULT_TIMEOUT 15
#define LDAP_CONNECTION_DEFAULT_TIMEOUT 2
#define LDAP_PAGE_SIZE 1024
-#ifndef LDAP_OPT_SUCCESS
-#define LDAP_OPT_SUCCESS 0
-#endif
-
#define ADS_PAGE_CTL_OID "1.2.840.113556.1.4.319"
/*