]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/Include/netdb.h
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / StdLib / Include / netdb.h
diff --git a/StdLib/Include/netdb.h b/StdLib/Include/netdb.h
deleted file mode 100644 (file)
index f50c8ce..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-/** @file\r
-\r
-    Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
-    This program and the accompanying materials\r
-    are licensed and made available under the terms and conditions of the BSD License\r
-    which accompanies this distribution.  The full text of the license may be found at\r
-    http://opensource.org/licenses/bsd-license.php\r
-\r
-    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
- * Copyright (c) 1980, 1983, 1988, 1993\r
- *  The Regents of the University of California.  All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions\r
- * are met:\r
- * 1. Redistributions of source code must retain the above copyright\r
- *    notice, this list of conditions and the following disclaimer.\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- *    notice, this list of conditions and the following disclaimer in the\r
- *    documentation and/or other materials provided with the distribution.\r
- * 3. Neither the name of the University nor the names of its contributors\r
- *    may be used to endorse or promote products derived from this software\r
- *    without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
- * SUCH DAMAGE.\r
- * -\r
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.\r
- *\r
- * Permission to use, copy, modify, and distribute this software for any\r
- * purpose with or without fee is hereby granted, provided that the above\r
- * copyright notice and this permission notice appear in all copies, and that\r
- * the name of Digital Equipment Corporation not be used in advertising or\r
- * publicity pertaining to distribution of the document or software without\r
- * specific, written prior permission.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL\r
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES\r
- * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT\r
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL\r
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR\r
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS\r
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\r
- * SOFTWARE.\r
- * -\r
- * Portions Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.\r
- * All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions\r
- * are met:\r
- * 1. Redistributions of source code must retain the above copyright\r
- *    notice, this list of conditions and the following disclaimer.\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- *    notice, this list of conditions and the following disclaimer in the\r
- *    documentation and/or other materials provided with the distribution.\r
- * 3. All advertising materials mentioning features or use of this software\r
- *    must display the following acknowledgement:\r
- *    This product includes software developed by WIDE Project and\r
- *    its contributors.\r
- * 4. Neither the name of the project nor the names of its contributors\r
- *    may be used to endorse or promote products derived from this software\r
- *    without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND\r
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE\r
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
- * SUCH DAMAGE.\r
- * -\r
- *      @(#)netdb.h 8.1 (Berkeley) 6/2/93\r
- *      netdb.h,v 1.15.18.6 2006/10/02 01:23:09 marka Exp\r
- *      netdb.h,v 1.55.2.1 2007/05/17 21:25:10 jdc Exp\r
- */\r
-#ifndef _NETDB_H_\r
-#define _NETDB_H_\r
-\r
-#include <machine/ansi.h>\r
-#include <machine/endian_machdep.h>\r
-#include <sys/ansi.h>\r
-#include <sys/cdefs.h>\r
-#include <sys/featuretest.h>\r
-#include <inttypes.h>\r
-#include <paths.h>\r
-\r
-/* Data types */\r
-#ifndef socklen_t\r
-typedef __socklen_t socklen_t;\r
-#define socklen_t   __socklen_t\r
-#endif\r
-\r
-#ifdef _EFI_SIZE_T_\r
-  typedef _EFI_SIZE_T_  size_t;\r
-  #undef  _EFI_SIZE_T_\r
-  #undef  _BSD_SIZE_T_\r
-#endif\r
-\r
-__BEGIN_DECLS\r
-extern int h_errno;\r
-__END_DECLS\r
-\r
-/** Structures returned by network data base library.  All addresses are\r
- *  supplied in host order, and returned in network order (suitable for\r
- *  use in system calls).\r
- */\r
-struct  hostent {\r
-  char   *h_name;       /**< official name of host */\r
-  char  **h_aliases;    /**< alias list */\r
-  int     h_addrtype;   /**< host address type */\r
-  int     h_length;     /**< length of address */\r
-  char  **h_addr_list;  /**< list of addresses from name server */\r
-};\r
-#define h_addr  h_addr_list[0]  /**< address, for backward compatiblity */\r
-\r
-/** Assumption here is that a network number\r
- *  fits in an unsigned long -- probably a poor one.\r
- */\r
-struct  netent {\r
-  char     *n_name;     /**< official name of net */\r
-  char    **n_aliases;  /**< alias list */\r
-  int       n_addrtype; /**< net address type */\r
-  uint32_t  n_net;      /**< network # */\r
-#if defined(__alpha__) || (defined(__i386__) && defined(_LP64)) || \\r
-    (defined(__sh__) && defined(_LP64) && (_BYTE_ORDER == _LITTLE_ENDIAN))\r
-  int       __n_pad0;   /* ABI compatibility */\r
-#endif\r
-};\r
-\r
-struct  servent {\r
-  char   *s_name;     /**< official service name */\r
-  char  **s_aliases;  /**< alias list */\r
-  int     s_port;     /**< port # */\r
-  char   *s_proto;    /**< protocol to use */\r
-};\r
-\r
-struct  protoent {\r
-  char   *p_name;     /**< official protocol name */\r
-  char  **p_aliases;  /**< alias list */\r
-  int     p_proto;    /**< protocol # */\r
-};\r
-\r
-/* Note: ai_addrlen used to be a size_t, per RFC 2553.\r
- * In XNS5.2, and subsequently in POSIX-2001 and\r
- * draft-ietf-ipngwg-rfc2553bis-02.txt it was changed to a socklen_t.\r
- * To accommodate for this while preserving binary compatibility with the\r
- * old interface, we prepend or append 32 bits of padding, depending on\r
- * the (LP64) architecture's endianness.\r
- *\r
- * This should be deleted the next time the libc major number is\r
- * incremented.\r
- */\r
-struct addrinfo {\r
-  int               ai_flags;     /**< AI_PASSIVE, AI_CANONNAME */\r
-  int               ai_family;    /**< PF_xxx */\r
-  int               ai_socktype;  /**< SOCK_xxx */\r
-  int               ai_protocol;  /**< 0 or IPPROTO_xxx for IPv4 and IPv6 */\r
-  socklen_t         ai_addrlen;   /**< length of ai_addr */\r
-#if defined(__alpha__) || (defined(__i386__) && defined(_LP64))\r
-  int               __ai_pad0;    /* ABI compatibility */\r
-#endif\r
-  char             *ai_canonname; /**< canonical name for hostname */\r
-  struct sockaddr  *ai_addr;      /**< binary address */\r
-  struct addrinfo  *ai_next;      /**< next structure in linked list */\r
-};\r
-\r
-/* Error return codes from gethostbyname() and gethostbyaddr()\r
- * (left in extern int h_errno).\r
-*/\r
-\r
-#define NETDB_INTERNAL   -1         /**< see errno */\r
-#define NETDB_SUCCESS     0         /**< no problem */\r
-#define NO_ADDRESS        NO_DATA   /* no address, look for MX record */\r
-#define HOST_NOT_FOUND    1         /**< Authoritative Answer Host not found */\r
-#define TRY_AGAIN         2         /**< Non-Authoritive Host not found, or SERVERFAIL */\r
-#define NO_RECOVERY       3         /**< Non recoverable errors, FORMERR, REFUSED, NOTIMP */\r
-#define NO_DATA           4         /**< Valid name, no data record of requested type */\r
-\r
-/* Error return codes from getaddrinfo() */\r
-#define EAI_ADDRFAMILY    1   /**< address family for hostname not supported */\r
-#define EAI_AGAIN         2   /**< temporary failure in name resolution */\r
-#define EAI_BADFLAGS      3   /**< invalid value for ai_flags */\r
-#define EAI_FAIL          4   /**< non-recoverable failure in name resolution */\r
-#define EAI_FAMILY        5   /**< ai_family not supported */\r
-#define EAI_MEMORY        6   /**< memory allocation failure */\r
-#define EAI_NODATA        7   /**< no address associated with hostname */\r
-#define EAI_NONAME        8   /**< hostname nor servname provided, or not known */\r
-#define EAI_SERVICE       9   /**< servname not supported for ai_socktype */\r
-#define EAI_SOCKTYPE      10  /**< ai_socktype not supported */\r
-#define EAI_SYSTEM        11  /**< system error returned in errno */\r
-#define EAI_BADHINTS      12  /**< invalid value for hints */\r
-#define EAI_PROTOCOL      13  /**< resolved protocol is unknown */\r
-#define EAI_OVERFLOW      14  /**< argument buffer overflow */\r
-#define EAI_MAX           15\r
-\r
-/* Flag values for getaddrinfo() */\r
-#define AI_PASSIVE      0x00000001  /* get address to use bind() */\r
-#define AI_CANONNAME    0x00000002  /* fill ai_canonname */\r
-\r
-#define AI_NUMERICHOST  0x00000004  /* prevent host name resolution */\r
-#define AI_NUMERICSERV  0x00000008  /* prevent service name resolution */\r
-/* valid flags for addrinfo (not a standard def, apps should not use it) */\r
-#define AI_MASK         (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV)\r
-\r
-/* Constants for getnameinfo() */\r
-#define NI_MAXHOST      1025\r
-#define NI_MAXSERV      32\r
-\r
-/* Flag values for getnameinfo() */\r
-#define NI_NOFQDN       0x00000001\r
-#define NI_NUMERICHOST  0x00000002\r
-#define NI_NAMEREQD     0x00000004\r
-#define NI_NUMERICSERV  0x00000008\r
-#define NI_DGRAM        0x00000010\r
-#define NI_NUMERICSCOPE 0x00000040\r
-\r
-/** Scope delimit character */\r
-#define SCOPE_DELIMITER '%'\r
-\r
-__BEGIN_DECLS\r
-void              endhostent      (void);\r
-void              endnetent       (void);\r
-void              endprotoent     (void);\r
-void              endservent      (void);\r
-struct hostent   *gethostbyaddr   (const char *, socklen_t, int);\r
-struct hostent   *gethostbyname   (const char *);\r
-struct hostent   *gethostbyname2  (const char *, int);\r
-struct hostent   *gethostent      (void);\r
-struct netent    *getnetbyaddr    (uint32_t, int);\r
-struct netent    *getnetbyname    (const char *);\r
-struct netent    *getnetent       (void);\r
-struct protoent  *getprotobyname  (const char *);\r
-struct protoent  *getprotobynumber(int);\r
-struct protoent  *getprotoent     (void);\r
-struct servent   *getservbyname   (const char *, const char *);\r
-struct servent   *getservbyport   (int, const char *);\r
-struct servent   *getservent      (void);\r
-void              sethostent      (int);\r
-void              setnetent       (int);\r
-void              setprotoent     (int);\r
-void              setservent      (int);\r
-int               getaddrinfo     ( const char * __restrict, const char * __restrict,\r
-                                    const struct addrinfo * __restrict,\r
-                                    struct addrinfo ** __restrict);\r
-int               getnameinfo     ( const struct sockaddr * __restrict, socklen_t,\r
-                                    char * __restrict, socklen_t,\r
-                                    char * __restrict, socklen_t, int);\r
-void              freeaddrinfo    (struct addrinfo *);\r
-const char       *gai_strerror    (int);\r
-void              setservent      (int);\r
-\r
-__END_DECLS\r
-\r
-#endif /* !_NETDB_H_ */\r