summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Netstat wants to access kernel internal structures for the kvm walker ofclaudio2021-03-171-1/+3
| | | | | the routing table. Define _KERNEL around the net/route.h include. OK florian@
* satisfy -fno-common, by (1) copying all the variable decls fromderaadt2021-01-262-29/+58
| | | | | | indent_globs.h to indent.c, and (2) changing all the same decls in indent_globs.h to be extern ok mortimer
* sockb variable is unused (and even worse, was common unused)deraadt2021-01-262-5/+2
|
* Add missing __KAME__ markers.florian2021-01-241-1/+5
| | | | OK claudio
* Replace SB_KNOTE and sb_flagsintr with direct checking of klist.visa2021-01-171-2/+1
| | | | OK mpi@ as part of a larger diff
* Unle recover the scope_id from a possible embedded scope if the scope_idclaudio2021-01-162-5/+7
| | | | | is not initalized. Do not reset the scope_id if it was already set. OK bluhm@ florian@
* Add missing .Cm macros to the Address Family table.schwarze2021-01-021-8/+8
| | | | While here, trim pointless quoting and one excessive column width.
* Markup route flags such that apropos(1) finds themkn2021-01-021-24/+24
| | | | | | | | | | netstat(1) is where the mapping between letters and flags is documented, but searching for them ("man -k any=RTF_" or "man -k -i any=blackhole") would only list route(4) and route(8). Markup preprocessor defines as such. OK schwarze
* getifaddrs() can return entries where ifa_addr is NULL. Check for thisbenno2020-12-291-2/+3
| | | | | before accessing anything in ifa_addr. ok claudio@
* Print specific headline for TCP state and IP protocol in netstat.bluhm2020-12-231-3/+4
| | | | OK claudio@ sthen@
* "Route show" and "netstat -r" provide formatting for routing tables withpamela2020-09-151-18/+10
| | | | | | | | sufficient space to display v4 addresses cleanly, but which truncate v6 addresses. The -n flag on each already provides additional column width for IPv6 addresses. Make this formatting the default. OK phessler kn
* oops - the description of -i had a similarly incorrect text as -I concerningjmc2020-07-181-9/+1
| | | | | | use of -f; remove that too; pointed out by guenther
* the text describing the effect of -f on -I is apparently wrong - no such codejmc2020-07-181-10/+2
| | | | | | | | | was ever added; the text was added 21 years ago when ip6 support was added; marfabastewart noticed it, and guenther tracked down the commit responsible; this commit removes that text;
* rework SYNOPSIS/usage() to show better the various use formats,jmc2020-06-162-58/+61
| | | | | | | and rework the man text to reflect this; guenther supplied the details on the various modes; deraadt suggested __progname be banished from usage();
* Remove superflous space I added with my last commit.remi2020-06-121-2/+2
| | | | noticed by jmc@
* update usage() with -R.remi2020-06-121-3/+4
| | | | reminded by jmc@
* Add -R to show a summary of rdomains with associated interfaces and tables.remi2020-06-124-6/+93
| | | | | | | | | | My first version also displayed the number of routes per table. But duming all routing tables to count the entries in userland is expensive. Once the kernel can export these counters the numbers can be added to the output of -R. OK benno@ previous version OK sthen@
* Print the correct field, sb_timeo has been replaced by sb_timeo_nsecs.mpi2020-01-151-2/+2
| | | | Breakage reported by espie@, ok bluhm@
* Make sure packet destination address matches interface address,sashan2019-12-082-2/+4
| | | | | | | | | where such packet is bound to. This check is enforced if and only IP forwarding is disabled. Change discussed with bluhm@, claudio@, deraadt@, markus@, tobhe@ OK bluhm@, claudio@, tobhe@
* The output of netstat -g was mangled. Fix header line and printbluhm2019-09-021-3/+3
| | | | | format. OK mpi@
* Prevent integer overflow in kernel and userland when checking mbufbluhm2019-07-161-6/+8
| | | | | | | | | limits. Convert kernel variables and calculations for mbuf memory into long to allow larger values on 64 bit machines. Put a range check into the kernel sysctl. For the interface itself int is still sufficient. In netstat -m cast all multiplications to unsigned long to hold the product of two unsigned int. input and OK visa@
* Count the number of TCP SACK options that were dropped due to thebluhm2019-07-121-3/+3
| | | | | sack hole list length or pool limit. OK claudio@
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-284-13/+13
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* Do memory size calculations as unsigned long. Otherwisebluhm2019-06-131-2/+2
| | | | | | netstat -m would print the result of a signed interger overflow if kern.maxclusters is 1048576 or above. OK claudio@
* Delete superfluous #includes of <ifaddrs.h>, <net/if_dl.h>, and <net/if_enc.h>guenther2019-05-101-2/+1
| | | | ok krw@, jsg@
* Fix reading route entries via kvm(3).mpi2019-04-283-187/+189
| | | | From Naoki Fukaumi, ok yasuoka@, sthen@
* The rip6 checksum errors are accounted per socket. So the no socketbluhm2019-04-201-2/+1
| | | | | | errors include these, do not subtract both from delivered. Avoids an underflow in the rip6 delivered counter. OK deraadt@ claudio@
* signpost the location of the text explaining routing table output a little better...jmc2019-04-171-1/+2
|
* remove some unneccessary baggage: Nm does not require an argument,jmc2019-04-171-11/+9
| | | | and the Bk/Ek invocation here is no longer neccessary;
* add -e to usage; while here, change the argument name to -T from tableidjmc2019-03-051-4/+4
| | | | to rtable, to match the man page;
* when showing interface stats, combine the queue drops with errors as failsdlg2019-03-044-47/+100
| | | | | | | if you want to see errors or queue drops on their own, use -e or -d respectively. ok claudio@ deraadt@
* With option -l, show only UDP sockets that can receive packets frombenno2018-12-181-2/+7
| | | | | | any other host, i.e. are somewhat like tcp sockets in LISTEN state. Suggested by tedu@ asking about netstat output. ok claudio@ tedu@
* Utilize sigio with sockets.visa2018-11-191-4/+2
| | | | OK mpi@
* Dont print "default" for "0.0.0.0" if it is a host route.yasuoka2018-08-311-3/+1
| | | | | | diff from asou at soum.co.jp ok claudio kn
* Print global IPsec counters.mpi2018-08-133-3/+39
| | | | ok markus@
* Use "rtable" not "tableid" as argument name for rtablekn2018-07-131-4/+4
| | | | | | | | Make rtable(4) usage documentation consistent with other programs. This is to have `man -k ar~rtable' show the full list without having to look for other variations of the same argument type. OK bluhm
* Zap unused mifi_t.kn2018-06-041-4/+1
| | | | OK bluhm mpi jca
* Zap unused sockaddr.kn2018-06-041-3/+1
| | | | OK bluhm deraadt jca
* Use <fcntl.h> instead of <sys/file.h> for open() and friends.guenther2018-04-262-6/+3
| | | | | | | Delete a bunch of unnecessary #includes and sort to match style(9) while doing the above cleanup. ok deraadt@ krw@
* AF_LOCAL is #define-non-grata; 'local' is 'unix'guenther2018-04-261-3/+3
| | | | ok jmc@ schwarze@
* No need for <sys/socketvar.h>mpi2018-01-051-2/+1
|
* Convert all the fields of {ah,esp,ipcomp}stat to uint64.visa2017-11-071-55/+55
| | | | | | This is a preliminary step for using percpu counters with the data. OK mpi@
* Bring "netstat -m" output up to speed with the kernelmikeb2017-10-281-13/+20
| | | | | | | | | | | The kernel no longer sets watermarks on cluster pools rendering "max" values useless. Instead, there's now a global limit on how much memory all cluster pools combined together can allocate from the system. The limit is set to kern.maxclusters number of 2Kb increments which allows us to display current, peak and maximum total memory used by the network. OK claudio, millert
* Remove the TCP_FACK option and associated #if{,n}def code.job2017-10-251-4/+1
| | | | | | | | | TCP_FACK was disabled by provos@ in June 1999. TCP_FACK is an algorithm that decides that when something is lost, all not SACKed packets until the most forward SACK are lost. It may be a correct estimate, if network does not reorder packets. OK visa@ mpi@ mikeb@
* add option -l to show only listening sockets (for tcp)benno2017-08-124-11/+21
| | | | feedback and ok awhile ago bluhm@ job@
* uint32_t is never < 0; pointed out by clang.florian2017-07-271-3/+3
| | | | | | | | While we originally get a short passed from the kernel, it's probably better for debugging purposes to show what we are actually having which is a uin32_t hence the %u format. OK deraadt
* When printing a tcpcb with -P and -v, also show the inp in netstatbluhm2017-05-161-3/+9
| | | | | output. OK mpi@
* Make netstat(8) always ask for IPv6 multicast routing information. Worstrzalamena2017-05-081-3/+2
| | | | | | | case is that we get an empty response instead of a message saying that there is no multicast support. ok mpi@
* For TCP sockets netstat -A must print the address of the TCP protocolbluhm2017-05-041-2/+3
| | | | | | control block. This is documented in fstat(1) and makes it possible to compare the values from both tools. OK sthen@
* Rename struct etheripstat members for consistency, move them all to 64bitsjca2017-03-071-10/+10
| | | | Will make transition to percpu counters easier. ok bluhm@