summaryrefslogtreecommitdiff
path: root/usr.bin/netstat/inet.c
AgeCommit message (Collapse)Author
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-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-01-26sockb variable is unused (and even worse, was common unused)Theo de Raadt
2021-01-17Replace SB_KNOTE and sb_flagsintr with direct checking of klist.Visa Hankala
OK mpi@ as part of a larger diff
2020-12-23Print specific headline for TCP state and IP protocol in netstat.Alexander Bluhm
OK claudio@ 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-07-12Count the number of TCP SACK options that were dropped due to theAlexander Bluhm
sack hole list length or pool limit. OK claudio@
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-13Print global IPsec counters.Martin Pieuchot
ok markus@
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-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
2017-05-16When printing a tcpcb with -P and -v, also show the inp in netstatAlexander Bluhm
output. OK mpi@
2017-05-04For TCP sockets netstat -A must print the address of the TCP protocolAlexander Bluhm
control block. This is documented in fstat(1) and makes it possible to compare the values from both tools. OK sthen@
2017-03-07Rename struct etheripstat members for consistency, move them all to 64bitsJeremie Courreges-Anglas
Will make transition to percpu counters easier. ok bluhm@
2017-02-20Crank all members of struct ipipstat to 64 bitsJeremie Courreges-Anglas
Will make conversion to percpu counters easier. ok bluhm@
2017-02-07IPsec packets could be dropped unaccounted if output after cryptoAlexander Bluhm
failed. Add a counter for that case. OK dhill@
2016-12-22Remove PIM support from the multicast stack.Rafael Zalamena
ok mpi@
2016-11-11Print the route cached at the inp with netstat -P. While there,Alexander Bluhm
fix a compiler warning about missing prototype. OK claudio@ mpi@
2016-09-02Drop non-encapulated ESP packets using a UDP-encapsulating TDB, and addVincent Gross
the relevant counters. Ok mikeb@
2016-08-27Pull in <sys/select.h> for howmany() and NBBY, used by various net*/*.hPhilip Guenther
ok deraadt@
2016-08-13%lld -> %llu for u_int64_t struct fields.Kenneth R Westerback
2016-08-13As the relevant struct's (e.g. tcpstat) use [u_]int64_t types, theKenneth R Westerback
proper printf() format is %ll[ud], not the antediluvian %q[ud]. Reminded by guenther@'s proposed retirement of quad types. ok tedu@
2016-07-20To tune the TCP SYN cache we need more information. Print theAlexander Bluhm
relevant counters with netstat -s -p tcp. OK henning@
2016-04-26Print tcps_noport with netstat -s like it is already done for udp.Alexander Bluhm
OK mpi@
2016-03-21Add a tcps_sc_seedrandom counter in TCP SYN cache and netstat -s.Alexander Bluhm
This shows how often the hash function is reseeded and the random bucket distribution changes. OK mpi@ claudio@
2015-08-20Do not cast result of malloc/calloc/realloc* if stdlib.h is in scopeTheo de Raadt
ok krw millert
2015-06-21There is no need to include sys/ucred.h. Only sys/file.h is needed for theClaudio Jeker
DTYPE defines.
2015-04-16remove unfinished/unused support for socket-attached ipsec-policiesMarkus Friedl
ok mikeb
2015-04-14IPsec auth and credentials are not stored in the kernel anymore;Mike Belopuhov
noticed by deraadt@
2015-02-12Switch the printing of open sockets from ugly KVM internals to useClaudio Jeker
kvm_getfiles. This allows to run netstat without any extra privileges and removes another setgid program from base.. There is still kvm reader code in there which is used for debugging purposes (crashdump). netstat should still behave mostly the same. deraadt@ and sthen@ agree that it is time to get this puppy in.
2015-02-08Count dropped SYN packets on the tcpstat. They are dropped due to theYASUOKA Masahiko
listen queue (backlog) limit or the memory shortage in syn-cache. ok henning reyk claudio
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers whereTheo de Raadt
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-11-03Put the socket splicing fields into a seperate struct sosplice thatAlexander Bluhm
gets only allocated when needed. This way struct socket shrinks from 472 to 392 bytes on amd64. When splicing gets active, another 88 bytes are allocated for struct sosplice. OK dlg@
2014-10-26remove unused variablesCharles Longeau
ok schwarze@
2014-10-23Remove networks(5) support.Ingo Schwarze
In particular, do not call getnetbyaddr(3), use gethostbyaddr(3) only. Do not call setnetent(3) and the dummy sethostent(3). OK henning@; and deraadt@ agrees with the general direction.
2014-08-14No need for <netinet/in_systm.h> nor <netinet/tcpip.h>.Martin Pieuchot
2014-06-23The second level of the CTL_NET sysctl is a PF_*, not an AF_*Philip Guenther
inconsistent usage in route(8) noted by Gregor Best (gbe (at) ring0.de)
2014-01-25Fix printing of icps_toofreq unlike IPv6 the IPv4 value is just a u_long.Claudio Jeker
Found by csszep (at) gmail.
2014-01-23hardware cecksummed counters -> software checksummed countersHenning Brauer
2014-01-19Report the number of dropped ICMP error because the rate limit got exceeded.Claudio Jeker
OK benno@ deraadt@
2013-12-25final circleq to tailq fix. restore the previous pointer check by readingTed Unangst
the previous value again and checking prev.next is still next. maybe ok guenther
2013-12-24more fixing after circleq conversion. a better fix to check the prevTed Unangst
pointer is forthcoming.
2013-12-23fix circleq tailq conversionTed Unangst
2013-12-20Switch inpt_queue from CIRCLEQ to TAILQ. Thus ending use of CIRCLEQKenneth R Westerback
in the base. Ports fixes to follow shortly for the two ports (gkrellm and net-snmp) affected. ok zhuk@ millert@
2013-10-24These two programs got fooled by the KAME/NRL split and need type repair.Theo de Raadt
They do not indicate a problem with the reduction of namespace export, but got suckered into the 1999 plan. ok benno
2013-08-18Fix calls to printf-like functions which passed a non-fixed stringPhilip Guenther
as the format and no variable args. Replace "%#0.*X" with "%#.*X": the zero-fill flag is ignored/implied on numeric conversions when a precision is specified. ok jung@ millert@ krw@