Home | History | Annotate | Download | only in netstat
History log of /src/usr.bin/netstat/main.c
RevisionDateAuthorComments
 1.105  18-Aug-2023  martin Rename local bpf_* functions to nsbpf_* to avoid conflicts with
new libpcap bpf_* functions
 1.104  24-Oct-2022  msaitoh Make ifq_drops in struct ifqueue and struct ifaltq 64 bit.
 1.103  02-Sep-2022  msaitoh KNF. No functional change.
 1.102  01-Sep-2022  msaitoh KNF. No functional change.
 1.101  10-Mar-2021  simonb Remove Network ATM soft intr queue reporting, we don't have that in the
kernel anymore.
 1.100  23-Apr-2020  joerg Avoid common symbol definitions.
 1.99  14-Jul-2016  christos branches: 1.99.8; 1.99.18;
remove soft interrupt queues that don't exist anymore.
 1.98  14-Jul-2016  christos remove __P
 1.97  14-Jul-2016  christos use sysctl to print multicast addresses
 1.96  13-Jul-2016  christos Use sysctl for interface printing (-i), leave on for multicast address printing
(-ia) and comment in the code where this is missing?
XXX: should that be an ioctl or sysctl? provide getifmultiaddrs() via the
routing socket? I guess since this is just for netstat a simple sysctl or
ioctl would suffice. I lean towards sysctl.
 1.95  12-Nov-2014  christos PR/47704: Takahiro HAYASHI: Fix -L flag
 1.94  07-Nov-2014  christos fix A,v,T with route display.
 1.93  06-Nov-2014  christos use the common code from route.c
 1.92  09-Oct-2014  enami Fix a bug introduced in rev. 1.62; it fails to negate (a && b).
 1.91  30-May-2014  rmind branches: 1.91.2;
netstat(1) and ifmcstat(8): ifnet was renamed to ifnet_list, PR/48850.
 1.90  28-Apr-2014  christos use the same for the route metrics part, both in the sysctl and kmem paths.
From Takahiro HAYASHI
 1.89  24-Apr-2014  christos The sysctl code does not support verbose route printing that prints the
internal route statistics. Restore the old kmem route printing code that
was not just used for post-mortem displays. Reported by kardel@, test by
netstat -nrvf inet
 1.88  23-Nov-2013  christos branches: 1.88.2;
Update for new pcb tailq's.
While here fix ipv6 pcb printing by making tcp6_dump with tcp.
XXX: Merge the inet and the inet6 code. It is silly to need to specify
-p tcp6 to print a tcp6 pcb, we already know what it is.
 1.87  18-Oct-2013  bad Make the -f option accept multiple address families.
Bump man page date.
 1.86  19-Jun-2013  christos Don't use -P as a kmem printer, verify that the address points to a pcb first!
 1.85  01-Mar-2013  joerg Retire OSI network stack. OK core@
 1.84  28-Jan-2013  joerg Use sysctl based code netstat -r. Remove support for post-mortem
analysis.
 1.83  22-Mar-2012  drochner branches: 1.83.2;
remove KAME IPSEC, replaced by FAST_IPSEC
 1.82  20-Mar-2012  matt Use C89 function definitions
 1.81  16-Sep-2011  joerg branches: 1.81.2; 1.81.4; 1.81.8; 1.81.10;
Use __dead
 1.80  17-Jul-2011  njoly Use errx() to display kvm_openfiles error message, the provided buffer
already has it.
 1.79  04-May-2011  dyoung Always try to open kmem, do not always set use_sysctl to 1, and do not
fail if opening kmem fails unless !use_sysctl. Fixes netstat(1) options
such as -s.
 1.78  03-May-2011  dyoung Reduces the resources demanded by TCP sessions in TIME_WAIT-state using
methods called Vestigial Time-Wait (VTW) and Maximum Segment Lifetime
Truncation (MSLT).

MSLT and VTW were contributed by Coyote Point Systems, Inc.

Even after a TCP session enters the TIME_WAIT state, its corresponding
socket and protocol control blocks (PCBs) stick around until the TCP
Maximum Segment Lifetime (MSL) expires. On a host whose workload
necessarily creates and closes down many TCP sockets, the sockets & PCBs
for TCP sessions in TIME_WAIT state amount to many megabytes of dead
weight in RAM.

Maximum Segment Lifetimes Truncation (MSLT) assigns each TCP session to
a class based on the nearness of the peer. Corresponding to each class
is an MSL, and a session uses the MSL of its class. The classes are
loopback (local host equals remote host), local (local host and remote
host are on the same link/subnet), and remote (local host and remote
host communicate via one or more gateways). Classes corresponding to
nearer peers have lower MSLs by default: 2 seconds for loopback, 10
seconds for local, 60 seconds for remote. Loopback and local sessions
expire more quickly when MSLT is used.

Vestigial Time-Wait (VTW) replaces a TIME_WAIT session's PCB/socket
dead weight with a compact representation of the session, called a
"vestigial PCB". VTW data structures are designed to be very fast and
memory-efficient: for fast insertion and lookup of vestigial PCBs,
the PCBs are stored in a hash table that is designed to minimize the
number of cacheline visits per lookup/insertion. The memory both
for vestigial PCBs and for elements of the PCB hashtable come from
fixed-size pools, and linked data structures exploit this to conserve
memory by representing references with a narrow index/offset from the
start of a pool instead of a pointer. When space for new vestigial PCBs
runs out, VTW makes room by discarding old vestigial PCBs, oldest first.
VTW cooperates with MSLT.

It may help to think of VTW as a "FIN cache" by analogy to the SYN
cache.

A 2.8-GHz Pentium 4 running a test workload that creates TIME_WAIT
sessions as fast as it can is approximately 17% idle when VTW is active
versus 0% idle when VTW is inactive. It has 103 megabytes more free RAM
when VTW is active (approximately 64k vestigial PCBs are created) than
when it is inactive.
 1.77  13-Dec-2010  pooka Add netstat rump client. For now, it always sets -X, i.e. will
use only sysctl and no kvm (implementing /dev/mem for a rump kernel
would probably not be hard, but still a non-zero effort).

Note: since there is absolutely no network activity in a fresh rump
kernel, rump.netstat usually displays exactly nothing when invoked
without parameters. Arguments like -r, -bi, -p icmp etc. produce
more stuff.
 1.76  29-Jun-2010  kefren Add mpls into family address list
 1.75  27-Jun-2010  kefren Add -T flag, that shows tags in route output
 1.74  24-Feb-2010  pooka Add -h, which makes output of bytes counts "humanized" (e.g. -bih)

(netstat had -h some 15 years ago, but since then it has been just
a fancy way of calling usage())
 1.73  14-Sep-2009  degroote Import pfsync support from OpenBSD 4.2

Pfsync interface exposes change in the pf(4) over a pseudo-interface, and can
be used to synchronise different pf.

This work was part of my 2009 GSoC

No objection on tech-net@
 1.72  13-Sep-2009  elad Checkin work in progress to make netstat use sysctl rather than kvm(3).

This commit mostly adds code written by Claudio Jeker for OpenBSD to
support sysctl in the interface printing parts (-i, -I, -w). The port has
been ported to NetBSD with tiny adjustments -- of course all bugs etc.
are mine.

Also add and document a -X flag to force sysctl usage. The documentation
notes this flag may be removed at any time and its presence should not be
relied on.

Some misc. comments/#ifdef changes/code snippet moves as well.

Please note that no functionality should change as the routing and
interface printing code is still not fully supported.

Mailing list reference:

http://mail-index.netbsd.org/tech-userlevel/2009/09/09/msg002604.html
 1.71  12-Apr-2009  lukem Fix many WARNS=4 issues (-Wshadow -Wcast-qual -Wsign-compare).
Fix probable bug with numeric printing of anon ports when using sysctl.
 1.70  21-Jul-2008  lukem branches: 1.70.2; 1.70.4; 1.70.6; 1.70.12;
Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
 1.69  24-Apr-2008  thorpej branches: 1.69.2;
Make note of a few things no longer available via kvm.
 1.68  23-Apr-2008  thorpej netns is no longer in the tree; completely purge it from netstat(1).
 1.67  23-Apr-2008  thorpej Make DDP stats per-cpu. While here, bump the counters to 64-bit and
make them available by sysctl.
 1.66  23-Apr-2008  thorpej PF_KEY stats for IPSEC and FAST_IPSEC are now per-CPU.
 1.65  15-Apr-2008  thorpej branches: 1.65.2;
ARP and IGMP stats are now available by sysctl.
 1.64  27-Apr-2007  mlelstv Fall back to kvm interface for protocols that do not yet
offer a sysctl interface. Fixes PR bin/36210.
 1.63  15-Nov-2006  elad branches: 1.63.2;
PR/35056: Keiichi Shima: netstat does not compile in crunched environment

Patch applied, thanks!
 1.62  13-Oct-2006  elad Refactor code a bit so we only use kmem when we really need it.
 1.61  27-Sep-2006  elad Good intentions are still intentions. If we can't open kvm, but we still
have sysctl, it's still not enough for -P. A groveler is a groveler is
a groveler.

On a different note, this code needs a rewrite.
 1.60  14-Sep-2006  christos - Back to using kvm if we have access to it, since the sysctl stats do not
yet support all the fields we need.
- Don't core-dump if we could not open the kvm file.
 1.59  26-Aug-2006  matt Conditionalize XNS support. No longer enabled.
 1.58  22-Aug-2006  christos well, the || needed to be an && and the operand order needed to be changed.
XXX: There are still things like interface printing that need kvm.
 1.57  21-Aug-2006  christos Fix another && || confusion, from Kurt Schreiner, thanks!
 1.56  17-Aug-2006  christos Don't use || if you need &&.
 1.55  04-Jun-2006  elad branches: 1.55.2;
another netstat fix, Kurt Schreiner. thanx!
 1.54  04-Jun-2006  elad fix logic; from Kurt Schreiner
 1.53  28-May-2006  elad Make netstat use sysctl when dumping routing tables/stats.
Heavily based on similar code from Claudio Jeker (at OpenBSD).

While here, fix inet/inet6 sysctl stuff commited previously to
actually work, and some other nits to make netstat more sysctl
friendly.

One step closer to losing setgid kmem on this one...
 1.52  18-May-2006  liamjfoy branches: 1.52.2;
Integrate Common Address Redundancy Procotol (CARP) from OpenBSD

'pseudo-device carp'

Thanks to: joerg@ christos@ riz@ and others who tested
Ok: core@
 1.51  14-Sep-2005  drochner make bpf stats #ifndef SMALL,
fixes build of x_netstat
 1.50  02-Sep-2005  rpaulo Request process information using sysctl(3) and not kvm(3) since bpf(4)
statistics and peers are only available using the former.
 1.49  04-Aug-2005  rpaulo Implemented the userland part of the BPF statistics and BPF peers,
net.bpf.stats and net.bpf.peers sysctls respectively. netstat(1) now
has an additional syntax:
netstat [-s] [-B] [-I Interface]

Only the super user can see a list of BPF peers with the following command:
# netstat -B
Active BPF peers
PID Int Recv Drop Capt Flags Bufsize Comm
4941 lo0 0 0 0 I--S- 262144 tcpdump
252 ex0 19668 0 5 I-RS- 32768 dhclient

And every user can see the BPF statistics with:
$ netstat -s -B
bpf:
19669 total packets received
5 total packets captured
0 total packets dropped

This idea came from FreeBSD (Christian S.J. Peron) but, currently, they
doen't have a userland utility in the base system to read the sysctls.

Reviewed by: christos@
 1.48  30-Oct-2004  dsl Add (unsigned char) cast to ctype functions
 1.47  04-Sep-2004  manu IPv4 PIM support, from the submission of Pavlin Radoslavov on tech-net@
 1.46  27-Jun-2004  jonathan Fix two stupid bugs I introduced with stats for fast-ipsec:

1. Pass the caller-supplied protocol name down through ipsec_switch().

2. Remove my poor attempt to print fast-ipsec stats automagically for
`netstat -s'. The previous code would print (fast)IPsec per-protocol
stats even for 'netstat', which is just wrong.

A better fix would be to enumerate the sub-"protocols" under IPsec;
but first lets fix the broken behaviour now, for a pullup to 2.0.
 1.45  06-Jun-2004  christos Temporary hack to fix ipsec stats lossage. Atatat, are you listening?
 1.44  07-May-2004  jonathan Redo net.inet.* sysctl subtree for fast-ipsec from scratch.
Attach FAST-IPSEC statistics with 64-bit counters to new sysctl MIB.
Rework netstat to show FAST_IPSEC statistics, via sysctl, for
netstat -p ipsec.

New kernel files:
sys/netipsec/Makefile (new file; install *_var.h includes)
sys/netipsec/ipsec_var.h (new 64-bit mib counter struct)

Changed kernel files:
sys/Makefile (recurse into sys/netipsec/)
sys/netinet/in.h (fake IP_PROTO name for fast_ipsec
sysctl subtree.)
sys/netipsec/ipsec.h (minimal userspace inclusion)
sys/netipsec/ipsec_osdep.h (minimal userspace inclusion)
sys/netipsec/ipsec_netbsd.c (redo sysctl subtree from scratch)
sys/netipsec/key*.c (fix broken net.key subtree)

sys/netipsec/ah_var.h (increase all counters to 64 bits)
sys/netipsec/esp_var.h (increase all counters to 64 bits)
sys/netipsec/ipip_var.h (increase all counters to 64 bits)
sys/netipsec/ipcomp_var.h (increase all counters to 64 bits)

sys/netipsec/ipsec.c (add #include netipsec/ipsec_var.h)
sys/netipsec/ipsec_mbuf.c (add #include netipsec/ipsec_var.h)
sys/netipsec/ipsec_output.c (add #include netipsec/ipsec_var.h)

sys/netinet/raw_ip.c (add #include netipsec/ipsec_var.h)
sys/netinet/tcp_input.c (add #include netipsec/ipsec_var.h)
sys/netinet/udp_usrreq.c (add #include netipsec/ipsec_var.h)

Changes to usr.bin/netstat to print the new fast-ipsec sysctl tree
for "netstat -s -p ipsec":

New file:
usr.bin/netstat/fast_ipsec.c (print fast-ipsec counters)

Changed files:
usr.bin/netstat/Makefile (add fast_ipsec.c)
usr.bin/netstat/netstat.h (declarations for fast_ipsec.c)
usr.bin/netstat/main.c (call KAME-vs-fast-ipsec dispatcher)
 1.43  04-Sep-2003  itojun branches: 1.43.2;
synchronize w/ inpcb/in6pcb change
 1.42  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.41  18-Apr-2003  lukem clear errno before strto(u)l() if we're going to test it for ERANGE afterwards
 1.40  26-Feb-2003  matt Add MBUFTRACE kernel option.
Do a little mbuf rework while here. Change all uses of MGET*(*, M_WAIT, *)
to m_get*(M_WAIT, *). These are not performance critical and making them
call m_get saves considerable space. Add m_clget analogue of MCLGET and
make corresponding change for M_WAIT uses.
Modify netinet, gem, fxp, tulip, nfs to support MBUFTRACE.
Begin to change netstat to use sysctl.
 1.39  04-Feb-2003  thorpej Update for callout changes, and show TCP timers in relative, rather
than absolute ticks.
 1.38  23-Jul-2002  enami Add more software intrq.
 1.37  03-Jul-2002  enami Introduce -q flag to print some information (like number of packets dropped
due to queue full) about software interrupt queues such as ipintrq.
 1.36  02-Jul-2002  soren Sync SYNOPSIS and usage() with reality.
 1.35  11-Jun-2002  itojun err/errx/warn/warnx do not need \n at the end
 1.34  18-Oct-2001  itojun print rip6stat. sync with kame
 1.33  28-May-2001  assar add `-s' that prints port numbers symbolically but addresses numerically
 1.32  19-Feb-2001  cgd convert to use getprogname()
 1.31  28-Oct-2000  itojun more fix to "pfkey printed twice" problem. PR 11323 from ura.
 1.30  05-Oct-2000  itojun don't print pfkey statistics twice. from uep
 1.29  15-Aug-2000  jhawk Add kernel counters for arp events, displayable with netstat -s -f arp
 1.28  06-Jul-2000  itojun more stats. from kame
 1.27  14-Apr-2000  simonb branches: 1.27.4;
Don't declare 'extern opt*' getopt variables.
 1.26  26-Feb-2000  itojun revise IPsec, pfkey, IPv6 multicast and IPv6 statistics. (sync with kame)
 1.25  13-Dec-1999  itojun per-interface statistics.
bring in and enable KAME scopeid hack.
lots of cleanups.
(sync with latest KAME)
 1.24  15-Sep-1999  is branches: 1.24.4;
Add -L option. netstat -r -L behaves like 4.3BSD netstat -r, that is, it
does not show route table entries pointing to link level addresses (ARP
entries or IPv6 neighbour discovery entries).
 1.23  01-Jul-1999  itojun make netstat IPv6-ready.
 1.22  14-Mar-1999  kristerw There is no -h flag. From OpenBSD.
 1.21  27-Feb-1999  sommerfe fix PR7057: division by zero if no mbufs allocated
fix PR7059 (partial): mbuf cluster counts were based on counters which
are no longer maintained.
(full fix will involve renaming the now-unused fields in mclstat in mbuf.h)
 1.20  08-Feb-1999  explorer fix dumping of pcbs
 1.19  15-Jan-1999  kml Added a verbose flag for route display that will show
the various route metrics.
 1.18  11-Jan-1999  mrg #ifndef SMALL changes. saves 30k on the sparc
 1.17  18-Jul-1998  lukem use AF_LOCAL instead of AF_UNIX. support -f local as synonym for -f unix
 1.16  12-Jul-1998  mrg - KNF
- use err(3)
- sprintf/strcpy -> snprintf/strncpy
- change route.c:domask() to take a size_t of the buffer passed.
 1.15  06-Jul-1998  mrg - change setgid kmem programs (that lend themselves to this) so setegid(getgid())
and the top, and then set the effective gid back to kmem around the call to
kvm_openfiles(). this reduces the time group kmem is available.
- for those above that also allow this, setgid(getgid()) after the call to
kvm_openfiles() to fully revoke priviledges.
- some KNF
- use err(3) over fprintf(3) in some places
 1.14  03-Jun-1998  thorpej Add an option to dump the contents of a PCB at the specified address, and
implement this for TCP.
 1.13  19-Mar-1998  kml Add support for a '-b' option to provide byte counts in and out,
instead of just packet counts. On the byte screens, errors and
collisions are not shown, since they are more packet count related.
 1.12  19-Oct-1997  lukem branches: 1.12.2;
fix up .Nm usage, getopt returns -1 not EOF
 1.11  03-Apr-1997  christos - netatalk additions
- printf format fixes
- minor prototype cleanups
 1.10  28-Feb-1997  jonathan Add compiled-in MCLBYTES and MSIZE to conf/param.c, as 'mclbytes" and "msize".

Add code to netstat to use libkvm to for kernel variables "mclbytes"
and "msize', and if found, use those for netstat -m rather than
compiled-in defaults.
 1.9  07-May-1996  thorpej Update for the changes to struct ifnet. While I'm here, fix a couple
of long-standing bugs:

- Actually deal with the fact that the kernel ifnet list is
a TAILQ; it just happened to work before.

- Use kvm_openfiles() instead of kvm_open(). The code passed
arguments to kvm_open() as if it were kvm_openfiles(), but
apparently went unnoticed since the prototypes are the same.
Amusing bit: there were XXX's in the code which seemed to
apologize for a verbose libkvm, when it happened to be a
bug in netstat!
 1.8  03-Oct-1995  thorpej New-style RCS ids.
 1.7  12-Jun-1995  mycroft Update to match kernel changes.
 1.6  13-May-1994  mycroft Clean up import.
 1.5  01-Apr-1994  cgd kill lots of off_t's.
 1.4  11-Jan-1994  brezak Incorporate changes for IP mcast and IGMP from cmaeda@cs.washington.edu.
 1.3  22-Dec-1993  cgd fix from James Jegers <jimj@miller.cs.uwm.edu>. Netstat -w didn't work
(and would seg fault, too). solution: tell getopt to expect an argument,
and set the appropriate flags when -w is given.
 1.2  01-Aug-1993  mycroft Add RCS identifiers.
 1.1  21-Mar-1993  cgd branches: 1.1.1;
after 0.2.2 "stable" patches applied
 1.1.1.1  06-Oct-1994  mycroft Import original 4.4-Lite version.
 1.12.2.1  19-Jan-1999  cgd pull up rev 1.18 from trunk (mrg)
 1.24.4.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.27.4.2  30-Oct-2000  tv Pullup 1.31 by patch [itojun]:
more fix to "pfkey printed twice" problem. PR 11323 from ura.
 1.27.4.1  05-Oct-2000  itojun pullup 1.29 -> 1.30 (approved by releng-1-5)
don't print pfkey statistics twice. from uep
 1.43.2.3  14-Jul-2004  tron Pull up revision 1.46 (requested by jonathan in ticket #647):
Fix two stupid bugs I introduced with stats for fast-ipsec:
1. Pass the caller-supplied protocol name down through ipsec_switch().
2. Remove my poor attempt to print fast-ipsec stats automagically for
`netstat -s'. The previous code would print (fast)IPsec per-protocol
stats even for 'netstat', which is just wrong.
A better fix would be to enumerate the sub-"protocols" under IPsec;
but first lets fix the broken behaviour now, for a pullup to 2.0.
 1.43.2.2  14-Jul-2004  tron Pull up revision 1.45 (requested by jonathan in ticket #647):
Temporary hack to fix ipsec stats lossage. Atatat, are you listening?
 1.43.2.1  10-May-2004  tron Pull up revision 1.44 (requested by jonathan in ticket #280):
Redo net.inet.* sysctl subtree for fast-ipsec from scratch.
Attach FAST-IPSEC statistics with 64-bit counters to new sysctl MIB.
Rework netstat to show FAST_IPSEC statistics, via sysctl, for
netstat -p ipsec.
New kernel files:
sys/netipsec/Makefile (new file; install *_var.h includes)
sys/netipsec/ipsec_var.h (new 64-bit mib counter struct)
Changed kernel files:
sys/Makefile (recurse into sys/netipsec/)
sys/netinet/in.h (fake IP_PROTO name for fast_ipsec
sysctl subtree.)
sys/netipsec/ipsec.h (minimal userspace inclusion)
sys/netipsec/ipsec_osdep.h (minimal userspace inclusion)
sys/netipsec/ipsec_netbsd.c (redo sysctl subtree from scratch)
sys/netipsec/key*.c (fix broken net.key subtree)
sys/netipsec/ah_var.h (increase all counters to 64 bits)
sys/netipsec/esp_var.h (increase all counters to 64 bits)
sys/netipsec/ipip_var.h (increase all counters to 64 bits)
sys/netipsec/ipcomp_var.h (increase all counters to 64 bits)
sys/netipsec/ipsec.c (add #include netipsec/ipsec_var.h)
sys/netipsec/ipsec_mbuf.c (add #include netipsec/ipsec_var.h)
sys/netipsec/ipsec_output.c (add #include netipsec/ipsec_var.h)
sys/netinet/raw_ip.c (add #include netipsec/ipsec_var.h)
sys/netinet/tcp_input.c (add #include netipsec/ipsec_var.h)
sys/netinet/udp_usrreq.c (add #include netipsec/ipsec_var.h)
Changes to usr.bin/netstat to print the new fast-ipsec sysctl tree
for "netstat -s -p ipsec":
New file:
usr.bin/netstat/fast_ipsec.c (print fast-ipsec counters)
Changed files:
usr.bin/netstat/Makefile (add fast_ipsec.c)
usr.bin/netstat/netstat.h (declarations for fast_ipsec.c)
usr.bin/netstat/main.c (call KAME-vs-fast-ipsec dispatcher)
 1.52.2.1  19-Jun-2006  chap Sync with head.
 1.55.2.3  01-Sep-2006  tron Pull up following revision(s) (requested by christos in ticket #77):
usr.bin/netstat/main.c: revision 1.58
well, the || needed to be an && and the operand order needed to be changed.
XXX: There are still things like interface printing that need kvm.
 1.55.2.2  01-Sep-2006  tron Pull up following revision(s) (requested by christos in ticket #77):
usr.bin/netstat/main.c: revision 1.57
Fix another && || confusion, from Kurt Schreiner, thanks!
 1.55.2.1  01-Sep-2006  tron Pull up following revision(s) (requested by christos in ticket #77):
usr.bin/netstat/main.c: revision 1.56
Don't use || if you need &&.
 1.63.2.1  07-May-2007  snj Pull up following revision(s) (requested by mlelstv in ticket #604):
usr.bin/netstat/main.c: revision 1.64
Fall back to kvm interface for protocols that do not yet
offer a sysctl interface. Fixes PR bin/36210.
 1.65.2.1  18-May-2008  yamt sync with head.
 1.69.2.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.70.12.1  30-Jul-2013  msaitoh Pull up following revision(s) (requested by christos in ticket #1868):
usr.bin/netstat/main.c: revision 1.86
usr.bin/netstat/netstat.h: revision 1.47
usr.bin/netstat/inet.c: revision 1.102
usr.bin/netstat/inet.c: revision 1.103
usr.bin/netstat/inet6.c: revision 1.61
usr.bin/netstat/inet6.c: revision 1.62
Don't use -P as a kmem printer, verify that the address points to a pcb first!
Not all pointers are 64bit - use uintptr_t instead of uint64_t.
 1.70.6.1  13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.70.4.1  30-Jul-2013  msaitoh Pull up following revision(s) (requested by christos in ticket #1868):
usr.bin/netstat/main.c: revision 1.86
usr.bin/netstat/netstat.h: revision 1.47
usr.bin/netstat/inet.c: revision 1.102
usr.bin/netstat/inet.c: revision 1.103
usr.bin/netstat/inet6.c: revision 1.61
usr.bin/netstat/inet6.c: revision 1.62
Don't use -P as a kmem printer, verify that the address points to a pcb first!
Not all pointers are 64bit - use uintptr_t instead of uint64_t.
 1.70.2.1  30-Jul-2013  msaitoh Pull up following revision(s) (requested by christos in ticket #1868):
usr.bin/netstat/main.c: revision 1.86
usr.bin/netstat/netstat.h: revision 1.47
usr.bin/netstat/inet.c: revision 1.102
usr.bin/netstat/inet.c: revision 1.103
usr.bin/netstat/inet6.c: revision 1.61
usr.bin/netstat/inet6.c: revision 1.62
Don't use -P as a kmem printer, verify that the address points to a pcb first!
Not all pointers are 64bit - use uintptr_t instead of uint64_t.
 1.81.10.1  29-Jul-2013  msaitoh Pull up following revision(s) (requested by christos in ticket #912):
usr.bin/netstat/main.c: revision 1.86
usr.bin/netstat/netstat.h: revision 1.47
usr.bin/netstat/inet.c: revision 1.102
usr.bin/netstat/inet.c: revision 1.103
usr.bin/netstat/inet6.c: revision 1.61
usr.bin/netstat/inet6.c: revision 1.62
Don't use -P as a kmem printer, verify that the address points to a pcb first!
Not all pointers are 64bit - use uintptr_t instead of uint64_t.
 1.81.8.1  29-Jul-2013  msaitoh Pull up following revision(s) (requested by christos in ticket #912):
usr.bin/netstat/main.c: revision 1.86
usr.bin/netstat/netstat.h: revision 1.47
usr.bin/netstat/inet.c: revision 1.102
usr.bin/netstat/inet.c: revision 1.103
usr.bin/netstat/inet6.c: revision 1.61
usr.bin/netstat/inet6.c: revision 1.62
Don't use -P as a kmem printer, verify that the address points to a pcb first!
Not all pointers are 64bit - use uintptr_t instead of uint64_t.
 1.81.4.1  29-Jul-2013  msaitoh Pull up following revision(s) (requested by christos in ticket #912):
usr.bin/netstat/main.c: revision 1.86
usr.bin/netstat/netstat.h: revision 1.47
usr.bin/netstat/inet.c: revision 1.102
usr.bin/netstat/inet.c: revision 1.103
usr.bin/netstat/inet6.c: revision 1.61
usr.bin/netstat/inet6.c: revision 1.62
Don't use -P as a kmem printer, verify that the address points to a pcb first!
Not all pointers are 64bit - use uintptr_t instead of uint64_t.
 1.81.2.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.81.2.1  17-Apr-2012  yamt sync with head
 1.83.2.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.83.2.2  23-Jun-2013  tls resync from head
 1.83.2.1  25-Feb-2013  tls resync with head
 1.88.2.1  10-Aug-2014  tls Rebase.
 1.91.2.1  08-Jan-2015  martin Pull up following revision(s) (requested by prlw1 in ticket #390):
usr.bin/netstat/mroute.c: revision 1.25
usr.bin/netstat/Makefile: revision 1.40
sbin/route/prog_ops.h: revision 1.3
sbin/route/rtutil.c: revision 1.1
sbin/route/rtutil.h: revision 1.1
usr.bin/netstat/mroute6.c: revision 1.15
sbin/route/extern.h: revision 1.15
usr.bin/netstat/show.c: file removal
usr.bin/netstat/main.c: revision 1.93
usr.bin/netstat/route.c: revision 1.83
usr.bin/netstat/netstat.h: revision 1.51
distrib/utils/x_route/Makefile: revision 1.18
sbin/route/show.c: revision 1.46
usr.bin/netstat/if.c: revision 1.80
sbin/route/route.c: revision 1.145
sbin/route/Makefile: revision 1.26
Factor out the netstat route printing code and use it here. There is no
point in having 2 different copies; fixes PR/49371
 1.99.18.1  12-Sep-2022  martin Pull up the following, requested by msaitoh in ticket #1522:

usr.bin/netstat/atalk.c 1.18,1.20-1.21
usr.bin/netstat/bpf.c 1.16 via patch
usr.bin/netstat/fast_ipsec.c 1.24
usr.bin/netstat/if.c 1.97-1.99,1.101-1.104 via patch
usr.bin/netstat/inet.c 1.111,1.115-1.116 via patch
usr.bin/netstat/inet6.c 1.74-1.75,1.80-1.81 via patch
usr.bin/netstat/main.c 1.100-1.103
usr.bin/netstat/mbuf.c 1.35
usr.bin/netstat/mroute.c 1.26-1.27
usr.bin/netstat/mroute6.c 1.16
usr.bin/netstat/netstat.h 1.52-1.53
usr.bin/netstat/pfkey.c 1.4-1.5 via patch
usr.bin/netstat/pfsync.c 1.4-1.5 via patch
usr.bin/netstat/route.c 1.86-1.88
usr.bin/netstat/unix.c 1.36-1.37
usr.bin/netstat/vtw.c 1.11,1.13

- sprintf() -> snprintf(), and adjust a buffer size to avoid any
potential for overflow.
- Fix netstat -rs to print it correctly.
- Add missing {IP,IP6}_STAT_NOIPSEC to netstat.
- Don't show any of the completely and utterly undocumented VTW info
if the feature isn't enabled.
- Print oqdrops correctly.
- Remove Network ATM soft intr queue reporting, we don't have that
in the kernel anymore.
- netstat.1: Add various xrefs present in the body to "See Also".
- KNF. Style fixes.
 1.99.8.1  12-Sep-2022  martin Pull up the following, requested by msaitoh in ticket #1762:

usr.bin/netstat/atalk.c 1.18,1.20-1.21
usr.bin/netstat/bpf.c 1.16 via patch
usr.bin/netstat/fast_ipsec.c 1.24 via patch
usr.bin/netstat/if.c 1.97-1.99,1.101-1.104 via patch
usr.bin/netstat/inet.c 1.111,1.115-1.116 via patch
usr.bin/netstat/inet6.c 1.70,1.74-1.75,1.80-1.81 via patch
usr.bin/netstat/main.c 1.100,1.102-1.103
usr.bin/netstat/mbuf.c 1.34-1.35
usr.bin/netstat/mroute.c 1.26-1.27
usr.bin/netstat/mroute6.c 1.16
usr.bin/netstat/netstat.h 1.52-1.53
usr.bin/netstat/pfkey.c 1.4-1.5 via patch
usr.bin/netstat/pfsync.c 1.4-1.5 via patch
usr.bin/netstat/route.c 1.87-1.88
usr.bin/netstat/unix.c 1.36-1.37
usr.bin/netstat/vtw.c 1.11,1.13

- Add names of a few more ICMPv6 messages.
Also make the array be explicitly 256 entries long.
- sprintf() -> snprintf(), and adjust a buffer size to avoid any
potential for overflow.
- Add missing {IP,IP6}_STAT_NOIPSEC to netstat.
- Don't show any of the completely and utterly undocumented VTW info
if the feature isn't enabled.
- Print oqdrops correctly.
- netstat.1: Add various xrefs present in the body to "See Also".
- Limit maximum owner name to appease gcc.
- KNF. Style fixes.

RSS XML Feed