174fd40c9SRandall Stewart /*- 274fd40c9SRandall Stewart * Copyright (c) 2001-2007, by Weongyo Jeong. All rights reserved. 374fd40c9SRandall Stewart * 474fd40c9SRandall Stewart * Redistribution and use in source and binary forms, with or without 574fd40c9SRandall Stewart * modification, are permitted provided that the following conditions are met: 674fd40c9SRandall Stewart * 774fd40c9SRandall Stewart * a) Redistributions of source code must retain the above copyright notice, 874fd40c9SRandall Stewart * this list of conditions and the following disclaimer. 974fd40c9SRandall Stewart * 1074fd40c9SRandall Stewart * b) Redistributions in binary form must reproduce the above copyright 1174fd40c9SRandall Stewart * notice, this list of conditions and the following disclaimer in 1274fd40c9SRandall Stewart * the documentation and/or other materials provided with the distribution. 1374fd40c9SRandall Stewart * 1474fd40c9SRandall Stewart * c) Neither the name of Cisco Systems, Inc. nor the names of its 1574fd40c9SRandall Stewart * contributors may be used to endorse or promote products derived 1674fd40c9SRandall Stewart * from this software without specific prior written permission. 1774fd40c9SRandall Stewart * 1874fd40c9SRandall Stewart * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1974fd40c9SRandall Stewart * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 2074fd40c9SRandall Stewart * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2174fd40c9SRandall Stewart * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 2274fd40c9SRandall Stewart * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2374fd40c9SRandall Stewart * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2474fd40c9SRandall Stewart * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2574fd40c9SRandall Stewart * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2674fd40c9SRandall Stewart * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2774fd40c9SRandall Stewart * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 2874fd40c9SRandall Stewart * THE POSSIBILITY OF SUCH DAMAGE. 2974fd40c9SRandall Stewart */ 3074fd40c9SRandall Stewart 3174fd40c9SRandall Stewart #if 0 3274fd40c9SRandall Stewart #ifndef lint 3374fd40c9SRandall Stewart static char sccsid[] = "@(#)sctp.c 0.1 (Berkeley) 4/18/2007"; 3474fd40c9SRandall Stewart #endif /* not lint */ 3574fd40c9SRandall Stewart #endif 3674fd40c9SRandall Stewart 3774fd40c9SRandall Stewart #include <sys/cdefs.h> 3874fd40c9SRandall Stewart __FBSDID("$FreeBSD$"); 3974fd40c9SRandall Stewart 4074fd40c9SRandall Stewart #include <sys/param.h> 4174fd40c9SRandall Stewart #include <sys/queue.h> 4274fd40c9SRandall Stewart #include <sys/types.h> 4374fd40c9SRandall Stewart #include <sys/socket.h> 4474fd40c9SRandall Stewart #include <sys/socketvar.h> 4574fd40c9SRandall Stewart #include <sys/sysctl.h> 4674fd40c9SRandall Stewart #include <sys/protosw.h> 4774fd40c9SRandall Stewart 4874fd40c9SRandall Stewart #include <netinet/in.h> 4974fd40c9SRandall Stewart #include <netinet/sctp.h> 5074fd40c9SRandall Stewart #include <netinet/sctp_constants.h> 5174fd40c9SRandall Stewart #include <arpa/inet.h> 5274fd40c9SRandall Stewart 5374fd40c9SRandall Stewart #include <err.h> 5474fd40c9SRandall Stewart #include <errno.h> 55821df508SXin LI #include <libutil.h> 56821df508SXin LI #include <netdb.h> 5774fd40c9SRandall Stewart #include <stdint.h> 5874fd40c9SRandall Stewart #include <stdio.h> 5974fd40c9SRandall Stewart #include <stdlib.h> 6074fd40c9SRandall Stewart #include <string.h> 61821df508SXin LI #include <unistd.h> 6274fd40c9SRandall Stewart #include "netstat.h" 6374fd40c9SRandall Stewart 6474fd40c9SRandall Stewart #ifdef SCTP 6574fd40c9SRandall Stewart 6674fd40c9SRandall Stewart void inetprint(struct in_addr *, int, const char *, int); 6774fd40c9SRandall Stewart static void sctp_statesprint(uint32_t state); 6874fd40c9SRandall Stewart 6974fd40c9SRandall Stewart #define NETSTAT_SCTP_STATES_CLOSED 0x0 7074fd40c9SRandall Stewart #define NETSTAT_SCTP_STATES_BOUND 0x1 7174fd40c9SRandall Stewart #define NETSTAT_SCTP_STATES_LISTEN 0x2 7274fd40c9SRandall Stewart #define NETSTAT_SCTP_STATES_COOKIE_WAIT 0x3 7374fd40c9SRandall Stewart #define NETSTAT_SCTP_STATES_COOKIE_ECHOED 0x4 7474fd40c9SRandall Stewart #define NETSTAT_SCTP_STATES_ESTABLISHED 0x5 7574fd40c9SRandall Stewart #define NETSTAT_SCTP_STATES_SHUTDOWN_SENT 0x6 7674fd40c9SRandall Stewart #define NETSTAT_SCTP_STATES_SHUTDOWN_RECEIVED 0x7 7774fd40c9SRandall Stewart #define NETSTAT_SCTP_STATES_SHUTDOWN_ACK_SENT 0x8 7874fd40c9SRandall Stewart #define NETSTAT_SCTP_STATES_SHUTDOWN_PENDING 0x9 7974fd40c9SRandall Stewart 8074fd40c9SRandall Stewart char *sctpstates[] = { 8174fd40c9SRandall Stewart "CLOSED", 8274fd40c9SRandall Stewart "BOUND", 8374fd40c9SRandall Stewart "LISTEN", 8474fd40c9SRandall Stewart "COOKIE_WAIT", 8574fd40c9SRandall Stewart "COOKIE_ECHOED", 8674fd40c9SRandall Stewart "ESTABLISHED", 8774fd40c9SRandall Stewart "SHUTDOWN_SENT", 8874fd40c9SRandall Stewart "SHUTDOWN_RECEIVED", 8974fd40c9SRandall Stewart "SHUTDOWN_ACK_SENT", 9074fd40c9SRandall Stewart "SHUTDOWN_PENDING" 9174fd40c9SRandall Stewart }; 9274fd40c9SRandall Stewart 9374fd40c9SRandall Stewart LIST_HEAD(xladdr_list, xladdr_entry) xladdr_head; 9474fd40c9SRandall Stewart struct xladdr_entry { 9574fd40c9SRandall Stewart struct xsctp_laddr *xladdr; 9674fd40c9SRandall Stewart LIST_ENTRY(xladdr_entry) xladdr_entries; 9774fd40c9SRandall Stewart }; 9874fd40c9SRandall Stewart 9974fd40c9SRandall Stewart LIST_HEAD(xraddr_list, xraddr_entry) xraddr_head; 10074fd40c9SRandall Stewart struct xraddr_entry { 10174fd40c9SRandall Stewart struct xsctp_raddr *xraddr; 10274fd40c9SRandall Stewart LIST_ENTRY(xraddr_entry) xraddr_entries; 10374fd40c9SRandall Stewart }; 10474fd40c9SRandall Stewart 10574fd40c9SRandall Stewart static int 10674fd40c9SRandall Stewart sctp_skip_xinpcb_ifneed(char *buf, const size_t buflen, size_t *offset) 10774fd40c9SRandall Stewart { 10874fd40c9SRandall Stewart int exist_tcb = 0; 10974fd40c9SRandall Stewart struct xsctp_tcb *xstcb; 11074fd40c9SRandall Stewart struct xsctp_raddr *xraddr; 11174fd40c9SRandall Stewart struct xsctp_laddr *xladdr; 11274fd40c9SRandall Stewart 11374fd40c9SRandall Stewart while (*offset < buflen) { 11474fd40c9SRandall Stewart xladdr = (struct xsctp_laddr *)(buf + *offset); 11574fd40c9SRandall Stewart *offset += sizeof(struct xsctp_laddr); 11674fd40c9SRandall Stewart if (xladdr->last == 1) 11774fd40c9SRandall Stewart break; 11874fd40c9SRandall Stewart } 11974fd40c9SRandall Stewart 12074fd40c9SRandall Stewart while (*offset < buflen) { 12174fd40c9SRandall Stewart xstcb = (struct xsctp_tcb *)(buf + *offset); 12274fd40c9SRandall Stewart *offset += sizeof(struct xsctp_tcb); 12374fd40c9SRandall Stewart if (xstcb->last == 1) 12474fd40c9SRandall Stewart break; 12574fd40c9SRandall Stewart 12674fd40c9SRandall Stewart exist_tcb = 1; 12774fd40c9SRandall Stewart 12874fd40c9SRandall Stewart while (*offset < buflen) { 12974fd40c9SRandall Stewart xladdr = (struct xsctp_laddr *)(buf + *offset); 13074fd40c9SRandall Stewart *offset += sizeof(struct xsctp_laddr); 13174fd40c9SRandall Stewart if (xladdr->last == 1) 13274fd40c9SRandall Stewart break; 13374fd40c9SRandall Stewart } 13474fd40c9SRandall Stewart 13574fd40c9SRandall Stewart while (*offset < buflen) { 13674fd40c9SRandall Stewart xraddr = (struct xsctp_raddr *)(buf + *offset); 13774fd40c9SRandall Stewart *offset += sizeof(struct xsctp_raddr); 13874fd40c9SRandall Stewart if (xraddr->last == 1) 13974fd40c9SRandall Stewart break; 14074fd40c9SRandall Stewart } 14174fd40c9SRandall Stewart } 14274fd40c9SRandall Stewart 14374fd40c9SRandall Stewart /* 14474fd40c9SRandall Stewart * If Lflag is set, we don't care about the return value. 14574fd40c9SRandall Stewart */ 14674fd40c9SRandall Stewart if (Lflag) 14774fd40c9SRandall Stewart return 0; 14874fd40c9SRandall Stewart 14974fd40c9SRandall Stewart return exist_tcb; 15074fd40c9SRandall Stewart } 15174fd40c9SRandall Stewart 15274fd40c9SRandall Stewart static void 15374fd40c9SRandall Stewart sctp_process_tcb(struct xsctp_tcb *xstcb, const char *name, 15474fd40c9SRandall Stewart char *buf, const size_t buflen, size_t *offset, int *indent) 15574fd40c9SRandall Stewart { 15674fd40c9SRandall Stewart int i, xl_total = 0, xr_total = 0, x_max; 15774fd40c9SRandall Stewart struct sockaddr *sa; 15874fd40c9SRandall Stewart struct xsctp_raddr *xraddr; 15974fd40c9SRandall Stewart struct xsctp_laddr *xladdr; 16074fd40c9SRandall Stewart struct xladdr_entry *prev_xl = NULL, *xl = NULL, *xl_tmp; 16174fd40c9SRandall Stewart struct xraddr_entry *prev_xr = NULL, *xr = NULL, *xr_tmp; 16274fd40c9SRandall Stewart #ifdef INET6 16374fd40c9SRandall Stewart struct sockaddr_in6 *in6; 16474fd40c9SRandall Stewart #endif 16574fd40c9SRandall Stewart 16674fd40c9SRandall Stewart LIST_INIT(&xladdr_head); 16774fd40c9SRandall Stewart LIST_INIT(&xraddr_head); 16874fd40c9SRandall Stewart 16974fd40c9SRandall Stewart /* 17074fd40c9SRandall Stewart * Make `struct xladdr_list' list and `struct xraddr_list' list 17174fd40c9SRandall Stewart * to handle the address flexibly. 17274fd40c9SRandall Stewart */ 17374fd40c9SRandall Stewart while (*offset < buflen) { 17474fd40c9SRandall Stewart xladdr = (struct xsctp_laddr *)(buf + *offset); 17574fd40c9SRandall Stewart *offset += sizeof(struct xsctp_laddr); 17674fd40c9SRandall Stewart if (xladdr->last == 1) 17774fd40c9SRandall Stewart break; 17874fd40c9SRandall Stewart 17974fd40c9SRandall Stewart prev_xl = xl; 18074fd40c9SRandall Stewart xl = malloc(sizeof(struct xladdr_entry)); 18174fd40c9SRandall Stewart if (xl == NULL) { 18274fd40c9SRandall Stewart warnx("malloc %lu bytes", 18374fd40c9SRandall Stewart (u_long)sizeof(struct xladdr_entry)); 18474fd40c9SRandall Stewart goto out; 18574fd40c9SRandall Stewart } 18674fd40c9SRandall Stewart xl->xladdr = xladdr; 18774fd40c9SRandall Stewart if (prev_xl == NULL) 18874fd40c9SRandall Stewart LIST_INSERT_HEAD(&xladdr_head, xl, xladdr_entries); 18974fd40c9SRandall Stewart else 19074fd40c9SRandall Stewart LIST_INSERT_AFTER(prev_xl, xl, xladdr_entries); 19174fd40c9SRandall Stewart xl_total++; 19274fd40c9SRandall Stewart } 19374fd40c9SRandall Stewart 19474fd40c9SRandall Stewart while (*offset < buflen) { 19574fd40c9SRandall Stewart xraddr = (struct xsctp_raddr *)(buf + *offset); 19674fd40c9SRandall Stewart *offset += sizeof(struct xsctp_raddr); 19774fd40c9SRandall Stewart if (xraddr->last == 1) 19874fd40c9SRandall Stewart break; 19974fd40c9SRandall Stewart 20074fd40c9SRandall Stewart prev_xr = xr; 20174fd40c9SRandall Stewart xr = malloc(sizeof(struct xraddr_entry)); 20274fd40c9SRandall Stewart if (xr == NULL) { 20374fd40c9SRandall Stewart warnx("malloc %lu bytes", 20474fd40c9SRandall Stewart (u_long)sizeof(struct xraddr_entry)); 20574fd40c9SRandall Stewart goto out; 20674fd40c9SRandall Stewart } 20774fd40c9SRandall Stewart xr->xraddr = xraddr; 20874fd40c9SRandall Stewart if (prev_xr == NULL) 20974fd40c9SRandall Stewart LIST_INSERT_HEAD(&xraddr_head, xr, xraddr_entries); 21074fd40c9SRandall Stewart else 21174fd40c9SRandall Stewart LIST_INSERT_AFTER(prev_xr, xr, xraddr_entries); 21274fd40c9SRandall Stewart xr_total++; 21374fd40c9SRandall Stewart } 21474fd40c9SRandall Stewart 21574fd40c9SRandall Stewart /* 21674fd40c9SRandall Stewart * Let's print the address infos. 21774fd40c9SRandall Stewart */ 21874fd40c9SRandall Stewart xl = LIST_FIRST(&xladdr_head); 21974fd40c9SRandall Stewart xr = LIST_FIRST(&xraddr_head); 22074fd40c9SRandall Stewart x_max = (xl_total > xr_total) ? xl_total : xr_total; 22174fd40c9SRandall Stewart for (i = 0; i < x_max; i++) { 22274fd40c9SRandall Stewart if (((*indent == 0) && i > 0) || *indent > 0) 22374fd40c9SRandall Stewart printf("%-11s ", " "); 22474fd40c9SRandall Stewart 22574fd40c9SRandall Stewart if (xl != NULL) { 22674fd40c9SRandall Stewart sa = &(xl->xladdr->address.sa); 22774fd40c9SRandall Stewart if ((sa->sa_family) == AF_INET) 22874fd40c9SRandall Stewart inetprint(&((struct sockaddr_in *)sa)->sin_addr, 22974fd40c9SRandall Stewart htons(xstcb->local_port), 23074fd40c9SRandall Stewart name, numeric_port); 23174fd40c9SRandall Stewart #ifdef INET6 23274fd40c9SRandall Stewart else { 23374fd40c9SRandall Stewart in6 = (struct sockaddr_in6 *)sa; 23474fd40c9SRandall Stewart inet6print(&in6->sin6_addr, 23574fd40c9SRandall Stewart htons(xstcb->local_port), 23674fd40c9SRandall Stewart name, numeric_port); 23774fd40c9SRandall Stewart } 23874fd40c9SRandall Stewart #endif 23974fd40c9SRandall Stewart } 24074fd40c9SRandall Stewart 24174fd40c9SRandall Stewart if (xr != NULL && !Lflag) { 24274fd40c9SRandall Stewart sa = &(xr->xraddr->address.sa); 24374fd40c9SRandall Stewart if ((sa->sa_family) == AF_INET) 24474fd40c9SRandall Stewart inetprint(&((struct sockaddr_in *)sa)->sin_addr, 24574fd40c9SRandall Stewart htons(xstcb->remote_port), 24674fd40c9SRandall Stewart name, numeric_port); 24774fd40c9SRandall Stewart #ifdef INET6 24874fd40c9SRandall Stewart else { 24974fd40c9SRandall Stewart in6 = (struct sockaddr_in6 *)sa; 25074fd40c9SRandall Stewart inet6print(&in6->sin6_addr, 25174fd40c9SRandall Stewart htons(xstcb->remote_port), 25274fd40c9SRandall Stewart name, numeric_port); 25374fd40c9SRandall Stewart } 25474fd40c9SRandall Stewart #endif 25574fd40c9SRandall Stewart } 25674fd40c9SRandall Stewart 25774fd40c9SRandall Stewart if (xl != NULL) 25874fd40c9SRandall Stewart xl = LIST_NEXT(xl, xladdr_entries); 25974fd40c9SRandall Stewart if (xr != NULL) 26074fd40c9SRandall Stewart xr = LIST_NEXT(xr, xraddr_entries); 26174fd40c9SRandall Stewart 26274fd40c9SRandall Stewart if (i == 0 && !Lflag) 26374fd40c9SRandall Stewart sctp_statesprint(xstcb->state); 26474fd40c9SRandall Stewart 26574fd40c9SRandall Stewart if (i < x_max) 26674fd40c9SRandall Stewart putchar('\n'); 26774fd40c9SRandall Stewart } 26874fd40c9SRandall Stewart 26974fd40c9SRandall Stewart out: 27074fd40c9SRandall Stewart /* 27174fd40c9SRandall Stewart * Free the list which be used to handle the address. 27274fd40c9SRandall Stewart */ 27374fd40c9SRandall Stewart xl = LIST_FIRST(&xladdr_head); 27474fd40c9SRandall Stewart while (xl != NULL) { 27574fd40c9SRandall Stewart xl_tmp = LIST_NEXT(xl, xladdr_entries); 27674fd40c9SRandall Stewart free(xl); 27774fd40c9SRandall Stewart xl = xl_tmp; 27874fd40c9SRandall Stewart } 27974fd40c9SRandall Stewart 28074fd40c9SRandall Stewart xr = LIST_FIRST(&xraddr_head); 28174fd40c9SRandall Stewart while (xr != NULL) { 28274fd40c9SRandall Stewart xr_tmp = LIST_NEXT(xr, xraddr_entries); 28374fd40c9SRandall Stewart free(xr); 28474fd40c9SRandall Stewart xr = xr_tmp; 28574fd40c9SRandall Stewart } 28674fd40c9SRandall Stewart } 28774fd40c9SRandall Stewart 28874fd40c9SRandall Stewart #ifdef SCTP_DEBUG 28974fd40c9SRandall Stewart uint32_t sctp_pdup[64]; 29074fd40c9SRandall Stewart int sctp_pcnt = 0; 29174fd40c9SRandall Stewart #endif 29274fd40c9SRandall Stewart 29374fd40c9SRandall Stewart static void 29474fd40c9SRandall Stewart sctp_process_inpcb(struct xsctp_inpcb *xinpcb, const char *name, 29574fd40c9SRandall Stewart char *buf, const size_t buflen, size_t *offset) 29674fd40c9SRandall Stewart { 29774fd40c9SRandall Stewart int offset_backup, indent = 0, xladdr_total = 0, is_listening = 0; 29874fd40c9SRandall Stewart static int first = 1; 29974fd40c9SRandall Stewart char *tname; 30074fd40c9SRandall Stewart struct xsctp_tcb *xstcb; 30174fd40c9SRandall Stewart struct xsctp_laddr *xladdr; 30274fd40c9SRandall Stewart struct sockaddr *sa; 30374fd40c9SRandall Stewart #ifdef INET6 30474fd40c9SRandall Stewart struct sockaddr_in6 *in6; 30574fd40c9SRandall Stewart #endif 30674fd40c9SRandall Stewart 30774fd40c9SRandall Stewart if ((xinpcb->flags & SCTP_PCB_FLAGS_TCPTYPE) == 30874fd40c9SRandall Stewart SCTP_PCB_FLAGS_TCPTYPE && xinpcb->maxqlen > 0) 30974fd40c9SRandall Stewart is_listening = 1; 31074fd40c9SRandall Stewart 31174fd40c9SRandall Stewart if (!Lflag && !is_listening && 31274fd40c9SRandall Stewart !(xinpcb->flags & SCTP_PCB_FLAGS_CONNECTED)) { 31374fd40c9SRandall Stewart #ifdef SCTP_DEBUG 31474fd40c9SRandall Stewart int i, found = 0; 31574fd40c9SRandall Stewart 31674fd40c9SRandall Stewart for (i = 0; i < sctp_pcnt; i++) { 31774fd40c9SRandall Stewart if (sctp_pdup[i] == xinpcb->flags) { 31874fd40c9SRandall Stewart found = 1; 31974fd40c9SRandall Stewart break; 32074fd40c9SRandall Stewart } 32174fd40c9SRandall Stewart } 32274fd40c9SRandall Stewart if (!found) { 32374fd40c9SRandall Stewart sctp_pdup[sctp_pcnt++] = xinpcb->flags; 32474fd40c9SRandall Stewart if (sctp_pcnt >= 64) 32574fd40c9SRandall Stewart sctp_pcnt = 0; 32674fd40c9SRandall Stewart printf("[0x%08x]", xinpcb->flags); 32774fd40c9SRandall Stewart } 32874fd40c9SRandall Stewart #endif 32974fd40c9SRandall Stewart offset_backup = *offset; 33074fd40c9SRandall Stewart if (!sctp_skip_xinpcb_ifneed(buf, buflen, offset)) 33174fd40c9SRandall Stewart return; 33274fd40c9SRandall Stewart *offset = offset_backup; 33374fd40c9SRandall Stewart } 33474fd40c9SRandall Stewart 33574fd40c9SRandall Stewart if (first) { 33674fd40c9SRandall Stewart if (!Lflag) { 33774fd40c9SRandall Stewart printf("Active SCTP associations"); 33874fd40c9SRandall Stewart if (aflag) 33974fd40c9SRandall Stewart printf(" (including servers)"); 34074fd40c9SRandall Stewart } else 34174fd40c9SRandall Stewart printf("Current listen queue sizes (qlen/maxqlen)"); 34274fd40c9SRandall Stewart putchar('\n'); 34374fd40c9SRandall Stewart if (Aflag) 34474fd40c9SRandall Stewart printf("%-8.8s ", "Socket"); 34574fd40c9SRandall Stewart if (Lflag) 34674fd40c9SRandall Stewart printf("%-5.5s %-5.5s %-8.8s %-22.22s\n", 34774fd40c9SRandall Stewart "Proto", "Type", "Listen", "Local Address"); 34874fd40c9SRandall Stewart else 34974fd40c9SRandall Stewart printf((Aflag && !Wflag) ? 35074fd40c9SRandall Stewart "%-5.5s %-5.5s %-18.18s %-18.18s %s\n" : 35174fd40c9SRandall Stewart "%-5.5s %-5.5s %-22.22s %-22.22s %s\n", 35274fd40c9SRandall Stewart "Proto", "Type", 35374fd40c9SRandall Stewart "Local Address", "Foreign Address", 35474fd40c9SRandall Stewart "(state)"); 35574fd40c9SRandall Stewart first = 0; 35674fd40c9SRandall Stewart } 35774fd40c9SRandall Stewart if (Lflag && xinpcb->maxqlen == 0) { 35874fd40c9SRandall Stewart (int)sctp_skip_xinpcb_ifneed(buf, buflen, offset); 35974fd40c9SRandall Stewart return; 36074fd40c9SRandall Stewart } 36174fd40c9SRandall Stewart if (Aflag) 36274fd40c9SRandall Stewart printf("%8lx ", (u_long)xinpcb); 36374fd40c9SRandall Stewart 36474fd40c9SRandall Stewart printf("%-5.5s ", name); 36574fd40c9SRandall Stewart 36674fd40c9SRandall Stewart if (xinpcb->flags & SCTP_PCB_FLAGS_TCPTYPE) 36774fd40c9SRandall Stewart tname = "1to1"; 36874fd40c9SRandall Stewart else if (xinpcb->flags & SCTP_PCB_FLAGS_UDPTYPE) 36974fd40c9SRandall Stewart tname = "1toN"; 37074fd40c9SRandall Stewart else 37174fd40c9SRandall Stewart return; 37274fd40c9SRandall Stewart 37374fd40c9SRandall Stewart printf("%-5.5s ", tname); 37474fd40c9SRandall Stewart 37574fd40c9SRandall Stewart if (Lflag) { 37674fd40c9SRandall Stewart char buf1[9]; 37774fd40c9SRandall Stewart 37874fd40c9SRandall Stewart snprintf(buf1, 9, "%hu/%hu", xinpcb->qlen, xinpcb->maxqlen); 37974fd40c9SRandall Stewart printf("%-8.8s ", buf1); 38074fd40c9SRandall Stewart } 38174fd40c9SRandall Stewart /* 38274fd40c9SRandall Stewart * process the local address. This routine are used for Lflag. 38374fd40c9SRandall Stewart */ 38474fd40c9SRandall Stewart while (*offset < buflen) { 38574fd40c9SRandall Stewart xladdr = (struct xsctp_laddr *)(buf + *offset); 38674fd40c9SRandall Stewart *offset += sizeof(struct xsctp_laddr); 38774fd40c9SRandall Stewart if (xladdr->last == 1) 38874fd40c9SRandall Stewart break; 38974fd40c9SRandall Stewart 39074fd40c9SRandall Stewart if (!Lflag && !is_listening) 39174fd40c9SRandall Stewart continue; 39274fd40c9SRandall Stewart 39374fd40c9SRandall Stewart if (xladdr_total != 0) 39474fd40c9SRandall Stewart putchar('\n'); 39574fd40c9SRandall Stewart if (xladdr_total > 0) 39674fd40c9SRandall Stewart printf((Lflag) ? 39774fd40c9SRandall Stewart "%-20.20s " : "%-11.11s ", " "); 39874fd40c9SRandall Stewart 39974fd40c9SRandall Stewart sa = &(xladdr->address.sa); 40074fd40c9SRandall Stewart if ((sa->sa_family) == AF_INET) 40174fd40c9SRandall Stewart inetprint(&((struct sockaddr_in *)sa)->sin_addr, 40274fd40c9SRandall Stewart htons(xinpcb->local_port), name, numeric_port); 40374fd40c9SRandall Stewart #ifdef INET6 40474fd40c9SRandall Stewart else { 40574fd40c9SRandall Stewart in6 = (struct sockaddr_in6 *)sa; 40674fd40c9SRandall Stewart inet6print(&in6->sin6_addr, 40774fd40c9SRandall Stewart htons(xinpcb->local_port), name, numeric_port); 40874fd40c9SRandall Stewart } 40974fd40c9SRandall Stewart #endif 41074fd40c9SRandall Stewart 41174fd40c9SRandall Stewart if (!Lflag && xladdr_total == 0 && is_listening == 1) 41274fd40c9SRandall Stewart printf("%-22.22s LISTEN", " "); 41374fd40c9SRandall Stewart 41474fd40c9SRandall Stewart xladdr_total++; 41574fd40c9SRandall Stewart } 41674fd40c9SRandall Stewart 41774fd40c9SRandall Stewart xstcb = (struct xsctp_tcb *)(buf + *offset); 41874fd40c9SRandall Stewart *offset += sizeof(struct xsctp_tcb); 41974fd40c9SRandall Stewart while (xstcb->last == 0 && *offset < buflen) { 42074fd40c9SRandall Stewart sctp_process_tcb(xstcb, name, buf, buflen, offset, &indent); 42174fd40c9SRandall Stewart indent++; 42274fd40c9SRandall Stewart xstcb = (struct xsctp_tcb *)(buf + *offset); 42374fd40c9SRandall Stewart *offset += sizeof(struct xsctp_tcb); 42474fd40c9SRandall Stewart } 42574fd40c9SRandall Stewart 42674fd40c9SRandall Stewart putchar('\n'); 42774fd40c9SRandall Stewart } 42874fd40c9SRandall Stewart 42974fd40c9SRandall Stewart /* 43074fd40c9SRandall Stewart * Print a summary of SCTP connections related to an Internet 43174fd40c9SRandall Stewart * protocol. 43274fd40c9SRandall Stewart */ 43374fd40c9SRandall Stewart void 434feda1a43SJohn Baldwin sctp_protopr(u_long off __unused, 435feda1a43SJohn Baldwin const char *name, int af1, int proto) 43674fd40c9SRandall Stewart { 43774fd40c9SRandall Stewart char *buf; 43874fd40c9SRandall Stewart const char *mibvar = "net.inet.sctp.assoclist"; 43904b764d8SXin LI size_t offset = 0; 44074fd40c9SRandall Stewart size_t len = 0; 44174fd40c9SRandall Stewart struct xsctp_inpcb *xinpcb; 44274fd40c9SRandall Stewart 44374fd40c9SRandall Stewart if (proto != IPPROTO_SCTP) 44474fd40c9SRandall Stewart return; 44574fd40c9SRandall Stewart 44674fd40c9SRandall Stewart if (sysctlbyname(mibvar, 0, &len, 0, 0) < 0) { 44774fd40c9SRandall Stewart if (errno != ENOENT) 44874fd40c9SRandall Stewart warn("sysctl: %s", mibvar); 44974fd40c9SRandall Stewart return; 45074fd40c9SRandall Stewart } 45174fd40c9SRandall Stewart if ((buf = malloc(len)) == 0) { 45274fd40c9SRandall Stewart warnx("malloc %lu bytes", (u_long)len); 45374fd40c9SRandall Stewart return; 45474fd40c9SRandall Stewart } 45574fd40c9SRandall Stewart if (sysctlbyname(mibvar, buf, &len, 0, 0) < 0) { 45674fd40c9SRandall Stewart warn("sysctl: %s", mibvar); 45774fd40c9SRandall Stewart free(buf); 45874fd40c9SRandall Stewart return; 45974fd40c9SRandall Stewart } 46074fd40c9SRandall Stewart 46174fd40c9SRandall Stewart xinpcb = (struct xsctp_inpcb *)(buf + offset); 46274fd40c9SRandall Stewart offset += sizeof(struct xsctp_inpcb); 46374fd40c9SRandall Stewart while (xinpcb->last == 0 && offset < len) { 46474fd40c9SRandall Stewart sctp_process_inpcb(xinpcb, name, buf, (const size_t)len, 46574fd40c9SRandall Stewart &offset); 46674fd40c9SRandall Stewart 46774fd40c9SRandall Stewart xinpcb = (struct xsctp_inpcb *)(buf + offset); 46874fd40c9SRandall Stewart offset += sizeof(struct xsctp_inpcb); 46974fd40c9SRandall Stewart } 47074fd40c9SRandall Stewart 47174fd40c9SRandall Stewart free(buf); 47274fd40c9SRandall Stewart } 47374fd40c9SRandall Stewart 47474fd40c9SRandall Stewart static void 47574fd40c9SRandall Stewart sctp_statesprint(uint32_t state) 47674fd40c9SRandall Stewart { 47774fd40c9SRandall Stewart int idx; 47874fd40c9SRandall Stewart 47974fd40c9SRandall Stewart switch (state) { 48074fd40c9SRandall Stewart case SCTP_STATE_COOKIE_WAIT: 48174fd40c9SRandall Stewart idx = NETSTAT_SCTP_STATES_COOKIE_WAIT; 48274fd40c9SRandall Stewart break; 48374fd40c9SRandall Stewart case SCTP_STATE_COOKIE_ECHOED: 48474fd40c9SRandall Stewart idx = NETSTAT_SCTP_STATES_COOKIE_ECHOED; 48574fd40c9SRandall Stewart break; 48674fd40c9SRandall Stewart case SCTP_STATE_OPEN: 48774fd40c9SRandall Stewart idx = NETSTAT_SCTP_STATES_ESTABLISHED; 48874fd40c9SRandall Stewart break; 48974fd40c9SRandall Stewart case SCTP_STATE_SHUTDOWN_SENT: 49074fd40c9SRandall Stewart idx = NETSTAT_SCTP_STATES_SHUTDOWN_SENT; 49174fd40c9SRandall Stewart break; 49274fd40c9SRandall Stewart case SCTP_STATE_SHUTDOWN_RECEIVED: 49374fd40c9SRandall Stewart idx = NETSTAT_SCTP_STATES_SHUTDOWN_RECEIVED; 49474fd40c9SRandall Stewart break; 49574fd40c9SRandall Stewart case SCTP_STATE_SHUTDOWN_ACK_SENT: 49674fd40c9SRandall Stewart idx = NETSTAT_SCTP_STATES_SHUTDOWN_ACK_SENT; 49774fd40c9SRandall Stewart break; 49874fd40c9SRandall Stewart case SCTP_STATE_SHUTDOWN_PENDING: 49974fd40c9SRandall Stewart idx = NETSTAT_SCTP_STATES_SHUTDOWN_PENDING; 50074fd40c9SRandall Stewart break; 50174fd40c9SRandall Stewart default: 50274fd40c9SRandall Stewart printf("UNKNOWN 0x%08x", state); 50374fd40c9SRandall Stewart return; 50474fd40c9SRandall Stewart } 50574fd40c9SRandall Stewart 50674fd40c9SRandall Stewart printf("%s", sctpstates[idx]); 50774fd40c9SRandall Stewart } 50874fd40c9SRandall Stewart 50974fd40c9SRandall Stewart /* 51074fd40c9SRandall Stewart * Dump SCTP statistics structure. 51174fd40c9SRandall Stewart */ 51274fd40c9SRandall Stewart void 513feda1a43SJohn Baldwin sctp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) 51474fd40c9SRandall Stewart { 51574fd40c9SRandall Stewart struct sctpstat sctpstat, zerostat; 51674fd40c9SRandall Stewart size_t len = sizeof(sctpstat); 51774fd40c9SRandall Stewart 518feda1a43SJohn Baldwin if (live) { 51974fd40c9SRandall Stewart if (zflag) 52074fd40c9SRandall Stewart memset(&zerostat, 0, len); 52174fd40c9SRandall Stewart if (sysctlbyname("net.inet.sctp.stats", &sctpstat, &len, 52274fd40c9SRandall Stewart zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { 52374fd40c9SRandall Stewart warn("sysctl: net.inet.sctp.stats"); 52474fd40c9SRandall Stewart return; 52574fd40c9SRandall Stewart } 526feda1a43SJohn Baldwin } else 527feda1a43SJohn Baldwin kread(off, &sctpstat, len); 52874fd40c9SRandall Stewart 52974fd40c9SRandall Stewart printf ("%s:\n", name); 53074fd40c9SRandall Stewart 53174fd40c9SRandall Stewart #define p(f, m) if (sctpstat.f || sflag <= 1) \ 532a3a60860SRandall Stewart printf(m, (uintmax_t)sctpstat.f, plural(sctpstat.f)) 53374fd40c9SRandall Stewart #define p1a(f, m) if (sctpstat.f || sflag <= 1) \ 534a3a60860SRandall Stewart printf(m, (uintmax_t)sctpstat.f) 53574fd40c9SRandall Stewart 53674fd40c9SRandall Stewart /* 53774fd40c9SRandall Stewart * input statistics 53874fd40c9SRandall Stewart */ 539a3a60860SRandall Stewart p(sctps_recvpackets, "\t%ju input packet%s\n"); 540a3a60860SRandall Stewart p(sctps_recvdatagrams, "\t\t%ju datagram%s\n"); 541a3a60860SRandall Stewart p(sctps_recvpktwithdata, "\t\t%ju packet%s that had data\n"); 542a3a60860SRandall Stewart p(sctps_recvsacks, "\t\t%ju input SACK chunk%s\n"); 543a3a60860SRandall Stewart p(sctps_recvdata, "\t\t%ju input DATA chunk%s\n"); 544a3a60860SRandall Stewart p(sctps_recvdupdata, "\t\t%ju duplicate DATA chunk%s\n"); 545a3a60860SRandall Stewart p(sctps_recvheartbeat, "\t\t%ju input HB chunk%s\n"); 546a3a60860SRandall Stewart p(sctps_recvheartbeatack, "\t\t%ju HB-ACK chunk%s\n"); 547a3a60860SRandall Stewart p(sctps_recvecne, "\t\t%ju input ECNE chunk%s\n"); 548a3a60860SRandall Stewart p(sctps_recvauth, "\t\t%ju input AUTH chunk%s\n"); 549a3a60860SRandall Stewart p(sctps_recvauthmissing, "\t\t%ju chunk%s missing AUTH\n"); 550a3a60860SRandall Stewart p(sctps_recvivalhmacid, "\t\t%ju invalid HMAC id%s received\n"); 551e5221e8bSRandall Stewart p(sctps_recvivalkeyid, "\t\t%ju invalid secret id%s received\n"); 552a3a60860SRandall Stewart p1a(sctps_recvauthfailed, "\t\t%ju auth failed\n"); 553e5221e8bSRandall Stewart p1a(sctps_recvexpress, "\t\t%ju fast path receives all one chunk\n"); 554e5221e8bSRandall Stewart p1a(sctps_recvexpressm, "\t\t%ju fast path multi-part data\n"); 55574fd40c9SRandall Stewart 55674fd40c9SRandall Stewart /* 55774fd40c9SRandall Stewart * output statistics 55874fd40c9SRandall Stewart */ 559a3a60860SRandall Stewart p(sctps_sendpackets, "\t%ju output packet%s\n"); 560a3a60860SRandall Stewart p(sctps_sendsacks, "\t\t%ju output SACK%s\n"); 561a3a60860SRandall Stewart p(sctps_senddata, "\t\t%ju output DATA chunk%s\n"); 562e5221e8bSRandall Stewart p(sctps_sendretransdata, "\t\t%ju retransmitted DATA chunk%s\n"); 563e5221e8bSRandall Stewart p(sctps_sendfastretrans, "\t\t%ju fast retransmitted DATA chunk%s\n"); 564a3a60860SRandall Stewart p(sctps_sendmultfastretrans, "\t\t%ju FR'%s that happened more " 5654db051c8SRandall Stewart "than once to same chunk\n"); 566a3a60860SRandall Stewart p(sctps_sendheartbeat, "\t\t%ju intput HB chunk%s\n"); 567a3a60860SRandall Stewart p(sctps_sendecne, "\t\t%ju output ECNE chunk%s\n"); 568a3a60860SRandall Stewart p(sctps_sendauth, "\t\t%ju output AUTH chunk%s\n"); 569a3a60860SRandall Stewart p1a(sctps_senderrors, "\t\t%ju ip_output error counter\n"); 57074fd40c9SRandall Stewart 57174fd40c9SRandall Stewart /* 57274fd40c9SRandall Stewart * PCKDROPREP statistics 57374fd40c9SRandall Stewart */ 574b8a1761eSRandall Stewart printf("\tPacket drop statistics:\n"); 575a3a60860SRandall Stewart p1a(sctps_pdrpfmbox, "\t\t%ju from middle box\n"); 576e5221e8bSRandall Stewart p1a(sctps_pdrpfehos, "\t\t%ju from end host\n"); 577a3a60860SRandall Stewart p1a(sctps_pdrpmbda, "\t\t%ju with data\n"); 578a3a60860SRandall Stewart p1a(sctps_pdrpmbct, "\t\t%ju non-data, non-endhost\n"); 579e5221e8bSRandall Stewart p1a(sctps_pdrpbwrpt, "\t\t%ju non-endhost, bandwidth rep only\n"); 580a3a60860SRandall Stewart p1a(sctps_pdrpcrupt, "\t\t%ju not enough for chunk header\n"); 581a3a60860SRandall Stewart p1a(sctps_pdrpnedat, "\t\t%ju not enough data to confirm\n"); 582e5221e8bSRandall Stewart p1a(sctps_pdrppdbrk, "\t\t%ju where process_chunk_drop said break\n"); 583a3a60860SRandall Stewart p1a(sctps_pdrptsnnf, "\t\t%ju failed to find TSN\n"); 584e5221e8bSRandall Stewart p1a(sctps_pdrpdnfnd, "\t\t%ju attempt reverse TSN lookup\n"); 585e5221e8bSRandall Stewart p1a(sctps_pdrpdiwnp, "\t\t%ju e-host confirms zero-rwnd\n"); 586e5221e8bSRandall Stewart p1a(sctps_pdrpdizrw, "\t\t%ju midbox confirms no space\n"); 587a3a60860SRandall Stewart p1a(sctps_pdrpbadd, "\t\t%ju data did not match TSN\n"); 588a3a60860SRandall Stewart p(sctps_pdrpmark, "\t\t%ju TSN'%s marked for Fast Retran\n"); 58974fd40c9SRandall Stewart 59074fd40c9SRandall Stewart /* 59174fd40c9SRandall Stewart * Timeouts 59274fd40c9SRandall Stewart */ 593b8a1761eSRandall Stewart printf("\tTimeouts:\n"); 594a3a60860SRandall Stewart p(sctps_timoiterator, "\t\t%ju iterator timer%s fired\n"); 595a3a60860SRandall Stewart p(sctps_timodata, "\t\t%ju T3 data time out%s\n"); 596a3a60860SRandall Stewart p(sctps_timowindowprobe, "\t\t%ju window probe (T3) timer%s fired\n"); 597a3a60860SRandall Stewart p(sctps_timoinit, "\t\t%ju INIT timer%s fired\n"); 598e5221e8bSRandall Stewart p(sctps_timosack, "\t\t%ju sack timer%s fired\n"); 599e5221e8bSRandall Stewart p(sctps_timoshutdown, "\t\t%ju shutdown timer%s fired\n"); 600a3a60860SRandall Stewart p(sctps_timoheartbeat, "\t\t%ju heartbeat timer%s fired\n"); 601a3a60860SRandall Stewart p1a(sctps_timocookie, "\t\t%ju a cookie timeout fired\n"); 602a3a60860SRandall Stewart p1a(sctps_timosecret, "\t\t%ju an endpoint changed its cookie" 603b8a1761eSRandall Stewart "secret\n"); 604a3a60860SRandall Stewart p(sctps_timopathmtu, "\t\t%ju PMTU timer%s fired\n"); 605e5221e8bSRandall Stewart p(sctps_timoshutdownack, "\t\t%ju shutdown ack timer%s fired\n"); 606e5221e8bSRandall Stewart p(sctps_timoshutdownguard, "\t\t%ju shutdown guard timer%s fired\n"); 607e5221e8bSRandall Stewart p(sctps_timostrmrst, "\t\t%ju stream reset timer%s fired\n"); 608a3a60860SRandall Stewart p(sctps_timoearlyfr, "\t\t%ju early FR timer%s fired\n"); 609a3a60860SRandall Stewart p1a(sctps_timoasconf, "\t\t%ju an asconf timer fired\n"); 610a3a60860SRandall Stewart p1a(sctps_timoautoclose, "\t\t%ju auto close timer fired\n"); 611e5221e8bSRandall Stewart p(sctps_timoassockill, "\t\t%ju asoc free timer%s expired\n"); 612a3a60860SRandall Stewart p(sctps_timoinpkill, "\t\t%ju inp free timer%s expired\n"); 61374fd40c9SRandall Stewart 61474fd40c9SRandall Stewart #if 0 61574fd40c9SRandall Stewart /* 61674fd40c9SRandall Stewart * Early fast retransmission counters 61774fd40c9SRandall Stewart */ 618e5221e8bSRandall Stewart p(sctps_earlyfrstart, "\t%ju TODO:sctps_earlyfrstart\n"); 619e5221e8bSRandall Stewart p(sctps_earlyfrstop, "\t%ju TODO:sctps_earlyfrstop\n"); 620e5221e8bSRandall Stewart p(sctps_earlyfrmrkretrans, "\t%ju TODO:sctps_earlyfrmrkretrans\n"); 621e5221e8bSRandall Stewart p(sctps_earlyfrstpout, "\t%ju TODO:sctps_earlyfrstpout\n"); 622e5221e8bSRandall Stewart p(sctps_earlyfrstpidsck1, "\t%ju TODO:sctps_earlyfrstpidsck1\n"); 623e5221e8bSRandall Stewart p(sctps_earlyfrstpidsck2, "\t%ju TODO:sctps_earlyfrstpidsck2\n"); 624e5221e8bSRandall Stewart p(sctps_earlyfrstpidsck3, "\t%ju TODO:sctps_earlyfrstpidsck3\n"); 625e5221e8bSRandall Stewart p(sctps_earlyfrstpidsck4, "\t%ju TODO:sctps_earlyfrstpidsck4\n"); 626e5221e8bSRandall Stewart p(sctps_earlyfrstrid, "\t%ju TODO:sctps_earlyfrstrid\n"); 627e5221e8bSRandall Stewart p(sctps_earlyfrstrout, "\t%ju TODO:sctps_earlyfrstrout\n"); 628e5221e8bSRandall Stewart p(sctps_earlyfrstrtmr, "\t%ju TODO:sctps_earlyfrstrtmr\n"); 62974fd40c9SRandall Stewart #endif 63074fd40c9SRandall Stewart 63174fd40c9SRandall Stewart /* 63274fd40c9SRandall Stewart * Others 63374fd40c9SRandall Stewart */ 634e5221e8bSRandall Stewart p1a(sctps_hdrops, "\t%ju packet shorter than header\n"); 635e5221e8bSRandall Stewart p1a(sctps_badsum, "\t%ju checksum error\n"); 636a3a60860SRandall Stewart p1a(sctps_noport, "\t%ju no endpoint for port\n"); 637a3a60860SRandall Stewart p1a(sctps_badvtag, "\t%ju bad v-tag\n"); 638a3a60860SRandall Stewart p1a(sctps_badsid, "\t%ju bad SID\n"); 639a3a60860SRandall Stewart p1a(sctps_nomem, "\t%ju no memory\n"); 640a3a60860SRandall Stewart p1a(sctps_fastretransinrtt, "\t%ju number of multiple FR in a RTT " 64174fd40c9SRandall Stewart "window\n"); 64274fd40c9SRandall Stewart #if 0 643e5221e8bSRandall Stewart p(sctps_markedretrans, "\t%ju TODO:sctps_markedretrans\n"); 64474fd40c9SRandall Stewart #endif 645e5221e8bSRandall Stewart p1a(sctps_naglesent, "\t%ju RFC813 allowed sending\n"); 646e5221e8bSRandall Stewart p1a(sctps_naglequeued, "\t%ju RFC813 does not allow sending\n"); 6474db051c8SRandall Stewart p1a(sctps_maxburstqueued, "\t%ju times max burst prohibited sending\n"); 648e5221e8bSRandall Stewart p1a(sctps_ifnomemqueued, "\t%ju look ahead tells us no memory in " 649b8a1761eSRandall Stewart "interface\n"); 650e5221e8bSRandall Stewart p(sctps_windowprobed, "\t%ju number%s of window probes sent\n"); 651a3a60860SRandall Stewart p(sctps_lowlevelerr, "\t%ju time%s an output error to clamp " 6524db051c8SRandall Stewart "down on next user send\n"); 653a3a60860SRandall Stewart p(sctps_lowlevelerrusr, "\t%ju time%s sctp_senderrors were " 654b8a1761eSRandall Stewart "caused from a user\n"); 655a3a60860SRandall Stewart p(sctps_datadropchklmt, "\t%ju number of in data drop%s due to " 65674fd40c9SRandall Stewart "chunk limit reached\n"); 657a3a60860SRandall Stewart p(sctps_datadroprwnd, "\t%ju number of in data drop%s due to rwnd " 65874fd40c9SRandall Stewart "limit reached\n"); 659a3a60860SRandall Stewart p(sctps_ecnereducedcwnd, "\t%ju time%s a ECN reduced " 66074fd40c9SRandall Stewart "the cwnd\n"); 661e5221e8bSRandall Stewart p1a(sctps_vtagexpress, "\t%ju used express lookup via vtag\n"); 6624db051c8SRandall Stewart p1a(sctps_vtagbogus, "\t%ju collision in express lookup\n"); 663a3a60860SRandall Stewart p(sctps_primary_randry, "\t%ju time%s the sender ran dry " 66474fd40c9SRandall Stewart "of user data on primary\n"); 665a3a60860SRandall Stewart p1a(sctps_cmt_randry, "\t%ju same for above\n"); 666a3a60860SRandall Stewart p(sctps_slowpath_sack, "\t%ju sack%s the slow way\n"); 667e5221e8bSRandall Stewart p(sctps_wu_sacks_sent, "\t%ju window update only sack%s sent\n"); 668e5221e8bSRandall Stewart p(sctps_sends_with_flags, "\t%ju send%s with sinfo_flags !=0\n"); 669e5221e8bSRandall Stewart p(sctps_sends_with_unord, "\t%ju unordered send%s\n"); 670e5221e8bSRandall Stewart p(sctps_sends_with_eof, "\t%ju send%s with EOF flag set\n"); 671e5221e8bSRandall Stewart p(sctps_sends_with_abort, "\t%ju send%s with ABORT flag set\n"); 672a3a60860SRandall Stewart p(sctps_protocol_drain_calls, "\t%ju time%s protocol drain called\n"); 673a3a60860SRandall Stewart p(sctps_protocol_drains_done, "\t%ju time%s we did a protocol " 674b8a1761eSRandall Stewart "drain\n"); 675a3a60860SRandall Stewart p(sctps_read_peeks, "\t%ju time%s recv was called with peek\n"); 676a3a60860SRandall Stewart p(sctps_cached_chk, "\t%ju cached chunk%s used\n"); 677e5221e8bSRandall Stewart p1a(sctps_cached_strmoq, "\t%ju cached stream oq's used\n"); 678e5221e8bSRandall Stewart p(sctps_left_abandon, "\t%ju unread message%s abandonded by close\n"); 679e5221e8bSRandall Stewart p1a(sctps_send_burst_avoid, "\t%ju send burst avoidance, already " 68074fd40c9SRandall Stewart "max burst inflight to net\n"); 681e5221e8bSRandall Stewart p1a(sctps_send_cwnd_avoid, "\t%ju send cwnd full avoidance, already " 682e5221e8bSRandall Stewart "max burst inflight to net\n"); 683a3a60860SRandall Stewart p(sctps_fwdtsn_map_over, "\t%ju number of map array over-run%s via " 68474fd40c9SRandall Stewart "fwd-tsn's\n"); 685b8a1761eSRandall Stewart 686b8a1761eSRandall Stewart #undef p 687b8a1761eSRandall Stewart #undef p1a 68874fd40c9SRandall Stewart } 68974fd40c9SRandall Stewart 69074fd40c9SRandall Stewart #endif /* SCTP */ 691