summaryrefslogtreecommitdiff
path: root/usr.bin/netstat/pfkey.c
Commit message (Collapse)AuthorAgeFilesLines
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Use nitems() from sys/param.h.Marcelo Araujo2016-07-301-2/+1
| | | | | | | | MFC after: 2 weeks. Sponsored by: gandi.net (BSD Day Taiwan) Notes: svn path=/head/; revision=303545
* Fix some libxo format string errors in the pfkey stats code.Mark Johnston2015-07-201-2/+2
| | | | | | | PR: 201700 Notes: svn path=/head/; revision=285708
* Convert netstat to use libxo.Marcel Moolenaar2015-02-211-31/+63
| | | | | | | | | | Obtained from: Phil Shafer <phil@juniper.net> Ported to -current by: alfred@ (mostly), Kim Shrier Formatting: marcel@ Sponsored by: Juniper Networks, Inc. Notes: svn path=/head/; revision=279122
* Migrate structs ahstat, espstat, ipcompstat, ipipstat, pfkeystat,Andrey V. Elsukov2013-07-091-1/+1
| | | | | | | ipsec4stat, ipsec6stat to PCPU counters. Notes: svn path=/head/; revision=253088
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-111-4/+0
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=216370
* Revert most part of 200420 as requested, as more review and polish isXin LI2009-12-131-0/+2
| | | | | | | needed. Notes: svn path=/head/; revision=200462
* Remove unneeded header includes from usr.bin/ except contributed code.Xin LI2009-12-111-2/+0
| | | | | | | Tested with: make universe Notes: svn path=/head/; revision=200420
* style(9)David E. O'Brien2008-01-021-12/+9
| | | | | | | | | | + kread is not a boolean, so check it as such + fix $FreeBSD$ Ids + denote copyrights with /*- + misc whitespace changes. Notes: svn path=/head/; revision=175061
* Restore netstat -M functionality for most statistics on core dumps. InJohn Baldwin2007-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) Notes: svn path=/head/; revision=171465
* Commit IPv6 support for FAST_IPSEC to the tree.George V. Neville-Neil2007-07-011-5/+1
| | | | | | | | | | | This commit includes all remaining changes for the time being including user space updates. Submitted by: bz Approved by: re Notes: svn path=/head/; revision=171135
* Don't shadow globals.Yaroslav Tykhiy2006-11-271-1/+1
| | | | | | | | Found by: WARNS=6 MFC after: 3 days Notes: svn path=/head/; revision=164687
* Achieve WARNS=2 by using uintmax_t to pass around 64-bit quantities,Yaroslav Tykhiy2006-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 Notes: svn path=/head/; revision=160787
* Add support for printing IPSEC protocol stats if the kernel was compiledKelly Yancey2005-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 Notes: svn path=/head/; revision=153809