diff options
author | charnier <charnier@FreeBSD.org> | 1998-07-28 06:25:35 +0000 |
---|---|---|
committer | charnier <charnier@FreeBSD.org> | 1998-07-28 06:25:35 +0000 |
commit | 6999d30e2ecf654e56794fbef703e59c1826883a (patch) | |
tree | af39bc77113f7018e1cc7575e152e190fbfdaa46 /sbin/route | |
parent | fbfb398b38056006ff0b633f6a6b17824fae8a7f (diff) | |
download | FreeBSD-src-6999d30e2ecf654e56794fbef703e59c1826883a.zip FreeBSD-src-6999d30e2ecf654e56794fbef703e59c1826883a.tar.gz |
Comment is .\" not .|'. Add -d and -t flags to SYNOPSIS and usage(). Getopt
returns -1. Correct use of .Nm. Spelling. Add rcsid and remove unused
#include.
Diffstat (limited to 'sbin/route')
-rw-r--r-- | sbin/route/route.8 | 27 | ||||
-rw-r--r-- | sbin/route/route.c | 25 |
2 files changed, 24 insertions, 28 deletions
diff --git a/sbin/route/route.8 b/sbin/route/route.8 index aea6425..03b9a97 100644 --- a/sbin/route/route.8 +++ b/sbin/route/route.8 @@ -30,17 +30,17 @@ .\" SUCH DAMAGE. .\" .\" @(#)route.8 8.3 (Berkeley) 3/19/94 -.|' $Id: route.8,v 1.10 1997/02/22 14:33:09 peter Exp $ +.\" $Id: route.8,v 1.11 1997/06/18 06:30:34 charnier Exp $ .\" .Dd March 19, 1994 .Dt ROUTE 8 .Os BSD 4.4 .Sh NAME .Nm route -.Nd manually manipulate the routing tables. +.Nd manually manipulate the routing tables .Sh SYNOPSIS .Nm route -.Op Fl nqv +.Op Fl dnqtv .Ar command .Oo .Op Ar modifiers @@ -55,20 +55,21 @@ system routing table management daemon such as should tend to this task. .Pp The -.Nm route : +.Nm utility supports a limited number of general options, but a rich command language, enabling the user to specify any arbitrary request that could be delivered via the programmatic interface discussed in .Xr route 4 . .Pp -.Bl -tag -width Ds +The following options are available: +.Bl -tag -width indent .It Fl n -Bypasses attempts to print host and network names symbolically +Bypass attempts to print host and network names symbolically when reporting actions. (The process of translating between symbolic names and numerical equivalents can be quite time consuming, and may require correct operation of the network; thus it may be expedient -to forgo this, especially when attempting to repair networking operations), +to forgot this, especially when attempting to repair networking operations). .It Fl v (verbose) Print additional details. .It Fl q @@ -76,7 +77,7 @@ Suppress all output. .El .Pp The -.Nm route : +.Nm utility provides six commands: .Pp .Bl -tag -width Fl -compact @@ -95,14 +96,14 @@ Continuously report any changes to the routing information base, routing lookup misses, or suspected network partitionings. .El .Pp -The monitor command has the syntax +The monitor command has the syntax: .Pp .Bd -filled -offset indent -compact .Nm route Op Fl n .Cm monitor .Ed .Pp -The flush command has the syntax +The flush command has the syntax: .Pp .Bd -filled -offset indent -compact .Nm route Op Fl n @@ -113,7 +114,7 @@ The flush command has the syntax If the .Cm flush command is specified, -.Nm route +.Nm will ``flush'' the routing tables of all gateway entries. When the address family may is specified by any of the .Fl osi , @@ -140,7 +141,7 @@ is the destination host or network, is the next-hop intermediary via which packets should be routed. Routes to a particular host may be distinguished from those to a network by interpreting the Internet address specified as the -.Ar destination argument. +.Ar destination argument . The optional modifiers .Fl net and @@ -329,5 +330,5 @@ command appeared in .Bx 4.2 . .Sh BUGS The first paragraph may have slightly exaggerated -.Xr routed Ns 's +.Xr routed 8 Ns 's abilities. diff --git a/sbin/route/route.c b/sbin/route/route.c index e08ba3a..02c6b77 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1,5 +1,4 @@ /* - * * Copyright (c) 1983, 1989, 1991, 1993 * The Regents of the University of California. All rights reserved. * @@ -39,11 +38,11 @@ static const char copyright[] = #endif /* not lint */ #ifndef lint -/* +#if 0 static char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94"; -*/ +#endif static const char rcsid[] = - "$Id: route.c,v 1.27 1997/12/24 00:59:49 imp Exp $"; + "$Id$"; #endif /* not lint */ #include <sys/param.h> @@ -51,7 +50,6 @@ static const char rcsid[] = #include <sys/socket.h> #include <sys/ioctl.h> #include <sys/sysctl.h> -#include <sys/time.h> #include <net/if.h> #include <net/route.h> @@ -67,12 +65,10 @@ static const char rcsid[] = #include <ctype.h> #include <err.h> #include <errno.h> -#include <paths.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sysexits.h> -#include <time.h> #include <unistd.h> struct keytab { @@ -120,7 +116,7 @@ usage(cp) if (cp) warnx("bad keyword: %s", cp); (void) fprintf(stderr, - "usage: route [ -nqv ] command [[ modifiers ] args ]\n"); + "usage: route [-dnqtv] command [[modifiers] args]\n"); exit(EX_USAGE); /* NOTREACHED */ } @@ -134,13 +130,12 @@ main(argc, argv) int argc; char **argv; { - extern int optind; int ch; if (argc < 2) usage((char *)NULL); - while ((ch = getopt(argc, argv, "nqdtv")) != EOF) + while ((ch = getopt(argc, argv, "nqdtv")) != -1) switch(ch) { case 'n': nflag = 1; @@ -249,7 +244,7 @@ bad: usage(*argv); if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) err(EX_OSERR, "route-sysctl-estimate"); if ((buf = malloc(needed)) == NULL) - err(EX_OSERR, "malloc"); + errx(EX_OSERR, "malloc failed"); if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) err(EX_OSERR, "route-sysctl-get"); lim = buf + needed; @@ -823,7 +818,7 @@ getaddr(which, s, hpp) su = &so_ifa; break; default: - usage("Internal Error"); + usage("internal error"); /*NOTREACHED*/ } su->sa.sa_len = aflen; @@ -995,7 +990,7 @@ interfaces() if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) err(EX_OSERR, "route-sysctl-estimate"); if ((buf = malloc(needed)) == NULL) - err(EX_OSERR, "malloc"); + errx(EX_OSERR, "malloc failed"); if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) err(EX_OSERR, "actual retrieval of interface table"); lim = buf + needed; @@ -1081,7 +1076,7 @@ rtmsg(cmd, flags) if (debugonly) return (0); if ((rlen = write(s, (char *)&m_rtmsg, l)) < 0) { - perror("writing to routing socket"); + warn("writing to routing socket"); return (-1); } if (cmd == RTM_GET) { @@ -1230,7 +1225,7 @@ print_getmsg(rtm, msglen) return; } if (rtm->rtm_msglen > msglen) { - warnx("message length mismatch, in packet %d, returned %d\n", + warnx("message length mismatch, in packet %d, returned %d", rtm->rtm_msglen, msglen); } if (rtm->rtm_errno) { |