summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/main.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Switch the printing of open sockets from ugly KVM internals to useclaudio2015-02-121-155/+86
| | | | | | | | 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.
* Get rid of another KVM reader and convert the multicast output to useclaudio2015-02-091-20/+5
| | | | the new sysctls. Looks good deraadt@
* Remove route/netstat -f encap in favor of ipsecctl -s flow.reyk2015-02-061-3/+1
| | | | OK deraadt@
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-2/+2
| | | | | | | | | 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)
* Remove networks(5) support.schwarze2014-10-231-8/+1
| | | | | | 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.
* The second level of the CTL_NET sysctl is a PF_*, not an AF_*guenther2014-06-231-2/+2
| | | | inconsistent usage in route(8) noted by Gregor Best (gbe (at) ring0.de)
* use strtonum. ok krwtedu2014-02-131-5/+9
|
* ddpcb and unixsw symbols are no longer used with kvm_readguenther2014-01-101-18/+14
| | | | ok deraadt@
* unsigned char cast for isdigit, dealing with argvderaadt2013-11-201-2/+2
| | | | ok benno
* use %d instea of %ideraadt2013-10-281-2/+2
|
* - add UNIX-domain socket info to struct kinfo_file2guenther2013-10-221-6/+11
| | | | | | | | | | - convert netstat from kvm_getfiles() to kvm_getfile2() using that - delete kvm_getfiles() and KERN_FILE as no longer used (bump libkvm's major) - rename kvm_getfile2() to kvm_getfiles(), kinfo_file2 to kinfo_file and KERN_FILE2 to KERN_FILE. ok deraadt@, millert@ ports scan sthen@
* As non-root, whenever netstat is about to print out a kernel pointer...deraadt2013-03-201-1/+4
| | | | print 0x0 instead. Hides a lot stuff people don't need to see.
* i missed usage and the manpage. prod by jmctedu2012-08-221-2/+2
|
* -h flag to print human numbers in conjunction with -w -btedu2012-08-221-2/+5
|
* Do some cleanup and improve the manpage. From Andreas Bartelt; ok henning, jmcmikeb2011-11-011-2/+2
|
* Fixup previous: don't forget to actually get the current rtable;mikeb2011-11-011-2/+3
| | | | reminded by Andreas Bartelt.
* List sockets existing only in the specified or current routing domain.mikeb2011-11-011-9/+12
| | | | | Prompted by the mail from Andreas Bartelt, tested by Andreas and me. ok henning
* rmove rotten netatalk bitshenning2011-07-091-12/+2
|
* Add a -B flag to netstat which displays buffer sizes for TCP sockets.jsing2011-03-151-3/+7
| | | | | | With feedback from bluhm@ ok bluhm@ sthen@
* Print socket structure internals when netstat -P pcbaddr is calledbluhm2010-10-301-55/+43
| | | | | with -v. Also netstat -P supports more than TCP now. ok markus@ jmc@
* Do similar changes to netstat as done to route(8). Try to show theclaudio2010-10-111-5/+36
| | | | | most expected rtable when doing a netstat -rn. OK henning@
* pass the correct af if not specified.dhill2010-07-141-3/+3
| | | | | | fixes printing active connections twice. ok claudio@
* Make deprecated command line argument for extractinglum2010-06-301-19/+19
| | | | | name list work properly. ok deraadt@ millert@
* Allow selecting both address family and protocol by passing the address familyblambert2010-06-291-14/+14
| | | | | | directly to the appropriate print functions. Found by jdixon@, tested jdixon@ and weerd@, ok krw@ deraadt@
* don't repeat the banner if not a tty.tedu2009-11-221-4/+8
| | | | | | add a -c count option to netstat. tweak spacing to not smear fields in vmstat. ok deraadt sthen
* IPv6 support for divert sockets.michele2009-11-051-1/+4
| | | | | | tested by phessler@ pyr@ ok claudio@ "go ahead" deraadt@
* Add (again) support for divert sockets. They allow you to:michele2009-10-041-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | - queue packets from pf(4) to a userspace application - reinject packets from the application into the kernel stack. The divert socket can be bound to a special "divert port" and will receive every packet diverted to that port by pf(4). The pf syntax is pretty simple, e.g.: pass on em0 inet proto tcp from any to any port 80 divert-packet port 1 A lot of discussion have happened since my last commit that resulted in many changes and improvements. I would *really* like to thank everyone who took part in the discussion especially canacar@ who spotted out which are the limitations of this approach. OpenBSD divert(4) is meant to be compatible with software running on top of FreeBSD's divert sockets even though they are pretty different and will become even more with time. discusses with many, but mainly reyk@ canacar@ deraadt@ dlg@ claudio@ beck@ tested by reyk@ and myself ok reyk@ claudio@ beck@ manpage help and ok by jmc@
* Make the kvm routing table code grok multiple routing tables and do notclaudio2009-05-071-2/+3
| | | | | default to table 0 by default. Makes debugging alternate tables possible. OK jsg@
* we use kvm_openfiles() not kvm_open(); Amarendra Godbolederaadt2009-02-211-2/+2
|
* Fix some interger overflows when accounting the used mbuf memory percentageclaudio2009-01-271-3/+3
| | | | | and while there use a better type for the plural{,es}() functions. OK henning@
* netstat statistics for pflow(4) via pseudo familygollo2008-09-161-1/+8
| | | | ok cluadio@ henning@
* make -f mpls work. OK norby@claudio2008-05-081-1/+3
|
* Make if.c kvm free by fetching the interface stats via sysctl like in systatclaudio2008-01-031-16/+14
| | | | | | and ospfd. What is not yet covered is the -d and -t flags to show interface queue drops and the if_timer. OK deraadt@
* Remove the kvm code in rt_stats() and use the sysctl code all the time.claudio2007-12-191-16/+6
| | | | | | While there remove the ugly rflag checks and make it more consistent with the rest of the code. Another step in making netstat setgid free. OK deraadt@
* delete rcsid crudderaadt2007-12-191-15/+1
|
* remove 21 nlist variables, and instead use sysctl to query the kernelderaadt2007-12-141-154/+68
| | | | | turn on INET6 the default (remove the #ifdef's) ok claudio reyk
* mbuf stats are always gotten via sysctl(), so remove old nlist stuffderaadt2007-12-111-52/+44
| | | | ok claudio pyr
* an usage message should fit on a 80-column displaysobrado2007-10-201-3/+4
| | | | ok jmc@
* Make it possible to show alternate routing tables in netstat. This mostlyclaudio2007-07-251-5/+13
| | | | comes from route(8) which already had the -T option. OK henning@
* Bring the index defines back in sync with struct nlist after removal of IPXclaudio2007-06-281-27/+27
| | | | | symbols from the table. This fixes the netstat issues some people reported. OK henning@
* remove IPX support, agreed by manyhenning2007-06-041-24/+4
|
* add -F to usage();jmc2007-03-231-3/+3
|
* Add a new flag -F to netstat restricting route display in conjuctionpyr2007-03-231-3/+6
| | | | | with -r to routes in the same address family as the destination. ok henning@, claudio@
* Fix KVM snooping code of netstat that got broken by the multiple tableclaudio2006-08-291-3/+12
| | | | "support". This makes netstat -A work again. OK markus@ henning@
* Moving netstat from kvm snooping to retrieving the routing tables viaclaudio2006-05-271-4/+13
| | | | | sysctl. Most code is stolen from route -- which was stolen from netstat. kvm snooping code is still in and useable. Put it in deraadt@ henning@
* make these use setres[ug]id for simple privilege dropping;djm2005-07-041-8/+12
| | | | ok deraadt@ millert@ moritz@
* add -P to docs and usage/synopsis; ok markus jmcjaredy2005-06-161-13/+11
|
* add -P for dumping PCB infos, similar to netbsd; ok deraadt@markus2005-06-151-31/+57
|
* bye bye, Xerox NS protocolshenning2005-06-081-61/+37
|
* - add a small description of final synopsis formjmc2005-05-021-3/+3
| | | | - tweak a spacing issue in usage()