Use C89 definitions
This commit is contained in:
parent
56a38fd9b4
commit
1f0437222e
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: inet_cidr_pton.c,v 1.7 2012/03/13 21:13:38 christos Exp $ */
|
/* $NetBSD: inet_cidr_pton.c,v 1.8 2012/03/20 17:08:13 matt Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
|
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
|
||||||
@ -22,7 +22,7 @@
|
|||||||
#if 0
|
#if 0
|
||||||
static const char rcsid[] = "Id: inet_cidr_pton.c,v 1.6 2005/04/27 04:56:19 sra Exp";
|
static const char rcsid[] = "Id: inet_cidr_pton.c,v 1.6 2005/04/27 04:56:19 sra Exp";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: inet_cidr_pton.c,v 1.7 2012/03/13 21:13:38 christos Exp $");
|
__RCSID("$NetBSD: inet_cidr_pton.c,v 1.8 2012/03/20 17:08:13 matt Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -55,10 +55,9 @@ __RCSID("$NetBSD: inet_cidr_pton.c,v 1.7 2012/03/13 21:13:38 christos Exp $");
|
|||||||
__weak_alias(inet_cidr_pton,_inet_cidr_pton)
|
__weak_alias(inet_cidr_pton,_inet_cidr_pton)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int inet_cidr_pton_ipv4 __P((const char *src, u_char *dst,
|
static int inet_cidr_pton_ipv4(const char *src, u_char *dst,
|
||||||
int *bits, int ipv6));
|
int *bits, int ipv6);
|
||||||
static int inet_cidr_pton_ipv6 __P((const char *src, u_char *dst,
|
static int inet_cidr_pton_ipv6(const char *src, u_char *dst, int *bits);
|
||||||
int *bits));
|
|
||||||
|
|
||||||
static int getbits(const char *, int ipv6);
|
static int getbits(const char *, int ipv6);
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#ifdef notdef
|
#ifdef notdef
|
||||||
static const char rcsid[] = "Id: inet_net_ntop.c,v 1.1.2.1 2002/08/02 02:17:21 marka Exp ";
|
static const char rcsid[] = "Id: inet_net_ntop.c,v 1.1.2.1 2002/08/02 02:17:21 marka Exp ";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: inet_net_ntop.c,v 1.2 2009/02/07 07:25:22 lukem Exp $");
|
__RCSID("$NetBSD: inet_net_ntop.c,v 1.3 2012/03/20 17:08:13 matt Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -49,10 +49,10 @@ __weak_alias(inet_net_ntop,_inet_net_ntop)
|
|||||||
# define SPRINTF(x) sprintf x
|
# define SPRINTF(x) sprintf x
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char * inet_net_ntop_ipv4 __P((const u_char *src, int bits,
|
static char * inet_net_ntop_ipv4(const u_char *src, int bits,
|
||||||
char *dst, size_t size));
|
char *dst, size_t size);
|
||||||
static char * inet_net_ntop_ipv6 __P((const u_char *src, int bits,
|
static char * inet_net_ntop_ipv6(const u_char *src, int bits,
|
||||||
char *dst, size_t size));
|
char *dst, size_t size);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* char *
|
* char *
|
||||||
@ -65,12 +65,7 @@ static char * inet_net_ntop_ipv6 __P((const u_char *src, int bits,
|
|||||||
* Paul Vixie (ISC), July 1996
|
* Paul Vixie (ISC), July 1996
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
inet_net_ntop(af, src, bits, dst, size)
|
inet_net_ntop(int af, const void *src, int bits, char *dst, size_t size)
|
||||||
int af;
|
|
||||||
const void *src;
|
|
||||||
int bits;
|
|
||||||
char *dst;
|
|
||||||
size_t size;
|
|
||||||
{
|
{
|
||||||
switch (af) {
|
switch (af) {
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
@ -97,11 +92,7 @@ inet_net_ntop(af, src, bits, dst, size)
|
|||||||
* Paul Vixie (ISC), July 1996
|
* Paul Vixie (ISC), July 1996
|
||||||
*/
|
*/
|
||||||
static char *
|
static char *
|
||||||
inet_net_ntop_ipv4(src, bits, dst, size)
|
inet_net_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size)
|
||||||
const u_char *src;
|
|
||||||
int bits;
|
|
||||||
char *dst;
|
|
||||||
size_t size;
|
|
||||||
{
|
{
|
||||||
char *odst = dst;
|
char *odst = dst;
|
||||||
char *t;
|
char *t;
|
||||||
@ -176,7 +167,8 @@ inet_net_ntop_ipv4(src, bits, dst, size)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
inet_net_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size) {
|
inet_net_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size)
|
||||||
|
{
|
||||||
u_int m;
|
u_int m;
|
||||||
int b;
|
int b;
|
||||||
size_t p;
|
size_t p;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#if 0
|
#if 0
|
||||||
static const char rcsid[] = "Id: inet_net_pton.c,v 1.4.2.1 2002/08/02 02:17:21 marka Exp ";
|
static const char rcsid[] = "Id: inet_net_pton.c,v 1.4.2.1 2002/08/02 02:17:21 marka Exp ";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: inet_net_pton.c,v 1.3 2012/03/13 21:13:38 christos Exp $");
|
__RCSID("$NetBSD: inet_net_pton.c,v 1.4 2012/03/20 17:08:13 matt Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -71,7 +71,8 @@ __weak_alias(inet_net_pton,_inet_net_pton)
|
|||||||
* Paul Vixie (ISC), June 1996
|
* Paul Vixie (ISC), June 1996
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
inet_net_pton_ipv4( const char *src, u_char *dst, size_t size) {
|
inet_net_pton_ipv4(const char *src, u_char *dst, size_t size)
|
||||||
|
{
|
||||||
static const char xdigits[] = "0123456789abcdef";
|
static const char xdigits[] = "0123456789abcdef";
|
||||||
static const char digits[] = "0123456789";
|
static const char digits[] = "0123456789";
|
||||||
int ch, dirty, bits;
|
int ch, dirty, bits;
|
||||||
@ -197,7 +198,8 @@ inet_net_pton_ipv4( const char *src, u_char *dst, size_t size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
getbits(const char *src, int *bitsp) {
|
getbits(const char *src, int *bitsp)
|
||||||
|
{
|
||||||
static const char digits[] = "0123456789";
|
static const char digits[] = "0123456789";
|
||||||
int n;
|
int n;
|
||||||
int val;
|
int val;
|
||||||
@ -227,7 +229,8 @@ getbits(const char *src, int *bitsp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
getv4(const char *src, u_char *dst, int *bitsp) {
|
getv4(const char *src, u_char *dst, int *bitsp)
|
||||||
|
{
|
||||||
static const char digits[] = "0123456789";
|
static const char digits[] = "0123456789";
|
||||||
u_char *odst = dst;
|
u_char *odst = dst;
|
||||||
int n;
|
int n;
|
||||||
@ -270,7 +273,8 @@ getv4(const char *src, u_char *dst, int *bitsp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
inet_net_pton_ipv6(const char *src, u_char *dst, size_t size) {
|
inet_net_pton_ipv6(const char *src, u_char *dst, size_t size)
|
||||||
|
{
|
||||||
static const char xdigits_l[] = "0123456789abcdef",
|
static const char xdigits_l[] = "0123456789abcdef",
|
||||||
xdigits_u[] = "0123456789ABCDEF";
|
xdigits_u[] = "0123456789ABCDEF";
|
||||||
u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
|
u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
|
||||||
@ -402,7 +406,8 @@ inet_net_pton_ipv6(const char *src, u_char *dst, size_t size) {
|
|||||||
* Paul Vixie (ISC), June 1996
|
* Paul Vixie (ISC), June 1996
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
inet_net_pton(int af, const char *src, void *dst, size_t size) {
|
inet_net_pton(int af, const char *src, void *dst, size_t size)
|
||||||
|
{
|
||||||
switch (af) {
|
switch (af) {
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
return (inet_net_pton_ipv4(src, dst, size));
|
return (inet_net_pton_ipv4(src, dst, size));
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: inet_ntop.c,v 1.8 2009/04/12 17:07:17 christos Exp $ */
|
/* $NetBSD: inet_ntop.c,v 1.9 2012/03/20 17:08:13 matt Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
|
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
|
||||||
@ -22,7 +22,7 @@
|
|||||||
#if 0
|
#if 0
|
||||||
static const char rcsid[] = "Id: inet_ntop.c,v 1.5 2005/11/03 22:59:52 marka Exp";
|
static const char rcsid[] = "Id: inet_ntop.c,v 1.5 2005/11/03 22:59:52 marka Exp";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: inet_ntop.c,v 1.8 2009/04/12 17:07:17 christos Exp $");
|
__RCSID("$NetBSD: inet_ntop.c,v 1.9 2012/03/20 17:08:13 matt Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
@ -66,11 +66,7 @@ static const char *inet_ntop6(const u_char *src, char *dst, socklen_t size);
|
|||||||
* Paul Vixie, 1996.
|
* Paul Vixie, 1996.
|
||||||
*/
|
*/
|
||||||
const char *
|
const char *
|
||||||
inet_ntop(af, src, dst, size)
|
inet_ntop(int af, const void *src, char *dst, socklen_t size)
|
||||||
int af;
|
|
||||||
const void *src;
|
|
||||||
char *dst;
|
|
||||||
socklen_t size;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
_DIAGASSERT(src != NULL);
|
_DIAGASSERT(src != NULL);
|
||||||
@ -100,10 +96,7 @@ inet_ntop(af, src, dst, size)
|
|||||||
* Paul Vixie, 1996.
|
* Paul Vixie, 1996.
|
||||||
*/
|
*/
|
||||||
static const char *
|
static const char *
|
||||||
inet_ntop4(src, dst, size)
|
inet_ntop4(const u_char *src, char *dst, socklen_t size)
|
||||||
const u_char *src;
|
|
||||||
char *dst;
|
|
||||||
socklen_t size;
|
|
||||||
{
|
{
|
||||||
char tmp[sizeof "255.255.255.255"];
|
char tmp[sizeof "255.255.255.255"];
|
||||||
int l;
|
int l;
|
||||||
@ -128,10 +121,7 @@ inet_ntop4(src, dst, size)
|
|||||||
* Paul Vixie, 1996.
|
* Paul Vixie, 1996.
|
||||||
*/
|
*/
|
||||||
static const char *
|
static const char *
|
||||||
inet_ntop6(src, dst, size)
|
inet_ntop6(const u_char *src, char *dst, socklen_t size)
|
||||||
const u_char *src;
|
|
||||||
char *dst;
|
|
||||||
socklen_t size;
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Note that int32_t and int16_t need only be "at least" large enough
|
* Note that int32_t and int16_t need only be "at least" large enough
|
||||||
|
Loading…
Reference in New Issue
Block a user