Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/route Now that the code can support tags and verbose ro...



details:   https://anonhg.NetBSD.org/src/rev/6daf7dfe9251
branches:  trunk
changeset: 333533:6daf7dfe9251
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Nov 07 14:57:08 2014 +0000

description:
Now that the code can support tags and verbose route printing, enable them.
Also document previously undocumented flags.

diffstat:

 sbin/route/route.8 |  12 +++++++++---
 sbin/route/route.c |  19 +++++++++++--------
 2 files changed, 20 insertions(+), 11 deletions(-)

diffs (126 lines):

diff -r 3b92a4421f3d -r 6daf7dfe9251 sbin/route/route.8
--- a/sbin/route/route.8        Fri Nov 07 12:57:42 2014 +0000
+++ b/sbin/route/route.8        Fri Nov 07 14:57:08 2014 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: route.8,v 1.50 2013/11/05 07:42:48 kefren Exp $
+.\"    $NetBSD: route.8,v 1.51 2014/11/07 14:57:08 christos Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"     @(#)route.8    8.4 (Berkeley) 6/1/94
 .\"
-.Dd November 5, 2013
+.Dd November 7, 2014
 .Dt ROUTE 8
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd manually manipulate the routing tables
 .Sh SYNOPSIS
 .Nm
-.Op Fl fnqSsv
+.Op Fl dfnqSsTtv
 .Ar command
 .Oo
 .Op Ar modifiers
@@ -67,6 +67,8 @@
 .Xr route 4 .
 .Pp
 .Bl -tag -width Ds
+.It Fl d
+Turn on debugging
 .It Fl f
 Remove all routes (as per
 .Cm flush ) .
@@ -96,6 +98,10 @@
 .Cm get
 command except for the actual gateway that will be used.
 How the gateway is printed depends on the type of route being looked up.
+.It Fl T
+Show tags in the route display.
+.It Fl t
+Test only, don't perform any actions.
 .It Fl v
 (verbose) Print additional details.
 .El
diff -r 3b92a4421f3d -r 6daf7dfe9251 sbin/route/route.c
--- a/sbin/route/route.c        Fri Nov 07 12:57:42 2014 +0000
+++ b/sbin/route/route.c        Fri Nov 07 14:57:08 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: route.c,v 1.145 2014/11/06 21:29:32 christos Exp $     */
+/*     $NetBSD: route.c,v 1.146 2014/11/07 14:57:08 christos Exp $     */
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)route.c    8.6 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: route.c,v 1.145 2014/11/06 21:29:32 christos Exp $");
+__RCSID("$NetBSD: route.c,v 1.146 2014/11/07 14:57:08 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -126,7 +126,7 @@
 
 int    pid, rtm_addrs;
 int    sock;
-int    forcehost, forcenet, doflush, nflag, af, qflag, tflag, Sflag;
+int    forcehost, forcenet, doflush, nflag, af, qflag, tflag, Sflag, Tflag;
 int    iflag, verbose, aflen = sizeof(struct sockaddr_in), rtag;
 int    locking, lockrest, debugonly, shortoutput;
 struct rt_metrics rt_metrics;
@@ -134,6 +134,7 @@
 short ns_nullh[] = {0,0,0};
 short ns_bh[] = {-1,-1,-1};
 
+static const char opts[] = "dfnqSsTtv";
 
 void
 usage(const char *cp)
@@ -142,8 +143,7 @@
        if (cp)
                warnx("botched keyword: %s", cp);
        (void)fprintf(stderr,
-           "Usage: %s [ -fnqSsv ] cmd [[ -<qualifers> ] args ]\n",
-           getprogname());
+           "Usage: %s [-%s] cmd [[-<qualifers>] args]\n", getprogname(), opts);
        exit(1);
        /* NOTREACHED */
 }
@@ -160,7 +160,7 @@
        if (argc < 2)
                usage(NULL);
 
-       while ((ch = getopt(argc, argv, "dfnqSstv")) != -1)
+       while ((ch = getopt(argc, argv, opts)) != -1)
                switch (ch) {
                case 'd':
                        debugonly = 1;
@@ -180,11 +180,14 @@
                case 's':
                        shortoutput = 1;
                        break;
+               case 'T':
+                       Tflag = RT_TFLAG;
+                       break;
                case 't':
                        tflag = 1;
                        break;
                case 'v':
-                       verbose = 1;
+                       verbose = RT_VFLAG;
                        break;
                case '?':
                default:
@@ -225,7 +228,7 @@
                return newroute(argc, argv);
 
        case K_SHOW:
-               show(argc, argv, nflag);
+               show(argc, argv, nflag|Tflag|verbose);
                return 0;
 
 #ifndef SMALL



Home | Main Index | Thread Index | Old Index