Commit Graph

60 Commits

Author SHA1 Message Date
Ruslan Ermilov
1093cc3199 Make `rttrash' variable (#routes not in table but not freed) visible
through ``netstat -rs''.
2001-06-29 09:08:24 +00:00
Ruslan Ermilov
8f309b9151 Fixed bogon in revision 1.37. Don't bogusly print a radix node's
duped key marker (``=>'') for routes with non-positive rmx_expire
metric, such as ethernet interface routes.

MFC after:	1 week
2001-06-29 08:37:12 +00:00
Ruslan Ermilov
aafccd6d93 Honor -s -s (don't show zero stats) with -r, untangle SYNOPSIS further.
(usage() still is not synchronized with SYNOPSIS, intentionally.)
2001-06-23 09:18:57 +00:00
Assar Westerlund
f964d60dd3 remove warnings
remove superfluous declarations
make things more consistent
2001-06-15 23:55:45 +00:00
Assar Westerlund
5e0517186d remove K&R support 2001-06-15 23:35:13 +00:00
Assar Westerlund
e9370a2e59 revert removal of warning and K&R support
Requested by: bde
2001-06-15 23:07:59 +00:00
Ruslan Ermilov
eba04a8da9 Line up `netstat -rl' display. 2001-06-15 18:15:11 +00:00
Assar Westerlund
af7a0a2d2b remove most of the warnings 2001-06-15 01:53:05 +00:00
Assar Westerlund
65ea0024ba add the option -S for printing port numbers symbolically but addresses
numerically.  clean up the CFLAGS in Makefile.
2001-06-15 00:25:44 +00:00
Hajimu UMEMOTO
7165726d0d Add missing column for Mtu in header when -rl is specified. 2001-06-11 17:32:53 +00:00
Hajimu UMEMOTO
3384154590 Sync with recent KAME.
This work was based on kame-20010528-freebsd43-snap.tgz and some
critical problem after the snap was out were fixed.
There are many many changes since last KAME merge.

TODO:
  - The definitions of SADB_* in sys/net/pfkeyv2.h are still different
    from RFC2407/IANA assignment because of binary compatibility
    issue.  It should be fixed under 5-CURRENT.
  - ip6po_m member of struct ip6_pktopts is no longer used.  But, it
    is still there because of binary compatibility issue.  It should
    be removed under 5-CURRENT.

Reviewed by:	itojun
Obtained from:	KAME
MFC after:	3 weeks
2001-06-11 12:39:29 +00:00
Ruslan Ermilov
54f6369da3 Always print at least 2 bytes for IN_CLASSB_NET networks.
Always print at least 3 bytes for IN_CLASSC_NET networks.

The standard 193.0.0 class C network for example, will now
be displayed as "193.0.0" as opposed to the confusing 193.

PR:		bin/21546
MFC after:	1 week
2001-06-08 15:44:17 +00:00
Ruslan Ermilov
b940897514 Restore printing of routes cloned from a RTF_CLONING parent
(e.g., ARP table entries) with the default routing display.

PR:		bin/26970
Reviewed by:	wollman
MFC after:	3 days
2001-05-07 12:29:36 +00:00
Ruslan Ermilov
089cdfad78 net/route.c:
A route generated from an RTF_CLONING route had the RTF_WASCLONED flag
  set but did not have a reference to the parent route, as documented in
  the rtentry(9) manpage.  This prevented such routes from being deleted
  when their parent route is deleted.

  Now, for example, if you delete an IP address from a network interface,
  all ARP entries that were cloned from this interface route are flushed.

  This also has an impact on netstat(1) output.  Previously, dynamically
  created ARP cache entries (RTF_STATIC flag is unset) were displayed as
  part of the routing table display (-r).  Now, they are only printed if
  the -a option is given.

netinet/in.c, netinet/in_rmx.c:

  When address is removed from an interface, also delete all routes that
  point to this interface and address.  Previously, for example, if you
  changed the address on an interface, outgoing IP datagrams might still
  use the old address.  The only solution was to delete and re-add some
  routes.  (The problem is easily observed with the route(8) command.)

  Note, that if the socket was already bound to the local address before
  this address is removed, new datagrams generated from this socket will
  still be sent from the old address.

PR:		kern/20785, kern/21914
Reviewed by:	wollman (the idea)
2001-03-15 14:52:12 +00:00
Brian Somers
d121b55666 MAXHOSTNAMELEN includes space for a NUL.
Don't roll our own version of trimdomain(), use the one in libutil.

Not objected to by: freebsd-audit
2001-03-14 20:51:26 +00:00
Ruslan Ermilov
3f320c4e60 Fixed the printing of header for IPv4 routing table without -l option.
Broken in rev 1.44.
2000-09-18 11:14:40 +00:00
Jun-ichiro itojun Hagino
32cd1d9601 sync with latest kame netstat. basically, more statistics 2000-07-04 16:26:46 +00:00
Mark Murray
097c3a616c Use Garrett's new (clearer) names. 2000-04-23 14:18:18 +00:00
Yoshinobu Inoue
b1d49ce7b6 Don't suppress Flags and Refs info for IPv4 entries.
(They need to be suppressed by default for IPv6 entries to keep the column
size of each entries in 80.)
2000-03-14 17:18:43 +00:00
Rodney W. Grimes
f22f5e6ba8 Instead of reporting all 0.0.0.0 as ``default'' only report
a true default of 0.0.0.0/0 as default.

Reviewed by:	wollman
2000-01-07 19:56:57 +00:00
Yoshinobu Inoue
7d56d3747c Getaddrinfo(), getnameinfo(), and etc support in libc/net.
Several udp and raw apps IPv6 support.

Reviewed by: freebsd-arch, cvs-committers
Obtained from: KAME project
1999-12-28 02:37:14 +00:00
Yoshinobu Inoue
49302f437a Added missing declaration for argment specification at pr_rthdr(),
caused by my previous patch, sorry.
Also, changed its var name from 'af' to 'wid_af', to avoid confusion with
global var 'af'.
1999-12-21 11:25:30 +00:00
Yoshinobu Inoue
c64893b10c define WID_DST6 and WID_GW6 and use them only for IPv6, to keep IPv4 related
information in 80 columns.

TODO: IPv6 related information is not likely to be kept in 80 columns, anyway.
      Some more print modes could be added,
      but what is the priority between those modes?
	-print out all information even if they don't fit into 80 columns
	-strip off some information to fit them into 80 columns

Reviewed by: markm
1999-12-21 09:31:14 +00:00
Yoshinobu Inoue
cfa1ca9dfa udp IPv6 support, IPv6/IPv4 tunneling support in kernel,
packet divert at kernel for IPv6/IPv4 translater daemon

This includes queue related patch submitted by jburkhol@home.com.

Submitted by: queue related patch from jburkhol@home.com
Reviewed by: freebsd-arch, cvs-committers
Obtained from: KAME project
1999-12-07 17:39:16 +00:00
Matthew Dillon
f41f949d09 Cleanup missing includes, stale includes, and a few printf format
inconsistancies.
1999-10-23 17:45:11 +00:00
Julian Elischer
4cf49a4355 Whistle's Netgraph link-layer (sometimes more) networking infrastructure.
Been in production for 3 years now. Gives Instant Frame relay to if_sr
and if_ar drivers, and PPPOE support soon. See:
ftp://ftp.whistle.com/pub/archie/netgraph/index.html
for on-line manual pages.

Reviewed by: Doug Rabson (dfr@freebsd.org)
Obtained from:  Whistle CVS tree
1999-10-21 09:06:11 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
John Birrell
acfd6b3968 Change casts from int to u_long and formats from %x to %lx.
Didn't fix the alignment of the output fields on alpha where addresses
require 16 characters to print.

Added a dummy field to the pt_u union to help the alpha compiler align
the u_sa field in a suiable way.
1998-08-18 13:41:38 +00:00
Bruce Evans
b45d09e830 Fixed type mismatches and style bugs in rev.1.30. 1998-07-06 20:52:08 +00:00
Warner Losh
9a1f6729af o Use snprintf over sprintf.
o Use strncpy correctly.
o Use enough buffer for line.

Inspired by or Obtained from: Similar changes in OpenBSD
1998-06-09 04:13:03 +00:00
Poul-Henning Kamp
384606eb2c netstat truncates info in sockaddr* between kgetsa and p_sockaddr
by dereferencing pointer to smaller structure

PR:		5256
Reviewed by:	phk
Submitted by:	Gregory D. Moncreaff <moncrg@bt340707.res.ray.com>
1998-04-22 06:54:31 +00:00
Poul-Henning Kamp
c5d1ef4169 The current version of netstat does not print the interface
name for AF_LINK routing entries. This makes debugging
network problems more difficult.
PR:		4182
Reviewed by:	phk
Submitted by:	Craig Leres <leres@ee.lbl.gov>
1998-04-19 18:18:25 +00:00
Philippe Charnier
5d422d6aa7 Remove prog, unused variables.
Cosmetic in usage string.
1997-07-29 06:51:41 +00:00
Poul-Henning Kamp
ef1f3a4fd4 Remove some quite bogus code that tried to find subnet names but instead
spammed named with bogus queries.
1997-05-25 08:36:20 +00:00
John Hay
64a0cc86b5 Add the new ipx statistics variables.
Remove the dns lookup code in the ipx functions. That is bogus and slows
things like netstat -r(f ipx) down, without gaining anything.

Remove the ipx error protocol statistics.
1997-05-10 10:03:43 +00:00
Peter Wemm
c115df18cd Revert $FreeBSD$ to $Id$ 1997-02-22 19:58:13 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Garrett Wollman
8766942543 Update to match changes in <net/if.h> and <netinet/ip_mroute.h>. 1997-01-03 20:16:31 +00:00
Garrett Wollman
628d2ac1b0 Fix up programs which expect <net/if.h> to include <sys/time.h> to instead
do it themselves.  (Some of these programs actually depended on this
beyond compiling the definition of struct ifinfo!)  Also fix up some
other #include messes while we're at it.
1996-12-10 17:11:53 +00:00
Garrett Wollman
9086499893 Eliminate unnecessary include of <sys/mbuf.h>. PCBs aren't stored in mbufs
any more.
1996-10-28 18:56:44 +00:00
Garrett Wollman
924a8fa376 Remove reference to oobsolete RTF_MASK flag (soon to be removed). 1996-10-09 18:19:07 +00:00
Julian Elischer
d4b2a43950 make appletalk networks not show an un-needed host
part in displaying the routes.
1996-09-05 23:34:09 +00:00
Julian Elischer
e56dd1bb4f Submitted by: archie@whistle.com
slight cleanups on yesterday's patches
1996-07-23 22:00:14 +00:00
Julian Elischer
3a67d2bc37 Submitted by: archie@whistle.com
appletalk cleanups
1996-07-23 01:18:47 +00:00
Peter Wemm
1336da0dea make netstat distinguish broadcast and blackhole routes where they appear.
(RTF_BLACKHOLE was already documented as being shown, but the code ignored
it)

Sumbitted by: Greg Lehey <grog@lemis.de>
1996-06-15 17:08:40 +00:00
Julian Elischer
cae2a25e65 better appletalk support. 1996-06-10 21:03:38 +00:00
Julian Elischer
63bf4575db patches to allow netstat to monitor appletalk sockets openned using the
/sys/netatalk protocol stack

more cleanups and fixes are likely
1996-06-08 00:20:42 +00:00
Alexander Langer
7d56c0ee6b Code cleanup: remove unused variables, use correct *printf format
specifiers (some unsigned values were printed as signed, some longs
were printed as ints), and place parentheses around assignments in
if statements.
1996-06-02 23:19:12 +00:00
Garrett Wollman
37b197b9ec For some reason, the changes to make route.c compile didn't make it over.
Fixed.

Pointed-out-by: joerg
1996-02-16 15:42:14 +00:00
Peter Wemm
9c437f50ee tidy up the domain name trimming code, and move it to a single place
rather than having the same bit of code duplicated in three places,
each with their own static copy of the host's local name.
1996-01-15 02:18:35 +00:00