summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/net/getaddrinfo.c56
-rw-r--r--lib/libc/net/getnameinfo.c25
2 files changed, 2 insertions, 79 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index 9c89de2863e..3fa1ce01d48 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/lib/libc/net/getaddrinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getaddrinfo.c,v 1.5 1999/12/30 08:54:20 itojun Exp $ */
+/* $OpenBSD: getaddrinfo.c,v 1.6 2000/01/17 08:15:26 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -47,20 +47,10 @@
* in ai_flags?
*/
-#if 0
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#else
-#define HAVE_SOCKADDR_SA_LEN
#define INET6
-#endif
#include <sys/types.h>
#include <sys/param.h>
-#if 0
-#include <sys/sysctl.h>
-#endif
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -76,28 +66,6 @@
#include <stdio.h>
#include <errno.h>
-#if 0
-#ifndef HAVE_PORTABLE_PROTOTYPE
-#include "cdecl_ext.h"
-#endif
-
-#ifndef HAVE_U_INT32_T
-#include "bittypes.h"
-#endif
-
-#ifndef HAVE_SOCKADDR_STORAGE
-#include "sockstorage.h"
-#endif
-
-#ifndef HAVE_ADDRINFO
-#include "addrinfo.h"
-#endif
-
-#if defined(__KAME__) && defined(INET6)
-# define FAITH
-#endif
-#endif
-
#define SUCCESS 0
#define ANY 0
#define YES 1
@@ -198,26 +166,6 @@ static int get_portmatch __P((const struct addrinfo *, const char *));
static int get_port __P((struct addrinfo *, const char *, int));
static const struct afd *find_afd __P((int));
-#if 0
-static char *ai_errlist[] = {
- "Success",
- "Address family for hostname not supported", /* EAI_ADDRFAMILY */
- "Temporary failure in name resolution", /* EAI_AGAIN */
- "Invalid value for ai_flags", /* EAI_BADFLAGS */
- "Non-recoverable failure in name resolution", /* EAI_FAIL */
- "ai_family not supported", /* EAI_FAMILY */
- "Memory allocation failure", /* EAI_MEMORY */
- "No address associated with hostname", /* EAI_NODATA */
- "hostname nor servname provided, or not known", /* EAI_NONAME */
- "servname not supported for ai_socktype", /* EAI_SERVICE */
- "ai_socktype not supported", /* EAI_SOCKTYPE */
- "System error returned in errno", /* EAI_SYSTEM */
- "Invalid value for hints", /* EAI_BADHINTS */
- "Resolved protocol is unknown", /* EAI_PROTOCOL */
- "Unknown error", /* EAI_MAX */
-};
-#endif
-
/* XXX macros that make external reference is BAD. */
#define GET_AI(ai, afd, addr) \
@@ -977,9 +925,7 @@ get_ai(pai, afd, addr)
memcpy(ai, pai, sizeof(struct addrinfo));
ai->ai_addr = (struct sockaddr *)(ai + 1);
memset(ai->ai_addr, 0, afd->a_socklen);
-#ifdef HAVE_SOCKADDR_SA_LEN
ai->ai_addr->sa_len = afd->a_socklen;
-#endif
ai->ai_addrlen = afd->a_socklen;
ai->ai_addr->sa_family = ai->ai_family = afd->a_af;
p = (char *)(ai->ai_addr);
diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c
index 000ce855238..8b2ca299efd 100644
--- a/lib/libc/net/getnameinfo.c
+++ b/lib/libc/net/getnameinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnameinfo.c,v 1.6 2000/01/05 04:50:48 itojun Exp $ */
+/* $OpenBSD: getnameinfo.c,v 1.7 2000/01/17 08:15:27 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -39,14 +39,7 @@
* modified).
*/
-#if 0
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#else
-#define HAVE_SA_LEN
#define INET6
-#endif
#include <sys/types.h>
#include <sys/socket.h>
@@ -59,16 +52,6 @@
#include <string.h>
#include <stddef.h>
-#if 0
-#ifndef HAVE_PORTABLE_PROTOTYPE
-#include "cdecl_ext.h"
-#endif
-
-#ifndef HAVE_ADDRINFO
-#include "addrinfo.h"
-#endif
-#endif
-
#define SUCCESS 0
#define ANY 0
#define YES 1
@@ -127,10 +110,8 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
if (sa == NULL)
return ENI_NOSOCKET;
-#ifdef HAVE_SA_LEN /*XXX*/
if (sa->sa_len != salen)
return ENI_SALEN;
-#endif
family = sa->sa_family;
for (i = 0; afdl[i].a_af; i++)
@@ -180,11 +161,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
if (IN_MULTICAST(v4a) || IN_EXPERIMENTAL(v4a))
flags |= NI_NUMERICHOST;
v4a >>= IN_CLASSA_NSHIFT;
-#if 0
- if (v4a == 0 || v4a == IN_LOOPBACKNET)
-#else
if (v4a == 0)
-#endif
flags |= NI_NUMERICHOST;
break;
#ifdef INET6