Commit Graph

434 Commits

Author SHA1 Message Date
christos
15a5bba97c - avoid pointer gymnastics
- remove unused variables
2013-10-18 20:26:45 +00:00
martin
a4110c4cbe Not all pointers are 64bit - use uintptr_t instead of uint64_t. 2013-06-20 10:43:18 +00:00
christos
08c3d981c5 Don't use -P as a kmem printer, verify that the address points to a pcb first! 2013-06-19 21:12:03 +00:00
christos
7ed35ab90d PR/47744: Frank Kardel: netstat -s stops output prematurely when ipsec is not
compiled.
If the first sysctl fails return silently.
XXX: pullup-6
2013-04-15 21:20:39 +00:00
joerg
e240adbd0b Retire OSI network stack. OK core@ 2013-03-01 18:25:13 +00:00
joerg
438eb8acb3 Use sysctl based code netstat -r. Remove support for post-mortem
analysis.
2013-01-28 13:49:08 +00:00
msaitoh
fd52732c92 Fix memory leak. 2012-12-14 08:15:44 +00:00
msaitoh
79efc68e80 Add -t flag. 2012-10-19 20:46:06 +00:00
msaitoh
c370a471ff Add note about -l option. Fixes PR#47085 reported by Julian Fagir. 2012-10-19 20:43:31 +00:00
msaitoh
fe467d4df9 Line up total numbers again (for -b case and -X case). 2012-10-19 19:50:19 +00:00
pgoyette
000a3dc38f Sort -h option properly (not between -I and -i)
XXX Should the date be updated?
2012-09-25 14:16:27 +00:00
drochner
364a06bb29 remove KAME IPSEC, replaced by FAST_IPSEC 2012-03-22 20:34:37 +00:00
matt
d34c2845b8 Use C89 function definitions 2012-03-20 20:34:57 +00:00
christos
0cdb0b2663 PR/44889: Yamamoto Takashi: netstat -d option is broken (from Elad) 2012-02-12 19:11:33 +00:00
drochner
892b9bad57 split the ipsec.c source file into the pfkey part which is shared
with FAST_IPSEC and KAME specific IPSEC statistics
2012-01-06 14:21:16 +00:00
drochner
47a381e15e more IPSEC header cleanup: don't install unneeded headers to userland,
and remove some differences berween KAME and FAST_IPSEC
2012-01-06 14:17:10 +00:00
christos
de766f5829 use the names from the include files. 2011-12-24 20:18:35 +00:00
gdt
c9bfbf1142 Move RTF_ANNOUNCE flag so that it no longer conflicts with RTF_PROTO2.
RTF_ANNOUNCE was defined as RTF_PROTO2.  The flag is used to indicated
that host should act as a proxy for a link level arp or ndp request.
(If RTF_PROTO2 is used as an experimental flag (as advertised),
various problems can occur.)

This commit provides a first-class definition with its own bit for
RTF_ANNOUNCE, removes the old aliasing definitions, and adds support
for the new RTF_ANNOUNCE flag to netstat(8) and route(8).,

Also, remove unused RTF_ flags that collide with RTF_PROTO1:
  netinet/icmp6.h defined RTF_PROBEMTU as RTF_PROTO1
  netinet/if_inarp.h defined RTF_USETRAILERS as RTF_PROTO1
  (Neither of these flags are used anywhere.  Both have been removed
  to reduce chances of collision with RTF_PROTO1.)

Figuring this out and the diff are the work of Beverly Schwartz of
BBN.

(Passed release build, boot in VM, with no apparently related atf
failures.)

Approved for Public Release, Distribution Unlimited
This material is based upon work supported by the Defense Advanced
Research Projects Agency and Space and Naval Warfare Systems Center,
Pacific, under Contract No. N66001-09-C-2073.
2011-11-11 15:09:32 +00:00
shattered
8836963d2f PR/43968 -- add 'segqlen' of TCPCB to 'netstat -P'.
OK by wiz@
2011-10-04 21:12:40 +00:00
joerg
6818646ac8 Use __dead 2011-09-16 15:39:25 +00:00
christos
aab2693089 document non-literal format strings 2011-08-16 12:03:31 +00:00
njoly
58b2cc408f Use errx() to display kvm_openfiles error message, the provided buffer
already has it.
2011-07-17 10:22:07 +00:00
wiz
322aa1720c New sentence, new line. 2011-06-21 20:51:27 +00:00
kefren
f881c97d31 add a sentence regarding multiple tags 2011-06-21 19:46:36 +00:00
kefren
214feb60c7 print multiple tags if exists, comma separated 2011-06-21 19:42:45 +00:00
manu
1b0d8e317f Display SOCK_SEQPACKET local sockets in sockstat and netstat 2011-05-29 04:45:08 +00:00
drochner
0a8dabda40 pull in AES-GCM/GMAC support from OpenBSD
This is still somewhat experimental. Tested between 2 similar boxes
so far. There is much potential for performance improvement. For now,
I've changed the gmac code to accept any data alignment, as the "char *"
pointer suggests. As the code is practically used, 32-bit alignment
can be assumed, at the cost of data copies. I don't know whether
bytewise access or copies are worse performance-wise. For efficient
implementations using SSE2 instructions on x86, even stricter
alignment requirements might arise.
2011-05-26 21:50:02 +00:00
joerg
a216da57a6 Default to -Wno-sign-compare -Wno-pointer-sign for clang.
Push -Wno-array-bounds down to the cases that depend on it.
Selectively disable warnings for 3rd party software or non-trivial
issues to be reviewed later to get clang -Werror to build most of the
tree.
2011-05-26 12:56:24 +00:00
drochner
ebc232a582 copy AES-XCBC-MAC support from KAME IPSEC to FAST_IPSEC
For this to fit, an API change in cryptosoft was adopted from OpenBSD
(addition of a "Setkey" method to hashes) which was done for GCM/GMAC
support there, so it might be useful in the future anyway.
tested against KAME IPSEC
AFAICT, FAST_IPSEC now supports as much as KAME.
2011-05-24 19:10:08 +00:00
spz
5f1fd2312c RA flood mitigation via a limit on accepted routes:
- introduce a limit for the routes accepted via IPv6 Router Advertisement:
  a common 2 interface client will have 6, the default limit is 100 and
  can be adjusted via sysctl
- report the current number of routes installed via RA via sysctl
- count discarded route additions. Note that one RA message is two routes.
  This is at present only across all interfaces even though per-interface
  would be more useful, since the per-interface structure complies to RFC2466
- bump kernel version due to the previous change
- adjust netstat to use the new value (with netstat -p icmp6)
2011-05-24 18:07:11 +00:00
drochner
cfdc35650d report aes-ctr statistic counter by name 2011-05-23 14:29:55 +00:00
dyoung
0d0dd0e146 Suppress whitespace at EOL to fix lib/librumphijack/t_tcpip. 2011-05-11 22:21:59 +00:00
drochner
4f6bdd19b5 use getmicrouptime(9) rather than microtime(9) for TIME_WAIT duration
calculation, because this doesn't get confused by system time changes,
and uses less CPU cycles
reviewed by dyoung
2011-05-11 15:08:59 +00:00
enami
dd41556bdf Use ptrdiff_t to hold pointer difference to avoid coredump on LP64 system. 2011-05-10 04:40:16 +00:00
drochner
3e2a0f5f49 decode camellia-cbc in stats histogram 2011-05-05 17:49:47 +00:00
pgoyette
38b438f332 Use %zx for _both_ size_t formats! 2011-05-04 03:43:30 +00:00
dyoung
fe23a102a6 On second thought, make a more conservative change: use %zx instead of
%x for size_t.
2011-05-04 01:31:40 +00:00
dyoung
6392073d00 Use %zu format for size_t instead of %x. 2011-05-04 01:30:01 +00:00
dyoung
7957556091 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.
2011-05-04 01:13:35 +00:00
dyoung
7135b6c6f4 Access the kvm_t using get_kvmd(), only. 2011-05-04 01:11:29 +00:00
dyoung
fea546afcb Don't use type qualifier 'register'. 2011-05-04 00:55:19 +00:00
dyoung
7f40ffb8aa Do not display expired or reclaimed vestigial TIME_WAIT entries. 2011-05-03 23:36:26 +00:00
dyoung
c2e43be1c5 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.
2011-05-03 18:28:44 +00:00
drochner
ab862eb3da fix some labels for ipcomp counters which didn't make sense at all 2011-04-19 18:34:39 +00:00
dyoung
9863fc9961 Use __arraycount() and PRIu64. Delete unnecessary casts to unsigned
long long.
2011-03-02 19:52:03 +00:00
dyoung
439199a3fb Pull pfsync_stats() out of inet.c and into pfsync.c so that inet.c does
not have to #include PF header files that pollute the global namespace
by #defining v4 and v6 (sheesh).
2011-03-01 19:01:59 +00:00
martin
82fe9809af Use RT_ROUNDUP() and friends from sys/route.h instead of homegrown
variants.
2011-02-04 14:31:23 +00:00
matt
4d5d6d9aa5 Add a new AF/PF_ROUTE which is 64-bit clean which makes the routing socket
interface (and its associated sysctls) act identically for both 32 and 64 bit
programs.  The old unclean one remains for backward compatibility.
2011-02-01 01:39:19 +00:00
pooka
3c577ba703 Deal with crunch the standard way. 2010-12-15 11:22:41 +00:00
he
c4e8d271ce Make this build with CRUNCHEDPROG defined, and default to the sysctl()
method of fetching information.  Apparently we can't simply not define
the prog_ops struct in this program.
2010-12-15 09:15:05 +00:00