Include valgrind.h if present on the system.
[samba.git] / source3 / include / includes.h
index 90477105576fede7bad43c5db8a4f079a4af4616..297f38ae9755ba9ec201809c0ac0652a86ead666 100644 (file)
 #endif /* HAVE_SYS_SHM_H */
 
 #ifdef HAVE_NATIVE_ICONV
+#ifdef HAVE_ICONV
 #include <iconv.h>
 #endif
+#ifdef HAVE_GICONV
+#include <giconv.h>
+#endif
+#endif
 
 #if HAVE_KRB5_H
 #include <krb5.h>
 #undef HAVE_LDAP
 #endif
 
+#if HAVE_GSSAPI_H
+#include <gssapi.h>
+#endif
+
 #if HAVE_GSSAPI_GSSAPI_H
 #include <gssapi/gssapi.h>
 #endif
 #include <gssapi/gssapi_generic.h>
 #endif
 
+#if HAVE_COM_ERR_H
+#include <com_err.h>
+#endif
+
+#if HAVE_VALGRIND_H
+/* Special macros that are no-ops except when run under Valgrind on x86.  */
+#include <valgrind.h>
+#endif
+
 /* we support ADS if we want it and have krb5 and ldap libs */
 #if defined(WITH_ADS) && defined(HAVE_KRB5) && defined(HAVE_LDAP)
 #define HAVE_ADS
@@ -754,12 +772,16 @@ extern int errno;
 #include "md5.h"
 #include "hmacmd5.h"
 
+#include "ntlmssp.h"
+
 #include "auth.h"
 
 #include "passdb.h"
 
 #include "sam.h"
 
+#include "gums.h"
+
 #include "session.h"
 
 #include "asn_1.h"
@@ -797,7 +819,7 @@ typedef struct smb_wpasswd {
 
 /* used in net.c */
 struct functable {
-       char *funcname;
+       const char *funcname;
        int (*fn)(int argc, const char **argv);
 };
 
@@ -956,6 +978,10 @@ size_t strnlen(const char *s, size_t n);
 unsigned long strtoul(const char *nptr, char **endptr, int base);
 #endif
 
+#ifndef HAVE_SETENV
+int setenv(const char *name, const char *value, int overwrite); 
+#endif
+
 #if (defined(USE_SETRESUID) && !defined(HAVE_SETRESUID_DECL))
 /* stupid glibc */
 int setresuid(uid_t ruid, uid_t euid, uid_t suid);
@@ -1160,6 +1186,15 @@ int snprintf(char *,size_t ,const char *, ...) PRINTF_ATTRIBUTE(3,4);
 int asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3);
 #endif
 
+void sys_adminlog(int priority, const char *format_str, ...) PRINTF_ATTRIBUTE(2,3);
+
+int pstr_sprintf(pstring s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
+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 smb_xvasprintf(char **ptr, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0);
+
 /* we used to use these fns, but now we have good replacements
    for snprintf and vsnprintf */
 #define slprintf snprintf
@@ -1189,5 +1224,30 @@ time_t timegm(struct tm *tm);
 #define VXFS_QUOTA
 #endif
 
+#if defined(HAVE_KRB5)
+
+#ifndef KRB5_SET_REAL_TIME
+krb5_error_code krb5_set_real_time(krb5_context context, int32_t seconds, int32_t microseconds);
+#endif
+
+#ifndef HAVE_KRB5_SET_DEFAULT_TGS_KTYPES
+krb5_error_code krb5_set_default_tgs_ktypes(krb5_context ctx, const krb5_enctype *enc);
+#endif
+
+#if defined(HAVE_KRB5_AUTH_CON_SETKEY) && !defined(HAVE_KRB5_AUTH_CON_SETUSERUSERKEY)
+krb5_error_code krb5_auth_con_setuseruserkey(krb5_context context, krb5_auth_context auth_context, krb5_keyblock *keyblock);
+#endif
+
+/* Samba wrapper function for krb5 functionality. */
+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);
+void get_auth_data_from_tkt(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);
+void free_kerberos_etypes(krb5_context context, krb5_enctype *enctypes);
+BOOL krb5_get_smb_session_key(krb5_context context, krb5_auth_context auth_context, uint8 session_key[16]);
+#endif /* HAVE_KRB5 */
+
 #endif /* _INCLUDES_H */