summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/mroute.c
Commit message (Collapse)AuthorAgeFilesLines
* style(9)obrien2008-01-021-4/+4
| | | | | | | + 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-27/+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 the names 'IPv4' and 'Forwarding Table' in program output, notbms2007-02-241-4/+4
| | | | 'Routing Table', to be consistent with what the code actually does and is.
* Add comments about where netstat is using KVM to read things whichbms2007-02-241-1/+3
| | | | should really be available via sysctl for a running system.
* Change wording of warnings when there is no ip_mroute.ko modulebms2007-02-211-7/+12
| | | | | | | | 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-4/+5
| | | | | | | 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
* Both fields of struct timeval are of a non-basic type,yar2006-07-281-6/+10
| | | | so we should cast them to a type printf() knows about.
* Add __FBSDID. Replace local variable sin by sockin to not conflict with sin(3).charnier2004-07-261-4/+2
| | | | | Use warnx() instead of warn() when error message is not of any interest. Add prototypes.
* 1. Add support for printing PIM-related statistics withhsu2003-08-071-0/+93
| | | | | | | | | netstat -s -p pim 2. Print information about the bandwidth meters installed in the kernel with netstat -g Submitted by: Pavlin Radoslavov <pavlin@icir.org>
* * Use sysctlbyname(3) to print statistics about the MFC andhsu2003-08-051-6/+24
| | | | | | | | | | | | | | multicast VIF tables. This change is needed for consistency with the rest of the netstat/mroute.c implementation, and because in some cases "netstat -g" may fail to report the multicast forwarding information (e.g., if we run a multicast router on PicoBSD). * Remove "DVMRP" from the head comment of file netstat/mroute.c, because the printed multicast-related statistics are not DVMRP-specific anymore. Submitted by: Pavlin Radoslavov <pavlin@icir.org>
* 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).
* If -s -s is specified, don't show zero multicast routing statistics.ru2001-09-071-26/+23
|
* Use sysctl to export multicast routing statsfenner2001-07-251-5/+13
|
* remove K&R supportassar2001-06-151-4/+2
|
* 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-4/+4
| | | | numerically. clean up the CFLAGS in Makefile.
* sync with latest kame netstat. basically, more statisticsitojun2000-07-041-4/+3
|
* IPv6 multicast routing.shin2000-01-281-1/+1
| | | | | | | | | | | | | 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.
* Cleanup towards -Walljulian1999-10-211-1/+6
|
* Don't use ip_mrtproto to determine whether multicast routing is infenner1999-01-181-66/+19
| | | | | | | | the kernel; this was left over from the earlier protocol-dependent kernel multicast routing code. Learn how to handle the malloc'd multicast routing table (instead of expecting it to be in mbufs)
* Update to match changes in <net/if.h> and <netinet/ip_mroute.h>.wollman1997-01-031-2/+0
|
* Fix up programs which expect <net/if.h> to include <sys/time.h> to insteadwollman1996-12-101-0/+1
| | | | | | do it themselves. (Some of these programs actually depended on this beyond compiling the definition of struct ifinfo!) Also fix up some other #include messes while we're at it.
* Code cleanup: remove unused variables, use correct *printf formatalex1996-06-021-16/+15
| | | | | | specifiers (some unsigned values were printed as signed, some longs were printed as ints), and place parentheses around assignments in if statements.
* Move #include of queue.h before #include of socketvar.h in preparation fordg1996-03-111-0/+1
| | | | struct socket changes.
* Merge in Lite-2 changes.peter1996-01-141-1/+1
|
* Re-write `netstat -g' code to match the 3.5 data structures.wollman1995-06-131-49/+47
|
* Tell netstat about the new multicast forwarding statistics. For the moment,wollman1994-09-081-8/+23
| | | | | don't try to do any multicast forwarding cache printouts; it's not clear that netstat can do anything particularly useful or meaningful.
* BSD 4.4 Lite Usr.bin Sourcesrgrimes1994-05-271-0/+222
OpenPOWER on IntegriCloud