summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/ipx.c
Commit message (Collapse)AuthorAgeFilesLines
* style(9)obrien2008-01-021-7/+7
| | | | | | | + kread is not a boolean, so check it as such + fix $FreeBSD$ Ids + denote copyrights with /*- + misc whitespace changes.
* Make tcpstates[] static, and make sure TCPSTATES is defined beforedes2007-07-301-2/+1
| | | | | | | | | <netinet/tcp_fsm.h> is included into any compilation unit that needs tcpstates[]. Also remove incorrect extern declarations and TCPDEBUG conditionals. This allows kernels both with and without TCPDEBUG to build, and unbreaks the tinderbox. Approved by: re (rwatson)
* Restore netstat -M functionality for most statistics on core dumps. Injhb2007-07-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* - Achieve WARNS=3 by using sparse initializers or avoiding initializers at all.yar2006-07-281-1/+1
| | | | | | | | - Fix a nlist initialization: it should be terminated by a NULL entry. - Constify. - Catch an unused parameter. Tested on: i386 amd64 ia64
* Achieve WARNS=2 by using uintmax_t to pass around 64-bit quantities,yar2006-07-281-0/+1
| | | | | | | 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
* evise use of queue(9) macros for netipx when used from userspace:rwatson2005-01-021-11/+5
| | | | LIST_FOREACH() is difficult to use correctly, so don't try to.
* Apply a simplifying patch submitted by rik to the IPX support inrwatson2004-12-311-34/+14
| | | | | | | | | | | netstat(1): - Make previously unnecessarily global variables local. - Use LIST_FOREACH() in preference to manual iteration. - Restore a sanity check through slightly incestuous use of queue macro knowledge. Submitted by: rik
* Update netstat(1) for recent conversion of netipx to queue(9) fromrwatson2004-12-311-3/+23
| | | | | | | home-brew linked lists. Read in the ipxpcb_list structure first in order to find the first pcb pointer. Then follow the chain as before, only the termination condition is a NULL next pointer rather than a next pointer equal to the original offset.
* Add __FBSDID. Replace local variable sin by sockin to not conflict with sin(3).charnier2004-07-261-5/+6
| | | | | Use warnx() instead of warn() when error message is not of any interest. Add prototypes.
* Warns cleanups for netstat:dwmalone2002-09-051-7/+7
| | | | | | | | | | | 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).
* Widen struct sockbuf's sb_timeo member to int from short. Withjdp2002-07-241-1/+1
| | | | | | | | | | | | | non-default but reasonable values of hz this member overflowed, breaking NFS over UDP. Also, as long as I'm plowing up struct sockbuf ... Change certain members from u_long/long to u_int/int in order to reduce wasted space on 64-bit machines. This change was requested by Andrew Gallatin. Netstat and systat need to be rebuilt. I am incrementing __FreeBSD_version in case any ports need to change.
* remove warningsassar2001-06-151-4/+4
| | | | | remove superfluous declarations make things more consistent
* remove K&R supportassar2001-06-151-17/+7
|
* revert removal of warning and K&R supportassar2001-06-151-6/+16
| | | | Requested by: bde
* remove most of the warningsassar2001-06-151-16/+6
|
* Cleanup towards -Walljulian1999-10-211-1/+1
|
* Allow suppress printing of lines with zero countsbp1999-10-181-2/+4
| | | | | | for an IPX address family. PR: 14168
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Fixed printf format errors.bde1998-07-061-62/+62
|
* Remove prog, unused variables.charnier1997-07-291-2/+1
| | | | Cosmetic in usage string.
* Add the new ipx statistics variables.jhay1997-05-101-6/+19
| | | | | | | Remove the dns lookup code in the ipx functions. That is bogus and slows things like netstat -r(f ipx) down, without gaining anything. Remove the ipx error protocol statistics.
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Fix up programs which expect <net/if.h> to include <sys/time.h> to insteadwollman1996-12-101-2/+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.
* Eliminate unnecessary include of <sys/mbuf.h>. PCBs aren't stored in mbufswollman1996-10-281-1/+4
| | | | any more.
* Code cleanup: remove unused variables, use correct *printf formatalex1996-06-021-3/+3
| | | | | | 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.
* Submitted by: Mike Mitchelljulian1995-10-271-0/+348
oops. forgot this file then went to bed.. sorry
OpenPOWER on IntegriCloud