summaryrefslogtreecommitdiff
path: root/usr.bin/netstat
AgeCommit message (Collapse)Author
2022-03-31man pages: add missing commas between subordinate and main clausesChristian Weisgerber
jmc@ dislikes a comma before "then" in a conditional, so leave those untouched. ok jmc@
2021-12-05sys/select.h is not needed, if howmany/NBBY are needed they will arriveTheo de Raadt
via netinet/in.h and sys/time.h, which I must say surprises me a bit
2021-11-29local copy of roundup() means no more sys/param.hTheo de Raadt
2021-11-21Add the new `ipsec_exctdb' ipsec(4) counter to count and expose to theVitaliy Makkoveev
userland the TDBs which exceeded hard limit. Also the `ipsec_notdb' counter description in header doesn't math to netstat(1) description. We never count `ipsec_notdb' and the netstat(1) description looks more appropriate so it's used to avoid confusion with the new counter. ok bluhm@
2021-03-17Netstat wants to access kernel internal structures for the kvm walker ofClaudio Jeker
the routing table. Define _KERNEL around the net/route.h include. OK florian@
2021-01-26satisfy -fno-common, by (1) copying all the variable decls fromTheo de Raadt
indent_globs.h to indent.c, and (2) changing all the same decls in indent_globs.h to be extern ok mortimer
2021-01-26sockb variable is unused (and even worse, was common unused)Theo de Raadt
2021-01-24Add missing __KAME__ markers.Florian Obser
OK claudio
2021-01-17Replace SB_KNOTE and sb_flagsintr with direct checking of klist.Visa Hankala
OK mpi@ as part of a larger diff
2021-01-16Unle recover the scope_id from a possible embedded scope if the scope_idClaudio Jeker
is not initalized. Do not reset the scope_id if it was already set. OK bluhm@ florian@
2021-01-02Add missing .Cm macros to the Address Family table.Ingo Schwarze
While here, trim pointless quoting and one excessive column width.
2021-01-02Markup route flags such that apropos(1) finds themkn
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
2020-12-29getifaddrs() can return entries where ifa_addr is NULL. Check for thisSebastian Benoit
before accessing anything in ifa_addr. ok claudio@
2020-12-23Print specific headline for TCP state and IP protocol in netstat.Alexander Bluhm
OK claudio@ sthen@
2020-09-15"Route show" and "netstat -r" provide formatting for routing tables withpamela
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
2020-07-18oops - the description of -i had a similarly incorrect text as -I concerningJason McIntyre
use of -f; remove that too; pointed out by guenther
2020-07-18the text describing the effect of -f on -I is apparently wrong - no such codeJason McIntyre
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;
2020-06-16rework SYNOPSIS/usage() to show better the various use formats,Jason McIntyre
and rework the man text to reflect this; guenther supplied the details on the various modes; deraadt suggested __progname be banished from usage();
2020-06-12Remove superflous space I added with my last commit.remi
noticed by jmc@
2020-06-12update usage() with -R.remi
reminded by jmc@
2020-06-12Add -R to show a summary of rdomains with associated interfaces and tables.remi
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@
2020-01-15Print the correct field, sb_timeo has been replaced by sb_timeo_nsecs.Martin Pieuchot
Breakage reported by espie@, ok bluhm@
2019-12-08Make sure packet destination address matches interface address,Alexandr Nedvedicky
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@
2019-09-02The output of netstat -g was mangled. Fix header line and printAlexander Bluhm
format. OK mpi@
2019-07-16Prevent integer overflow in kernel and userland when checking mbufAlexander Bluhm
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@
2019-07-12Count the number of TCP SACK options that were dropped due to theAlexander Bluhm
sack hole list length or pool limit. OK claudio@
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
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.
2019-06-13Do memory size calculations as unsigned long. OtherwiseAlexander Bluhm
netstat -m would print the result of a signed interger overflow if kern.maxclusters is 1048576 or above. OK claudio@
2019-05-10Delete superfluous #includes of <ifaddrs.h>, <net/if_dl.h>, and <net/if_enc.h>Philip Guenther
ok krw@, jsg@
2019-04-28Fix reading route entries via kvm(3).Martin Pieuchot
From Naoki Fukaumi, ok yasuoka@, sthen@
2019-04-20The rip6 checksum errors are accounted per socket. So the no socketAlexander Bluhm
errors include these, do not subtract both from delivered. Avoids an underflow in the rip6 delivered counter. OK deraadt@ claudio@
2019-04-17signpost the location of the text explaining routing table output a little ↵Jason McIntyre
better...
2019-04-17remove some unneccessary baggage: Nm does not require an argument,Jason McIntyre
and the Bk/Ek invocation here is no longer neccessary;
2019-03-05add -e to usage; while here, change the argument name to -T from tableidJason McIntyre
to rtable, to match the man page;
2019-03-04when showing interface stats, combine the queue drops with errors as failsDavid Gwynne
if you want to see errors or queue drops on their own, use -e or -d respectively. ok claudio@ deraadt@
2018-12-18With option -l, show only UDP sockets that can receive packets fromSebastian Benoit
any other host, i.e. are somewhat like tcp sockets in LISTEN state. Suggested by tedu@ asking about netstat output. ok claudio@ tedu@
2018-11-19Utilize sigio with sockets.Visa Hankala
OK mpi@
2018-08-31Dont print "default" for "0.0.0.0" if it is a host route.YASUOKA Masahiko
diff from asou at soum.co.jp ok claudio kn
2018-08-13Print global IPsec counters.Martin Pieuchot
ok markus@
2018-07-13Use "rtable" not "tableid" as argument name for rtablekn
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
2018-06-04Zap unused mifi_t.kn
OK bluhm mpi jca
2018-06-04Zap unused sockaddr.kn
OK bluhm deraadt jca
2018-04-26Use <fcntl.h> instead of <sys/file.h> for open() and friends.Philip Guenther
Delete a bunch of unnecessary #includes and sort to match style(9) while doing the above cleanup. ok deraadt@ krw@
2018-04-26AF_LOCAL is #define-non-grata; 'local' is 'unix'Philip Guenther
ok jmc@ schwarze@
2018-01-05No need for <sys/socketvar.h>Martin Pieuchot
2017-11-07Convert all the fields of {ah,esp,ipcomp}stat to uint64.Visa Hankala
This is a preliminary step for using percpu counters with the data. OK mpi@
2017-10-28Bring "netstat -m" output up to speed with the kernelMike Belopuhov
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
2017-10-25Remove the TCP_FACK option and associated #if{,n}def code.job
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@
2017-08-12add option -l to show only listening sockets (for tcp)Sebastian Benoit
feedback and ok awhile ago bluhm@ job@
2017-07-27uint32_t is never < 0; pointed out by clang.Florian Obser
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