Keep using Samba3's charset.h for now.
[amitay/samba.git] / source3 / include / includes.h
index 3f35602ba6ebd8e32df452979dba9433153428dc..523a11e255da3c7b66d3a1d5ccc94c82d491b1f4 100644 (file)
@@ -190,12 +190,12 @@ typedef int ber_int_t;
 #undef HAVE_LDAP
 #endif
 
-#if HAVE_GSSAPI_H
-#include <gssapi.h>
-#elif HAVE_GSSAPI_GSSAPI_H
+#if HAVE_GSSAPI_GSSAPI_H
 #include <gssapi/gssapi.h>
 #elif HAVE_GSSAPI_GSSAPI_GENERIC_H
 #include <gssapi/gssapi_generic.h>
+#elif HAVE_GSSAPI_H
+#include <gssapi.h>
 #endif
 
 #if HAVE_COM_ERR_H
@@ -241,8 +241,10 @@ typedef int ber_int_t;
 #include <aio.h>
 #endif
 
-/* skip valgrind headers on 64bit AMD boxes */
-#ifndef HAVE_64BIT_LINUX
+#ifdef WITH_MADVISE_PROTECTED
+#include <sys/mman.h>
+#endif
+
 /* Special macros that are no-ops except when run under Valgrind on
  * x86.  They've moved a little bit from valgrind 1.0.4 to 1.9.4 */
 #if HAVE_VALGRIND_MEMCHECK_H
@@ -251,12 +253,11 @@ typedef int ber_int_t;
 #elif HAVE_VALGRIND_H
 #include <valgrind.h>
 #endif
-#endif
 
 /* If we have --enable-developer and the valgrind header is present,
  * then we're OK to use it.  Set a macro so this logic can be done only
  * once. */
-#if defined(DEVELOPER) && !defined(HAVE_64BIT_LINUX)
+#if defined(DEVELOPER)
 #if (HAVE_VALGRIND_H || HAVE_VALGRIND_VALGRIND_H)
 #define VALGRIND
 #endif
@@ -399,6 +400,7 @@ typedef sig_atomic_t volatile SIG_ATOMIC_T;
 #endif
 
 #define SBIG_UINT(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32))
+#define BIG_UINT(p, ofs) ((((uint64_t) IVAL(p,(ofs)+4))<<32)|IVAL(p,ofs))
 #define IVAL2_TO_SMB_BIG_UINT(buf,off) ( (((uint64_t)(IVAL((buf),(off)))) & ((uint64_t)0xFFFFFFFF)) | \
                (( ((uint64_t)(IVAL((buf),(off+4)))) & ((uint64_t)0xFFFFFFFF) ) << 32 ) )
 
@@ -559,7 +561,6 @@ typedef char fstring[FSTRING_LEN];
 #endif
 
 /* Samba 3 doesn't use iconv_convenience: */
-extern void *global_iconv_convenience;
 extern void *cmdline_lp_ctx;
 struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
 
@@ -575,6 +576,10 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
 
 #include "../talloc/talloc.h"
 
+#include "event.h"
+#include "../lib/util/tevent_unix.h"
+#include "../lib/util/tevent_ntstatus.h"
+
 #include "../lib/util/data_blob.h"
 #include "../lib/util/time.h"
 #include "../lib/util/asn1.h"
@@ -593,10 +598,10 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
 #include "dynconfig.h"
 #include "util_getent.h"
 #include "debugparse.h"
-#include "version.h"
 #include "privileges.h"
 #include "messages.h"
 #include "locking.h"
+#include "smb_perfcount.h"
 #include "smb.h"
 #include "nameserv.h"
 #include "secrets.h"
@@ -619,12 +624,9 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
 #include "ntlmssp.h"
 #include "auth.h"
 #include "ntdomain.h"
-#include "rpc_svcctl.h"
-#include "rpc_lsa.h"
 #include "reg_objects.h"
 #include "reg_db.h"
 #include "rpc_spoolss.h"
-#include "rpc_eventlog.h"
 #include "rpc_perfcount.h"
 #include "rpc_perfcount_defs.h"
 #include "librpc/gen_ndr/notify.h"
@@ -643,19 +645,21 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
 #include "nsswitch/winbind_client.h"
 #include "spnego.h"
 #include "rpc_client.h"
-#include "event.h"
 #include "dbwrap.h"
 #include "packet.h"
 #include "ctdbd_conn.h"
 #include "../lib/util/talloc_stack.h"
 #include "memcache.h"
-#include "async_req.h"
+#include "../lib/async_req/async_req_ntstatus.h"
 #include "async_smb.h"
-#include "async_sock.h"
+#include "../lib/async_req/async_sock.h"
 #include "services.h"
 #include "eventlog.h"
 
 #include "lib/smbconf/smbconf.h"
+#include "lib/smbconf/smbconf_init.h"
+#include "lib/smbconf/smbconf_reg.h"
+#include "lib/smbconf/smbconf_txt.h"
 
 /* Defines for wisXXX functions. */
 #define UNI_UPPER    0x1
@@ -675,22 +679,6 @@ struct printjob;
 
 #include "smbldap.h"
 
-#include "smb_ldap.h"
-
-struct dns_reg_state;
-
-void dns_register_smbd(struct dns_reg_state ** dns_state_ptr,
-               unsigned port,
-               int *maxfd,
-               fd_set *listen_set,
-               struct timeval *timeout);
-
-void dns_register_close(struct dns_reg_state ** dns_state_ptr);
-
-
-bool dns_register_smbd_reply(struct dns_reg_state *dns_state,
-               fd_set *lfds, struct timeval *timeout);
-
 /*
  * Reasons for cache flush.
  */
@@ -892,8 +880,25 @@ char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...) PRINTF_ATT
 #define XATTR_REPLACE 0x2       /* set value, fail if attr does not exist */
 #endif
 
-#if defined(HAVE_KRB5)
+/*
+ * This should be under the HAVE_KRB5 flag but since they're used
+ * in lp_kerberos_method(), they ned to be always available
+ */
+#define KERBEROS_VERIFY_SECRETS 0
+#define KERBEROS_VERIFY_SYSTEM_KEYTAB 1
+#define KERBEROS_VERIFY_DEDICATED_KEYTAB 2
+#define KERBEROS_VERIFY_SECRETS_AND_KEYTAB 3
 
+/*
+ * If you add any entries to the above, please modify the below expressions
+ * so they remain accurate.
+ */
+#define USE_KERBEROS_KEYTAB (KERBEROS_VERIFY_SECRETS != lp_kerberos_method())
+#define USE_SYSTEM_KEYTAB \
+    ((KERBEROS_VERIFY_SECRETS_AND_KEYTAB == lp_kerberos_method()) || \
+     (KERBEROS_VERIFY_SYSTEM_KEYTAB == lp_kerberos_method()))
+
+#if defined(HAVE_KRB5)
 krb5_error_code smb_krb5_parse_name(krb5_context context,
                                const char *name, /* in unix charset */
                                 krb5_principal *principal);
@@ -1048,6 +1053,10 @@ ssize_t readahead(int fd, off64_t offset, size_t count);
 #undef HAVE_MMAP
 #endif
 
+#ifndef CONST_DISCARD
+#define CONST_DISCARD(type, ptr)      ((type) ((void *) (ptr)))
+#endif
+
 void smb_panic( const char *why ) _NORETURN_;
 void dump_core(void) _NORETURN_;
 void exit_server(const char *const reason) _NORETURN_;