Commit Graph

35 Commits

Author SHA1 Message Date
christos 9b005038ce add missing initializer 2006-10-16 02:55:10 +00:00
pooka 4df78a97d5 print the L flag for routes with llinfo. makes you not wonder why
non-llinfo routes are being printed for route show -llinfo
2006-09-23 23:01:01 +00:00
dyoung 6333e1495e Let us qualify 'route flush' and 'route show' commands with -llinfo
and -host flags, which is useful for displaying/flushing ARP entries:

# route -n show -inet -llinfo -host
Routing table

Internet:
Destination        Gateway            Flags
169.254.1.119      link#1             UH
169.254.230.110    00:02:6f:21:e6:6e  UH
# route -n flush -inet -llinfo -host
169.254.1.119                             done
169.254.230.110      0.2.6f.21.e6.6e      done
169.254.237.70                            done
# route -n show -inet -llinfo -host
Routing table
#

This will help me address bin/11079, "dhclient may require arp and sed".

Extract common code from flushroutes() and show(), creating
parse_show_opts().

While I'm here, make small cosmetic changes to flushroutes().
2006-09-23 22:41:25 +00:00
dyoung bf71bcc951 Remove dead code. 2006-09-23 21:11:53 +00:00
dogcow f2d329dca0 remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP. 2006-09-07 02:40:31 +00:00
matt e6ff03ce6f Remove XNS and CCITT/X25 bits. 2006-08-26 15:26:02 +00:00
christos 81a178c561 PR/32632: Yves-Emmanuel JUTARD: Improvment suggestion in 'route' display.
Add a new -S flag that prints a space for missing flags.
2006-01-25 16:29:10 +00:00
ginsbach 031f929a6c Add full IPv6 syntax support when route is built with -DSMALL and -DINET6.
Fixes PR/23937.  Adapted from supplied patch.
2005-08-31 02:58:30 +00:00
ginsbach ba49deed2a Clean up some minor nits:
+ style (KNF).
  . don't cast NULL
  . white space clean up
+ use consistent format for error messages.
+ plug memory leaks and avoid malloc(0).
+ verbose message should display even when routing table is empty
  (flushroutes).
2005-08-30 19:01:25 +00:00
ginsbach 08af90d648 Accept protocol flags, i.e. -inet, -inet6, with the show command.
[From OpenBSD via DragonFly BSD]
2005-08-09 21:25:42 +00:00
ginsbach 3997584e62 More style nits (KNF); casts and sizeof's are not followed by a space. 2005-08-09 19:43:24 +00:00
christos dea4bd707c const poisoning. 2005-06-26 21:28:15 +00:00
ginsbach d96d2a6f15 Adjust field width for route -n show similar to netstat -rn when displaying
INET6 route entries.
2005-05-13 14:58:47 +00:00
xtraeme 69cbd40c14 Kill __P(), use ANSI function declarations. 2005-02-05 14:05:23 +00:00
agc 276d62f603 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22308, verified by myself.
2003-08-07 10:04:22 +00:00
itojun 9cbeabfe77 strlcpy [a few mistakes found] 2003-05-17 23:02:28 +00:00
atatat 2e4d1a174e Print a R on reject routes to indicate that they're not normal routes,
and check netmask (or prefix) length as well as the destination
address when determining if a route is a "default" or not.  This means
that the output from 'route show' will no longer say:

	Internet6:
	Destination       Gateway            Flags
	default           localhost          UG
	default           localhost          UG

but instead

	Internet6:
	Destination       Gateway            Flags
	::/104            localhost          UGR
	::/96             localhost          UGR

which makes much more sense.
2001-10-24 16:05:06 +00:00
bjh21 6ef5a92fbb When dumping the routing table, use getnameinfo() to print link-layer
addresses rather than doing it ourselves and falling back to link_ntoa().
2001-10-06 18:32:45 +00:00
itojun fee00b1a78 mark cloned routes with RTF_CLONED. present it with netstat -r by "c".
let static routes overwrite cloned routes, as cloned routes can come back again
if necessary.  behavior same as freebsd/bsdi, code partially from bsdi42.
(NRL rt->rt_parent was not added)
should fix PR 11916 and maybe some other PRs with ARP behavior.

recompilation of usr.sbin/route6d is suggested.
2001-01-27 04:49:31 +00:00
itojun ad678343e6 support RTF_BLACKHOLE.
XXX route show is total duplicate of netstat -r, we need to either remove
route show, or share the same source code, otherwise maintenance cost
bites (and is biting) us
2001-01-27 04:26:49 +00:00
is 9979da6cbb Format string cleanups by Bill Sommerfeld. 2000-10-10 20:24:49 +00:00
drochner 85cbf55d16 Since our gcc doesn't warn about NULL format strings anymore, we can
fix the incorrect err(1, "%s", "") et al.
Closes PR bin/7592 by cgd.
1999-11-09 15:06:30 +00:00
itojun 0a69640f14 remove false fix for routing socket align issue. 1999-09-03 04:17:19 +00:00
itojun 65b4964f1e fix alignment issue in routing socket data, on 64bit arch (i.e. alpha).
sockaddrs are packed with ROUNDUP() in sys/net/rtsock.c so userland
programs needs to follow that.

PR: 8179
1999-09-03 03:47:39 +00:00
itojun 9e2ce6114e tweak IPv6 case so that "route show" does not truncate numeric IPv6 address.
PR: 7955
1999-07-17 06:51:27 +00:00
itojun d4aa58bc6c avoid using constants, use #define'd values. 1999-07-12 20:46:15 +00:00
itojun d211125175 IPv6-ready route command (-inet6 and -prefixlen are added) 1999-07-02 15:29:02 +00:00
lukem a9db50e608 * implement -f; flush all routes before executing command
* reset af to 0 in flushroutes() and newroute()
* cleanup -DSMALL:
-   `flush' and AF_APPLETALK is supported (the latter had partial support)
-   AF_NS, AF_ISO, and AF_CCITT are not supported at all (rather than being
-   partially unsupported).
1998-10-23 05:36:42 +00:00
mycroft 519d858510 __AUDIT__ cleanup. 1998-07-28 19:22:54 +00:00
kleink 5f9598407c Recognize AF_APPLETALK as "AppleTalk". 1997-12-01 17:03:24 +00:00
christos e65e7d8dd2 Use {warn,err}{,x}(3) instead of printf's 1997-11-16 17:03:11 +00:00
lukem c9d9a2a11e * cleanup for WARNS=1
* use .Nm correctly
* deprecate register
* getopt returns -1 not EOF
1997-09-15 09:15:26 +00:00
mrg 1dcbfad4c0 be safe with buffers. 1997-04-21 11:42:11 +00:00
christos d9349e61e1 - Add netatalk bits
- Add prototypes
- Fix printf formats
1997-04-03 02:35:46 +00:00
gwr a54521537f As discussed some time ago, add a "show" sub-command.
Also allow compilation with -DSMALL to ommit support for
non-essential protocols (i.e. when built into a ramdisk).
Use a less hack-ish way to generate keywords.[ch] and just
check in the result (helps ../../distrib/utils/x_route).
1996-11-15 18:01:36 +00:00