summaryrefslogtreecommitdiff
path: root/usr.bin/netstat/inet6.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-02-01 01:51:32 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-02-01 01:51:32 +0000
commitd37545996269bdd7c355f84cf61256720a3957b2 (patch)
tree6cb3b0dc815585ff8059e2b134485bf3dde7e1e8 /usr.bin/netstat/inet6.c
parent008b743045938d851a91ad089652bef3944a3ede (diff)
ansi
Diffstat (limited to 'usr.bin/netstat/inet6.c')
-rw-r--r--usr.bin/netstat/inet6.c60
1 files changed, 23 insertions, 37 deletions
diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c
index e8a863cc401..be54955a356 100644
--- a/usr.bin/netstat/inet6.c
+++ b/usr.bin/netstat/inet6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet6.c,v 1.24 2002/10/26 18:56:53 itojun Exp $ */
+/* $OpenBSD: inet6.c,v 1.25 2003/02/01 01:51:31 deraadt Exp $ */
/* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */
/*
* Copyright (c) 1983, 1988, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)inet.c 8.4 (Berkeley) 4/20/94";
#else
-/*__RCSID("$OpenBSD: inet6.c,v 1.24 2002/10/26 18:56:53 itojun Exp $");*/
+/*__RCSID("$OpenBSD: inet6.c,v 1.25 2003/02/01 01:51:31 deraadt Exp $");*/
/*__RCSID("KAME Id: inet6.c,v 1.10 2000/02/09 10:49:31 itojun Exp");*/
#endif
#endif /* not lint */
@@ -346,9 +346,7 @@ static char *ip6nh[] = {
* Dump IP6 statistics structure.
*/
void
-ip6_stats(off, name)
- u_long off;
- char *name;
+ip6_stats(u_long off, char *name)
{
struct ip6stat ip6stat;
int first, i;
@@ -510,8 +508,7 @@ ip6_stats(off, name)
* Dump IPv6 per-interface statistics based on RFC 2465.
*/
void
-ip6_ifstats(ifname)
- char *ifname;
+ip6_ifstats(char *ifname)
{
struct in6_ifreq ifr;
int s;
@@ -828,9 +825,7 @@ static char *icmp6names[] = {
* Dump ICMPv6 statistics.
*/
void
-icmp6_stats(off, name)
- u_long off;
- char *name;
+icmp6_stats(u_long off, char *name)
{
struct icmp6stat icmp6stat;
int i, first;
@@ -857,7 +852,7 @@ icmp6_stats(off, name)
first = 0;
}
printf("\t\t%s: %llu\n", icmp6names[i],
- (unsigned long long)icmp6stat.icp6s_outhist[i]);
+ (unsigned long long)icmp6stat.icp6s_outhist[i]);
}
p(icp6s_badcode, "\t%llu message%s with bad code fields\n");
p(icp6s_tooshort, "\t%llu message%s < minimum length\n");
@@ -870,7 +865,7 @@ icmp6_stats(off, name)
first = 0;
}
printf("\t\t%s: %llu\n", icmp6names[i],
- (unsigned long long)icmp6stat.icp6s_inhist[i]);
+ (unsigned long long)icmp6stat.icp6s_inhist[i]);
}
printf("\tHistogram of error messages to be generated:\n");
p_5(icp6s_odst_unreach_noroute, "\t\t%llu no route\n");
@@ -904,8 +899,7 @@ icmp6_stats(off, name)
* Dump ICMPv6 per-interface statistics based on RFC 2466.
*/
void
-icmp6_ifstats(ifname)
- char *ifname;
+icmp6_ifstats(char *ifname)
{
struct in6_ifreq ifr;
int s;
@@ -972,9 +966,7 @@ icmp6_ifstats(ifname)
* Dump PIM statistics structure.
*/
void
-pim6_stats(off, name)
- u_long off;
- char *name;
+pim6_stats(u_long off, char *name)
{
struct pim6stat pim6stat;
@@ -1000,9 +992,7 @@ pim6_stats(off, name)
* Dump raw ip6 statistics structure.
*/
void
-rip6_stats(off, name)
- u_long off;
- char *name;
+rip6_stats(u_long off, char *name)
{
struct rip6stat rip6stat;
u_quad_t delivered;
@@ -1039,20 +1029,18 @@ rip6_stats(off, name)
*/
void
-inet6print(in6, port, proto)
- struct in6_addr *in6;
- int port;
- char *proto;
+inet6print(struct in6_addr *in6, int port, char *proto)
{
-#define GETSERVBYPORT6(port, proto, ret)\
-do {\
- if (strcmp((proto), "tcp6") == 0)\
- (ret) = getservbyport((int)(port), "tcp");\
- else if (strcmp((proto), "udp6") == 0)\
- (ret) = getservbyport((int)(port), "udp");\
- else\
- (ret) = getservbyport((int)(port), (proto));\
-} while (0)
+
+#define GETSERVBYPORT6(port, proto, ret) do { \
+ if (strcmp((proto), "tcp6") == 0) \
+ (ret) = getservbyport((int)(port), "tcp"); \
+ else if (strcmp((proto), "udp6") == 0) \
+ (ret) = getservbyport((int)(port), "udp"); \
+ else \
+ (ret) = getservbyport((int)(port), (proto)); \
+ } while (0)
+
struct servent *sp = 0;
char line[80], *cp;
int width;
@@ -1081,8 +1069,7 @@ do {\
*/
char *
-inet6name(in6p)
- struct in6_addr *in6p;
+inet6name(struct in6_addr *in6p)
{
char *cp;
static char line[NI_MAXHOST];
@@ -1145,8 +1132,7 @@ inet6name(in6p)
* Dump the contents of a TCP6 PCB.
*/
void
-tcp6_dump(pcbaddr)
- u_long pcbaddr;
+tcp6_dump(u_long pcbaddr)
{
struct tcp6cb tcp6cb;
int i;