summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat
Commit message (Collapse)AuthorAgeFilesLines
* MFC r285782:markj2015-07-311-6/+18
| | | | | | Fix counter reads on platforms where sizeof(uint64_t) != sizeof(uint64_t *). PR: 201700
* MFC r265096:garga2015-07-021-11/+13
| | | | | | | | | | | | | | | Fix "netstat -gW" behavior broken in r259638. netstat has two options for printing multicast tables: sysctl (the default one for live systems) and kvm-based one (for cores). It looks like kvm-based one hasn't been working since it's been introduced in r190012 due to absence of mfctablesize kernel symbol. Check for all ipv4-multicast symbols being correctly resolved was introduced in r259638 regardless of 'live' value leading to "No IPv4 MROUTING" error message. Reported by: Olivier Cochard-Labbé Approved by: melifaro@ Sponsored by: Netgate
* MFC r266418, r266448hiren2015-04-063-5/+18
| | | | | | | | | Add the flowtype to the inpcb. Add -R to netstat to dump RSS/flow information. Reviewed by: delphij Relnotes: yes (for r266448) Sponsored by: Limelight Networks
* MFC r266177:hrs2014-10-091-3/+6
| | | | | | | - Do not override sin6_scope_id in LLA when it is already set to non-zero. This fixes destination list in output of netstat -r. - Plug a memory leak. - Add RTM_VERSION check.
* MFC r266494:hrs2014-10-091-10/+7
| | | | | | | - Fix a bug which can make sysctl() fail when -F is specified. - Increase WID_IF_DEFAULT() from 6 to 8 (the default for AF_INET6) because we have interfaces with longer names than 6 chars like epairN{a,b}. - Style fixes.
* MFC r271307:ae2014-10-091-1/+1
| | | | | | | | Add the ability to set `prefer_source' flag to an IPv6 address. It affects the IPv6 source address selection algorithm (RFC 6724) and allows override the last rule ("longest matching prefix") for choosing among equivalent addresses. The address with `prefer_source' will be preferred source address.
* MFC r270927:ae2014-09-081-1/+1
| | | | | | | Add the reverse part to rule #9. Also change its description in the netstat(8) output. Approved by: re (gjb)
* MFC r270348:markj2014-09-061-6/+6
| | | | | | | | | | | | | | Add some missing checks for unsupported interfaces (e.g. pflog(4)) when handling ioctls. While here, remove duplicated checks for a NULL ifp in in6_control(): this check is already done near the beginning of the function. MFC r270349: Suppress warnings when retrieving protocol stats from interfaces that don't support IPv6 (e.g. pflog(4)). PR: 189117 Approved by: re (gjb)
* MFC r261525:bz2014-08-161-0/+11
| | | | | Print the MD5 signature information introduced in r221023 (head) in the TCP statistics output.
* Merge r260524,r260540melifaro2014-05-082-16/+39
| | | | | | | | | | | r260524: Add -4/-6 shorthand for -finet/-finet6 in route(8) and netstat(8). r260540: Bump dates in nestat(1) and route(8) man pages. Fix several small errors introduced by r260524. Suggested by: glebius
* Merge r263203: garbage collect long time obsoleted (or never used) stuffglebius2014-04-092-18/+0
| | | | from routing API.
* o Provide a compatibility shim for netstat(1) to obtain output queueglebius2014-04-031-3/+8
| | | | | | | | | | | | | drops via NET_RT_IFLISTL sysctl. The sysctl handler appends oqdrops at the end of struct if_msghdrl, and netstat(1) sees that as an additional field of struct if_data. This allows us to fetch the data keeping ABI and API compatibility. This is direct commit to stable/10. o Merge r263331 from head, to restore printing of queue drops. Sponsored by: Nginx, Inc. Sponsored by: Netflix
* Merge missed r262819, that fixes broken build.glebius2014-03-231-4/+4
|
* Merge r262763, r262767, r262771, r262806 from head:glebius2014-03-213-31/+38
| | | | | | | | | | - Remove rt_metrics_lite and simply put its members into rtentry. - 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.
* Merge r259562,r259566,r259638,r259645,r260124 by melifaro:glebius2014-03-197-214/+351
| | | | | Switch netstat -rn to use standard API for retrieving list of routes instead of peeking inside in-kernel radix via kget.
* Bulk sync of pf changes from head, in attempt to fixup broken build Iglebius2014-03-123-2/+12
| | | | | | | | | made in r263029. Merge r257186,257215,257349,259736,261797. These changesets split pfvar.h into several smaller headers and make userland utilities to include only some of them.
* Merge r261582, r261601, r261610, r261613, r261627, r261640, r261641, r261823,glebius2014-03-044-3/+90
| | | | | | | | | | r261825, r261859, r261875, r261883, r261911, r262027, r262028, r262029, r262030, r262162 from head. Large flowtable revamp. See commit messages for merged revisions for details. Sponsored by: Netflix
* Merged /head:r256510,256512,257376,257469,260052:glebius2014-01-276-463/+314
| | | | Make 'netstat -i' use getifaddrs(3) instead of kvm(3).
* - Use getnameinfo(3) instead of gethostbyaddr(3) or inet_ntop(3).hrs2013-08-171-18/+25
| | | | | - Fill sin6_scope_id from in6p.sin6_addr.s6_addr[2]. struct inpcb has struct in6_addr for the endpoint addresses, so sin6_scope_id must be filled.
* Remove the large part of struct ipsecstat. Only few fields of thisae2013-07-231-69/+3
| | | | | | | | | | | structure is used, but they already have equal fields in the struct newipsecstat, that was introduced with FAST_IPSEC and then was merged together with old ipsecstat structure. This fixes kernel stack overflow on some architectures after migration ipsecstat to PCPU counters. Reported by: Taku YAMAMOTO, Maciej Milewski
* Sweep unused nlist entries.glebius2013-07-161-48/+26
| | | | Sponsored by: Nginx, Inc.
* Introduce new structure sfstat for collecting sendfile's statisticsae2013-07-152-11/+15
| | | | | | | and remove corresponding fields from struct mbstat. Use PCPU counters and SFSTAT_INC() macro for update these statistics. Discussed with: glebius
* Add -F fibnum option to specify an FIB number for -r flag.hrs2013-07-124-11/+40
|
* Migrate structs ahstat, espstat, ipcompstat, ipipstat, pfkeystat,ae2013-07-092-5/+5
| | | | ipsec4stat, ipsec6stat to PCPU counters.
* Migrate struct carpstats to PCPU counters.ae2013-07-091-1/+1
|
* Migrate structs ip6stat, icmp6stat and rip6stat to PCPU counters.ae2013-07-091-3/+3
|
* Migrate structs arpstat, icmpstat, mrtstat, pimstat and udpstat to PCPUae2013-07-092-5/+5
| | | | counters.
* Use new macros to implement ipstat and tcpstat using PCPU counters.ae2013-07-093-20/+16
| | | | Change interface of kread_counters() similar ot kread() in the netstat(1).
* Prepare network statistics structures for migration to PCPU counters.ae2013-07-093-125/+109
| | | | | | | | | | Use uint64_t as type for all fields of structures. Changed structures: ahstat, arpstat, espstat, icmp6_ifstat, icmp6stat, in6_ifstat, ip6stat, ipcompstat, ipipstat, ipsecstat, mrt6stat, mrtstat, pfkeystat, pim6stat, pimstat, rip6stat, udpstat. Discussed with: arch@
* Replace hardcoded numbers. Also use interface-local scope name insteadae2013-04-161-9/+9
| | | | of node-local.
* Use kvm_counter_u64_fetch() to fix obtaining ipstat and tcpstat fromglebius2013-04-103-29/+69
| | | | | | kernel core files. Sponsored by: Nginx, Inc.
* Merge from projects/counters: TCP/IP stats.glebius2013-04-081-124/+130
| | | | | | | | | Convert 'struct ipstat' and 'struct tcpstat' to counter(9). This speeds up IP forwarding at extreme packet rates, and makes accounting more precise. Sponsored by: Nginx, Inc.
* Add forgotten .Elmelifaro2013-03-091-0/+1
| | | | MFC with: r248112
* Document netstat -Q flags meaning.melifaro2013-03-091-1/+6
| | | | MFC after: 1 week
* WARNS=6 compliancecharnier2013-02-196-11/+10
|
* Use pluralies() for "entry"/"entries".glebius2013-01-221-1/+1
|
* Fill sin6_scope_id in sockaddr_in6 before passing it from the kernel tohrs2012-11-171-0/+6
| | | | | | | | | | | | userland via routing socket or sysctl. This eliminates the following KAME-specific sin6_scope_id handling routine from each userland utility: sin6.sin6_scope_id = ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]); This behavior can be controlled by net.inet6.ip6.deembed_scopeid. This is set to 1 by default (sin6_scope_id will be filled in the kernel). Reviewed by: bz
* Show the number of times we block waiting for mbufs.alfred2012-10-251-4/+18
| | | | | | | | | | | | | | | | | | Machines can stall out because mbufs are low, however sometimes we won't see "requests denied", instead we see user land processes or kernel threads blocking waiting for mbufs because they set M_WAIT. These consumers do not see errors, only stalling. Unfortunately until now, netstat did not export this information so you could have experienced an mbuf shortage and have no way of seeing it unless you happen to run netstat at the exact time of the shortage and see "in use" = "max". By exporting the number of times processes are blocked, we can effectively see how often non-interrupt context threads are effectively "denied". MFC after: 2 weeks
* Remove unused variable. Newer versions of gcc care.eadler2012-10-221-2/+0
| | | | | | Submitted by: Sascha Wildner <saw@online.de> Approved by: cperciva MFC after: 3 days
* Merge the projects/pf/head branch, that was worked on for last six months,glebius2012-09-081-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into head. The most significant achievements in the new code: o Fine grained locking, thus much better performance. o Fixes to many problems in pf, that were specific to FreeBSD port. New code doesn't have that many ifdefs and much less OpenBSDisms, thus is more attractive to our developers. Those interested in details, can browse through SVN log of the projects/pf/head branch. And for reference, here is exact list of revisions merged: r232043, r232044, r232062, r232148, r232149, r232150, r232298, r232330, r232332, r232340, r232386, r232390, r232391, r232605, r232655, r232656, r232661, r232662, r232663, r232664, r232673, r232691, r233309, r233782, r233829, r233830, r233834, r233835, r233836, r233865, r233866, r233868, r233873, r234056, r234096, r234100, r234108, r234175, r234187, r234223, r234271, r234272, r234282, r234307, r234309, r234382, r234384, r234456, r234486, r234606, r234640, r234641, r234642, r234644, r234651, r235505, r235506, r235535, r235605, r235606, r235826, r235991, r235993, r236168, r236173, r236179, r236180, r236181, r236186, r236223, r236227, r236230, r236252, r236254, r236298, r236299, r236300, r236301, r236397, r236398, r236399, r236499, r236512, r236513, r236525, r236526, r236545, r236548, r236553, r236554, r236556, r236557, r236561, r236570, r236630, r236672, r236673, r236679, r236706, r236710, r236718, r237154, r237155, r237169, r237314, r237363, r237364, r237368, r237369, r237376, r237440, r237442, r237751, r237783, r237784, r237785, r237788, r237791, r238421, r238522, r238523, r238524, r238525, r239173, r239186, r239644, r239652, r239661, r239773, r240125, r240130, r240131, r240136, r240186, r240196, r240212. I'd like to thank people who participated in early testing: Tested by: Florian Smeets <flo freebsd.org> Tested by: Chekaluk Vitaly <artemrts ukr.net> Tested by: Ben Wilber <ben desync.com> Tested by: Ian FREISLICH <ianf cloudseed.co.za>
* Allow netstat to be build if INET is not defined in the kernel.tuexen2012-07-162-0/+8
| | | | | | | Thanks to Garrett Cooper for reporting the issue. MFC after: 3 days X-MFC: 238501
* - Updated TOE support in the kernel.np2012-06-191-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Stateful TCP offload drivers for Terminator 3 and 4 (T3 and T4) ASICs. These are available as t3_tom and t4_tom modules that augment cxgb(4) and cxgbe(4) respectively. The cxgb/cxgbe drivers continue to work as usual with or without these extra features. - iWARP driver for Terminator 3 ASIC (kernel verbs). T4 iWARP in the works and will follow soon. Build-tested with make universe. 30s overview ============ What interfaces support TCP offload? Look for TOE4 and/or TOE6 in the capabilities of an interface: # ifconfig -m | grep TOE Enable/disable TCP offload on an interface (just like any other ifnet capability): # ifconfig cxgbe0 toe # ifconfig cxgbe0 -toe Which connections are offloaded? Look for toe4 and/or toe6 in the output of netstat and sockstat: # netstat -np tcp | grep toe # sockstat -46c | grep toe Reviewed by: bz, gnn Sponsored by: Chelsio communications. MFC after: ~3 months (after 9.1, and after ensuring MFC is feasible)
* Eliminate an unused parameter of static method igmp_stats_live_old().delphij2012-04-131-2/+2
| | | | MFC after: 1 month
* With pf 4.5 import the name of pfsync stats sysctl has changed, thusglebius2012-04-041-2/+2
| | | | 'netstat -sp pfsync' got broken. Fix this.
* After r232745, which makes sure __bswap16(), ntohs() and htons() returndim2012-03-091-3/+0
| | | | | | | | | | | | | __uint16_t, we can partially undo r228668. Note the remark "Work around a clang false positive with format string warnings and ntohs macros (see LLVM PR 11313)" was actually incorrect. Before r232745, on some arches, the ntohs() macros did in fact return int, not uint16_t, so clang was right in warning about the %hu format string. MFC after: 2 weeks
* Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, todim2012-02-281-3/+1
| | | | | | | | | | | | | | | | | | | | | get rid of testing explicitly for clang (using ${CC:T:Mclang}) in individual Makefiles. Instead, use the following extra macros, for use with clang: - NO_WERROR.clang (disables -Werror) - NO_WCAST_ALIGN.clang (disables -Wcast-align) - NO_WFORMAT.clang (disables -Wformat and friends) - CLANG_NO_IAS (disables integrated assembler) - CLANG_OPT_SMALL (adds flags for extra small size optimizations) As a side effect, this enables setting CC/CXX/CPP in src.conf instead of make.conf! For clang, use the following: CC=clang CXX=clang++ CPP=clang-cpp MFC after: 2 weeks
* Merge multi-FIB IPv6 support from projects/multi-fibv6/head/:bz2012-02-171-13/+16
| | | | | | | | | | | | Extend the so far IPv4-only support for multiple routing tables (FIBs) introduced in r178888 to IPv6 providing feature parity. This includes an extended rtalloc(9) KPI for IPv6, the necessary adjustments to the network stack, and user land support as in netstat. Sponsored by: Cisco Systems, Inc. Reviewed by: melifaro (basically) MFC after: 10 days
* Don't print a warning when using netstat to printtuexen2012-01-251-1/+2
| | | | | | | SCTP statistics when there is not SCTP in the kernel. This problem was reported by Sean Mahood. MFC after: 1 week.
* In ng_socket(4) expose less kernel internals to userland. This commitglebius2012-01-231-8/+2
| | | | breaks ABI, but makes probability of ABI breakage in future less.
* Fix warning when compiling with gcc46:eadler2012-01-101-2/+0
| | | | | | | error: variable 'ifnetfound' set but not used Approved by: dim MFC after: 3 days
OpenPOWER on IntegriCloud