History log of /freebsd-10-stable/usr.bin/netstat/sctp.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 294150 16-Jan-2016 tuexen

MFC r287284:
Use the userland exported states and handle them completely.


# 293307 07-Jan-2016 markj

MFC r287649:
Use a common subroutine to fetch and zero protocol stats instead of
duplicating roughly similar code for each protocol.


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 246988 19-Feb-2013 charnier

WARNS=6 compliance


# 238514 16-Jul-2012 tuexen

Allow netstat to be build if INET is not defined in the kernel.
Thanks to Garrett Cooper for reporting the issue.

MFC after: 3 days
X-MFC: 238501


# 230555 25-Jan-2012 tuexen

Don't print a warning when using netstat to print
SCTP statistics when there is not SCTP in the kernel.
This problem was reported by Sean Mahood.

MFC after: 1 week.


# 229403 03-Jan-2012 ed

Replace index() and rindex() calls with strchr() and strrchr().

The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.


# 224271 22-Jul-2011 tuexen

Fix the following bugs related to the SCTP support of netstat:
* Correctly handle -a.
* -A isn't supported.
* Show all closed 1-to-1 and 1-to-many style sockets.
* Show all listening 1-to-many style sockets.
* Use consistent formatting for -W.

PR: 150642
Approved by: re@
MFC after: 4 weeks.


# 219613 13-Mar-2011 brucec

Fix typo.


# 213620 08-Oct-2010 dim

Remove superfluous cast in usr.bin/netstat/sctp.c.

Found by: clang
Submitted by: Norberto Lopes, nlopes dot ml at gmail dot com
Approved by: rpaulo (mentor)


# 200462 13-Dec-2009 delphij

Revert most part of 200420 as requested, as more review and polish is
needed.


# 200420 11-Dec-2009 delphij

Remove unneeded header includes from usr.bin/ except contributed code.

Tested with: make universe


# 178252 16-Apr-2008 rrs

Fixes typo's in sctp.c


# 175061 02-Jan-2008 obrien

style(9)
+ kread is not a boolean, so check it as such
+ fix $FreeBSD$ Ids
+ denote copyrights with /*-
+ misc whitespace changes.


# 172720 17-Oct-2007 rrs

Fix incorrect string formats for netstat/s

PR: 117175
Obtained from: Weongyo Jeong (weongyo.jeong@gmail.com)
MFC after: 1 week


# 172103 09-Sep-2007 rrs

- Netstat warning removal for 64 bit aware platforms.
Approved by: re@freebsd.org (B Mah)


# 171942 23-Aug-2007 rrs

- Fix typo in netstat's display of Nagle algorithm - refer to the RFC.

Submitted by: bruce@cran.org.uk
Approved by: re@freebsd.org (Bruce Mah)


# 171465 16-Jul-2007 jhb

Restore netstat -M functionality for most statistics on core dumps. In
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)


# 170882 17-Jun-2007 rrs

o style(9) nit.
o shorten explainations which are over 80 columns in console.
o group rows
o clean up and change explanations a little bit.
Obtained from: weongyo.jeong@gmail.com


# 170860 16-Jun-2007 rrs

- Forced commit to update who actually did this code (I forgot
the obtained from in the original line)
Obtained from: Weongyo Jeong (weongyo.jeong@gmail.com)


# 170646 13-Jun-2007 delphij

sctp_process_inpcb() wants an offset parameter in size_t,
so define it as what it is expected. This fixes WARNS=3
without NO_WERROR build.


# 170461 09-Jun-2007 rrs

Adds support for SCTP.