diff options
author | Jared Yanovich <jaredy@cvs.openbsd.org> | 2005-03-30 08:23:48 +0000 |
---|---|---|
committer | Jared Yanovich <jaredy@cvs.openbsd.org> | 2005-03-30 08:23:48 +0000 |
commit | e821da7bc4373cb3e0f90a115ca88a618d555eab (patch) | |
tree | 4a4971b9da5824153f819a01a4ebfbb99a41294a | |
parent | 6c14ffca4e8e0ddbde9975cdcbfe9b54731763aa (diff) |
kill -S; ok henning
-rw-r--r-- | usr.bin/netstat/main.c | 11 | ||||
-rw-r--r-- | usr.bin/netstat/netstat.1 | 8 | ||||
-rw-r--r-- | usr.bin/netstat/netstat.h | 3 | ||||
-rw-r--r-- | usr.bin/netstat/route.c | 34 |
4 files changed, 11 insertions, 45 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index cea5bddd028..8e735472ef0 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.53 2005/03/25 17:01:04 jaredy Exp $ */ +/* $OpenBSD: main.c,v 1.54 2005/03/30 08:23:47 jaredy Exp $ */ /* $NetBSD: main.c,v 1.9 1996/05/07 02:55:02 thorpej Exp $ */ /* @@ -40,7 +40,7 @@ char copyright[] = #if 0 static char sccsid[] = "from: @(#)main.c 8.4 (Berkeley) 3/1/94"; #else -static char *rcsid = "$OpenBSD: main.c,v 1.53 2005/03/25 17:01:04 jaredy Exp $"; +static char *rcsid = "$OpenBSD: main.c,v 1.54 2005/03/30 08:23:47 jaredy Exp $"; #endif #endif /* not lint */ @@ -302,7 +302,7 @@ main(int argc, char *argv[]) af = AF_UNSPEC; - while ((ch = getopt(argc, argv, "Aabdf:gI:ilM:mN:np:qrSstuvw:")) != -1) + while ((ch = getopt(argc, argv, "Aabdf:gI:ilM:mN:np:qrstuvw:")) != -1) switch (ch) { case 'A': Aflag = 1; @@ -380,9 +380,6 @@ main(int argc, char *argv[]) case 'r': rflag = 1; break; - case 'S': - Sflag = 1; - break; case 's': ++sflag; break; @@ -635,7 +632,7 @@ usage(void) (void)fprintf(stderr, "usage: %s [-Aan] [-f address_family] [-M core] [-N system]\n", __progname); (void)fprintf(stderr, -" %s [-bdgilmnqrSstu] [-f address_family] [-M core] [-N system]\n", __progname); +" %s [-bdgilmnqrstu] [-f address_family] [-M core] [-N system]\n", __progname); (void)fprintf(stderr, " %s [-bdn] [-I interface] [-M core] [-N system] [-w wait]\n", __progname); (void)fprintf(stderr, diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1 index bc959224cdd..9e152c94942 100644 --- a/usr.bin/netstat/netstat.1 +++ b/usr.bin/netstat/netstat.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: netstat.1,v 1.40 2004/07/13 23:33:29 jmc Exp $ +.\" $OpenBSD: netstat.1,v 1.41 2005/03/30 08:23:47 jaredy Exp $ .\" $NetBSD: netstat.1,v 1.11 1995/10/03 21:42:43 thorpej Exp $ .\" .\" Copyright (c) 1983, 1990, 1992, 1993 @@ -43,7 +43,7 @@ .Op Fl M Ar core .Op Fl N Ar system .Nm netstat -.Op Fl bdgilmnqrSstu +.Op Fl bdgilmnqrstu .Op Fl f Ar address_family .Op Fl M Ar core .Op Fl N Ar system @@ -222,10 +222,6 @@ Show the routing tables. If the .Fl s option is also specified, show routing statistics instead. -.It Fl S -Make the -.Fl r -command display the source selector part of the routes. .It Fl s Show per-protocol statistics. If this option is repeated, counters with a value of zero are suppressed. diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h index a0c4d1eaa8f..a06f1c55402 100644 --- a/usr.bin/netstat/netstat.h +++ b/usr.bin/netstat/netstat.h @@ -1,4 +1,4 @@ -/* $OpenBSD: netstat.h,v 1.32 2005/03/25 17:01:04 jaredy Exp $ */ +/* $OpenBSD: netstat.h,v 1.33 2005/03/30 08:23:47 jaredy Exp $ */ /* $NetBSD: netstat.h,v 1.6 1996/05/07 02:55:05 thorpej Exp $ */ /* @@ -49,7 +49,6 @@ int nflag; /* show addresses numerically */ int pflag; /* show given protocol */ int qflag; /* only display non-zero values for output */ int rflag; /* show routing tables (or routing stats) */ -int Sflag; /* show source address in routing table */ int sflag; /* show protocol statistics */ int tflag; /* show i/f watchdog timers */ int vflag; /* be verbose */ diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 76160ecfc13..1e8a77d43ec 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.67 2005/03/25 17:01:04 jaredy Exp $ */ +/* $OpenBSD: route.c,v 1.68 2005/03/30 08:23:47 jaredy Exp $ */ /* $NetBSD: route.c,v 1.15 1996/05/07 02:55:06 thorpej Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94"; #else -static char *rcsid = "$OpenBSD: route.c,v 1.67 2005/03/25 17:01:04 jaredy Exp $"; +static char *rcsid = "$OpenBSD: route.c,v 1.68 2005/03/30 08:23:47 jaredy Exp $"; #endif #endif /* not lint */ @@ -110,7 +110,6 @@ struct bits { { RTF_PROTO2, '2' }, { RTF_PROTO3, '3' }, { RTF_CLONED, 'c' }, - { RTF_SOURCE, 's' }, { 0 } }; @@ -137,7 +136,6 @@ static void p_sockaddr(struct sockaddr *, struct sockaddr *, int, int); static void p_flags(int, char *); static void p_rtentry(struct rtentry *); static void encap_print(struct rtentry *); -static void sa_src2dst(struct sockaddr *); /* * Print routing tables. @@ -249,12 +247,8 @@ pr_rthdr(int af) if (Aflag) printf("%-*.*s ", PLEN, PLEN, "Address"); - if (Sflag) - printf("%-*.*s ", - WID_DST(af), WID_DST(af), "Source"); - printf("%-*.*s ", - WID_DST(af), WID_DST(af), "Destination"); - printf("%-*.*s %-6.6s %6.6s %6.6s %6.6s %s\n", + printf("%-*.*s %-*.*s %-6.6s %6.6s %6.6s %6.6s %s\n", + WID_DST(af), WID_DST(af), "Destination", WID_GW(af), WID_GW(af), "Gateway", "Flags", "Refs", "Use", "Mtu", "Interface"); } @@ -631,13 +625,6 @@ p_rtentry(struct rtentry *rt) } else mask = 0; - if (Sflag && sa->sa_family == AF_INET) { - sa_src2dst(sa); - sa_src2dst(mask); - p_sockaddr(sa, mask, rt->rt_flags, WID_DST(sa->sa_family)); - sa_src2dst(sa); - sa_src2dst(mask); - } p_sockaddr(sa, mask, rt->rt_flags, WID_DST(sa->sa_family)); p_sockaddr(kgetsa(rt->rt_gateway), 0, RTF_HOST, WID_GW(sa->sa_family)); p_flags(rt->rt_flags, "%-6.6s "); @@ -1153,16 +1140,3 @@ upHex(char *p0) break; } } - -void -sa_src2dst(struct sockaddr *sa) -{ - struct sockaddr_rtin *rtin = satortin(sa); - struct in_addr tmp; - - if (sa != NULL) { - tmp = rtin->rtin_dst; - rtin->rtin_dst = rtin->rtin_src; - rtin->rtin_src = tmp; - } -} |