diff options
Diffstat (limited to 'src/lib/libc/net/getaddrinfo.c')
| -rw-r--r-- | src/lib/libc/net/getaddrinfo.c | 56 |
1 files changed, 1 insertions, 55 deletions
diff --git a/src/lib/libc/net/getaddrinfo.c b/src/lib/libc/net/getaddrinfo.c index 9c89de2863..3fa1ce01d4 100644 --- a/src/lib/libc/net/getaddrinfo.c +++ b/src/lib/libc/net/getaddrinfo.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: getaddrinfo.c,v 1.5 1999/12/30 08:54:20 itojun Exp $ */ | 1 | /* $OpenBSD: getaddrinfo.c,v 1.6 2000/01/17 08:15:26 itojun Exp $ */ |
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. | 4 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. |
| @@ -47,20 +47,10 @@ | |||
| 47 | * in ai_flags? | 47 | * in ai_flags? |
| 48 | */ | 48 | */ |
| 49 | 49 | ||
| 50 | #if 0 | ||
| 51 | #ifdef HAVE_CONFIG_H | ||
| 52 | #include "config.h" | ||
| 53 | #endif | ||
| 54 | #else | ||
| 55 | #define HAVE_SOCKADDR_SA_LEN | ||
| 56 | #define INET6 | 50 | #define INET6 |
| 57 | #endif | ||
| 58 | 51 | ||
| 59 | #include <sys/types.h> | 52 | #include <sys/types.h> |
| 60 | #include <sys/param.h> | 53 | #include <sys/param.h> |
| 61 | #if 0 | ||
| 62 | #include <sys/sysctl.h> | ||
| 63 | #endif | ||
| 64 | #include <sys/socket.h> | 54 | #include <sys/socket.h> |
| 65 | #include <net/if.h> | 55 | #include <net/if.h> |
| 66 | #include <netinet/in.h> | 56 | #include <netinet/in.h> |
| @@ -76,28 +66,6 @@ | |||
| 76 | #include <stdio.h> | 66 | #include <stdio.h> |
| 77 | #include <errno.h> | 67 | #include <errno.h> |
| 78 | 68 | ||
| 79 | #if 0 | ||
| 80 | #ifndef HAVE_PORTABLE_PROTOTYPE | ||
| 81 | #include "cdecl_ext.h" | ||
| 82 | #endif | ||
| 83 | |||
| 84 | #ifndef HAVE_U_INT32_T | ||
| 85 | #include "bittypes.h" | ||
| 86 | #endif | ||
| 87 | |||
| 88 | #ifndef HAVE_SOCKADDR_STORAGE | ||
| 89 | #include "sockstorage.h" | ||
| 90 | #endif | ||
| 91 | |||
| 92 | #ifndef HAVE_ADDRINFO | ||
| 93 | #include "addrinfo.h" | ||
| 94 | #endif | ||
| 95 | |||
| 96 | #if defined(__KAME__) && defined(INET6) | ||
| 97 | # define FAITH | ||
| 98 | #endif | ||
| 99 | #endif | ||
| 100 | |||
| 101 | #define SUCCESS 0 | 69 | #define SUCCESS 0 |
| 102 | #define ANY 0 | 70 | #define ANY 0 |
| 103 | #define YES 1 | 71 | #define YES 1 |
| @@ -198,26 +166,6 @@ static int get_portmatch __P((const struct addrinfo *, const char *)); | |||
| 198 | static int get_port __P((struct addrinfo *, const char *, int)); | 166 | static int get_port __P((struct addrinfo *, const char *, int)); |
| 199 | static const struct afd *find_afd __P((int)); | 167 | static const struct afd *find_afd __P((int)); |
| 200 | 168 | ||
| 201 | #if 0 | ||
| 202 | static char *ai_errlist[] = { | ||
| 203 | "Success", | ||
| 204 | "Address family for hostname not supported", /* EAI_ADDRFAMILY */ | ||
| 205 | "Temporary failure in name resolution", /* EAI_AGAIN */ | ||
| 206 | "Invalid value for ai_flags", /* EAI_BADFLAGS */ | ||
| 207 | "Non-recoverable failure in name resolution", /* EAI_FAIL */ | ||
| 208 | "ai_family not supported", /* EAI_FAMILY */ | ||
| 209 | "Memory allocation failure", /* EAI_MEMORY */ | ||
| 210 | "No address associated with hostname", /* EAI_NODATA */ | ||
| 211 | "hostname nor servname provided, or not known", /* EAI_NONAME */ | ||
| 212 | "servname not supported for ai_socktype", /* EAI_SERVICE */ | ||
| 213 | "ai_socktype not supported", /* EAI_SOCKTYPE */ | ||
| 214 | "System error returned in errno", /* EAI_SYSTEM */ | ||
| 215 | "Invalid value for hints", /* EAI_BADHINTS */ | ||
| 216 | "Resolved protocol is unknown", /* EAI_PROTOCOL */ | ||
| 217 | "Unknown error", /* EAI_MAX */ | ||
| 218 | }; | ||
| 219 | #endif | ||
| 220 | |||
| 221 | /* XXX macros that make external reference is BAD. */ | 169 | /* XXX macros that make external reference is BAD. */ |
| 222 | 170 | ||
| 223 | #define GET_AI(ai, afd, addr) \ | 171 | #define GET_AI(ai, afd, addr) \ |
| @@ -977,9 +925,7 @@ get_ai(pai, afd, addr) | |||
| 977 | memcpy(ai, pai, sizeof(struct addrinfo)); | 925 | memcpy(ai, pai, sizeof(struct addrinfo)); |
| 978 | ai->ai_addr = (struct sockaddr *)(ai + 1); | 926 | ai->ai_addr = (struct sockaddr *)(ai + 1); |
| 979 | memset(ai->ai_addr, 0, afd->a_socklen); | 927 | memset(ai->ai_addr, 0, afd->a_socklen); |
| 980 | #ifdef HAVE_SOCKADDR_SA_LEN | ||
| 981 | ai->ai_addr->sa_len = afd->a_socklen; | 928 | ai->ai_addr->sa_len = afd->a_socklen; |
| 982 | #endif | ||
| 983 | ai->ai_addrlen = afd->a_socklen; | 929 | ai->ai_addrlen = afd->a_socklen; |
| 984 | ai->ai_addr->sa_family = ai->ai_family = afd->a_af; | 930 | ai->ai_addr->sa_family = ai->ai_family = afd->a_af; |
| 985 | p = (char *)(ai->ai_addr); | 931 | p = (char *)(ai->ai_addr); |
