r15053: fix portabilities issues between 32-bit winbind clients and a 64-bit winbindd...
[tprouty/samba.git] / source / include / includes.h
index 45c7133f1ea676ac63afa27e2635e41420115851..1e59f50008d271cede9712178d43dbef8ea3b392 100644 (file)
 #include "config.h"
 #endif
 
 #include "config.h"
 #endif
 
+#ifndef __cplusplus
+#define class #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
+#define private #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
+#define public #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
+#define protected #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
+#define template #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
+#define this #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
+#define new #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
+#define delete #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
+#define friend #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
+#endif
+
 #include "local.h"
 
 #ifdef AIX
 #include "local.h"
 
 #ifdef AIX
@@ -55,7 +67,7 @@
 #define PRINTF_ATTRIBUTE(a1, a2)
 #endif
 
 #define PRINTF_ATTRIBUTE(a1, a2)
 #endif
 
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__cplusplus)
 /** gcc attribute used on function parameters so that it does not emit
  * warnings about them being unused. **/
 #  define UNUSED(param) param __attribute__ ((unused))
 /** gcc attribute used on function parameters so that it does not emit
  * warnings about them being unused. **/
 #  define UNUSED(param) param __attribute__ ((unused))
 #include <poll.h>
 #endif
 
 #include <poll.h>
 #endif
 
-#ifdef HAVE_EXECINFO_H
-#include <execinfo.h>
-#endif
-
-#ifdef HAVE_SYS_CAPABILITY_H
-
-#if defined(BROKEN_REDHAT_7_SYSTEM_HEADERS) && !defined(_I386_STATFS_H) && !defined(_PPC_STATFS_H)
-#define _I386_STATFS_H
-#define _PPC_STATFS_H
-#define BROKEN_REDHAT_7_STATFS_WORKAROUND
-#endif
-
-#include <sys/capability.h>
-
-#ifdef BROKEN_REDHAT_7_STATFS_WORKAROUND
-#undef _I386_STATFS_H
-#undef _PPC_STATFS_H
-#undef BROKEN_REDHAT_7_STATFS_WORKAROUND
-#endif
-
-#endif
-
 #if defined(HAVE_RPC_RPC_H)
 /*
  * Check for AUTH_ERROR define conflict with rpc/rpc.h in prot.h.
 #if defined(HAVE_RPC_RPC_H)
 /*
  * Check for AUTH_ERROR define conflict with rpc/rpc.h in prot.h.
 
 #if HAVE_LBER_H
 #include <lber.h>
 
 #if HAVE_LBER_H
 #include <lber.h>
+#ifndef LBER_USE_DER
+#define LBER_USE_DER 0x01
+#endif
 #endif
 
 #if HAVE_LDAP_H
 #include <ldap.h>
 #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
 #else
 #undef HAVE_LDAP
 #endif
 #else
 #undef HAVE_LDAP
 #endif
 #include <sys/xattr.h>
 #endif
 
 #include <sys/xattr.h>
 #endif
 
+#ifdef HAVE_SYS_EA_H
+#include <sys/ea.h>
+#endif
+
+#ifdef HAVE_SYS_EXTATTR_H
+#include <sys/extattr.h>
+#endif
+
+#ifdef HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+
 #if HAVE_LOCALE_H
 #include <locale.h>
 #endif
 #if HAVE_LOCALE_H
 #include <locale.h>
 #endif
 #include <langinfo.h>
 #endif
 
 #include <langinfo.h>
 #endif
 
+#if defined(HAVE_AIO_H) && defined(WITH_AIO)
+#include <aio.h>
+#endif
+
+/* skip valgrind headers on 64bit AMD boxes */
+#ifndef HAVE_64BIT_LINUX
 /* 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
 /* 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
 #elif HAVE_VALGRIND_H
 #include <valgrind.h>
 #endif
 #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 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) && (HAVE_VALGRIND_H || HAVE_VALGRIND_VALGRIND_H)
+#if defined(DEVELOPER) && !defined(HAVE_64BIT_LINUX)
+#if (HAVE_VALGRIND_H || HAVE_VALGRIND_VALGRIND_H)
 #define VALGRIND
 #endif
 #define VALGRIND
 #endif
+#endif
 
 
 /* we support ADS if we want it and have krb5 and ldap libs */
 
 
 /* we support ADS if we want it and have krb5 and ldap libs */
@@ -528,6 +558,7 @@ typedef int VOLATILE SIG_ATOMIC_T;
 #endif
 
 #ifndef HAVE_SOCKLEN_T_TYPE
 #endif
 
 #ifndef HAVE_SOCKLEN_T_TYPE
+#define HAVE_SOCKLEN_T_TYPE
 typedef int socklen_t;
 #endif
 
 typedef int socklen_t;
 #endif
 
@@ -607,6 +638,19 @@ typedef int socklen_t;
 #endif
 #endif
 
 #endif
 #endif
 
+/*
+ * check for 8 byte long long
+ */
+
+#if !defined(uint64)
+#if (SIZEOF_LONG == 8)
+#define uint64 unsigned long
+#elif (SIZEOF_LONG_LONG == 8)
+#define uint64 unsigned long long
+#endif /* don't lie.  If we don't have it, then don't use it */
+#endif
+
+
 /*
  * Types for devices, inodes and offsets.
  */
 /*
  * Types for devices, inodes and offsets.
  */
@@ -619,6 +663,20 @@ typedef int socklen_t;
 #  endif
 #endif
 
 #  endif
 #endif
 
+#ifndef LARGE_SMB_DEV_T
+#  if (defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_DEV64_T)) || (defined(SIZEOF_DEV_T) && (SIZEOF_DEV_T == 8))
+#    define LARGE_SMB_DEV_T 1
+#  endif
+#endif
+
+#ifdef LARGE_SMB_DEV_T
+#define SDEV_T_VAL(p, ofs, v) (SIVAL((p),(ofs),(v)&0xFFFFFFFF), SIVAL((p),(ofs)+4,(v)>>32))
+#define DEV_T_VAL(p, ofs) ((SMB_DEV_T)(((SMB_BIG_UINT)(IVAL((p),(ofs))))| (((SMB_BIG_UINT)(IVAL((p),(ofs)+4))) << 32)))
+#else 
+#define SDEV_T_VAL(p, ofs, v) (SIVAL((p),(ofs),v),SIVAL((p),(ofs)+4,0))
+#define DEV_T_VAL(p, ofs) ((SMB_DEV_T)(IVAL((p),(ofs))))
+#endif
+
 /*
  * Setup the correctly sized inode type.
  */
 /*
  * Setup the correctly sized inode type.
  */
@@ -638,9 +696,11 @@ typedef int socklen_t;
 #endif
 
 #ifdef LARGE_SMB_INO_T
 #endif
 
 #ifdef LARGE_SMB_INO_T
-#define SINO_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32))
+#define SINO_T_VAL(p, ofs, v) (SIVAL((p),(ofs),(v)&0xFFFFFFFF), SIVAL((p),(ofs)+4,(v)>>32))
+#define INO_T_VAL(p, ofs) ((SMB_INO_T)(((SMB_BIG_UINT)(IVAL(p,ofs)))| (((SMB_BIG_UINT)(IVAL(p,(ofs)+4))) << 32)))
 #else 
 #else 
-#define SINO_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
+#define SINO_T_VAL(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
+#define INO_T_VAL(p, ofs) ((SMB_INO_T)(IVAL((p),(ofs))))
 #endif
 
 #ifndef SMB_OFF_T
 #endif
 
 #ifndef SMB_OFF_T
@@ -717,6 +777,18 @@ typedef int socklen_t;
 #  endif
 #endif
 
 #  endif
 #endif
 
+/*
+ * Type for DIR structure.
+ */
+
+#ifndef SMB_STRUCT_DIR
+#  if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_DIR64)
+#    define SMB_STRUCT_DIR DIR64
+#  else
+#    define SMB_STRUCT_DIR DIR
+#  endif
+#endif
+
 /*
  * Defines for 64 bit fcntl locks.
  */
 /*
  * Defines for 64 bit fcntl locks.
  */
@@ -753,6 +825,29 @@ typedef int socklen_t;
 #  endif
 #endif
 
 #  endif
 #endif
 
+/*
+ * Type for aiocb structure.
+ */
+
+#ifndef SMB_STRUCT_AIOCB
+#  if defined(WITH_AIO)
+#    if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_AIOCB64)
+#      define SMB_STRUCT_AIOCB struct aiocb64
+#    else
+#      define SMB_STRUCT_AIOCB struct aiocb
+#    endif
+#  else
+#    define SMB_STRUCT_AIOCB int /* AIO not being used but we still need the define.... */
+#  endif
+#endif
+
+#ifndef HAVE_STRUCT_TIMESPEC
+struct timespec {
+       time_t tv_sec;            /* Seconds.  */
+       long tv_nsec;           /* Nanoseconds.  */
+};
+#endif
+
 #ifndef MIN
 #define MIN(a,b) ((a)<(b)?(a):(b))
 #endif
 #ifndef MIN
 #define MIN(a,b) ((a)<(b)?(a):(b))
 #endif
@@ -780,19 +875,27 @@ extern int errno;
 #define NGROUPS_MAX 32 /* Guess... */
 #endif
 
 #define NGROUPS_MAX 32 /* Guess... */
 #endif
 
+#ifdef SOCKET_WRAPPER
+#define SOCKET_WRAPPER_REPLACE
+#include "include/socket_wrapper.h"
+#endif
+
 /* Our own pstrings and fstrings */
 #include "pstring.h"
 
 /* Lists, trees, caching, database... */
 #include "xfile.h"
 #include "intl.h"
 /* Our own pstrings and fstrings */
 #include "pstring.h"
 
 /* Lists, trees, caching, database... */
 #include "xfile.h"
 #include "intl.h"
-#include "ubi_sLinkList.h"
-#include "ubi_dLinkList.h"
 #include "dlinklist.h"
 #include "tdb/tdb.h"
 #include "tdb/spinlock.h"
 #include "tdb/tdbutil.h"
 #include "dlinklist.h"
 #include "tdb/tdb.h"
 #include "tdb/spinlock.h"
 #include "tdb/tdbutil.h"
+
 #include "talloc.h"
 #include "talloc.h"
+/* And a little extension. Abort on type mismatch */
+#define talloc_get_type_abort(ptr, type) \
+       (type *)talloc_check_name_abort(ptr, #type)
+
 #include "nt_status.h"
 #include "ads.h"
 #include "interfaces.h"
 #include "nt_status.h"
 #include "ads.h"
 #include "interfaces.h"
@@ -802,14 +905,9 @@ extern int errno;
 #include "messages.h"
 #include "charset.h"
 #include "dynconfig.h"
 #include "messages.h"
 #include "charset.h"
 #include "dynconfig.h"
-#include "adt_tree.h"
 
 #include "util_getent.h"
 
 
 #include "util_getent.h"
 
-#ifndef UBI_BINTREE_H
-#include "ubi_Cache.h"
-#endif /* UBI_BINTREE_H */
-
 #include "debugparse.h"
 
 #include "version.h"
 #include "debugparse.h"
 
 #include "version.h"
@@ -826,19 +924,17 @@ extern int errno;
 
 #include "privileges.h"
 
 
 #include "privileges.h"
 
-#include "rpc_creds.h"
+#include "rpc_misc.h"
+
+#include "rpc_dce.h"
 
 #include "mapping.h"
 
 #include "passdb.h"
 
 
 #include "mapping.h"
 
 #include "passdb.h"
 
-#include "ntdomain.h"
-
-#include "rpc_misc.h"
-
 #include "rpc_secdes.h"
 
 #include "rpc_secdes.h"
 
-#include "nt_printing.h"
+#include "authdata.h"
 
 #include "msdfs.h"
 
 
 #include "msdfs.h"
 
@@ -853,11 +949,35 @@ extern int errno;
 
 #include "auth.h"
 
 
 #include "auth.h"
 
+#include "ntdomain.h"
+
+#include "rpc_svcctl.h"
+#include "rpc_ntsvcs.h"
+#include "rpc_lsa.h"
+#include "rpc_netlogon.h"
+#include "reg_objects.h"
+#include "rpc_reg.h"
+#include "rpc_samr.h"
+#include "rpc_srvsvc.h"
+#include "rpc_wkssvc.h"
+#include "rpc_spoolss.h"
+#include "rpc_eventlog.h"
+#include "rpc_dfs.h"
+#include "rpc_ds.h"
+#include "rpc_echo.h"
+#include "rpc_shutdown.h"
+#include "rpc_perfcount.h"
+#include "rpc_perfcount_defs.h"
+
+#include "nt_printing.h"
+
 #include "idmap.h"
 
 #include "client.h"
 
 #include "idmap.h"
 
 #include "client.h"
 
+#ifdef WITH_SMBWRAPPER
 #include "smbw.h"
 #include "smbw.h"
+#endif
 
 #include "session.h"
 
 
 #include "session.h"
 
@@ -873,6 +993,10 @@ extern int errno;
 
 #include "spnego.h"
 
 
 #include "spnego.h"
 
+#include "rpc_client.h"
+
+#include "event.h"
+
 /*
  * Type for wide character dirent structure.
  * Only d_name is defined by POSIX.
 /*
  * Type for wide character dirent structure.
  * Only d_name is defined by POSIX.
@@ -902,6 +1026,11 @@ struct functable {
        int (*fn)(int argc, const char **argv);
 };
 
        int (*fn)(int argc, const char **argv);
 };
 
+struct functable2 {
+       const char *funcname;
+       int (*fn)(int argc, const char **argv);
+       const char *helptext;
+};
 
 /* Defines for wisXXX functions. */
 #define UNI_UPPER    0x1
 
 /* Defines for wisXXX functions. */
 #define UNI_UPPER    0x1
@@ -923,6 +1052,8 @@ struct smb_ldap_privates;
 
 #include "smbldap.h"
 
 
 #include "smbldap.h"
 
+#include "smb_ldap.h"
+
 /***** automatically generated prototypes *****/
 #ifndef NO_PROTO_H
 #include "proto.h"
 /***** automatically generated prototypes *****/
 #ifndef NO_PROTO_H
 #include "proto.h"
@@ -1251,13 +1382,18 @@ extern int DEBUGLEVEL;
 #endif
 
 /* add varargs prototypes with printf checking */
 #endif
 
 /* add varargs prototypes with printf checking */
+/*PRINTFLIKE2 */
 int fdprintf(int , const char *, ...) PRINTF_ATTRIBUTE(2,3);
 int fdprintf(int , const char *, ...) PRINTF_ATTRIBUTE(2,3);
+/*PRINTFLIKE1 */
 int d_printf(const char *, ...) PRINTF_ATTRIBUTE(1,2);
 int d_printf(const char *, ...) PRINTF_ATTRIBUTE(1,2);
+/*PRINTFLIKE2 */
 int d_fprintf(FILE *f, const char *, ...) PRINTF_ATTRIBUTE(2,3);
 #ifndef HAVE_SNPRINTF_DECL
 int d_fprintf(FILE *f, const char *, ...) PRINTF_ATTRIBUTE(2,3);
 #ifndef HAVE_SNPRINTF_DECL
+/*PRINTFLIKE3 */
 int snprintf(char *,size_t ,const char *, ...) PRINTF_ATTRIBUTE(3,4);
 #endif
 #ifndef HAVE_ASPRINTF_DECL
 int snprintf(char *,size_t ,const char *, ...) PRINTF_ATTRIBUTE(3,4);
 #endif
 #ifndef HAVE_ASPRINTF_DECL
+/*PRINTFLIKE2 */
 int asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3);
 #endif
 
 int asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3);
 #endif
 
@@ -1268,11 +1404,19 @@ int asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3);
 #if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_VSNPRINTF)
 #define snprintf smb_snprintf
 #define vsnprintf smb_vsnprintf
 #if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_VSNPRINTF)
 #define snprintf smb_snprintf
 #define vsnprintf smb_vsnprintf
+
+/* PRINTFLIKE3 */
+int smb_snprintf(char *str,size_t count,const char *fmt,...);
+int smb_vsnprintf (char *str, size_t count, const char *fmt, va_list args);
+
 #endif
 
 #endif
 
+/* PRINTFLIKE2 */
 void sys_adminlog(int priority, const char *format_str, ...) PRINTF_ATTRIBUTE(2,3);
 
 void sys_adminlog(int priority, const char *format_str, ...) PRINTF_ATTRIBUTE(2,3);
 
+/* PRINTFLIKE2 */
 int pstr_sprintf(pstring s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
 int pstr_sprintf(pstring s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
+/* PRINTFLIKE2 */
 int fstr_sprintf(fstring s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
 
 int d_vfprintf(FILE *f, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0);
 int fstr_sprintf(fstring s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
 
 int d_vfprintf(FILE *f, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0);
@@ -1284,7 +1428,6 @@ int smb_xvasprintf(char **ptr, const char *format, va_list ap) PRINTF_ATTRIBUTE(
 #define slprintf snprintf
 #define vslprintf vsnprintf
 
 #define slprintf snprintf
 #define vslprintf vsnprintf
 
-
 /* we need to use __va_copy() on some platforms */
 #ifdef HAVE_VA_COPY
 #define VA_COPY(dest, src) va_copy(dest, src)
 /* we need to use __va_copy() on some platforms */
 #ifdef HAVE_VA_COPY
 #define VA_COPY(dest, src) va_copy(dest, src)
@@ -1330,7 +1473,7 @@ void krb5_free_unparsed_name(krb5_context ctx, char *val);
 void setup_kaddr( krb5_address *pkaddr, struct sockaddr *paddr);
 int create_kerberos_key_from_string(krb5_context context, krb5_principal host_princ, krb5_data *password, krb5_keyblock *key, krb5_enctype enctype);
 int create_kerberos_key_from_string_direct(krb5_context context, krb5_principal host_princ, krb5_data *password, krb5_keyblock *key, krb5_enctype enctype);
 void setup_kaddr( krb5_address *pkaddr, struct sockaddr *paddr);
 int create_kerberos_key_from_string(krb5_context context, krb5_principal host_princ, krb5_data *password, krb5_keyblock *key, krb5_enctype enctype);
 int create_kerberos_key_from_string_direct(krb5_context context, krb5_principal host_princ, krb5_data *password, krb5_keyblock *key, krb5_enctype enctype);
-void get_auth_data_from_tkt(DATA_BLOB *auth_data, krb5_ticket *tkt);
+BOOL get_auth_data_from_tkt(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, krb5_ticket *tkt);
 krb5_const_principal get_principal_from_tkt(krb5_ticket *tkt);
 krb5_error_code krb5_locate_kdc(krb5_context ctx, const krb5_data *realm, struct sockaddr **addr_pp, int *naddrs, int get_masters);
 krb5_error_code get_kerberos_allowed_etypes(krb5_context context, krb5_enctype **enctypes);
 krb5_const_principal get_principal_from_tkt(krb5_ticket *tkt);
 krb5_error_code krb5_locate_kdc(krb5_context ctx, const krb5_data *realm, struct sockaddr **addr_pp, int *naddrs, int get_masters);
 krb5_error_code get_kerberos_allowed_etypes(krb5_context context, krb5_enctype **enctypes);
@@ -1341,6 +1484,49 @@ krb5_principal kerberos_fetch_salt_princ_for_host_princ(krb5_context context, kr
 void kerberos_set_creds_enctype(krb5_creds *pcreds, int enctype);
 BOOL kerberos_compatible_enctypes(krb5_context context, krb5_enctype enctype1, krb5_enctype enctype2);
 void kerberos_free_data_contents(krb5_context context, krb5_data *pdata);
 void kerberos_set_creds_enctype(krb5_creds *pcreds, int enctype);
 BOOL kerberos_compatible_enctypes(krb5_context context, krb5_enctype enctype1, krb5_enctype enctype2);
 void kerberos_free_data_contents(krb5_context context, krb5_data *pdata);
+NTSTATUS decode_pac_data(TALLOC_CTX *mem_ctx,
+                        DATA_BLOB *pac_data_blob,
+                        krb5_context context, 
+                        krb5_keyblock *service_keyblock,
+                        krb5_const_principal client_principal,
+                        time_t tgs_authtime,
+                        PAC_DATA **pac_data);
+void smb_krb5_checksum_from_pac_sig(krb5_checksum *cksum, 
+                                   PAC_SIGNATURE_DATA *sig);
+krb5_error_code smb_krb5_verify_checksum(krb5_context context,
+                                        krb5_keyblock *keyblock,
+                                        krb5_keyusage usage,
+                                        krb5_checksum *cksum,
+                                        uint8 *data,
+                                        size_t length);
+time_t get_authtime_from_tkt(krb5_ticket *tkt);
+void smb_krb5_free_ap_req(krb5_context context, 
+                         krb5_ap_req *ap_req);
+krb5_error_code smb_krb5_get_keyinfo_from_ap_req(krb5_context context, 
+                                                const krb5_data *inbuf, 
+                                                krb5_kvno *kvno, 
+                                                krb5_enctype *enctype);
+krb5_error_code krb5_rd_req_return_keyblock_from_keytab(krb5_context context,
+                                                       krb5_auth_context *auth_context,
+                                                       const krb5_data *inbuf,
+                                                       krb5_const_principal server,
+                                                       krb5_keytab keytab,
+                                                       krb5_flags *ap_req_options,
+                                                       krb5_ticket **ticket, 
+                                                       krb5_keyblock **keyblock);
+krb5_error_code smb_krb5_parse_name_norealm(krb5_context context, 
+                                           const char *name, 
+                                           krb5_principal *principal);
+BOOL smb_krb5_principal_compare_any_realm(krb5_context context, 
+                                         krb5_const_principal princ1, 
+                                         krb5_const_principal princ2);
+int cli_krb5_get_ticket(const char *principal, time_t time_offset, 
+                       DATA_BLOB *ticket, DATA_BLOB *session_key_krb5, uint32 extra_ap_opts, const char *ccname);
+PAC_LOGON_INFO *get_logon_info_from_pac(PAC_DATA *pac_data);
+krb5_error_code smb_krb5_renew_ticket(const char *ccache_string, const char *client_string, const char *service_string, time_t *new_start_time);
+krb5_error_code kpasswd_err_to_krb5_err(krb5_error_code res_code);
+NTSTATUS krb5_to_nt_status(krb5_error_code kerberos_error);
+krb5_error_code nt_status_to_krb5(NTSTATUS nt_status);
 #endif /* HAVE_KRB5 */
 
 
 #endif /* HAVE_KRB5 */
 
 
@@ -1373,4 +1559,21 @@ LDAP *ldap_open_with_timeout(const char *server, int port, unsigned int to);
 #undef HAVE_MMAP
 #endif
 
 #undef HAVE_MMAP
 #endif
 
+#define CONST_DISCARD(type, ptr)      ((type) ((void *) (ptr)))
+#define CONST_ADD(type, ptr)          ((type) ((const void *) (ptr)))
+
+#ifndef NORETURN_ATTRIBUTE
+#if (__GNUC__ >= 3)
+#define NORETURN_ATTRIBUTE __attribute__ ((noreturn))
+#else
+#define NORETURN_ATTRIBUTE
+#endif
+#endif
+
+void smb_panic( const char *why ) NORETURN_ATTRIBUTE ;
+void dump_core(void) NORETURN_ATTRIBUTE ;
+void exit_server(const char *const reason) NORETURN_ATTRIBUTE ;
+void exit_server_cleanly(const char *const reason) NORETURN_ATTRIBUTE ;
+void exit_server_fault(void) NORETURN_ATTRIBUTE ;
+
 #endif /* _INCLUDES_H */
 #endif /* _INCLUDES_H */