about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog13
-rw-r--r--bits/netdb.h33
-rw-r--r--include/netdb.h2
-rw-r--r--inet/getnetbyad.c5
-rw-r--r--inet/getnetbyad_r.c5
-rw-r--r--nis/nss_nis/nis-network.c5
-rw-r--r--nis/nss_nisplus/nisplus-network.c5
-rw-r--r--nss/nss_files/files-network.c4
-rw-r--r--resolv/netdb.h22
-rw-r--r--sysdeps/generic/bits/netdb.h33
-rw-r--r--sysdeps/generic/stdint.h5
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/netdb.h35
12 files changed, 142 insertions, 25 deletions
diff --git a/ChangeLog b/ChangeLog
index 315d8b931b..80b2564c78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2000-04-01  Ulrich Drepper  <drepper@redhat.com>
 
+	* include/netdb.h: Change type of first parameter of __getnetbyaddr_r.
+	* inet/getnetbyad.c: Likewise.
+	* inet/getnetbyad_r.c: Likewise.
+	* nis/nss_nis/nis-network.c: Likewise.
+	* nis/nssplus_nis/nisplus-network.c: Likewise.
+	* nss/nss_files/files-network.c: Likewise.
+	* resolv/netdb.h: Define uint32_t if not already happened.
+	Include bits/netdb.h.  Remove definition of struct netent.
+	Change type of first parameter of getnetbyaddr_r and getnetbyaddr.
+	* sysdeps/generic/stdint.h: Allow definition of uint32_t elsewhere.
+	* sysdeps/generic/bits/netdb.h: New file.
+	* sysdeps/unix/sysv/linux/alpha/bits/netdb.h: New file.
+
 	* dlfcn/Makefile (distribute): Add glreflib1.c and glreflib2.c.
 	(tests): Add glrefmain.
 	Add rules to build modules and run tests.  Ignore result of glrefmain
diff --git a/bits/netdb.h b/bits/netdb.h
new file mode 100644
index 0000000000..f687a3ee7c
--- /dev/null
+++ b/bits/netdb.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000 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 modify it under the terms of the GNU Library General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be
+   useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, write to the Free Software Foundation, Inc., 59 Temple Place -
+   Suite 330, Boston, MA 02111-1307, USA.  */
+
+#ifndef _NETDB_H
+# error "Never include <bits/netdb.h> directly; use <netdb.h> instead."
+#endif
+
+
+/* Description of data base entry for a single network.  NOTE: here a
+   poor assumption is made.  The network number is expected to fit
+   into an unsigned long int variable.  */
+struct netent
+{
+  char *n_name;			/* Official name of network.  */
+  char **n_aliases;		/* Alias list.  */
+  int n_addrtype;		/* Net address type.  */
+  uint32_t n_net;		/* Network number.  */
+};
diff --git a/include/netdb.h b/include/netdb.h
index 48fdddd7d4..eeede8de40 100644
--- a/include/netdb.h
+++ b/include/netdb.h
@@ -31,7 +31,7 @@ extern int __getnetent_r (struct netent *__restrict __result_buf,
 			  struct netent **__restrict __result,
 			  int *__restrict __h_errnop);
 
-extern int __getnetbyaddr_r (unsigned long int __net, int __type,
+extern int __getnetbyaddr_r (uint32_t __net, int __type,
 			     struct netent *__restrict __result_buf,
 			     char *__restrict __buf, size_t __buflen,
 			     struct netent **__restrict __result,
diff --git a/inet/getnetbyad.c b/inet/getnetbyad.c
index 7d9006d268..0f6c7b303f 100644
--- a/inet/getnetbyad.c
+++ b/inet/getnetbyad.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -18,12 +18,13 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <netdb.h>
+#include <stdint.h>
 
 
 #define LOOKUP_TYPE	struct netent
 #define FUNCTION_NAME	getnetbyaddr
 #define DATABASE_NAME	networks
-#define ADD_PARAMS	unsigned long int net, int type
+#define ADD_PARAMS	uint32_t net, int type
 #define ADD_VARIABLES	net, type
 #define BUFLEN		1024
 #define NEED_H_ERRNO	1
diff --git a/inet/getnetbyad_r.c b/inet/getnetbyad_r.c
index c27fa88370..4bcec16544 100644
--- a/inet/getnetbyad_r.c
+++ b/inet/getnetbyad_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -18,12 +18,13 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <netdb.h>
+#include <stdint.h>
 
 
 #define LOOKUP_TYPE	struct netent
 #define FUNCTION_NAME	getnetbyaddr
 #define DATABASE_NAME	networks
-#define ADD_PARAMS	unsigned long int net, int type
+#define ADD_PARAMS	uint32_t net, int type
 #define ADD_VARIABLES	net, type
 #define NEED__RES	1
 #define NEED_H_ERRNO	1
diff --git a/nis/nss_nis/nis-network.c b/nis/nss_nis/nis-network.c
index 4e8c94fe9a..cae0b773b8 100644
--- a/nis/nss_nis/nis-network.c
+++ b/nis/nss_nis/nis-network.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
 
@@ -21,6 +21,7 @@
 #include <netdb.h>
 #include <ctype.h>
 #include <errno.h>
+#include <stdint.h>
 #include <string.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
@@ -247,7 +248,7 @@ _nss_nis_getnetbyname_r (const char *name, struct netent *net, char *buffer,
 }
 
 enum nss_status
-_nss_nis_getnetbyaddr_r (unsigned long addr, int type, struct netent *net,
+_nss_nis_getnetbyaddr_r (uint32_t addr, int type, struct netent *net,
 			 char *buffer, size_t buflen, int *errnop,
 			 int *herrnop)
 {
diff --git a/nis/nss_nisplus/nisplus-network.c b/nis/nss_nisplus/nisplus-network.c
index f152c49f11..4b2339baa2 100644
--- a/nis/nss_nisplus/nisplus-network.c
+++ b/nis/nss_nisplus/nisplus-network.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
 
@@ -21,6 +21,7 @@
 #include <netdb.h>
 #include <errno.h>
 #include <ctype.h>
+#include <stdint.h>
 #include <string.h>
 #include <arpa/inet.h>
 #include <bits/libc-lock.h>
@@ -365,7 +366,7 @@ _nss_nisplus_getnetbyname_r (const char *name, struct netent *network,
 
 /* XXX type is ignored, SUN's NIS+ table doesn't support it */
 enum nss_status
-_nss_nisplus_getnetbyaddr_r (const unsigned long addr, const int type,
+_nss_nisplus_getnetbyaddr_r (uint32_t addr, const int type,
 			     struct netent *network, char *buffer,
 			     size_t buflen, int *errnop, int *herrnop)
 {
diff --git a/nss/nss_files/files-network.c b/nss/nss_files/files-network.c
index 8bf9c04adf..3b1fec9724 100644
--- a/nss/nss_files/files-network.c
+++ b/nss/nss_files/files-network.c
@@ -1,5 +1,5 @@
 /* Networks file parser in nss_files module.
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 2000 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
@@ -53,4 +53,4 @@ DB_LOOKUP (netbyaddr, ,,
 	     if (result->n_addrtype == type && result->n_net == net)
 	       /* Bingo!  */
 	       break;
-	   }, unsigned long int net, int type)
+	   }, uint32_t net, int type)
diff --git a/resolv/netdb.h b/resolv/netdb.h
index 508e7c4692..50420c3e44 100644
--- a/resolv/netdb.h
+++ b/resolv/netdb.h
@@ -32,6 +32,13 @@
 #define __need_size_t
 #include <stddef.h>
 
+#ifndef __uint32_t_defined
+typedef unsigned int		uint32_t;
+# define __uint32_t_defined
+#endif
+
+#include <bits/netdb.h>
+
 /* Absolute file name for network data base files.  */
 #define	_PATH_HEQUIV		"/etc/hosts.equiv"
 #define	_PATH_HOSTS		"/etc/hosts"
@@ -184,17 +191,6 @@ extern int gethostbyname2_r (__const char *__restrict __name, int __af,
 #endif	/* misc */
 
 
-/* Description of data base entry for a single network.  NOTE: here a
-   poor assumption is made.  The network number is expected to fit
-   into an unsigned long int variable.  */
-struct netent
-{
-  char *n_name;			/* Official name of network.  */
-  char **n_aliases;		/* Alias list.  */
-  int n_addrtype;		/* Net address type.  */
-  unsigned long	int n_net;	/* Network number.  */
-};
-
 /* Open network data base files and mark them as staying open even
    after a later search if STAY_OPEN is non-zero.  */
 extern void setnetent (int __stay_open) __THROW;
@@ -208,7 +204,7 @@ extern struct netent *getnetent (void) __THROW;
 
 /* Return entry from network data base which address match NET and
    type TYPE.  */
-extern struct netent *getnetbyaddr (unsigned long int __net, int __type)
+extern struct netent *getnetbyaddr (uint32_t __net, int __type)
      __THROW;
 
 /* Return entry from network data base for network with NAME.  */
@@ -225,7 +221,7 @@ extern int getnetent_r (struct netent *__restrict __result_buf,
 			struct netent **__restrict __result,
 			int *__restrict __h_errnop) __THROW;
 
-extern int getnetbyaddr_r (unsigned long int __net, int __type,
+extern int getnetbyaddr_r (uint32_t __net, int __type,
 			   struct netent *__restrict __result_buf,
 			   char *__restrict __buf, size_t __buflen,
 			   struct netent **__restrict __result,
diff --git a/sysdeps/generic/bits/netdb.h b/sysdeps/generic/bits/netdb.h
new file mode 100644
index 0000000000..f687a3ee7c
--- /dev/null
+++ b/sysdeps/generic/bits/netdb.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000 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 modify it under the terms of the GNU Library General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be
+   useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, write to the Free Software Foundation, Inc., 59 Temple Place -
+   Suite 330, Boston, MA 02111-1307, USA.  */
+
+#ifndef _NETDB_H
+# error "Never include <bits/netdb.h> directly; use <netdb.h> instead."
+#endif
+
+
+/* Description of data base entry for a single network.  NOTE: here a
+   poor assumption is made.  The network number is expected to fit
+   into an unsigned long int variable.  */
+struct netent
+{
+  char *n_name;			/* Official name of network.  */
+  char **n_aliases;		/* Alias list.  */
+  int n_addrtype;		/* Net address type.  */
+  uint32_t n_net;		/* Network number.  */
+};
diff --git a/sysdeps/generic/stdint.h b/sysdeps/generic/stdint.h
index 1269b78f34..73f3108a42 100644
--- a/sysdeps/generic/stdint.h
+++ b/sysdeps/generic/stdint.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2000 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
@@ -49,7 +49,10 @@ typedef long long int		int64_t;
 /* Unsigned.  */
 typedef unsigned char		uint8_t;
 typedef unsigned short int	uint16_t;
+#ifndef __uint32_t_defined
 typedef unsigned int		uint32_t;
+# define __uint32_t_defined
+#endif
 #if __WORDSIZE == 64
 typedef unsigned long int	uint64_t;
 #else
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/netdb.h b/sysdeps/unix/sysv/linux/alpha/bits/netdb.h
new file mode 100644
index 0000000000..f5a33d998d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/bits/netdb.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000 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 modify it under the terms of the GNU Library General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be
+   useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, write to the Free Software Foundation, Inc., 59 Temple Place -
+   Suite 330, Boston, MA 02111-1307, USA.  */
+
+#ifndef _NETDB_H
+# error "Never include <bits/netdb.h> directly; use <netdb.h> instead."
+#endif
+
+
+/* Description of data base entry for a single network.  NOTE: here a
+   poor assumption is made.  The network number is expected to fit
+   into an unsigned long int variable.  */
+struct netent
+{
+  char *n_name;			/* Official name of network.  */
+  char **n_aliases;		/* Alias list.  */
+  int n_addrtype;		/* Net address type.  */
+  /* XXX We should probably use uint32_t for the field and ensure
+     compatiblity by adding appropriate padding.  */
+  unsigned long	int n_net;	/* Network number.  */
+};