* 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.
This commit is contained in:
Ulrich Drepper 2000-04-01 22:30:22 +00:00
parent 4380ef5e29
commit 9b48fa9b41
12 changed files with 142 additions and 25 deletions

View File

@ -1,5 +1,18 @@
2000-04-01 Ulrich Drepper <drepper@redhat.com> 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. * dlfcn/Makefile (distribute): Add glreflib1.c and glreflib2.c.
(tests): Add glrefmain. (tests): Add glrefmain.
Add rules to build modules and run tests. Ignore result of glrefmain Add rules to build modules and run tests. Ignore result of glrefmain

33
bits/netdb.h Normal file
View File

@ -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. */
};

View File

@ -31,7 +31,7 @@ extern int __getnetent_r (struct netent *__restrict __result_buf,
struct netent **__restrict __result, struct netent **__restrict __result,
int *__restrict __h_errnop); 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, struct netent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen, char *__restrict __buf, size_t __buflen,
struct netent **__restrict __result, struct netent **__restrict __result,

View File

@ -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. This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@ -18,12 +18,13 @@
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <netdb.h> #include <netdb.h>
#include <stdint.h>
#define LOOKUP_TYPE struct netent #define LOOKUP_TYPE struct netent
#define FUNCTION_NAME getnetbyaddr #define FUNCTION_NAME getnetbyaddr
#define DATABASE_NAME networks #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 ADD_VARIABLES net, type
#define BUFLEN 1024 #define BUFLEN 1024
#define NEED_H_ERRNO 1 #define NEED_H_ERRNO 1

View File

@ -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. This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@ -18,12 +18,13 @@
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <netdb.h> #include <netdb.h>
#include <stdint.h>
#define LOOKUP_TYPE struct netent #define LOOKUP_TYPE struct netent
#define FUNCTION_NAME getnetbyaddr #define FUNCTION_NAME getnetbyaddr
#define DATABASE_NAME networks #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 ADD_VARIABLES net, type
#define NEED__RES 1 #define NEED__RES 1
#define NEED_H_ERRNO 1 #define NEED_H_ERRNO 1

View File

@ -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. This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996. Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
@ -21,6 +21,7 @@
#include <netdb.h> #include <netdb.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
#include <stdint.h>
#include <string.h> #include <string.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
@ -247,7 +248,7 @@ _nss_nis_getnetbyname_r (const char *name, struct netent *net, char *buffer,
} }
enum nss_status 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, char *buffer, size_t buflen, int *errnop,
int *herrnop) int *herrnop)
{ {

View File

@ -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. This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997. Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
@ -21,6 +21,7 @@
#include <netdb.h> #include <netdb.h>
#include <errno.h> #include <errno.h>
#include <ctype.h> #include <ctype.h>
#include <stdint.h>
#include <string.h> #include <string.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <bits/libc-lock.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 */ /* XXX type is ignored, SUN's NIS+ table doesn't support it */
enum nss_status 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, struct netent *network, char *buffer,
size_t buflen, int *errnop, int *herrnop) size_t buflen, int *errnop, int *herrnop)
{ {

View File

@ -1,5 +1,5 @@
/* Networks file parser in nss_files module. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or 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) if (result->n_addrtype == type && result->n_net == net)
/* Bingo! */ /* Bingo! */
break; break;
}, unsigned long int net, int type) }, uint32_t net, int type)

View File

@ -32,6 +32,13 @@
#define __need_size_t #define __need_size_t
#include <stddef.h> #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. */ /* Absolute file name for network data base files. */
#define _PATH_HEQUIV "/etc/hosts.equiv" #define _PATH_HEQUIV "/etc/hosts.equiv"
#define _PATH_HOSTS "/etc/hosts" #define _PATH_HOSTS "/etc/hosts"
@ -184,17 +191,6 @@ extern int gethostbyname2_r (__const char *__restrict __name, int __af,
#endif /* misc */ #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 /* Open network data base files and mark them as staying open even
after a later search if STAY_OPEN is non-zero. */ after a later search if STAY_OPEN is non-zero. */
extern void setnetent (int __stay_open) __THROW; 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 /* Return entry from network data base which address match NET and
type TYPE. */ type TYPE. */
extern struct netent *getnetbyaddr (unsigned long int __net, int __type) extern struct netent *getnetbyaddr (uint32_t __net, int __type)
__THROW; __THROW;
/* Return entry from network data base for network with NAME. */ /* 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, struct netent **__restrict __result,
int *__restrict __h_errnop) __THROW; 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, struct netent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen, char *__restrict __buf, size_t __buflen,
struct netent **__restrict __result, struct netent **__restrict __result,

View File

@ -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. */
};

View File

@ -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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -49,7 +49,10 @@ typedef long long int int64_t;
/* Unsigned. */ /* Unsigned. */
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
typedef unsigned short int uint16_t; typedef unsigned short int uint16_t;
#ifndef __uint32_t_defined
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
# define __uint32_t_defined
#endif
#if __WORDSIZE == 64 #if __WORDSIZE == 64
typedef unsigned long int uint64_t; typedef unsigned long int uint64_t;
#else #else

View File

@ -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. */
};