summaryrefslogtreecommitdiff
path: root/usr.bin/netstat/sctp.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2007-07-16 17:15:55 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2007-07-16 17:15:55 +0000
commitfeda1a4372d5e340da97042375dfb783dea52eda (patch)
tree165174828db97bceab2299030940226f1b6620cf /usr.bin/netstat/sctp.c
parent72d73315396520151f86f8c6cb42b09d5a1073e5 (diff)
Notes
Diffstat (limited to 'usr.bin/netstat/sctp.c')
-rw-r--r--usr.bin/netstat/sctp.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/usr.bin/netstat/sctp.c b/usr.bin/netstat/sctp.c
index b3038d3e3ab93..feb9a25b28852 100644
--- a/usr.bin/netstat/sctp.c
+++ b/usr.bin/netstat/sctp.c
@@ -432,8 +432,8 @@ sctp_process_inpcb(struct xsctp_inpcb *xinpcb, const char *name,
* protocol.
*/
void
-sctp_protopr(u_long proto,
- const char *name, int af1)
+sctp_protopr(u_long off __unused,
+ const char *name, int af1, int proto)
{
char *buf;
const char *mibvar = "net.inet.sctp.assoclist";
@@ -511,18 +511,21 @@ sctp_statesprint(uint32_t state)
* Dump SCTP statistics structure.
*/
void
-sctp_stats(u_long off __unused, const char *name, int af1 __unused)
+sctp_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
{
struct sctpstat sctpstat, zerostat;
size_t len = sizeof(sctpstat);
- if (zflag)
- memset(&zerostat, 0, len);
- if (sysctlbyname("net.inet.sctp.stats", &sctpstat, &len,
- zflag ? &zerostat : NULL, zflag ? len : 0) < 0) {
- warn("sysctl: net.inet.sctp.stats");
- return;
- }
+ if (live) {
+ if (zflag)
+ memset(&zerostat, 0, len);
+ if (sysctlbyname("net.inet.sctp.stats", &sctpstat, &len,
+ zflag ? &zerostat : NULL, zflag ? len : 0) < 0) {
+ warn("sysctl: net.inet.sctp.stats");
+ return;
+ }
+ } else
+ kread(off, &sctpstat, len);
printf ("%s:\n", name);