History log of /freebsd-9.3-release/usr.bin/netstat/unix.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

# 225736 22-Sep-2011 kensmith

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

Approved by: re (implicit)


# 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


# 197777 05-Oct-2009 rwatson

netstat(1) support for UNIX SOCK_SEQPACKET sockets -- changes were required
only for the kvm case, as we supported SOCK_SEQPACKET via sysctl already.

Sponsored by: Google
MFC after: 3 months


# 186644 31-Dec-2008 maxim

o With -L flag show unix sockets listen queues stats. It is useful
to know number of not accepted connections for monitoring purposes.

PR: bin/128871
Submitted by: Anton Yuzhaninov
MFC after: 1 month


# 175061 02-Jan-2008 obrien

style(9)
+ kread is not a boolean, so check it as such
+ fix $FreeBSD$ Ids
+ denote copyrights with /*-
+ misc whitespace changes.


# 171465 16-Jul-2007 jhb

Restore netstat -M functionality for most statistics on core dumps. In
general, when support was added to netstat for fetching data using sysctl,
no provision was left for fetching equivalent data from a core dump, and
in fact, netstat would _always_ fetch data from the live kernel using
sysctl even when -M was specified resulting in the user believing they
were getting data from coredumps when they actually weren't. Some specific
changes:
- Add a global 'live' variable that is true if netstat is running against
the live kernel and false if -M has been specified.
- Stop abusing the sysctl flag in the protocol tables to hold the protocol
number. Instead, the protocol is now its own field in the tables, and
it is passed as a separate parameter to the PCB and stat routines rather
than overloading the KVM offset parameter.
- Don't run PCB or stats functions who don't have a namelist offset if we
are being run against a crash dump (!live).
- For the inet and unix PCB routines, we generate the same buffer from KVM
that the sysctl usually generates complete with the header and trailer.
- Don't run bpf stats for !live (before it would just silently always run
live).
- kread() no longer trashes memory when opening the buffer if there is an
error on open and the passed in buffer is smaller than _POSIX2_LINE_MAX.
- The multicast routing code doesn't fallback to kvm on live kernels if
the sysctl fails. Keeping this made the code rather hairy, and netstat
is already tied to the kernel ABI anyway (even when using sysctl's since
things like xinpcb contain an inpcb) so any kernels this is run against
that have the multicast routing stuff should have the sysctls.
- Don't try to dig around in the kernel linker in the netgraph PCB routine
for core dumps.

Other notes:
- sctp's PCB routine only works on live kernels, it looked rather
complicated to generate all the same stuff via KVM. Someone can always
add it later if desired though.
- Fix the ipsec removal bug where N_xxx for IPSEC stats weren't renumbered.
- Use sysctlbyname() everywhere rather than hardcoded mib values.

MFC after: 1 week
Approved by: re (rwatson)


# 160787 28-Jul-2006 yar

Achieve WARNS=2 by using uintmax_t to pass around 64-bit quantities,
including to printf(). Using uintmax_t is also robust to further
extensions in both the C language and the bitwidth of kernel counters.

Tested on: i386 amd64 ia64


# 132671 26-Jul-2004 charnier

Add __FBSDID. Replace local variable sin by sockin to not conflict with sin(3).
Use warnx() instead of warn() when error message is not of any interest. Add
prototypes.


# 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.


# 78314 15-Jun-2001 assar

remove K&R support


# 78309 15-Jun-2001 assar

revert removal of warning and K&R support

Requested by: bde


# 78245 14-Jun-2001 assar

remove most of the warnings


# 70524 30-Dec-2000 phk

Use macro API to <sys/queue.h>

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


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 44091 16-Feb-1999 fenner

Fix off-by-one error.


# 38185 08-Aug-1998 phk

Make netstat work again.


# 37453 06-Jul-1998 bde

Fixed printf format errors.


# 36103 16-May-1998 wollman

Fix rev. 1.7: get offsetof from the correct header file.


# 36091 16-May-1998 ache

Fix broken sun_len usage: it is not sun_path length but bigger


# 36080 15-May-1998 wollman

mbuf, inet, and unix modules no longer read kvm.


# 28726 25-Aug-1997 wollman

While I'm in here, fix address printing for `netstat -f unix' which has been
broken for a couple of weeks now...


# 27753 29-Jul-1997 charnier

Remove prog, unused variables.
Cosmetic in usage string.


# 16080 02-Jun-1996 alex

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.


# 14543 11-Mar-1996 dg

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


# 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