summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/mroute6.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r287649:markj2016-01-071-10/+3
| | | | | Use a common subroutine to fetch and zero protocol stats instead of duplicating roughly similar code for each protocol.
* Merge r259562,r259566,r259638,r259645,r260124 by melifaro:glebius2014-03-191-2/+36
| | | | | Switch netstat -rn to use standard API for retrieving list of routes instead of peeking inside in-kernel radix via kget.
* style(9)obrien2008-01-021-3/+2
| | | | | | | + kread is not a boolean, so check it as such + fix $FreeBSD$ Ids + denote copyrights with /*- + misc whitespace changes.
* Restore netstat -M functionality for most statistics on core dumps. Injhb2007-07-161-26/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | general, when support was added to netstat for fetching data using sysctl, no provision was left for fetching equivalent data from a core dump, and in fact, netstat would _always_ fetch data from the live kernel using sysctl even when -M was specified resulting in the user believing they were getting data from coredumps when they actually weren't. Some specific changes: - Add a global 'live' variable that is true if netstat is running against the live kernel and false if -M has been specified. - Stop abusing the sysctl flag in the protocol tables to hold the protocol number. Instead, the protocol is now its own field in the tables, and it is passed as a separate parameter to the PCB and stat routines rather than overloading the KVM offset parameter. - Don't run PCB or stats functions who don't have a namelist offset if we are being run against a crash dump (!live). - For the inet and unix PCB routines, we generate the same buffer from KVM that the sysctl usually generates complete with the header and trailer. - Don't run bpf stats for !live (before it would just silently always run live). - kread() no longer trashes memory when opening the buffer if there is an error on open and the passed in buffer is smaller than _POSIX2_LINE_MAX. - The multicast routing code doesn't fallback to kvm on live kernels if the sysctl fails. Keeping this made the code rather hairy, and netstat is already tied to the kernel ABI anyway (even when using sysctl's since things like xinpcb contain an inpcb) so any kernels this is run against that have the multicast routing stuff should have the sysctls. - Don't try to dig around in the kernel linker in the netgraph PCB routine for core dumps. Other notes: - sctp's PCB routine only works on live kernels, it looked rather complicated to generate all the same stuff via KVM. Someone can always add it later if desired though. - Fix the ipsec removal bug where N_xxx for IPSEC stats weren't renumbered. - Use sysctlbyname() everywhere rather than hardcoded mib values. MFC after: 1 week Approved by: re (rwatson)
* Use sysctl(2), not kvm(3), to read IPv6 multicast information frombms2007-02-241-17/+49
| | | | | | the running system. Use the name 'IPv6 Forwarding Table', not 'IPv6 Routing Table', to be consistent with what the code actually does and is.
* Change wording of warnings when there is no ip_mroute.ko modulebms2007-02-211-4/+7
| | | | | | | | loaded into the system. Change wording of comments to reflect the fact we should unconditionally use KVM if the -M option is used to specify a core file. Add comments to document the fact that IPv6 multicast forwarding information display still relies on KVM for gathering information.
* Nits.bms2006-09-291-1/+1
| | | | Submitted by: ru
* Push removal of mrouted down to the rest of the tree.bms2006-09-291-1/+1
|
* Achieve WARNS=2 by using uintmax_t to pass around 64-bit quantities,yar2006-07-281-18/+19
| | | | | | | including to printf(). Using uintmax_t is also robust to further extensions in both the C language and the bitwidth of kernel counters. Tested on: i386 amd64 ia64
* Add __FBSDID. Replace local variable sin by sockin to not conflict with sin(3).charnier2004-07-261-1/+3
| | | | | Use warnx() instead of warn() when error message is not of any interest. Add prototypes.
* Warns cleanups for netstat:dwmalone2002-09-051-5/+5
| | | | | | | | | | | 1) Include arpa/inet.h for ntohs. 2) Constness fixes. 3) Fix shadowing except for "sin" which shouldn't be in scope. 4) Remove register keyword. 5) Add missing initialsers to user defined structs. 5) Make prototype of netname6 globally visable. 6) Use right macros for printing syncache stats (even though entrie isn't a word).
* fixed typo.suz2002-07-031-2/+2
| | | | | obtained from: KAME MFC after: 3 days
* If -s -s is specified, don't show zero multicast routing statistics.ru2001-09-071-40/+25
|
* Deprecate the -l option in favour of more natural -W.ru2001-09-071-2/+2
| | | | | | | | The compatibility glue is still provided. (This change is not yet reflected in the manpage, nor in usage(). This will be fixed at a later time today, with the general manpage cleanup commit.)
* remove warningsassar2001-06-151-2/+0
| | | | | remove superfluous declarations make things more consistent
* remove K&R supportassar2001-06-151-5/+3
|
* revert removal of warning and K&R supportassar2001-06-151-2/+4
| | | | Requested by: bde
* remove most of the warningsassar2001-06-151-4/+2
|
* add the option -S for printing port numbers symbolically but addressesassar2001-06-151-6/+6
| | | | numerically. clean up the CFLAGS in Makefile.
* Sync with recent KAME.ume2001-06-111-0/+1
| | | | | | | | | | | | | | | | | | This work was based on kame-20010528-freebsd43-snap.tgz and some critical problem after the snap was out were fixed. There are many many changes since last KAME merge. TODO: - The definitions of SADB_* in sys/net/pfkeyv2.h are still different from RFC2407/IANA assignment because of binary compatibility issue. It should be fixed under 5-CURRENT. - ip6po_m member of struct ip6_pktopts is no longer used. But, it is still there because of binary compatibility issue. It should be removed under 5-CURRENT. Reviewed by: itojun Obtained from: KAME MFC after: 3 weeks
* Fix typo s/thissystem/this system/jesper2001-04-161-1/+1
| | | | Submitted by: Stephen <sdk@shell.yuck.net>
* To make compilable without -DINET6.ume2000-08-071-0/+2
| | | | | PR: bin/20407 Submitted by: Patrick Bihan-Faou <patrick@mindstep.com>
* sync with latest kame netstat. basically, more statisticsitojun2000-07-041-28/+42
|
* IPv6 multicast routing.shin2000-01-281-0/+235
kernel IPv6 multicast routing support. pim6 dense mode daemon pim6 sparse mode daemon netstat support of IPv6 multicast routing statistics Merging to the current and testing with other existing multicast routers is done by Tatsuya Jinmei <jinmei@kame.net>, who writes and maintainances the base code in KAME distribution. Make world check and kernel build check was also successful.
OpenPOWER on IntegriCloud