aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-07-26 10:14:02 +0000
committerRoland McGrath <roland@gnu.org>1995-07-26 10:14:02 +0000
commit3d61b63cc722951e3a5261e6bc3f0488eb35d441 (patch)
tree19195b08df7f3f992f0d539205df60ff690cd0f6
parent958f803fc021993cc2ee1d4157d0092b830368aa (diff)
downloadglibc-3d61b63cc722951e3a5261e6bc3f0488eb35d441.tar.xz
glibc-3d61b63cc722951e3a5261e6bc3f0488eb35d441.zip
* asia, backward, europe, leapseconds, southamerica: New data from
ADO's 95e. * inet/Makefile (routines): Removed inet_addr. * inet/inet_addr.c: Moved to resolv/ subdirectory. * resolv/Makefile (routines): Added inet_addr. * resolv/inet_addr.c: Incorporated from BIND 4.9.3-BETA24 release. * resolv/gethnamaddr.c: Likewise. * resolv/getnetbyaddr.c: Likewise. * resolv/getnetbyname.c: Likewise. * resolv/getnetent.c: Likewise. * resolv/getnetnamadr.c: Likewise. * resolv/herror.c: Likewise. * resolv/nsap_addr.c: Likewise. * resolv/res_comp.c: Likewise. * resolv/res_debug.c: Likewise. * resolv/res_init.c: Likewise. * resolv/res_mkquery.c: Likewise. * resolv/res_query.c: Likewise. * resolv/res_send.c: Likewise. * resolv/resolv.h: Likewise. * resolv/sethostent.c: Likewise. * resolv/arpa/nameser.h: Likewise. * inet/netdb.h: Incorporated from BIND 4.9.3-BETA24 release. [__GNU_LIBRARY__]: Include <rpc/netdb.h> instead of repeating its declarations (and doing so only #ifdef sun!). * posix/sys/types.h [__USE_BSD] (__BIT_TYPES_DEFINED__): New macro. [__USE_BSD] [__GNUC__] (int64_t, u_int64_t, register_t): New typedefs.
-rw-r--r--ChangeLog30
-rw-r--r--inet/Makefile2
-rw-r--r--inet/netdb.h44
-rw-r--r--posix/sys/types.h19
-rw-r--r--resolv/Makefile4
-rw-r--r--resolv/arpa/nameser.h8
-rw-r--r--resolv/gethnamaddr.c23
-rw-r--r--resolv/getnetbyname.c4
-rw-r--r--resolv/getnetnamadr.c19
-rw-r--r--resolv/herror.c6
-rw-r--r--resolv/inet_addr.c (renamed from inet/inet_addr.c)83
-rw-r--r--resolv/nsap_addr.c1
-rw-r--r--resolv/res_comp.c6
-rw-r--r--resolv/res_debug.c70
-rw-r--r--resolv/res_init.c67
-rw-r--r--resolv/res_mkquery.c12
-rw-r--r--resolv/res_query.c7
-rw-r--r--resolv/res_send.c42
-rw-r--r--resolv/resolv.h9
-rw-r--r--resolv/sethostent.c36
-rw-r--r--time/asia49
-rw-r--r--time/backward3
-rw-r--r--time/europe9
-rw-r--r--time/leapseconds3
-rw-r--r--time/southamerica54
25 files changed, 405 insertions, 205 deletions
diff --git a/ChangeLog b/ChangeLog
index 5227ff0ad7..ac62c30f52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,35 @@
Wed Jul 26 02:00:29 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+ * asia, backward, europe, leapseconds, southamerica: New data from
+ ADO's 95e.
+
+ * inet/Makefile (routines): Removed inet_addr.
+ * inet/inet_addr.c: Moved to resolv/ subdirectory.
+ * resolv/Makefile (routines): Added inet_addr.
+ * resolv/inet_addr.c: Incorporated from BIND 4.9.3-BETA24 release.
+ * resolv/gethnamaddr.c: Likewise.
+ * resolv/getnetbyaddr.c: Likewise.
+ * resolv/getnetbyname.c: Likewise.
+ * resolv/getnetent.c: Likewise.
+ * resolv/getnetnamadr.c: Likewise.
+ * resolv/herror.c: Likewise.
+ * resolv/nsap_addr.c: Likewise.
+ * resolv/res_comp.c: Likewise.
+ * resolv/res_debug.c: Likewise.
+ * resolv/res_init.c: Likewise.
+ * resolv/res_mkquery.c: Likewise.
+ * resolv/res_query.c: Likewise.
+ * resolv/res_send.c: Likewise.
+ * resolv/resolv.h: Likewise.
+ * resolv/sethostent.c: Likewise.
+ * resolv/arpa/nameser.h: Likewise.
+ * inet/netdb.h: Incorporated from BIND 4.9.3-BETA24 release.
+ [__GNU_LIBRARY__]: Include <rpc/netdb.h> instead of repeating
+ its declarations (and doing so only #ifdef sun!).
+
+ * posix/sys/types.h [__USE_BSD] (__BIT_TYPES_DEFINED__): New macro.
+ [__USE_BSD] [__GNUC__] (int64_t, u_int64_t, register_t): New typedefs.
+
* malloc/memalign.c: Allocate (SIZE + ALIGNMENT - 1) and then trim
if possible.
diff --git a/inet/Makefile b/inet/Makefile
index 6a308c9b4b..069485b903 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -24,7 +24,7 @@ subdir := inet
headers := netinet/in.h $(wildcard arpa/*.h protocols/*.h) netdb.h
routines := ntohl ntohs htonl htons \
- inet_addr inet_lnaof inet_mkadr \
+ inet_lnaof inet_mkadr \
inet_netof inet_ntoa inet_net \
getproto getprtent getprtname \
getsrvbynm getsrvbypt getservent \
diff --git a/inet/netdb.h b/inet/netdb.h
index 21caa894f9..a568e2d6a5 100644
--- a/inet/netdb.h
+++ b/inet/netdb.h
@@ -1,4 +1,6 @@
-/*-
+/*
+ * ++Copyright++ 1980, 1983, 1988, 1993
+ * -
* Copyright (c) 1980, 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -29,19 +31,16 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * @(#)netdb.h 8.1 (Berkeley) 6/2/93
- * $Id$
* -
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
+ *
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies, and that
* the name of Digital Equipment Corporation not be used in advertising or
* publicity pertaining to distribution of the document or software without
* specific, written prior permission.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
@@ -54,15 +53,28 @@
* --Copyright--
*/
+/*
+ * @(#)netdb.h 8.1 (Berkeley) 6/2/93
+ * $Id$
+ */
+
#ifndef _NETDB_H_
#define _NETDB_H_
+#include <sys/param.h>
+#if (!defined(BSD)) || (BSD < 199306)
+# include <sys/bitypes.h>
+#endif
+#include <sys/cdefs.h>
+
#define _PATH_HEQUIV "/etc/hosts.equiv"
#define _PATH_HOSTS "/etc/hosts"
#define _PATH_NETWORKS "/etc/networks"
#define _PATH_PROTOCOLS "/etc/protocols"
#define _PATH_SERVICES "/etc/services"
+extern int h_errno;
+
/*
* Structures returned by network data base library. All addresses are
* supplied in host order, and returned in network order (suitable for
@@ -106,8 +118,6 @@ struct protoent {
* (left in extern int h_errno).
*/
-extern int h_errno;
-
#define NETDB_INTERNAL -1 /* see errno */
#define NETDB_SUCCESS 0 /* no problem */
#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */
@@ -116,8 +126,6 @@ extern int h_errno;
#define NO_DATA 4 /* Valid name, no data record of requested type */
#define NO_ADDRESS NO_DATA /* no address, look for MX record */
-#include <sys/cdefs.h>
-
__BEGIN_DECLS
void endhostent __P((void));
void endnetent __P((void));
@@ -136,7 +144,7 @@ struct servent *getservbyname __P((const char *, const char *));
struct servent *getservbyport __P((int, const char *));
struct servent *getservent __P((void));
void herror __P((const char *));
-char *hstrerror __P((int));
+const char *hstrerror __P((int));
void sethostent __P((int));
/* void sethostfile __P((const char *)); */
void setnetent __P((int));
@@ -144,4 +152,18 @@ void setprotoent __P((int));
void setservent __P((int));
__END_DECLS
+/* This is nec'y to make this include file properly replace the sun version. */
+#ifdef __GNU_LIBRARY__
+#include <rpc/netdb.h>
+#else
+#ifdef sun
+struct rpcent {
+ char *r_name; /* name of server for this rpc program */
+ char **r_aliases; /* alias list */
+ int r_number; /* rpc program number */
+};
+struct rpcent *getrpcbyname(), *getrpcbynumber(), *getrpcent();
+#endif /* sun */
+#endif /* __GNU_LIBRARY__ */
+
#endif /* !_NETDB_H_ */
diff --git a/posix/sys/types.h b/posix/sys/types.h
index b231de93c5..8178303c66 100644
--- a/posix/sys/types.h
+++ b/posix/sys/types.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -71,12 +71,21 @@ typedef unsigned int uint;
#ifdef __USE_BSD
/* These size-specific names are used by some of the inet code. */
-typedef int int32_t;
-typedef short int int16_t;
typedef char int8_t;
-typedef unsigned int u_int32_t;
-typedef unsigned short int u_int16_t;
typedef unsigned char u_int8_t;
+typedef short int int16_t;
+typedef unsigned short int u_int16_t;
+typedef int int32_t;
+typedef unsigned int u_int32_t;
+#ifdef __GNUC__
+typedef long long int int64_t;
+typedef unsigned long long int u_int64_t;
+typedef int register_t __attribute__ ((__mode__ (word)));
+#endif
+
+/* Some code from BIND tests this macro to see if the types above are
+ defined. */
+#define __BIT_TYPES_DEFINED__ 1
#endif
diff --git a/resolv/Makefile b/resolv/Makefile
index 510f16c179..e07cfb0b15 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1994 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -26,6 +26,6 @@ distribute := ../conf/portability.h
routines := gethnamaddr getnetbyaddr getnetbyname getnetent getnetnamadr \
herror nsap_addr res_comp res_debug res_init res_mkquery \
- res_query res_send sethostent
+ res_query res_send sethostent inet_addr
include ../Rules
diff --git a/resolv/arpa/nameser.h b/resolv/arpa/nameser.h
index 1a660ade63..3792b7963c 100644
--- a/resolv/arpa/nameser.h
+++ b/resolv/arpa/nameser.h
@@ -83,7 +83,7 @@
* is new enough to contain a certain feature.
*/
-#define __BIND 19940417 /* interface version stamp */
+#define __BIND 19950621 /* interface version stamp */
/*
* Define constants based on rfc883
@@ -258,8 +258,7 @@ typedef struct {
unsigned rd: 1; /* recursion desired */
/* fields in fourth byte */
unsigned ra: 1; /* recursion available */
- unsigned pr: 1; /* primary server req'd (!standard) */
- unsigned unused :2; /* unused bits (MBZ as of 4.9.3a3) */
+ unsigned unused :3; /* unused bits (MBZ as of 4.9.3a3) */
unsigned rcode :4; /* response code */
#endif
#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
@@ -271,8 +270,7 @@ typedef struct {
unsigned qr :1; /* response flag */
/* fields in fourth byte */
unsigned rcode :4; /* response code */
- unsigned unused :2; /* unused bits (MBZ as of 4.9.3a3) */
- unsigned pr :1; /* primary server req'd (!standard) */
+ unsigned unused :3; /* unused bits (MBZ as of 4.9.3a3) */
unsigned ra :1; /* recursion available */
#endif
/* remaining bytes */
diff --git a/resolv/gethnamaddr.c b/resolv/gethnamaddr.c
index 55a3fb09a4..d3b68f7d95 100644
--- a/resolv/gethnamaddr.c
+++ b/resolv/gethnamaddr.c
@@ -250,10 +250,12 @@ getanswer(answer, anslen, qname, qclass, qtype)
continue;
}
if (type != qtype) {
- syslog(LOG_NOTICE|LOG_AUTH,
+ /* CNAME->PTR should not cause a log message. */
+ if (!(qtype == T_PTR && type == T_CNAME))
+ syslog(LOG_NOTICE|LOG_AUTH,
"gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"",
- qname, p_class(qclass), p_type(qtype),
- p_type(type));
+ qname, p_class(qclass), p_type(qtype),
+ p_type(type));
cp += n;
continue; /* XXX - had_error++ ? */
}
@@ -380,6 +382,11 @@ gethostbyname(name)
int n;
extern struct hostent *_gethtbyname();
+ if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
+ h_errno = NETDB_INTERNAL;
+ return (NULL);
+ }
+
/*
* if there aren't any dots, it could be a user-level alias.
* this is also done in res_query() since we are not the only
@@ -406,7 +413,9 @@ gethostbyname(name)
h_errno = HOST_NOT_FOUND;
return (NULL);
}
- host.h_name = (char *)name;
+ strncpy(hostbuf, name, MAXDNAME);
+ hostbuf[MAXDNAME] = '\0';
+ host.h_name = hostbuf;
host.h_aliases = host_aliases;
host_aliases[0] = NULL;
host.h_addrtype = AF_INET;
@@ -451,6 +460,10 @@ gethostbyaddr(addr, len, type)
#endif /*SUNSECURITY*/
extern struct hostent *_gethtbyaddr();
+ if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
+ h_errno = NETDB_INTERNAL;
+ return (NULL);
+ }
if (type != AF_INET) {
errno = EAFNOSUPPORT;
h_errno = NETDB_INTERNAL;
@@ -480,7 +493,7 @@ gethostbyaddr(addr, len, type)
old_options = _res.options;
_res.options &= ~RES_DNSRCH;
_res.options |= RES_DEFNAMES;
- if (!(rhp = gethostbyname(hp->h_name))) {
+ if (!(rhp = gethostbyname(hname2))) {
syslog(LOG_NOTICE|LOG_AUTH,
"gethostbyaddr: No A record for %s (verifying [%s])",
hname2, inet_ntoa(*((struct in_addr *)addr)));
diff --git a/resolv/getnetbyname.c b/resolv/getnetbyname.c
index 1d2029fe6c..cc3f281c5d 100644
--- a/resolv/getnetbyname.c
+++ b/resolv/getnetbyname.c
@@ -44,11 +44,7 @@ extern int _net_stayopen;
struct netent *
_getnetbyname(name)
-#if (defined(sun) || defined(DGUX))
- register char *name;
-#else
register const char *name;
-#endif
{
register struct netent *p;
register char **cp;
diff --git a/resolv/getnetnamadr.c b/resolv/getnetnamadr.c
index 19a31afee8..e5cc505d04 100644
--- a/resolv/getnetnamadr.c
+++ b/resolv/getnetnamadr.c
@@ -56,7 +56,6 @@ static char rcsid[] = "$Id$";
#include <ctype.h>
#include <errno.h>
#include <string.h>
-#include "conf/portability.h"
extern int h_errno;
@@ -65,11 +64,7 @@ extern int errno;
#endif
struct netent *_getnetbyaddr __P((long net, int type));
-#if defined(sun)
-struct netent *_getnetbyname __P((char *name));
-#else
struct netent *_getnetbyname __P((const char *name));
-#endif
#define BYADDR 0
#define BYNAME 1
@@ -102,8 +97,7 @@ getnetanswer(answer, anslen, net_i)
register u_char *cp;
register int n;
u_char *eom;
- int type, class, buflen, ancount, qdcount, haveanswer, i, nchar,
- getclass = C_ANY, net_length = 0;
+ int type, class, buflen, ancount, qdcount, haveanswer, i, nchar;
char aux1[30], aux2[30], ans[30], *in, *st, *pauxt, *bp, **ap,
*paux1 = &aux1[0], *paux2 = &aux2[0], flag = 0;
static struct netent net_entry;
@@ -264,19 +258,18 @@ getnetbyaddr(net, net_type)
struct netent *
getnetbyname(net)
-#if defined(sun)
- register char *net;
-#else
register const char *net;
-#endif
{
- unsigned int netbr[4];
int anslen;
querybuf buf;
char qbuf[MAXDNAME];
struct netent *net_entry;
- strcpy(&qbuf[0],net);
+ if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
+ h_errno = NETDB_INTERNAL;
+ return (NULL);
+ }
+ strcpy(&qbuf[0], net);
anslen = res_search(qbuf, C_IN, T_PTR, (u_char *)&buf, sizeof(buf));
if (anslen < 0) {
#ifdef DEBUG
diff --git a/resolv/herror.c b/resolv/herror.c
index 872a009a18..988e52cbd9 100644
--- a/resolv/herror.c
+++ b/resolv/herror.c
@@ -68,7 +68,7 @@ static char rcsid[] = "$Id$";
# include "../conf/portability.h"
#endif
-char *h_errlist[] = {
+const char *h_errlist[] = {
"Resolver Error 0 (no error)",
"Unknown host", /* 1 HOST_NOT_FOUND */
"Host name lookup failure", /* 2 TRY_AGAIN */
@@ -98,7 +98,7 @@ herror(s)
v->iov_len = 2;
v++;
}
- v->iov_base = hstrerror(h_errno);
+ v->iov_base = (char *)hstrerror(h_errno);
v->iov_len = strlen(v->iov_base);
v++;
v->iov_base = "\n";
@@ -106,7 +106,7 @@ herror(s)
writev(STDERR_FILENO, iov, (v - iov) + 1);
}
-char *
+const char *
hstrerror(err)
int err;
{
diff --git a/inet/inet_addr.c b/resolv/inet_addr.c
index 246a418a95..2a15067b07 100644
--- a/inet/inet_addr.c
+++ b/resolv/inet_addr.c
@@ -1,7 +1,9 @@
/*
+ * ++Copyright++ 1983, 1990, 1993
+ * -
* Copyright (c) 1983, 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
+ * The Regents of the University of California. All rights reserved.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -12,12 +14,12 @@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -29,16 +31,44 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ * -
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ * -
+ * --Copyright--
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
+static char rcsid[] = "$Id$";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <ctype.h>
+#include "../conf/portability.h"
+
+/* these are compatibility routines, not needed on recent BSD releases */
+
+#ifndef NEED_INETADDR
+int __inet_addr_unneeded__;
+#else
/*
* Ascii internet address interpretation routine.
@@ -54,6 +84,11 @@ inet_addr(cp)
return (val.s_addr);
return (INAD