aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/netstat/netstat.h
Commit message (Collapse)AuthorAgeFilesLines
* netstat: Use bool more widelyEd Maste2025-02-041-18/+18
| | | | | | | | | | Following c2aa91745e87 ("netstat: restore printing the "default" keyword, provide -nn option"), consistently use bool where appropriate for commandline flags. Reviewed by: glebius Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48832
* netstat: restore printing the "default" keyword, provide -nn optionGleb Smirnoff2025-02-031-2/+2
| | | | | | | | | | | | | | | Avoid POLA breakage and preserve output standard that really predates the FreeBSD project itself. There are scripts in the wild that rely on the behavior. Provide option to specify -nn twice to have a completely numeric output of the routing tables. Fixes: 9206c79961986c2114a9a2cfccf009ac010ad259 This reverts commit e090646d6f5a4a6848ecd4bcb1f2db498ea3b3e2. Reviewed by: zlei, gallatin, melifaro, allanjude, markj, emaste Differential Revision: https://reviews.freebsd.org/D48729
* netstat: Add version information to libxo outputBram2024-09-061-0/+2
| | | | | | | | Add version information to libxo output so that libxo content consumers can track changes. Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1350
* pflow: netstat statisticsKristof Provost2024-01-161-0/+1
| | | | | | | Expose pflow counters via netstat. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43107
* usr.bin: Remove ancient SCCS tags.Warner Losh2023-11-271-2/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* divert(4): provide statisticsGleb Smirnoff2022-08-301-0/+1
| | | | | | | Instead of incrementing pretty random counters in the IP statistics, create divert socket statistics structure. Export via netstat(1). Differential revision: https://reviews.freebsd.org/D36381
* Extend netstat to display TCP stack and detailed congestion stateRichard Scheffenegger2020-10-091-1/+2
| | | | | | | | | | | | | | | | | Adding the "-c" option used to show detailed per-connection congestion control state for TCP sessions. This is one summary patch, which adds the relevant variables into xtcpcb. As previous "spare" space is used, these changes are ABI compatible. Reviewed by: tuexen MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26518 Notes: svn path=/head/; revision=366566
* Introduce scalable route multipath.Alexander V. Chernikov2020-10-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is based on the nexthop objects landed in D24232. The change introduces the concept of nexthop groups. Each group contains the collection of nexthops with their relative weights and a dataplane-optimized structure to enable efficient nexthop selection. Simular to the nexthops, nexthop groups are immutable. Dataplane part gets compiled during group creation and is basically an array of nexthop pointers, compiled w.r.t their weights. With this change, `rt_nhop` field of `struct rtentry` contains either nexthop or nexthop group. They are distinguished by the presense of NHF_MULTIPATH flag. All dataplane lookup functions returns pointer to the nexthop object, leaving nexhop groups details inside routing subsystem. User-visible changes: The change is intended to be backward-compatible: all non-mpath operations should work as before with ROUTE_MPATH and net.route.multipath=1. All routes now comes with weight, default weight is 1, maximum is 2^24-1. Current maximum multipath group width is statically set to 64. This will become sysctl-tunable in the followup changes. Using functionality: * Recompile kernel with ROUTE_MPATH * set net.route.multipath to 1 route add -6 2001:db8::/32 2001:db8::2 -weight 10 route add -6 2001:db8::/32 2001:db8::3 -weight 20 netstat -6On Nexthop groups data Internet6: GrpIdx NhIdx Weight Slots Gateway Netif Refcnt 1 ------- ------- ------- --------------------------------------- --------- 1 13 10 1 2001:db8::2 vlan2 14 20 2 2001:db8::3 vlan2 Next steps: * Land outbound hashing for locally-originated routes ( D26523 ). * Fix net/bird multipath (net/frr seems to work fine) * Add ROUTE_MPATH to GENERIC * Set net.route.multipath=1 by default Tested by: olivier Reviewed by: glebius Relnotes: yes Differential Revision: https://reviews.freebsd.org/D26449 Notes: svn path=/head/; revision=366390
* Add a -C option to netstat to display the congestion control forMichael Tuexen2020-09-131-0/+1
| | | | | | | | | | | | TCP connections. Reviewed by: rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D26414 Notes: svn path=/head/; revision=365688
* Introduce nexthop objects and new routing KPI.Alexander V. Chernikov2020-04-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the foundational change for the routing subsytem rearchitecture. More details and goals are available in https://reviews.freebsd.org/D24141 . This patch introduces concept of nexthop objects and new nexthop-based routing KPI. Nexthops are objects, containing all necessary information for performing the packet output decision. Output interface, mtu, flags, gw address goes there. For most of the cases, these objects will serve the same role as the struct rtentry is currently serving. Typically there will be low tens of such objects for the router even with multiple BGP full-views, as these objects will be shared between routing entries. This allows to store more information in the nexthop. New KPI: struct nhop_object *fib4_lookup(uint32_t fibnum, struct in_addr dst, uint32_t scopeid, uint32_t flags, uint32_t flowid); struct nhop_object *fib6_lookup(uint32_t fibnum, const struct in6_addr *dst6, uint32_t scopeid, uint32_t flags, uint32_t flowid); These 2 function are intended to replace all all flavours of <in_|in6_>rtalloc[1]<_ign><_fib>, mpath functions and the previous fib[46]-generation functions. Upon successful lookup, they return nexthop object which is guaranteed to exist within current NET_EPOCH. If longer lifetime is desired, one can specify NHR_REF as a flag and get a referenced version of the nexthop. Reference semantic closely resembles rtentry one, allowing sed-style conversion. Additionally, another 2 functions are introduced to support uRPF functionality inside variety of our firewalls. Their primary goal is to hide the multipath implementation details inside the routing subsystem, greatly simplifying firewalls implementation: int fib4_lookup_urpf(uint32_t fibnum, struct in_addr dst, uint32_t scopeid, uint32_t flags, const struct ifnet *src_if); int fib6_lookup_urpf(uint32_t fibnum, const struct in6_addr *dst6, uint32_t scopeid, uint32_t flags, const struct ifnet *src_if); All functions have a separate scopeid argument, paving way to eliminating IPv6 scope embedding and allowing to support IPv4 link-locals in the future. Structure changes: * rtentry gets new 'rt_nhop' pointer, slightly growing the overall size. * rib_head gets new 'rnh_preadd' callback pointer, slightly growing overall sz. Old KPI: During the transition state old and new KPI will coexists. As there are another 4-5 decent-sized conversion patches, it will probably take a couple of weeks. To support both KPIs, fields not required by the new KPI (most of rtentry) has to be kept, resulting in the temporary size increase. Once conversion is finished, rtentry will notably shrink. More details: * architectural overview: https://reviews.freebsd.org/D24141 * list of the next changes: https://reviews.freebsd.org/D24232 Reviewed by: ae,glebius(initial version) Differential Revision: https://reviews.freebsd.org/D24232 Notes: svn path=/head/; revision=359823
* Add the "TCP Blackbox Recorder" which we discussed at the developerJonathan T. Looney2018-03-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | summits at BSDCan and BSDCam in 2017. The TCP Blackbox Recorder allows you to capture events on a TCP connection in a ring buffer. It stores metadata with the event. It optionally stores the TCP header associated with an event (if the event is associated with a packet) and also optionally stores information on the sockets. It supports setting a log ID on a TCP connection and using this to correlate multiple connections that share a common log ID. You can log connections in different modes. If you are doing a coordinated test with a particular connection, you may tell the system to put it in mode 4 (continuous dump). Or, if you just want to monitor for errors, you can put it in mode 1 (ring buffer) and dump all the ring buffers associated with the connection ID when we receive an error signal for that connection ID. You can set a default mode that will be applied to a particular ratio of incoming connections. You can also manually set a mode using a socket option. This commit includes only basic probes. rrs@ has added quite an abundance of probes in his TCP development work. He plans to commit those soon. There are user-space programs which we plan to commit as ports. These read the data from the log device and output pcapng files, and then let you analyze the data (and metadata) in the pcapng files. Reviewed by: gnn (previous version) Obtained from: Netflix, Inc. Relnotes: yes Differential Revision: https://reviews.freebsd.org/D11085 Notes: svn path=/head/; revision=331347
* 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
* After inpcb route caching was put back in place there is no need forBjoern A. Zeeb2017-07-271-1/+0
| | | | | | | | | | | flowtable anymore (as flowtable was never considered to be useful in the forwarding path). Reviewed by: np Differential Revision: https://reviews.freebsd.org/D11448 Notes: svn path=/head/; revision=321618
* 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 strlcpy and snprintf in netstat(1).Xin LI2017-01-051-0/+9
| | | | | | | | | | | | Expand inet6name() line buffer to NI_MAXHOST and use strlcpy/snprintf in various places. Reported by: Anton Yuzhaninov <citrin citrin ru> MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D8916 Notes: svn path=/head/; revision=311392
* Print running TCP connection counts with TCP statistics.Gleb Smirnoff2016-03-151-2/+4
| | | | Notes: svn path=/head/; revision=296882
* Use a common subroutine to fetch and zero protocol stats instead ofMark Johnston2015-09-111-0/+2
| | | | | | | | | duplicating roughly similar code for each protocol. MFC after: 2 weeks Notes: svn path=/head/; revision=287649
* Remove prototypes for undefined functions from netstat.h.Mark Johnston2015-09-111-15/+0
| | | | Notes: svn path=/head/; revision=287647
* Simplify kvm symbol resolution and error handling. The symbol tableHiroki Sato2015-09-021-3/+2
| | | | | | | | nl_symbols will eventually be organized into several modules depending on MK_* variables. Notes: svn path=/head/; revision=287407
* - Add -W flag support for network column in intpr() (-i flag) andHiroki Sato2015-09-011-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | routepr() (-r flag). It is too narrow to show an IPv6 prefix in most cases. - Accept "local" as a synonym of "unix" in protocol family name. - Show a prefix length in CIDR notation when name resolution failed in netname(). - Make routename() and netname() AF-independent and remove unnecessary typecasting from struct sockaddr. - Use getnameinfo(3) to format L2 addr in intpr(). - Fix a bug which showed "Address" when -A flag is specfied in pr_rthdr(). - Replace cryptic GETSA() macro with SA_SIZE(). - Fix declarations shadowing local variables with the same names. - Add more static, remove unused header files and variables. MFC after: 1 week Notes: svn path=/head/; revision=287351
* Convert netstat to use libxo.Marcel Moolenaar2015-02-211-2/+2
| | | | | | | | | | 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
* Add -R to netstat to dump RSS/flow information.Adrian Chadd2014-05-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is intended to help in diagnostics and debugging of NIC and stack flowid support. Eventually this will grow another column (RSS CPU ID) but that currently isn't cached in the inpcb. There's also no clean flowtype -> flowtype identifier string. This is the mbuf M_HASHTYPE_* values for RSS. Here's some example output: adrian@adrian-hackbox:~/work/freebsd/head/src % netstat -Rn | more Active Internet connections Proto Recv-Q Send-Q Local Address Foreign Address flowid ftype tcp4 0 0 10.11.1.65.22 10.11.1.64.12409 29041942 2 udp4 0 0 127.0.0.1.123 *.* 00000000 0 udp6 0 0 fe80::1%lo0.123 *.* 00000000 0 udp6 0 0 ::1.123 *.* 00000000 0 udp4 0 0 10.11.1.65.123 *.* 00000000 0 Tested: * amd64 system w/ igb NIC; local driver changes to expose RSS flowid in if_igb. Notes: svn path=/head/; revision=266448
* Remove AppleTalk support.Gleb Smirnoff2014-03-141-5/+0
| | | | | | | | | | | | | AppleTalk was a network transport protocol for Apple Macintosh devices in 80s and then 90s. Starting with Mac OS X in 2000 the AppleTalk was a legacy protocol and primary networking protocol is TCP/IP. The last Mac OS X release to support AppleTalk happened in 2009. The same year routing equipment vendors (namely Cisco) end their support. Thus, AppleTalk won't be supported in FreeBSD 11.0-RELEASE. Notes: svn path=/head/; revision=263152
* Remove IPX support.Gleb Smirnoff2014-03-141-10/+0
| | | | | | | | | | | | | | IPX was a network transport protocol in Novell's NetWare network operating system from late 80s and then 90s. The NetWare itself switched to TCP/IP as default transport in 1998. Later, in this century the Novell Open Enterprise Server became successor of Novell NetWare. The last release that claimed to still support IPX was OES 2 in 2007. Routing equipment vendors (e.g. Cisco) discontinued support for IPX in 2011. Thus, IPX won't be supported in FreeBSD 11.0-RELEASE. Notes: svn path=/head/; revision=263140
* - Remove rt_metrics_lite and simply put its members into rtentry.Gleb Smirnoff2014-03-051-0/+1
| | | | | | | | | | | | | | | | | | | - Use counter(9) for rt_pksent (former rt_rmx.rmx_pksent). This removes another cache trashing ++ from packet forwarding path. - Create zini/fini methods for the rtentry UMA zone. Via initialize mutex and counter in them. - Fix reporting of rmx_pksent to routing socket. - Fix netstat(1) to report "Use" both in kvm(3) and sysctl(3) mode. The change is mostly targeted for stable/10 merge. For head, rt_pksent is expected to just disappear. Discussed with: melifaro Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=262763
* o Revamp API between flowtable and netinet, netinet6.Gleb Smirnoff2014-02-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | - ip_output() and ip_output6() simply call flowtable_lookup(), passing mbuf and address family. That's the only code under #ifdef FLOWTABLE in the protocols code now. o Revamp statistics gathering and export. - Remove hand made pcpu stats, and utilize counter(9). - Snapshot of statistics is available via 'netstat -rs'. - All sysctls are moved into net.flowtable namespace, since spreading them over net.inet isn't correct. o Properly separate at compile time INET and INET6 parts. o General cleanup. - Remove chain of multiple flowtables. We simply have one for IPv4 and one for IPv6. - Flowtables are allocated in flowtable.c, symbols are static. - With proper argument to SYSINIT() we no longer need flowtable_ready. - Hash salt doesn't need to be per-VNET. - Removed rudimentary debugging, which use quite useless in dtrace era. The runtime behavior of flowtable shouldn't be changed by this commit. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=261601
* Use more fine-grained kvm(3) symbol lookup: routing code retrieves onlyAlexander V. Chernikov2013-12-201-9/+9
| | | | | | | | | | | | | | necessary symbols needed per subsystem. Main kvm(3) init is now delayed as much as possbile. This finally fixes performance issues reported in kern/167204. Some non-working code (ng_socket.ko symbol addresses calculation) removed. Some global variables eliminated. PR: kern/167204 MFC after: 4 weeks Notes: svn path=/head/; revision=259638
* Restore corefiles handling via kvm(3).Alexander V. Chernikov2013-12-181-0/+1
| | | | | | | | Found by: John-Mark Gurney <jmg at funkthat.com> MFC after: 4 weeks Notes: svn path=/head/; revision=259566
* Rewrite netstat/if.c to use getifaddrs(3) and getifmaddrs(3) instead ofGleb Smirnoff2013-10-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libkvm digging in kernel memory. This is possible since r231506 made getifaddrs(3) to supply if_data for each ifaddr. The pros of this change is that now netstat(1) doesn't know about kernel struct ifnet and struct ifaddr. And these structs are about to change significantly in head soon. New netstat binary will work well with 10.0 and any future kernel. The cons is that now it isn't possible to obtain interface statistics from a vmcore. Functions intpr() and sidewaysintpr() were rewritten from scratch. The output of netstat(1) has underwent the following changes: 1) The MTU is not printed for protocol addresses, since it has no notion. Dash is printed instead. If there would be a strong desire to return previous output, it is doable. 2) Output interface queue drops are not printed. Currently this data isn't available to userland via any API. We plan to drop 'struct ifqueue' from 'struct ifnet' very soon, so old kvm(3) access to queue drops is soon to be broken, too. The plan is that drivers would handle their queues theirselves and a new field in if_data would be updated in case of drops. 3) In-kernel reference count for multicast addresses isn't printed. I doubt that anyone used it. Anyway, netstat(1) is sysadmin tool, not kernel debugger. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=256512
* Add -F fibnum option to specify an FIB number for -r flag.Hiroki Sato2013-07-121-1/+1
| | | | Notes: svn path=/head/; revision=253275
* Use new macros to implement ipstat and tcpstat using PCPU counters.Andrey V. Elsukov2013-07-091-1/+1
| | | | | | | Change interface of kread_counters() similar ot kread() in the netstat(1). Notes: svn path=/head/; revision=253083
* Use kvm_counter_u64_fetch() to fix obtaining ipstat and tcpstat fromGleb Smirnoff2013-04-101-0/+1
| | | | | | | | | kernel core files. Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=249345
* - Hide the internal scope address representation of the KAME IPv6Hajimu UMEMOTO2011-01-201-0/+1
| | | | | | | | | | | stack from the output of `netstat -ani'. - The node-local multicast address in the output of `netstat -rn' should be handled as well. Spotted by: Bernd Walter <ticso__at__cicely7.cicely.de> Notes: svn path=/head/; revision=217642
* 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
* Add new, per connection, statistics for TCP, including:George V. Neville-Neil2010-11-171-0/+1
| | | | | | | | | | | | | Retransmitted Packets Zero Window Advertisements Out of Order Receives These statistics are available via the -T argument to netstat(1). MFC after: 2 weeks Notes: svn path=/head/; revision=215434
* Teach netstat -Q to work with -N and -M by adding libkvm versions of dataRobert Watson2010-03-011-1/+1
| | | | | | | | | | | | query routines. This code is necessarily more fragile in the presence of kernel changes than querying the kernel via sysctl (the default), but useful when investigating crashes or live kernel state via firewire. MFC after: 1 week Sponsored by: Juniper Networks Notes: svn path=/head/; revision=204499
* Teach netstat(1) to print out netisr statistics when given the -Q argument.Robert Watson2010-02-221-0/+5
| | | | | | | | | | | Currently supports only reporting on live systems via sysctl, kmem support needs to be edded. MFC after: 1 week Sponsored by: Juniper Networks Notes: svn path=/head/; revision=204202
* Add a new option, -q howmany, which when used in conjuction with -w,Xin LI2010-01-111-0/+1
| | | | | | | | | | | exits netstat after _howmany_ outputs. Requested by: thomasa Reviewed by: freebsd-net (bms, old version in early 2007) MFC after: 1 month Notes: svn path=/head/; revision=202060
* Unbreak user space after if_timer/if_watchdog removal in r199975.Bjoern A. Zeeb2009-12-011-1/+0
| | | | | | | Tested by: glebius Notes: svn path=/head/; revision=199992
* netstat(1) support for UNIX SOCK_SEQPACKET sockets -- changes were requiredRobert Watson2009-10-051-1/+1
| | | | | | | | | | only for the kvm case, as we supported SOCK_SEQPACKET via sysctl already. Sponsored by: Google MFC after: 3 months Notes: svn path=/head/; revision=197777
* Add ARP statistics to the kernel and netstat.George V. Neville-Neil2009-09-031-0/+1
| | | | | | | | | | | | | | | | | | | | | New counters now exist for: requests sent replies sent requests received replies received packets received total packets dropped due to no ARP entry entrys timed out Duplicate IPs seen The new statistics are seen in the netstat command when it is given the -s command line switch. MFC after: 2 weeks In collaboration with: bz Notes: svn path=/head/; revision=196797
* Introduce a number of changes to the MROUTING code.Bruce M Simpson2009-03-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is purely a forwarding plane cleanup; no control plane code is involved. Summary: * Split IPv4 and IPv6 MROUTING support. The static compile-time kernel option remains the same, however, the modules may now be built for IPv4 and IPv6 separately as ip_mroute_mod and ip6_mroute_mod. * Clean up the IPv4 multicast forwarding code to use BSD queue and hash table constructs. Don't build our own timer abstractions when ratecheck() and timevalclear() etc will do. * Expose the multicast forwarding cache (MFC) and virtual interface table (VIF) as sysctls, to reduce netstat's dependence on libkvm for this information for running kernels. * bandwidth meters however still require libkvm. * Make the MFC hash table size a boot/load-time tunable ULONG, net.inet.ip.mfchashsize (defaults to 256). * Remove unused members from struct vif and struct mfc. * Kill RSVP support, as no current RSVP implementation uses it. These stubs could be moved to raw_ip.c. * Don't share locks or initialization between IPv4 and IPv6. * Don't use a static struct route_in6 in ip6_mroute.c. The v6 code is still using a cached struct route_in6, this is moved to mif6 for the time being. * More cleanup remains to be merged from ip_mroute.c to ip6_mroute.c. v4 path tested using ports/net/mcast-tools. v6 changes are mostly mechanical locking and *have not* been tested. As these changes partially break some kernel ABIs, they will not be MFCed. There is a lot more work to be done here. Reviewed by: Pavlin Radoslavov Notes: svn path=/head/; revision=190012
* Now that ifmcstat(8) does not suck, retire host-mode netstat -g.Bruce M Simpson2009-02-151-1/+0
| | | | | | | This change will not be back-ported. Notes: svn path=/head/; revision=188649
* add new build knobs and jigger some existing controls to improveSam Leffler2008-09-211-0/+2
| | | | | | | | | | | control over the result of buildworld and installworld; this especially helps packaging systems such as nanobsd Reviewed by: various (posted to arch) MFC after: 1 month Notes: svn path=/head/; revision=183242
* Minimize changes CURRENT<->releng7.David E. O'Brien2008-09-011-1/+1
| | | | Notes: svn path=/head/; revision=182602
* Update the kernel to count the number of mbufs and clustersGeorge V. Neville-Neil2008-05-151-0/+1
| | | | | | | | | | | | | | | (all types) used per socket buffer. Add support to netstat to print out all of the socket buffer statistics. Update the netstat manual page to describe the new -x flag which gives the extended output. Reviewed by: rwatson, julian Notes: svn path=/head/; revision=179027
* Fix netname() [1] and routename() on big-endian LP64 archs.Marius Strobl2008-02-071-2/+2
| | | | | | | | Submitted by: Yuri Pankov [1] MFC after: 3 days Notes: svn path=/head/; revision=176099
* style(9)David E. O'Brien2008-01-021-6/+6
| | | | | | | | | | + 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-38/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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