Commit Graph

50 Commits

Author SHA1 Message Date
Mark Murray
e65dd7bc2f fix warnings; change variable/argument names that mask global names. 2002-04-28 12:15:40 +00:00
Matthew N. Dodd
6f9cdfce19 Print statistics for AF_IPX.
Note that the IPX code doesn't update these correctly yet, but should.
2001-10-19 00:40:51 +00:00
Ruslan Ermilov
acb60e59c1 The previous change also disaligned lines with AF_IPX and AF_NS
addresses.  Unshrink "Network" width to the previous value, and
make sure everything is aligned again.
2001-10-09 08:33:50 +00:00
Matthew N. Dodd
dd1f8b9bf4 Minor output formatting for 'netstat -i':
- Right align Mtu
- Print AF_INET family with correct field width.
2001-10-09 05:58:26 +00:00
Ruslan Ermilov
d44ddba96c Implement the ``-f address_family'' filter for -i.
Prodded by:	Igor Podlesny <poige@morning.ru>
2001-09-11 17:14:33 +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
cf5e44f88e First round of netstat(1) cleanup.
Removed the ambiguity in -s, -f, -p and -i flags handling.
Basically, there are four displays (except others):

1.  PCB display.
2.  Protocol statistics display. (-s)
3.  Interface statistics display. (-i)
4.  Per-interface protocol statistics display. (-i -s)

All of the above except 3) can be limited to a particular
protocol family (-f) or a single protocol (-p).

Some examples:

1.  netstat -f inet    -- show PCBs of all INET protocols
2.  netstat -p udp     -- show PCB of UDP protocol only (NEW!)
3.  netstat -s         -- show protocol statistics for all families
4.  netstat -s -f inet -- show INET protocols statistics
5.  netstat -s -p icmp -- show ICMP protocol statistics

This is a work in progress.  Manpage has been fixed slightly,
but is still incomplete.
2001-06-15 18:25:38 +00:00
Assar Westerlund
af7a0a2d2b remove most of the warnings 2001-06-15 01:53:05 +00:00
Bill Fenner
b9d92bf53e Add missing break when printing IPv6 multicast addresses.
Use the sockaddr_dl sdl_type, not ifnet.if_type, to decide what type
 a multicast sockaddr_dl is.
2001-04-26 06:02:03 +00:00
Poul-Henning Kamp
0b23654bb3 Don't core dump when given "-i -a". Problem caused by a mistaken
dereference of a kernel-pointer in userland.

PR:		26168
Submitted by:	Peter Pentchev <roam@orbitel.bg>
2001-03-30 19:16:04 +00:00
Josef Karthauser
445f17bbee When displaying interface statistics with -i show a '-' for any
values that aren't updated for a particular network-layer address.
2001-03-04 22:25:05 +00:00
Poul-Henning Kamp
6817526d14 Convert if_multiaddrs from LIST to TAILQ so that it can be traversed
backwards in the three drivers which want to do that.

Reviewed by:    mikeh
2001-02-06 10:12:15 +00:00
Poul-Henning Kamp
4d51ef6343 Use macro API to <sys/queue.h>
Submitted by:	"Jason" <jsmethers@pdq.net>
Reviewed by:	phk
2000-12-30 21:22:54 +00:00
Guido van Rooij
591c194a92 Now that the amount of (pseudo) interfaces is growing with IPv6,
get rid of stupid upperbound on the amount of interfaces (was 8).
2000-10-30 11:53:19 +00:00
Josef Karthauser
5da9f8fa97 Augment the 'ifaddr' structure with a 'struct if_data' to keep
statistics on a per network address basis.

Teach the IPv4 and IPv6 input/output routines to log packets/bytes
against the network address connected to the flow.

Teach netstat to display the per-address stats for IP protocols
when 'netstat -i' is evoked, instead of displaying the per-interface
stats.
2000-10-19 23:15:54 +00:00
John Polstra
3cfac2c58d Fix bug: "netstat -si" prints interface information, but the header
line is missing.  This apparently was broken in revision 1.31 of
"if.c".

Submitted by:	Maxime Henrion <mhenrion@cybercable.fr>
2000-07-28 04:05:04 +00:00
Jordan K. Hubbard
e54ca68cb8 Print mac addresses in standard byte:byte format rather than
byte.byte.  This makes it consistent with our other utilities
like arp(8) and ifconfig(8).

Submitted by:	Paul Vixie <paul@vix.com>
2000-01-03 17:48:36 +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
Doug Rabson
890bc2a54a Fix the output of 'netstat -I de0 1' for the alpha. Fix a bunch of
warnings while I'm here.
1999-11-09 22:22:36 +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
a97a99221a Cleanup towards -Wall 1999-10-21 07:08:56 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Luigi Rizzo
0024d1db07 Add support for printing bridging statistics with ``-p bdg '' .
If someone has a better flag to use I'll be glad to change it.
1999-04-26 16:11:50 +00:00
Bill Fumerola
9baac9f2e9 IPX address formatting nit.
PR:		bin/11179
Submitted by:	Dan Nelson <dnelson@emsphone.com>
1999-04-20 22:04:31 +00:00
Bruce Evans
22694ebad5 Fixed printf format errors. 1998-07-06 21:01:54 +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
75fb877061 Print out the interface's multicast addresses using the new
structures.
1997-01-13 21:27:46 +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
15244cd5c2 Learn to follow the new interface address lists. 1996-12-13 21:29:59 +00:00
Garrett Wollman
0e27dc0563 Understand queue-ized ifnet structures. 1996-12-11 20:39:43 +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
Bill Fenner
f6719675d2 Display multicast addresses if the "a" flag is used in combination
with "-i".  This was already in the man page but was not implemented.

Obtained from:	Multicast release 3.5
1996-12-02 06:38:30 +00:00
Julian Elischer
a8d3784533 fix printing of netranges in the i and r displays for netatalk 1996-08-31 07:43:01 +00:00
Julian Elischer
3a67d2bc37 Submitted by: archie@whistle.com
appletalk cleanups
1996-07-23 01:18:47 +00:00
Julian Elischer
6ffcfd6c9e appletalk cleanups
e.g.
Active ATALK connections
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
ddp        0      0  [69.230]130            [*.*]*
ddp        0      0  [69.230]128            [*.*]*
ddp        0      0  [69.230]1              [*.*]*

etc..
1996-07-09 02:55:47 +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
David Greenman
0b87c9157d Make the -w option actually useful to people. Instead of it creating a
messy 130 column collage, output the system totals -or- info for a
specific interface if -I is given. Also wait for <interval> before
outputting the first sample so that it represents meaningful data (as
opposed to the total since the system was booted - most busy systems
wrap around many times during their operation, so these numbers are
only misleading).
1996-02-29 07:44:37 +00:00
Garrett Wollman
cbc17e711e XNS sort-of-support is no more. 1996-02-13 17:30:37 +00:00
Garrett Wollman
0761cb293e Remove support for OSI networking in user-land (#ifdef OSI aor CCITT)
in preparation for its removal from the kernel source tree.  NB: because
a function was deleted, libc is now at version 3.0 (was 2.2 previously).
1996-02-06 20:36:15 +00:00
Peter Wemm
05ddff6e30 Merge in Lite-2 changes. 1996-01-14 23:33:13 +00:00
Stefan Eßer
09a67ffa0e Increase width of Network column from 11 to 13 for the AF_INET case.
This seems to have been missed, when the recent IPX changes went in ...
1995-11-22 22:21:04 +00:00
Julian Elischer
cc6a66f20e Reviewed by: julian and jhay@mikom.csir.co.za
Submitted by:	Mike Mitchell, supervisor@alb.asctmd.com

This is a bulk mport of Mike's IPX/SPX protocol stacks and all the
related gunf that goes with it..
it is not guaranteed to work 100% correctly at this time
but as we had several people trying to work on it
I figured it would be better to get it checked in so
they could all get teh same thing to work on..

Mikes been using it for a year or so
but on 2.0

more changes and stuff will be merged in from other developers now that this is in.

Mike Mitchell, Network Engineer
AMTECH Systems Corporation, Technology and Manufacturing
8600 Jefferson Street, Albuquerque, New Mexico 87113 (505) 856-8000
supervisor@alb.asctmd.com
1995-10-26 20:31:59 +00:00
David Greenman
1b72e71cc2 Fixed netstat to not bogusly mangle the argv[] command args by rewriting
the way it stores and handles "interface". The previous behavior resulted
in strange output from 'w' and 'ps' when an interface specification was
given to netstat.
1995-09-23 15:04:28 +00:00
David Greenman
3aa80b1d81 Output statistics as unsigned in the -w section.
Look at error return of kread() and stop on error.
Fix warning in kread() to not output "kvm_read:" twice.
Killed PCB cache misses stat as we no longer have it.
1995-07-29 22:34:15 +00:00
David Greenman
e1e293a5dc Added '-b' option to display the number of in and out bytes on a given
interface (used with -i and -I flag).
1994-10-12 02:37:35 +00:00
David Greenman
541f256275 Changed output formatting to 0 pad hex bytes if necessary. This makes
the output consistent with traditional representations of ethernet
addresses. I still don't like the spacing in netstat -i, however.
1994-08-05 12:38:06 +00:00
Rodney W. Grimes
9b50d90275 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00