Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/lib/addns/dns.h

    r740 r988  
    2828#include "../replace/replace.h"
    2929#include "system/network.h"
     30#include "system/kerberos.h"
     31#include "system/gssapi.h"
    3032
    3133/* make sure we have included the correct config.h */
     
    3739#endif /* NO_CONFIG_H */
    3840
    39 #include <stdio.h>
    40 #include <stdlib.h>
    4141#include <fcntl.h>
    4242#include <time.h>
    43 #include <string.h>
    44 #include <errno.h>
    4543#include <netdb.h>
    46 #include <sys/types.h>
    47 #include <sys/socket.h>
    48 #include <netinet/in.h>
    49 #include <arpa/inet.h>
    50 #include <stdarg.h>
    51 
    52 #ifdef HAVE_UUID_UUID_H
    53 #include <uuid/uuid.h>
    54 #endif
    55 
    56 #ifdef HAVE_KRB5_H
    57 #include <krb5.h>
    58 #endif
    59 
    60 #ifdef HAVE_INTTYPES_H
    61 #include <inttypes.h>
    62 
    63 #ifndef int16
    64 #define int16 int16_t
    65 #endif
    66 
    67 #ifndef uint16
    68 #define uint16 uint16_t
    69 #endif
    70 
    71 #ifndef int32
    72 #define int32 int32_t
    73 #endif
    74 
    75 #ifndef uint32
    76 #define uint32 uint32_t
    77 #endif
    78 #endif
    79 
    80 #ifdef HAVE_KRB5_H
    81 #include <krb5.h>
    82 #endif
    83 
    84 #if HAVE_GSSAPI_GSSAPI_H
    85 #include <gssapi/gssapi.h>
    86 #elif HAVE_GSSAPI_GSSAPI_GENERIC_H
    87 #include <gssapi/gssapi_generic.h>
    88 #elif HAVE_GSSAPI_H
    89 #include <gssapi.h>
    90 #endif
    91 
    92 #if defined(HAVE_GSSAPI_H) || defined(HAVE_GSSAPI_GSSAPI_H) || defined(HAVE_GSSAPI_GSSAPI_GENERIC_H)
    93 #define HAVE_GSSAPI_SUPPORT    1
    94 #endif
    9544
    9645#include <talloc.h>
    97 
    98 #if 0
    99 
    100 Disable these now we have checked all code paths and ensured
    101 NULL returns on zero request. JRA.
    102 
    103 void *_talloc_zero_zeronull(const void *ctx, size_t size, const char *name);
    104 void *_talloc_memdup_zeronull(const void *t, const void *p, size_t size, const char *name);
    105 void *_talloc_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);
    106 void *_talloc_zero_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);
    107 void *talloc_zeronull(const void *context, size_t size, const char *name);
    108 
    109 #define TALLOC(ctx, size) talloc_zeronull(ctx, size, __location__)
    110 #define TALLOC_P(ctx, type) (type *)talloc_zeronull(ctx, sizeof(type), #type)
    111 #define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array_zeronull(ctx, sizeof(type), count, #type)
    112 #define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup_zeronull(ctx, ptr, size, __location__)
    113 #define TALLOC_ZERO(ctx, size) _talloc_zero_zeronull(ctx, size, __location__)
    114 #define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero_zeronull(ctx, sizeof(type), #type)
    115 #define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array_zeronull(ctx, sizeof(type), count, #type)
    116 #define TALLOC_SIZE(ctx, size) talloc_zeronull(ctx, size, __location__)
    117 #define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero_zeronull(ctx, size, __location__)
    118 
    119 #else
    120 
    121 #define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__)
    122 #define TALLOC_P(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type)
    123 #define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type)
    124 #define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup(ctx, ptr, size, __location__)
    125 #define TALLOC_ZERO(ctx, size) _talloc_zero(ctx, size, __location__)
    126 #define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type)
    127 #define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array(ctx, sizeof(type), count, #type)
    128 #define TALLOC_SIZE(ctx, size) talloc_named_const(ctx, size, __location__)
    129 #define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero(ctx, size, __location__)
    130 
    131 #endif
    132 
    133 #define TALLOC_REALLOC(ctx, ptr, count) _talloc_realloc(ctx, ptr, count, __location__)
    134 #define TALLOC_REALLOC_ARRAY(ctx, ptr, type, count) (type *)_talloc_realloc_array(ctx, ptr, sizeof(type), count, #type)
    135 #define talloc_destroy(ctx) talloc_free(ctx)
    136 #ifndef TALLOC_FREE
    137 #define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0)
    138 #endif
    139 
    140 /*******************************************************************
    141    Type definitions for int16, int32, uint16 and uint32.  Needed
    142    for Samba coding style
    143 *******************************************************************/
    144 
    145 #ifndef uint8
    146 #  define uint8 unsigned char
    147 #endif
    148 
    149 #if !defined(int16) && !defined(HAVE_INT16_FROM_RPC_RPC_H)
    150 #  if (SIZEOF_SHORT == 4)
    151 #    define int16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
    152 #  else /* SIZEOF_SHORT != 4 */
    153 #    define int16 short
    154 #  endif /* SIZEOF_SHORT != 4 */
    155    /* needed to work around compile issue on HP-UX 11.x */
    156 #  define _INT16        1
    157 #endif
    158 
    159 /*
    160  * Note we duplicate the size tests in the unsigned
    161  * case as int16 may be a typedef from rpc/rpc.h
    162  */
    163 
    164 #if !defined(uint16) && !defined(HAVE_UINT16_FROM_RPC_RPC_H)
    165 #  if (SIZEOF_SHORT == 4)
    166 #    define uint16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
    167 #  else /* SIZEOF_SHORT != 4 */
    168 #    define uint16 unsigned short
    169 #  endif /* SIZEOF_SHORT != 4 */
    170 #endif
    171 
    172 #if !defined(int32) && !defined(HAVE_INT32_FROM_RPC_RPC_H)
    173 #  if (SIZEOF_INT == 4)
    174 #    define int32 int
    175 #  elif (SIZEOF_LONG == 4)
    176 #    define int32 long
    177 #  elif (SIZEOF_SHORT == 4)
    178 #    define int32 short
    179 #  else
    180      /* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */
    181 #    define int32 int
    182 #  endif
    183 #  ifndef _INT32
    184      /* needed to work around compile issue on HP-UX 11.x */
    185 #    define _INT32        1
    186 #  endif
    187 #endif
    188 
    189 /*
    190  * Note we duplicate the size tests in the unsigned
    191  * case as int32 may be a typedef from rpc/rpc.h
    192  */
    193 
    194 #if !defined(uint32) && !defined(HAVE_UINT32_FROM_RPC_RPC_H)
    195 #  if (SIZEOF_INT == 4)
    196 #    define uint32 unsigned int
    197 #  elif (SIZEOF_LONG == 4)
    198 #    define uint32 unsigned long
    199 #  elif (SIZEOF_SHORT == 4)
    200 #    define uint32 unsigned short
    201 #  else
    202       /* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */
    203 #    define uint32 unsigned
    204 #  endif
    205 #endif
    206 
    207 /*
    208  * check for 8 byte long long
    209  */
    210 
    211 #if !defined(uint64)
    212 #  if (SIZEOF_LONG == 8)
    213 #    define uint64 unsigned long
    214 #  elif (SIZEOF_LONG_LONG == 8)
    215 #    define uint64 unsigned long long
    216 #  endif /* don't lie.  If we don't have it, then don't use it */
    217 #endif
    218 
    219 /* needed on Sun boxes */
    220 #ifndef INADDR_NONE
    221 #define INADDR_NONE          0xFFFFFFFF
    222 #endif
    22346
    22447#include "dnserr.h"
     
    24871#define QTYPE_CNAME     5
    24972#define QTYPE_SOA       6
     73#define QTYPE_AAAA      28
    25074#define QTYPE_ANY       255
    25175#define QTYPE_TKEY      249
     
    329153struct dns_question {
    330154        struct dns_domain_name *name;
    331         uint16 q_type;
    332         uint16 q_class;
     155        uint16_t q_type;
     156        uint16_t q_class;
    333157};
    334158
     
    341165struct dns_zone {
    342166        struct dns_domain_name *name;
    343         uint16 z_type;
    344         uint16 z_class;
     167        uint16_t z_type;
     168        uint16_t z_class;
    345169};
    346170
    347171struct dns_rrec {
    348172        struct dns_domain_name *name;
    349         uint16 type;
    350         uint16 r_class;
    351         uint32 ttl;
    352         uint16 data_length;
    353         uint8 *data;
     173        uint16_t type;
     174        uint16_t r_class;
     175        uint32_t ttl;
     176        uint16_t data_length;
     177        uint8_t *data;
    354178};
    355179
     
    358182        time_t inception;
    359183        time_t expiration;
    360         uint16 mode;
    361         uint16 error;
    362         uint16 key_length;
    363         uint8 *key;
     184        uint16_t mode;
     185        uint16_t error;
     186        uint16_t key_length;
     187        uint8_t *key;
    364188};
    365189
    366190struct dns_request {
    367         uint16 id;
    368         uint16 flags;
    369         uint16 num_questions;
    370         uint16 num_answers;
    371         uint16 num_auths;
    372         uint16 num_additionals;
     191        uint16_t id;
     192        uint16_t flags;
     193        uint16_t num_questions;
     194        uint16_t num_answers;
     195        uint16_t num_auths;
     196        uint16_t num_additionals;
    373197        struct dns_question **questions;
    374198        struct dns_rrec **answers;
     
    384208
    385209struct dns_update_request {
    386         uint16 id;
    387         uint16 flags;
    388         uint16 num_zones;
    389         uint16 num_preqs;
    390         uint16 num_updates;
    391         uint16 num_additionals;
     210        uint16_t id;
     211        uint16_t flags;
     212        uint16_t num_zones;
     213        uint16_t num_preqs;
     214        uint16_t num_updates;
     215        uint16_t num_additionals;
    392216        struct dns_zone **zones;
    393217        struct dns_rrec **preqs;
     
    397221
    398222struct dns_connection {
    399         int32 hType;
     223        int32_t hType;
    400224        int s;
    401         struct sockaddr RecvAddr;
     225        struct sockaddr_storage RecvAddr;
    402226};
    403227
    404228struct dns_buffer {
    405         uint8 *data;
     229        uint8_t *data;
    406230        size_t size;
    407231        size_t offset;
     
    419243
    420244DNS_ERROR dns_create_query( TALLOC_CTX *mem_ctx, const char *name,
    421                             uint16 q_type, uint16 q_class,
     245                            uint16_t q_type, uint16_t q_class,
    422246                            struct dns_request **preq );
    423247DNS_ERROR dns_create_update( TALLOC_CTX *mem_ctx, const char *name,
     
    428252                           struct dns_update_request **preq);
    429253DNS_ERROR dns_create_rrec(TALLOC_CTX *mem_ctx, const char *name,
    430                           uint16 type, uint16 r_class, uint32 ttl,
    431                           uint16 data_length, uint8 *data,
     254                          uint16_t type, uint16_t r_class, uint32_t ttl,
     255                          uint16_t data_length, uint8_t *data,
    432256                          struct dns_rrec **prec);
    433257DNS_ERROR dns_add_rrec(TALLOC_CTX *mem_ctx, struct dns_rrec *rec,
    434                        uint16 *num_records, struct dns_rrec ***records);
     258                       uint16_t *num_records, struct dns_rrec ***records);
    435259DNS_ERROR dns_create_tkey_record(TALLOC_CTX *mem_ctx, const char *keyname,
    436260                                 const char *algorithm_name, time_t inception,
    437                                  time_t expiration, uint16 mode, uint16 error,
    438                                  uint16 key_length, const uint8 *key,
     261                                 time_t expiration, uint16_t mode, uint16_t error,
     262                                 uint16_t key_length, const uint8_t *key,
    439263                                 struct dns_rrec **prec);
    440264DNS_ERROR dns_create_name_in_use_record(TALLOC_CTX *mem_ctx,
     
    443267                                        struct dns_rrec **prec);
    444268DNS_ERROR dns_create_delete_record(TALLOC_CTX *mem_ctx, const char *name,
    445                                    uint16 type, uint16 r_class,
     269                                   uint16_t type, uint16_t r_class,
    446270                                   struct dns_rrec **prec);
    447271DNS_ERROR dns_create_name_not_in_use_record(TALLOC_CTX *mem_ctx,
    448                                             const char *name, uint32 type,
     272                                            const char *name, uint32_t type,
    449273                                            struct dns_rrec **prec);
    450274DNS_ERROR dns_create_a_record(TALLOC_CTX *mem_ctx, const char *host,
    451                               uint32 ttl, const struct sockaddr_storage *pss,
     275                              uint32_t ttl, const struct sockaddr_storage *pss,
    452276                              struct dns_rrec **prec);
     277DNS_ERROR dns_create_aaaa_record(TALLOC_CTX *mem_ctx, const char *host,
     278                                 uint32_t ttl, const struct sockaddr_storage *pss,
     279                                 struct dns_rrec **prec);
    453280DNS_ERROR dns_unmarshall_tkey_record(TALLOC_CTX *mem_ctx, struct dns_rrec *rec,
    454281                                     struct dns_tkey_record **ptkey);
    455282DNS_ERROR dns_create_tsig_record(TALLOC_CTX *mem_ctx, const char *keyname,
    456283                                 const char *algorithm_name,
    457                                  time_t time_signed, uint16 fudge,
    458                                  uint16 mac_length, const uint8 *mac,
    459                                  uint16 original_id, uint16 error,
     284                                 time_t time_signed, uint16_t fudge,
     285                                 uint16_t mac_length, const uint8_t *mac,
     286                                 uint16_t original_id, uint16_t error,
    460287                                 struct dns_rrec **prec);
    461288DNS_ERROR dns_add_rrec(TALLOC_CTX *mem_ctx, struct dns_rrec *rec,
    462                        uint16 *num_records, struct dns_rrec ***records);
     289                       uint16_t *num_records, struct dns_rrec ***records);
    463290DNS_ERROR dns_create_update_request(TALLOC_CTX *mem_ctx,
    464291                                    const char *domainname,
     
    470297/* from dnssock.c */
    471298
    472 DNS_ERROR dns_open_connection( const char *nameserver, int32 dwType,
     299DNS_ERROR dns_open_connection( const char *nameserver, int32_t dwType,
    473300                    TALLOC_CTX *mem_ctx,
    474301                    struct dns_connection **conn );
     
    487314
    488315struct dns_buffer *dns_create_buffer(TALLOC_CTX *mem_ctx);
    489 void dns_marshall_buffer(struct dns_buffer *buf, const uint8 *data,
     316void dns_marshall_buffer(struct dns_buffer *buf, const uint8_t *data,
    490317                         size_t len);
    491 void dns_marshall_uint16(struct dns_buffer *buf, uint16 val);
    492 void dns_marshall_uint32(struct dns_buffer *buf, uint32 val);
    493 void dns_unmarshall_buffer(struct dns_buffer *buf, uint8 *data,
     318void dns_marshall_uint16(struct dns_buffer *buf, uint16_t val);
     319void dns_marshall_uint32(struct dns_buffer *buf, uint32_t val);
     320void dns_unmarshall_buffer(struct dns_buffer *buf, uint8_t *data,
    494321                           size_t len);
    495 void dns_unmarshall_uint16(struct dns_buffer *buf, uint16 *val);
    496 void dns_unmarshall_uint32(struct dns_buffer *buf, uint32 *val);
     322void dns_unmarshall_uint16(struct dns_buffer *buf, uint16_t *val);
     323void dns_unmarshall_uint32(struct dns_buffer *buf, uint32_t *val);
    497324void dns_unmarshall_domain_name(TALLOC_CTX *mem_ctx,
    498325                                struct dns_buffer *buf,
     
    517344struct dns_request *dns_update2request(struct dns_update_request *update);
    518345struct dns_update_request *dns_request2update(struct dns_request *request);
    519 uint16 dns_response_code(uint16 flags);
     346uint16_t dns_response_code(uint16_t flags);
    520347const char *dns_errstr(DNS_ERROR err);
    521348
    522349/* from dnsgss.c */
    523350
    524 #ifdef HAVE_GSSAPI_SUPPORT
     351#ifdef HAVE_GSSAPI
    525352
    526353void display_status( const char *msg, OM_uint32 maj_stat, OM_uint32 min_stat );
     
    534361                          const char *keyname,
    535362                          const char *algorithmname,
    536                           time_t time_signed, uint16 fudge);
    537 
    538 #endif  /* HAVE_GSSAPI_SUPPORT */
     363                          time_t time_signed, uint16_t fudge);
     364
     365#endif  /* HAVE_GSSAPI */
    539366
    540367#endif  /* _DNS_H */
Note: See TracChangeset for help on using the changeset viewer.