dns_hosts_file: move to a separate subsystem
[sfrench/samba-autobuild/.git] / lib / addns / dns.h
index 29f1ed3e997cae33e791253aa592c950cbb6b4cd..2864bdf53961110cef36dee082a578bd4ba37829 100644 (file)
@@ -27,6 +27,8 @@
 
 #include "../replace/replace.h"
 #include "system/network.h"
+#include "system/kerberos.h"
+#include "system/gssapi.h"
 
 /* make sure we have included the correct config.h */
 #ifndef NO_CONFIG_H /* for some tests */
 #endif
 #endif /* NO_CONFIG_H */
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <fcntl.h>
 #include <time.h>
-#include <string.h>
-#include <errno.h>
 #include <netdb.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <stdarg.h>
 
 #ifdef HAVE_UUID_UUID_H
 #include <uuid/uuid.h>
 #endif
 
-#ifdef HAVE_KRB5_H
-#include <krb5.h>
-#endif
-
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-
-#ifndef int16
-#define int16 int16_t
-#endif
-
-#ifndef uint16
-#define uint16 uint16_t
-#endif
-
-#ifndef int32
-#define int32 int32_t
-#endif
-
-#ifndef uint32
-#define uint32 uint32_t
-#endif
-#endif
-
-#ifdef HAVE_KRB5_H
-#include <krb5.h>
-#endif
-
-#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 defined(HAVE_GSSAPI_H) || defined(HAVE_GSSAPI_GSSAPI_H) || defined(HAVE_GSSAPI_GSSAPI_GENERIC_H)
-#define HAVE_GSSAPI_SUPPORT    1
-#endif
-
 #include <talloc.h>
 
-#if 0
-
-Disable these now we have checked all code paths and ensured
-NULL returns on zero request. JRA.
-
-void *_talloc_zero_zeronull(const void *ctx, size_t size, const char *name);
-void *_talloc_memdup_zeronull(const void *t, const void *p, size_t size, const char *name);
-void *_talloc_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);
-void *_talloc_zero_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);
-void *talloc_zeronull(const void *context, size_t size, const char *name);
-
-#define TALLOC(ctx, size) talloc_zeronull(ctx, size, __location__)
-#define TALLOC_P(ctx, type) (type *)talloc_zeronull(ctx, sizeof(type), #type)
-#define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array_zeronull(ctx, sizeof(type), count, #type)
-#define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup_zeronull(ctx, ptr, size, __location__)
-#define TALLOC_ZERO(ctx, size) _talloc_zero_zeronull(ctx, size, __location__)
-#define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero_zeronull(ctx, sizeof(type), #type)
-#define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array_zeronull(ctx, sizeof(type), count, #type)
-#define TALLOC_SIZE(ctx, size) talloc_zeronull(ctx, size, __location__)
-#define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero_zeronull(ctx, size, __location__)
-
-#else
-
-#define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__)
-#define TALLOC_P(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type)
-#define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type)
-#define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup(ctx, ptr, size, __location__)
-#define TALLOC_ZERO(ctx, size) _talloc_zero(ctx, size, __location__)
-#define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type)
-#define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array(ctx, sizeof(type), count, #type)
-#define TALLOC_SIZE(ctx, size) talloc_named_const(ctx, size, __location__)
-#define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero(ctx, size, __location__)
-
-#endif
-
-#define TALLOC_REALLOC(ctx, ptr, count) _talloc_realloc(ctx, ptr, count, __location__)
-#define TALLOC_REALLOC_ARRAY(ctx, ptr, type, count) (type *)_talloc_realloc_array(ctx, ptr, sizeof(type), count, #type)
-#define talloc_destroy(ctx) talloc_free(ctx)
-#ifndef TALLOC_FREE
-#define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0)
-#endif
-
 /*******************************************************************
    Type definitions for int16, int32, uint16 and uint32.  Needed
    for Samba coding style
@@ -247,6 +158,7 @@ void *talloc_zeronull(const void *context, size_t size, const char *name);
 #define QTYPE_MD        3
 #define QTYPE_CNAME    5
 #define QTYPE_SOA      6
+#define QTYPE_AAAA     28
 #define QTYPE_ANY      255
 #define        QTYPE_TKEY      249
 #define QTYPE_TSIG     250
@@ -450,6 +362,9 @@ DNS_ERROR dns_create_name_not_in_use_record(TALLOC_CTX *mem_ctx,
 DNS_ERROR dns_create_a_record(TALLOC_CTX *mem_ctx, const char *host,
                              uint32 ttl, const struct sockaddr_storage *pss,
                              struct dns_rrec **prec);
+DNS_ERROR dns_create_aaaa_record(TALLOC_CTX *mem_ctx, const char *host,
+                                uint32 ttl, const struct sockaddr_storage *pss,
+                                struct dns_rrec **prec);
 DNS_ERROR dns_unmarshall_tkey_record(TALLOC_CTX *mem_ctx, struct dns_rrec *rec,
                                     struct dns_tkey_record **ptkey);
 DNS_ERROR dns_create_tsig_record(TALLOC_CTX *mem_ctx, const char *keyname,
@@ -521,7 +436,7 @@ const char *dns_errstr(DNS_ERROR err);
 
 /* from dnsgss.c */
 
-#ifdef HAVE_GSSAPI_SUPPORT
+#ifdef HAVE_GSSAPI
 
 void display_status( const char *msg, OM_uint32 maj_stat, OM_uint32 min_stat ); 
 DNS_ERROR dns_negotiate_sec_ctx( const char *target_realm,
@@ -535,6 +450,6 @@ DNS_ERROR dns_sign_update(struct dns_update_request *req,
                          const char *algorithmname,
                          time_t time_signed, uint16 fudge);
 
-#endif /* HAVE_GSSAPI_SUPPORT */
+#endif /* HAVE_GSSAPI */
 
 #endif /* _DNS_H */