History log of /freebsd-9.3-release/usr.bin/systat/netstat.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 231279 09-Feb-2012 ed

MFC r226396:

Fix whitespace inconsistencies in systat(1).

According to md5(1), the resulting binary is the same.


# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 223493 24-Jun-2011 kevlo

Remove duplicated header files


# 216370 11-Dec-2010 joel

Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with: imp, rwatson


# 200462 13-Dec-2009 delphij

Revert most part of 200420 as requested, as more review and polish is
needed.


# 200420 11-Dec-2009 delphij

Remove unneeded header includes from usr.bin/ except contributed code.

Tested with: make universe


# 189848 15-Mar-2009 rwatson

Correct a number of evolved problems with inp_vflag and inp_flags:
certain flags that should have been in inp_flags ended up in inp_vflag,
meaning that they were inconsistently locked, and in one case,
interpreted. Move the following flags from inp_vflag to gaps in the
inp_flags space (and clean up the inp_flags constants to make gaps
more obvious to future takers):

INP_TIMEWAIT
INP_SOCKREF
INP_ONESBCAST
INP_DROPPED

Some aspects of this change have no effect on kernel ABI at all, as these
are UDP/TCP/IP-internal uses; however, netstat and sockstat detect
INP_TIMEWAIT when listing TCP sockets, so any MFC will need to take this
into account.

MFC after: 1 week (or after dependencies are MFC'd)
Reviewed by: bz


# 175387 16-Jan-2008 delphij

ANSIfy and remove register.

Resulting binary verified with strip(1)+md5(1).


# 164680 27-Nov-2006 yar

The logic of fetchnetstat_sysctl() isn't too complex: if idx is 0,
we set and use xtp; if idx is 1, we set and use xip; the other cases
are impossible. However, GCC cannot see that xip and xtp are always
initialized before use because they are initialized and used in
different if/else blocks. So setting them to NULL at the very
beginning won't hurt.


# 164679 27-Nov-2006 yar

+ WARNS=4 reminds that nlist.n_name isn't const.
+ Use C99 initializers to be WARNS-clean.
+ The last element in a namelist should have its n_name set to NULL,
not to an empty string.


# 164678 27-Nov-2006 yar

Don't discard a const qualifier from constant strings.


# 158161 30-Apr-2006 bde

Remove trailing whitespace.

Submitted by: Se=E1n Farley <sean-freebsd at farley dot org>
PR: bin/81874


# 158160 30-Apr-2006 bde

Show the load average in the tcp display (it was already shown, perhaps
not very usefully, in all other displays). This was the original point
of the PR.

Move the load average up by 2 so that it starts in row 0 for all windows
(2 lines above it were wasted for all other windows except vmstat).
Move everything below it up by 2 or 3 (3 for icmp and icmp6 which had
an extra blank line due from not compensating for the foot-shooting in
note (3); only ip and ip6 compensated). Reduce the magic numbers related
to this.

Notes by the submitter:
%%%
1. All the subwin() calls are identical using #define MAINWIN_ROW 3
(systat.h).
2. The load average is at the top of the window.
3. Each display starts on the fourth line. I made changes to those
displays that shifted the start line (i.e., icmp). This entailed a
lot of changes within the comments at the top of those displays.
4. For ip6, I shifted the "Input next-header histogram" column down one
row to separate it from "IPv6 Output". I raised "bad scope packets"
and "address selection failed" up one row to stay with "IPv6 Input"
(valid?). They were down one row to probably line up at the bottom,
but I think they should stick with their fellow items in a column.
5. I condensed ifstat a bit. It had a lot of empty rows.
%%%

Submitted by: Se=E1n Farley <sean-freebsd at farley dot org>
PR: bin/81874


# 142095 19-Feb-2005 ume

simply ignore unknown address family.

MFC after: 1 week


# 142093 19-Feb-2005 ume

teach IPv6 to `systat -netstat'.

Tested by: kuriyama
MFC after: 1 week


# 123800 24-Dec-2003 silby

Make systat -net aware of compressed time_wait sockets.


# 118318 01-Aug-2003 dwmalone

Add ip6 and icmp6 displays to systat.

MFC after: 2 weeks


# 100591 24-Jul-2002 jdp

Widen struct sockbuf's sb_timeo member to int from short. With
non-default but reasonable values of hz this member overflowed,
breaking NFS over UDP.

Also, as long as I'm plowing up struct sockbuf ... Change certain
members from u_long/long to u_int/int in order to reduce wasted
space on 64-bit machines. This change was requested by Andrew
Gallatin.

Netstat and systat need to be rebuilt. I am incrementing
__FreeBSD_version in case any ports need to change.


# 92922 21-Mar-2002 imp

remove __P


# 87715 11-Dec-2001 markm

WARNS=2 fixes with NO_WERROR set, as there are some header issues
with namelists. use __FBSDID().


# 74671 23-Mar-2001 tmm

Get rid of setgid kmem for systat, and while being there, fix some bugs
and compiler warnings.
The data for network statistics are still obtained via the kvm interface
if systat was started with the needed privileges, otherwise sysctls are
used. The reason for this is that with really many open sockets, the
sysctl method is probably slower, but it systat -netstat is probably not
really usable in either mode under these conditions.

Approved by: rwatson


# 70526 30-Dec-2000 phk

My bad, committed the submitted patch rather than the fixed patch.


# 70523 30-Dec-2000 phk

Use macro API to <sys/queue.h>

Submitted by: "Jason" <jsmethers@pdq.net>
Reviewed by: phk


# 50635 30-Aug-1999 peter

systat is way too comfortable with curses internals...


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 40060 08-Oct-1998 obrien

Quiet many compiler warnings.


# 36916 12-Jun-1998 peter

#include <arpa/inet.h>


# 36789 09-Jun-1998 imp

o Use snprintf rather than sprintf
o Add more checks for buffer overflows
o Use snprintf rather than strcat/cpy and have better checks for max
length exceeded.

Most of these changes are not exploitable buffer overruns, but it never
hurts to be safe.

Inspired by and obtained from: OpenBSD


# 23012 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 21673 14-Jan-1997 jkh

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.


# 19330 02-Nov-1996 phk

bin/1942 curses problem in systat
truncate if too long for field.
2.2 candidate.


# 19234 28-Oct-1996 wollman

Eliminate unnecessary include of <sys/mbuf.h>.


# 14543 11-Mar-1996 dg

Move #include of queue.h before #include of socketvar.h in preparation for
struct socket changes.


# 8874 30-May-1995 rgrimes

Remove trailing whitespace.


# 7715 09-Apr-1995 dg

Updated for 4.4BSD queue macros. (Oops, I forgot to commit this last night;
sorry Jordan).


# 1591 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1590,
which included commits to RCS files with non-trunk default branches.


# 1590 27-May-1994 rgrimes

BSD 4.4 Lite Usr.bin Sources