"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.11.23/lib/isc/win32/netdb.h" (7 Sep 2020, 4421 Bytes) of package /linux/misc/dns/bind9/9.11.23/bind-9.11.23.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "netdb.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
    3  *
    4  * This Source Code Form is subject to the terms of the Mozilla Public
    5  * License, v. 2.0. If a copy of the MPL was not distributed with this
    6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    7  *
    8  * See the COPYRIGHT file distributed with this work for additional
    9  * information regarding copyright ownership.
   10  */
   11 
   12 
   13 #ifndef NETDB_H
   14 #define NETDB_H 1
   15 
   16 #include <stddef.h>
   17 #include <winsock2.h>
   18 
   19 /*
   20  * Define if <netdb.h> does not declare struct addrinfo.
   21  */
   22 
   23 #if _MSC_VER < 1600
   24 struct addrinfo {
   25     int     ai_flags;      /* AI_PASSIVE, AI_CANONNAME */
   26     int     ai_family;     /* PF_xxx */
   27     int     ai_socktype;   /* SOCK_xxx */
   28     int     ai_protocol;   /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
   29     size_t      ai_addrlen;    /* Length of ai_addr */
   30     char        *ai_canonname; /* Canonical name for hostname */
   31     struct sockaddr *ai_addr;      /* Binary address */
   32     struct addrinfo *ai_next;      /* Next structure in linked list */
   33 };
   34 #endif
   35 
   36 
   37 /*
   38  * Undefine all \#defines we are interested in as <netdb.h> may or may not have
   39  * defined them.
   40  */
   41 
   42 /*
   43  * Error return codes from gethostbyname() and gethostbyaddr()
   44  * (left in extern int h_errno).
   45  */
   46 
   47 #undef  NETDB_INTERNAL
   48 #undef  NETDB_SUCCESS
   49 #undef  HOST_NOT_FOUND
   50 #undef  TRY_AGAIN
   51 #undef  NO_RECOVERY
   52 #undef  NO_DATA
   53 #undef  NO_ADDRESS
   54 
   55 #define NETDB_INTERNAL  -1  /* see errno */
   56 #define NETDB_SUCCESS   0   /* no problem */
   57 #define HOST_NOT_FOUND  1 /* Authoritative Answer Host not found */
   58 #define TRY_AGAIN   2 /* Non-Authoritative Host not found, or SERVERFAIL */
   59 #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
   60 #define NO_DATA     4 /* Valid name, no data record of requested type */
   61 #define NO_ADDRESS  NO_DATA     /* no address, look for MX record */
   62 
   63 /*
   64  * Error return codes from getaddrinfo()
   65  */
   66 
   67 #undef  EAI_ADDRFAMILY
   68 #undef  EAI_AGAIN
   69 #undef  EAI_BADFLAGS
   70 #undef  EAI_FAIL
   71 #undef  EAI_FAMILY
   72 #undef  EAI_MEMORY
   73 #undef  EAI_NODATA
   74 #undef  EAI_NONAME
   75 #undef  EAI_SERVICE
   76 #undef  EAI_SOCKTYPE
   77 #undef  EAI_SYSTEM
   78 #undef  EAI_BADHINTS
   79 #undef  EAI_PROTOCOL
   80 #undef  EAI_MAX
   81 
   82 #define EAI_ADDRFAMILY   1  /* address family for hostname not supported */
   83 #define EAI_AGAIN    2  /* temporary failure in name resolution */
   84 #define EAI_BADFLAGS     3  /* invalid value for ai_flags */
   85 #define EAI_FAIL     4  /* non-recoverable failure in name resolution */
   86 #define EAI_FAMILY   5  /* ai_family not supported */
   87 #define EAI_MEMORY   6  /* memory allocation failure */
   88 #define EAI_NODATA   7  /* no address associated with hostname */
   89 #define EAI_NONAME   8  /* hostname nor servname provided, or not known */
   90 #define EAI_SERVICE  9  /* servname not supported for ai_socktype */
   91 #define EAI_SOCKTYPE    10  /* ai_socktype not supported */
   92 #define EAI_SYSTEM  11  /* system error returned in errno */
   93 #define EAI_BADHINTS    12
   94 #define EAI_PROTOCOL    13
   95 #define EAI_MAX     14
   96 
   97 /*
   98  * Flag values for getaddrinfo()
   99  */
  100 #undef  AI_PASSIVE
  101 #undef  AI_CANONNAME
  102 #undef  AI_NUMERICHOST
  103 
  104 #define AI_PASSIVE  0x00000001
  105 #define AI_CANONNAME    0x00000002
  106 #define AI_NUMERICHOST  0x00000004
  107 
  108 /*
  109  * Flag values for getipnodebyname()
  110  */
  111 #undef AI_V4MAPPED
  112 #undef AI_ALL
  113 #undef AI_ADDRCONFIG
  114 #undef AI_DEFAULT
  115 
  116 #define AI_V4MAPPED 0x00000008
  117 #define AI_ALL      0x00000010
  118 #define AI_ADDRCONFIG   0x00000020
  119 #define AI_DEFAULT  (AI_V4MAPPED|AI_ADDRCONFIG)
  120 
  121 /*
  122  * Constants for getnameinfo()
  123  */
  124 #undef  NI_MAXHOST
  125 #undef  NI_MAXSERV
  126 
  127 #define NI_MAXHOST  1025
  128 #define NI_MAXSERV  32
  129 
  130 /*
  131  * Flag values for getnameinfo()
  132  */
  133 #undef  NI_NOFQDN
  134 #undef  NI_NUMERICHOST
  135 #undef  NI_NAMEREQD
  136 #undef  NI_NUMERICSERV
  137 #undef  NI_DGRAM
  138 #undef  NI_NUMERICSCOPE
  139 
  140 #define NI_NOFQDN   0x00000001
  141 #define NI_NUMERICHOST  0x00000002
  142 #define NI_NAMEREQD 0x00000004
  143 #define NI_NUMERICSERV  0x00000008
  144 #define NI_DGRAM    0x00000010
  145 #define NI_NUMERICSCOPE 0x00000020  /*2553bis-00*/
  146 
  147 /*
  148  * Structures for getrrsetbyname()
  149  */
  150 struct rdatainfo {
  151     unsigned int        rdi_length;
  152     unsigned char       *rdi_data;
  153 };
  154 
  155 struct rrsetinfo {
  156     unsigned int        rri_flags;
  157     int         rri_rdclass;
  158     int         rri_rdtype;
  159     unsigned int        rri_ttl;
  160     unsigned int        rri_nrdatas;
  161     unsigned int        rri_nsigs;
  162     char            *rri_name;
  163     struct rdatainfo    *rri_rdatas;
  164     struct rdatainfo    *rri_sigs;
  165 };
  166 
  167 /*
  168  * Flags for getrrsetbyname()
  169  */
  170 #define RRSET_VALIDATED     0x00000001
  171     /* Set was dnssec validated */
  172 
  173 /*
  174  * Return codes for getrrsetbyname()
  175  */
  176 #define ERRSET_SUCCESS      0
  177 #define ERRSET_NOMEMORY     1
  178 #define ERRSET_FAIL     2
  179 #define ERRSET_INVAL        3
  180 
  181 
  182 #endif /* NETDB_H */