summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/pfkey.c
Commit message (Collapse)AuthorAgeFilesLines
* style(9)obrien2008-01-021-12/+9
| | | | | | | + kread is not a boolean, so check it as such + fix $FreeBSD$ Ids + denote copyrights with /*- + misc whitespace changes.
* Restore netstat -M functionality for most statistics on core dumps. Injhb2007-07-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Commit IPv6 support for FAST_IPSEC to the tree.gnn2007-07-011-5/+1
| | | | | | | | This commit includes all remaining changes for the time being including user space updates. Submitted by: bz Approved by: re
* Don't shadow globals.yar2006-11-271-1/+1
| | | | | Found by: WARNS=6 MFC after: 3 days
* Achieve WARNS=2 by using uintmax_t to pass around 64-bit quantities,yar2006-07-281-22/+23
| | | | | | | 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
* Add support for printing IPSEC protocol stats if the kernel was compiledkbyanc2005-12-281-0/+184
with FAST_IPSEC rather than the KAME IPSEC stack. Note that the output of "netstat -s -p ipsec" differs depending on which stack is compiled into the kernel since they each keep different stats. This delta also adds the "esp", "ah", and "ipcomp" protocol stats, which are also available when the kernel is compiled with the FAST_IPSEC stack (e.g. "netstat -s -p esp"). Submitted by: Matt Titus <titus at nttmcl dot com> MFC after: 3 days
OpenPOWER on IntegriCloud