diff options
Diffstat (limited to 'usr.bin/netstat/sctp.c')
-rw-r--r-- | usr.bin/netstat/sctp.c | 438 |
1 files changed, 285 insertions, 153 deletions
diff --git a/usr.bin/netstat/sctp.c b/usr.bin/netstat/sctp.c index a2ef7d568..cdbbc49 100644 --- a/usr.bin/netstat/sctp.c +++ b/usr.bin/netstat/sctp.c @@ -58,9 +58,11 @@ __FBSDID("$FreeBSD$"); #include <stdint.h> #include <stdio.h> #include <stdlib.h> +#include <stdbool.h> #include <string.h> #include <unistd.h> #include "netstat.h" +#include <libxo/xo.h> #ifdef SCTP @@ -98,8 +100,8 @@ struct xladdr_entry { LIST_HEAD(xraddr_list, xraddr_entry) xraddr_head; struct xraddr_entry { - struct xsctp_raddr *xraddr; - LIST_ENTRY(xraddr_entry) xraddr_entries; + struct xsctp_raddr *xraddr; + LIST_ENTRY(xraddr_entry) xraddr_entries; }; /* @@ -192,12 +194,16 @@ inet6name(struct in6_addr *in6p) #endif static void -sctp_print_address(union sctp_sockstore *address, int port, int num_port) +sctp_print_address(const char *container, union sctp_sockstore *address, + int port, int num_port) { struct servent *sp = 0; char line[80], *cp; int width; + if (container) + xo_open_container(container); + switch (address->sa.sa_family) { #ifdef INET case AF_INET: @@ -221,7 +227,14 @@ sctp_print_address(union sctp_sockstore *address, int port, int num_port) else sprintf(cp, "%d ", ntohs((u_short)port)); width = Wflag ? 45 : 22; - printf("%-*.*s ", width, width, line); + xo_emit("{d:target/%-*.*s} ", width, width, line); + + int alen = cp - line - 1, plen = strlen(cp) - 1; + xo_emit("{e:address/%*.*s}{e:port/%*.*s}", alen, alen, line, plen, + plen, cp); + + if (container) + xo_close_container(container); } static int @@ -297,7 +310,7 @@ sctp_process_tcb(struct xsctp_tcb *xstcb, prev_xl = xl; xl = malloc(sizeof(struct xladdr_entry)); if (xl == NULL) { - warnx("malloc %lu bytes", + xo_warnx("malloc %lu bytes", (u_long)sizeof(struct xladdr_entry)); goto out; } @@ -318,7 +331,7 @@ sctp_process_tcb(struct xsctp_tcb *xstcb, prev_xr = xr; xr = malloc(sizeof(struct xraddr_entry)); if (xr == NULL) { - warnx("malloc %lu bytes", + xo_warnx("malloc %lu bytes", (u_long)sizeof(struct xraddr_entry)); goto out; } @@ -333,26 +346,29 @@ sctp_process_tcb(struct xsctp_tcb *xstcb, /* * Let's print the address infos. */ + xo_open_list("address"); xl = LIST_FIRST(&xladdr_head); xr = LIST_FIRST(&xraddr_head); x_max = (xl_total > xr_total) ? xl_total : xr_total; for (i = 0; i < x_max; i++) { + xo_open_instance("address"); + if (((*indent == 0) && i > 0) || *indent > 0) - printf("%-12s ", " "); + xo_emit("{P:/%-12s} ", " "); if (xl != NULL) { - sctp_print_address(&(xl->xladdr->address), + sctp_print_address("local", &(xl->xladdr->address), htons(xstcb->local_port), numeric_port); } else { if (Wflag) { - printf("%-45s ", " "); + xo_emit("{P:/%-45s} ", " "); } else { - printf("%-22s ", " "); + xo_emit("{P:/%-22s} ", " "); } } if (xr != NULL && !Lflag) { - sctp_print_address(&(xr->xraddr->address), + sctp_print_address("remote", &(xr->xraddr->address), htons(xstcb->remote_port), numeric_port); } @@ -365,7 +381,8 @@ sctp_process_tcb(struct xsctp_tcb *xstcb, sctp_statesprint(xstcb->state); if (i < x_max) - putchar('\n'); + xo_emit("\n"); + xo_close_instance("address"); } out: @@ -404,23 +421,26 @@ sctp_process_inpcb(struct xsctp_inpcb *xinpcb, if (first) { if (!Lflag) { - printf("Active SCTP associations"); + xo_emit("Active SCTP associations"); if (aflag) - printf(" (including servers)"); + xo_emit(" (including servers)"); } else - printf("Current listen queue sizes (qlen/maxqlen)"); - putchar('\n'); + xo_emit("Current listen queue sizes (qlen/maxqlen)"); + xo_emit("\n"); if (Lflag) - printf("%-6.6s %-5.5s %-8.8s %-22.22s\n", + xo_emit("{T:/%-6.6s} {T:/%-5.5s} {T:/%-8.8s} " + "{T:/%-22.22s}\n", "Proto", "Type", "Listen", "Local Address"); else if (Wflag) - printf("%-6.6s %-5.5s %-45.45s %-45.45s %s\n", + xo_emit("{T:/%-6.6s} {T:/%-5.5s} {T:/%-45.45s} " + "{T:/%-45.45s} {T:/%s}\n", "Proto", "Type", "Local Address", "Foreign Address", "(state)"); else - printf("%-6.6s %-5.5s %-22.22s %-22.22s %s\n", + xo_emit("{T:/%-6.6s} {T:/%-5.5s} {T:/%-22.22s} " + "{T:/%-22.22s} {T:/%s}\n", "Proto", "Type", "Local Address", "Foreign Address", "(state)"); @@ -450,27 +470,38 @@ sctp_process_inpcb(struct xsctp_inpcb *xinpcb, char buf1[9]; snprintf(buf1, 9, "%hu/%hu", xinpcb->qlen, xinpcb->maxqlen); - printf("%-6.6s %-5.5s ", pname, tname); - printf("%-8.8s ", buf1); + xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ", + pname, tname); + xo_emit("{d:queues/%-8.8s}{e:queue-len/%hu}" + "{e:max-queue-len/%hu} ", + buf1, xinpcb->qlen, xinpcb->maxqlen); } offset_laddr = *offset; process_closed = 0; + + xo_open_list("local-address"); retry: while (*offset < buflen) { xladdr = (struct xsctp_laddr *)(buf + *offset); *offset += sizeof(struct xsctp_laddr); if (xladdr->last) { if (aflag && !Lflag && (xladdr_total == 0) && process_closed) { - printf("%-6.6s %-5.5s ", pname, tname); + xo_open_instance("local-address"); + + xo_emit("{:protocol/%-6.6s/%s} " + "{:type/%-5.5s/%s} ", pname, tname); if (Wflag) { - printf("%-91.91s CLOSED", " "); + xo_emit("{P:/%-91.91s/%s} " + "{:state/CLOSED}", " "); } else { - printf("%-45.45s CLOSED", " "); + xo_emit("{P:/%-45.45s/%s} " + "{:state/CLOSED}", " "); } + xo_close_instance("local-address"); } if (process_closed || is_listening) { - putchar('\n'); + xo_emit("\n"); } break; } @@ -478,31 +509,39 @@ retry: if (!Lflag && !is_listening && !process_closed) continue; + xo_open_instance("local-address"); + if (xladdr_total == 0) { - printf("%-6.6s %-5.5s ", pname, tname); + xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ", + pname, tname); } else { - putchar('\n'); - printf((Lflag) ? - "%-21.21s " : "%-12.12s ", " "); + xo_emit("\n"); + xo_emit(Lflag ? "{P:/%-21.21s} " : "{P:/%-12.12s} ", + " "); } - sctp_print_address(&(xladdr->address), + sctp_print_address("local", &(xladdr->address), htons(xinpcb->local_port), numeric_port); if (aflag && !Lflag && xladdr_total == 0) { if (Wflag) { if (process_closed) { - printf("%-45.45s CLOSED", " "); + xo_emit("{P:/%-45.45s} " + "{:state/CLOSED}", " "); } else { - printf("%-45.45s LISTEN", " "); + xo_emit("{P:/%-45.45s} " + "{:state:LISTEN}", " "); } } else { if (process_closed) { - printf("%-22.22s CLOSED", " "); + xo_emit("{P:/%-22.22s} " + "{:state/CLOSED}", " "); } else { - printf("%-22.22s LISTEN", " "); + xo_emit("{P:/%-22.22s} " + "{:state/LISTEN}", " "); } } } xladdr_total++; + xo_close_instance("local-address"); } xstcb = (struct xsctp_tcb *)(buf + *offset); @@ -513,12 +552,15 @@ retry: goto retry; } while (xstcb->last == 0 && *offset < buflen) { - printf("%-6.6s %-5.5s ", pname, tname); + xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ", + pname, tname); sctp_process_tcb(xstcb, buf, buflen, offset, &indent); indent++; xstcb = (struct xsctp_tcb *)(buf + *offset); *offset += sizeof(struct xsctp_tcb); } + + xo_close_list("local-address"); } /* @@ -540,15 +582,15 @@ sctp_protopr(u_long off __unused, if (sysctlbyname(mibvar, 0, &len, 0, 0) < 0) { if (errno != ENOENT) - warn("sysctl: %s", mibvar); + xo_warn("sysctl: %s", mibvar); return; } if ((buf = malloc(len)) == 0) { - warnx("malloc %lu bytes", (u_long)len); + xo_warnx("malloc %lu bytes", (u_long)len); return; } if (sysctlbyname(mibvar, buf, &len, 0, 0) < 0) { - warn("sysctl: %s", mibvar); + xo_warn("sysctl: %s", mibvar); free(buf); return; } @@ -594,11 +636,11 @@ sctp_statesprint(uint32_t state) idx = NETSTAT_SCTP_STATES_SHUTDOWN_PENDING; break; default: - printf("UNKNOWN 0x%08x", state); + xo_emit("UNKNOWN {:state/0x%08x}", state); return; } - printf("%s", sctpstates[idx]); + xo_emit("{:state/%s}", sctpstates[idx]); } /* @@ -616,96 +658,160 @@ sctp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) if (sysctlbyname("net.inet.sctp.stats", &sctpstat, &len, zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { if (errno != ENOENT) - warn("sysctl: net.inet.sctp.stats"); + xo_warn("sysctl: net.inet.sctp.stats"); return; } } else kread(off, &sctpstat, len); - printf ("%s:\n", name); + xo_open_container(name); + xo_emit("{T:/%s}:\n", name); #define p(f, m) if (sctpstat.f || sflag <= 1) \ - printf(m, (uintmax_t)sctpstat.f, plural(sctpstat.f)) + xo_emit(m, (uintmax_t)sctpstat.f, plural(sctpstat.f)) #define p1a(f, m) if (sctpstat.f || sflag <= 1) \ - printf(m, (uintmax_t)sctpstat.f) + xo_emit(m, (uintmax_t)sctpstat.f) /* * input statistics */ - p(sctps_recvpackets, "\t%ju input packet%s\n"); - p(sctps_recvdatagrams, "\t\t%ju datagram%s\n"); - p(sctps_recvpktwithdata, "\t\t%ju packet%s that had data\n"); - p(sctps_recvsacks, "\t\t%ju input SACK chunk%s\n"); - p(sctps_recvdata, "\t\t%ju input DATA chunk%s\n"); - p(sctps_recvdupdata, "\t\t%ju duplicate DATA chunk%s\n"); - p(sctps_recvheartbeat, "\t\t%ju input HB chunk%s\n"); - p(sctps_recvheartbeatack, "\t\t%ju HB-ACK chunk%s\n"); - p(sctps_recvecne, "\t\t%ju input ECNE chunk%s\n"); - p(sctps_recvauth, "\t\t%ju input AUTH chunk%s\n"); - p(sctps_recvauthmissing, "\t\t%ju chunk%s missing AUTH\n"); - p(sctps_recvivalhmacid, "\t\t%ju invalid HMAC id%s received\n"); - p(sctps_recvivalkeyid, "\t\t%ju invalid secret id%s received\n"); - p1a(sctps_recvauthfailed, "\t\t%ju auth failed\n"); - p1a(sctps_recvexpress, "\t\t%ju fast path receives all one chunk\n"); - p1a(sctps_recvexpressm, "\t\t%ju fast path multi-part data\n"); + p(sctps_recvpackets, "\t{:received-packets/%ju} " + "{N:/input packet%s}\n"); + p(sctps_recvdatagrams, "\t\t{:received-datagrams/%ju} " + "{N:/datagram%s}\n"); + p(sctps_recvpktwithdata, "\t\t{:received-with-data/%ju} " + "{N:/packet%s that had data}\n"); + p(sctps_recvsacks, "\t\t{:received-sack-chunks/%ju} " + "{N:/input SACK chunk%s}\n"); + p(sctps_recvdata, "\t\t{:received-data-chunks/%ju} " + "{N:/input DATA chunk%s}\n"); + p(sctps_recvdupdata, "\t\t{:received-duplicate-data-chunks/%ju} " + "{N:/duplicate DATA chunk%s}\n"); + p(sctps_recvheartbeat, "\t\t{:received-hb-chunks/%ju} " + "{N:/input HB chunk%s}\n"); + p(sctps_recvheartbeatack, "\t\t{:received-hb-ack-chunks/%ju} " + "{N:/HB-ACK chunk%s}\n"); + p(sctps_recvecne, "\t\t{:received-ecne-chunks/%ju} " + "{N:/input ECNE chunk%s}\n"); + p(sctps_recvauth, "\t\t{:received-auth-chunks/%ju} " + "{N:/input AUTH chunk%s}\n"); + p(sctps_recvauthmissing, "\t\t{:dropped-missing-auth/%ju} " + "{N:/chunk%s missing AUTH}\n"); + p(sctps_recvivalhmacid, "\t\t{:dropped-invalid-hmac/%ju} " + "{N:/invalid HMAC id%s received}\n"); + p(sctps_recvivalkeyid, "\t\t{:dropped-invalid-secret/%ju} " + "{N:/invalid secret id%s received}\n"); + p1a(sctps_recvauthfailed, "\t\t{:dropped-auth-failed/%ju} " + "{N:/auth failed}\n"); + p1a(sctps_recvexpress, "\t\t{:received-fast-path/%ju} " + "{N:/fast path receives all one chunk}\n"); + p1a(sctps_recvexpressm, "\t\t{:receives-fast-path-multipart/%ju} " + "{N:/fast path multi-part data}\n"); /* * output statistics */ - p(sctps_sendpackets, "\t%ju output packet%s\n"); - p(sctps_sendsacks, "\t\t%ju output SACK%s\n"); - p(sctps_senddata, "\t\t%ju output DATA chunk%s\n"); - p(sctps_sendretransdata, "\t\t%ju retransmitted DATA chunk%s\n"); - p(sctps_sendfastretrans, "\t\t%ju fast retransmitted DATA chunk%s\n"); - p(sctps_sendmultfastretrans, "\t\t%ju FR'%s that happened more " - "than once to same chunk\n"); - p(sctps_sendheartbeat, "\t\t%ju output HB chunk%s\n"); - p(sctps_sendecne, "\t\t%ju output ECNE chunk%s\n"); - p(sctps_sendauth, "\t\t%ju output AUTH chunk%s\n"); - p1a(sctps_senderrors, "\t\t%ju ip_output error counter\n"); + p(sctps_sendpackets, "\t{:sent-packets/%ju} " + "{N:/output packet%s}\n"); + p(sctps_sendsacks, "\t\t{:sent-sacks/%ju} " + "{N:/output SACK%s}\n"); + p(sctps_senddata, "\t\t{:sent-data-chunks/%ju} " + "{N:/output DATA chunk%s}\n"); + p(sctps_sendretransdata, "\t\t{:sent-retransmitted-data-chunks/%ju} " + "{N:/retransmitted DATA chunk%s}\n"); + p(sctps_sendfastretrans, "\t\t" + "{:sent-fast-retransmitted-data-chunks/%ju} " + "{N:/fast retransmitted DATA chunk%s}\n"); + p(sctps_sendmultfastretrans, "\t\t" + "{:sent-fast-retransmitted-data-chunk-multiple-times/%ju} " + "{N:/FR'%s that happened more than once to same chunk}\n"); + p(sctps_sendheartbeat, "\t\t{:sent-hb-chunks/%ju} " + "{N:/output HB chunk%s}\n"); + p(sctps_sendecne, "\t\t{:sent-ecne-chunks/%ju} " + "{N:/output ECNE chunk%s}\n"); + p(sctps_sendauth, "\t\t{:sent-auth-chunks/%ju} " + "{N:/output AUTH chunk%s}\n"); + p1a(sctps_senderrors, "\t\t{:send-errors/%ju} " + "{N:/ip_output error counter}\n"); /* * PCKDROPREP statistics */ - printf("\tPacket drop statistics:\n"); - p1a(sctps_pdrpfmbox, "\t\t%ju from middle box\n"); - p1a(sctps_pdrpfehos, "\t\t%ju from end host\n"); - p1a(sctps_pdrpmbda, "\t\t%ju with data\n"); - p1a(sctps_pdrpmbct, "\t\t%ju non-data, non-endhost\n"); - p1a(sctps_pdrpbwrpt, "\t\t%ju non-endhost, bandwidth rep only\n"); - p1a(sctps_pdrpcrupt, "\t\t%ju not enough for chunk header\n"); - p1a(sctps_pdrpnedat, "\t\t%ju not enough data to confirm\n"); - p1a(sctps_pdrppdbrk, "\t\t%ju where process_chunk_drop said break\n"); - p1a(sctps_pdrptsnnf, "\t\t%ju failed to find TSN\n"); - p1a(sctps_pdrpdnfnd, "\t\t%ju attempt reverse TSN lookup\n"); - p1a(sctps_pdrpdiwnp, "\t\t%ju e-host confirms zero-rwnd\n"); - p1a(sctps_pdrpdizrw, "\t\t%ju midbox confirms no space\n"); - p1a(sctps_pdrpbadd, "\t\t%ju data did not match TSN\n"); - p(sctps_pdrpmark, "\t\t%ju TSN'%s marked for Fast Retran\n"); + xo_emit("\t{T:Packet drop statistics}:\n"); + xo_open_container("drop-statistics"); + p1a(sctps_pdrpfmbox, "\t\t{:middle-box/%ju} " + "{N:/from middle box}\n"); + p1a(sctps_pdrpfehos, "\t\t{:end-host/%ju} " + "{N:/from end host}\n"); + p1a(sctps_pdrpmbda, "\t\t{:with-data/%ju} " + "{N:/with data}\n"); + p1a(sctps_pdrpmbct, "\t\t{:non-data/%ju} " + "{N:/non-data, non-endhost}\n"); + p1a(sctps_pdrpbwrpt, "\t\t{:non-endhost/%ju} " + "{N:/non-endhost, bandwidth rep only}\n"); + p1a(sctps_pdrpcrupt, "\t\t{:short-header/%ju} " + "{N:/not enough for chunk header}\n"); + p1a(sctps_pdrpnedat, "\t\t{:short-data/%ju} " + "{N:/not enough data to confirm}\n"); + p1a(sctps_pdrppdbrk, "\t\t{:chunk-break/%ju} " + "{N:/where process_chunk_drop said break}\n"); + p1a(sctps_pdrptsnnf, "\t\t{:tsn-not-found/%ju} " + "{N:/failed to find TSN}\n"); + p1a(sctps_pdrpdnfnd, "\t\t{:reverse-tsn/%ju} " + "{N:/attempt reverse TSN lookup}\n"); + p1a(sctps_pdrpdiwnp, "\t\t{:confirmed-zero-window/%ju} " + "{N:/e-host confirms zero-rwnd}\n"); + p1a(sctps_pdrpdizrw, "\t\t{:middle-box-no-space/%ju} " + "{N:/midbox confirms no space}\n"); + p1a(sctps_pdrpbadd, "\t\t{:bad-data/%ju} " + "{N:/data did not match TSN}\n"); + p(sctps_pdrpmark, "\t\t{:tsn-marked-fast-retransmission/%ju} " + "{N:/TSN'%s marked for Fast Retran}\n"); + xo_close_container("drop-statistics"); /* * Timeouts */ - printf("\tTimeouts:\n"); - p(sctps_timoiterator, "\t\t%ju iterator timer%s fired\n"); - p(sctps_timodata, "\t\t%ju T3 data time out%s\n"); - p(sctps_timowindowprobe, "\t\t%ju window probe (T3) timer%s fired\n"); - p(sctps_timoinit, "\t\t%ju INIT timer%s fired\n"); - p(sctps_timosack, "\t\t%ju sack timer%s fired\n"); - p(sctps_timoshutdown, "\t\t%ju shutdown timer%s fired\n"); - p(sctps_timoheartbeat, "\t\t%ju heartbeat timer%s fired\n"); - p1a(sctps_timocookie, "\t\t%ju a cookie timeout fired\n"); - p1a(sctps_timosecret, "\t\t%ju an endpoint changed its cookie" + xo_emit("\t{T:Timeouts}:\n"); + xo_open_container("timeouts"); + p(sctps_timoiterator, "\t\t{:iterator/%ju} " + "{N:/iterator timer%s fired}\n"); + p(sctps_timodata, "\t\t{:t3-data/%ju} " + "{N:/T3 data time out%s}\n"); + p(sctps_timowindowprobe, "\t\t{:window-probe/%ju} " + "{N:/window probe (T3) timer%s fired}\n"); + p(sctps_timoinit, "\t\t{:init-timer/%ju} " + "{N:/INIT timer%s fired}\n"); + p(sctps_timosack, "\t\t{:sack-timer/%ju} " + "{N:/sack timer%s fired}\n"); + p(sctps_timoshutdown, "\t\t{:shutdown-timer/%ju} " + "{N:/shutdown timer%s fired}\n"); + p(sctps_timoheartbeat, "\t\t{:heartbeat-timer/%ju} " + "{N:/heartbeat timer%s fired}\n"); + p1a(sctps_timocookie, "\t\t{:cookie-timer/%ju} " + "{N:/a cookie timeout fired}\n"); + p1a(sctps_timosecret, "\t\t{:endpoint-changed-cookie/%ju} " + "{N:/an endpoint changed its cook}ie" "secret\n"); - p(sctps_timopathmtu, "\t\t%ju PMTU timer%s fired\n"); - p(sctps_timoshutdownack, "\t\t%ju shutdown ack timer%s fired\n"); - p(sctps_timoshutdownguard, "\t\t%ju shutdown guard timer%s fired\n"); - p(sctps_timostrmrst, "\t\t%ju stream reset timer%s fired\n"); - p(sctps_timoearlyfr, "\t\t%ju early FR timer%s fired\n"); - p1a(sctps_timoasconf, "\t\t%ju an asconf timer fired\n"); - p1a(sctps_timoautoclose, "\t\t%ju auto close timer fired\n"); - p(sctps_timoassockill, "\t\t%ju asoc free timer%s expired\n"); - p(sctps_timoinpkill, "\t\t%ju inp free timer%s expired\n"); + p(sctps_timopathmtu, "\t\t{:pmtu-timer/%ju} " + "{N:/PMTU timer%s fired}\n"); + p(sctps_timoshutdownack, "\t\t{:shutdown-timer/%ju} " + "{N:/shutdown ack timer%s fired}\n"); + p(sctps_timoshutdownguard, "\t\t{:shutdown-guard-timer/%ju} " + "{N:/shutdown guard timer%s fired}\n"); + p(sctps_timostrmrst, "\t\t{:stream-reset-timer/%ju} " + "{N:/stream reset timer%s fired}\n"); + p(sctps_timoearlyfr, "\t\t{:early-fast-retransmission-timer/%ju} " + "{N:/early FR timer%s fired}\n"); + p1a(sctps_timoasconf, "\t\t{:asconf-timer/%ju} " + "{N:/an asconf timer fired}\n"); + p1a(sctps_timoautoclose, "\t\t{:auto-close-timer/%ju} " + "{N:/auto close timer fired}\n"); + p(sctps_timoassockill, "\t\t{:asoc-free-timer/%ju} " + "{N:/asoc free timer%s expired}\n"); + p(sctps_timoinpkill, "\t\t{:input-free-timer/%ju} " + "{N:/inp free timer%s expired}\n"); + xo_close_container("timeouts"); #if 0 /* @@ -727,60 +833,86 @@ sctp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) /* * Others */ - p1a(sctps_hdrops, "\t%ju packet shorter than header\n"); - p1a(sctps_badsum, "\t%ju checksum error\n"); - p1a(sctps_noport, "\t%ju no endpoint for port\n"); - p1a(sctps_badvtag, "\t%ju bad v-tag\n"); - p1a(sctps_badsid, "\t%ju bad SID\n"); - p1a(sctps_nomem, "\t%ju no memory\n"); - p1a(sctps_fastretransinrtt, "\t%ju number of multiple FR in a RTT " - "window\n"); + p1a(sctps_hdrops, "\t{:dropped-too-short/%ju} " + "{N:/packet shorter than header}\n"); + p1a(sctps_badsum, "\t{:dropped-bad-checksum/%ju} " + "{N:/checksum error}\n"); + p1a(sctps_noport, "\t{:dropped-no-endpoint/%ju} " + "{N:/no endpoint for port}\n"); + p1a(sctps_badvtag, "\t{:dropped-bad-v-tag/%ju} " + "{N:/bad v-tag}\n"); + p1a(sctps_badsid, "\t{:dropped-bad-sid/%ju} " + "{N:/bad SID}\n"); + p1a(sctps_nomem, "\t{:dropped-no-memory/%ju} " + "{N:/no memory}\n"); + p1a(sctps_fastretransinrtt, "\t{:multiple-fast-retransmits-in-rtt/%ju} " + "{N:/number of multiple FR in a RT}T window\n"); #if 0 p(sctps_markedretrans, "\t%ju TODO:sctps_markedretrans\n"); #endif - p1a(sctps_naglesent, "\t%ju RFC813 allowed sending\n"); - p1a(sctps_naglequeued, "\t%ju RFC813 does not allow sending\n"); - p1a(sctps_maxburstqueued, "\t%ju times max burst prohibited sending\n"); - p1a(sctps_ifnomemqueued, "\t%ju look ahead tells us no memory in " - "interface\n"); - p(sctps_windowprobed, "\t%ju number%s of window probes sent\n"); - p(sctps_lowlevelerr, "\t%ju time%s an output error to clamp " - "down on next user send\n"); - p(sctps_lowlevelerrusr, "\t%ju time%s sctp_senderrors were " - "caused from a user\n"); - p(sctps_datadropchklmt, "\t%ju number of in data drop%s due to " - "chunk limit reached\n"); - p(sctps_datadroprwnd, "\t%ju number of in data drop%s due to rwnd " - "limit reached\n"); - p(sctps_ecnereducedcwnd, "\t%ju time%s a ECN reduced " - "the cwnd\n"); - p1a(sctps_vtagexpress, "\t%ju used express lookup via vtag\n"); - p1a(sctps_vtagbogus, "\t%ju collision in express lookup\n"); - p(sctps_primary_randry, "\t%ju time%s the sender ran dry " - "of user data on primary\n"); - p1a(sctps_cmt_randry, "\t%ju same for above\n"); - p(sctps_slowpath_sack, "\t%ju sack%s the slow way\n"); - p(sctps_wu_sacks_sent, "\t%ju window update only sack%s sent\n"); - p(sctps_sends_with_flags, "\t%ju send%s with sinfo_flags !=0\n"); - p(sctps_sends_with_unord, "\t%ju unordered send%s\n"); - p(sctps_sends_with_eof, "\t%ju send%s with EOF flag set\n"); - p(sctps_sends_with_abort, "\t%ju send%s with ABORT flag set\n"); - p(sctps_protocol_drain_calls, "\t%ju time%s protocol drain called\n"); - p(sctps_protocol_drains_done, "\t%ju time%s we did a protocol " - "drain\n"); - p(sctps_read_peeks, "\t%ju time%s recv was called with peek\n"); - p(sctps_cached_chk, "\t%ju cached chunk%s used\n"); - p1a(sctps_cached_strmoq, "\t%ju cached stream oq's used\n"); - p(sctps_left_abandon, "\t%ju unread message%s abandonded by close\n"); - p1a(sctps_send_burst_avoid, "\t%ju send burst avoidance, already " - "max burst inflight to net\n"); - p1a(sctps_send_cwnd_avoid, "\t%ju send cwnd full avoidance, already " - "max burst inflight to net\n"); - p(sctps_fwdtsn_map_over, "\t%ju number of map array over-run%s via " - "fwd-tsn's\n"); + p1a(sctps_naglesent, "\t{:rfc813-sent/%ju} " + "{N:/RFC813 allowed sending}\n"); + p1a(sctps_naglequeued, "\t{:rfc813-queued/%ju} " + "{N:/RFC813 does not allow sending}\n"); + p1a(sctps_maxburstqueued, "\t{:max-burst-queued/%ju} " + "{N:/times max burst prohibited sending}\n"); + p1a(sctps_ifnomemqueued, "\t{:no-memory-in-interface/%ju} " + "{N:/look ahead tells us no memory in interface}\n"); + p(sctps_windowprobed, "\t{:sent-window-probes/%ju} " + "{N:/number%s of window probes sent}\n"); + p(sctps_lowlevelerr, "\t{:low-level-err/%ju} " + "{N:/time%s an output error to clamp down on next user send}\n"); + p(sctps_lowlevelerrusr, "\t{:low-level-user-error/%ju} " + "{N:/time%s sctp_senderrors were caused from a user}\n"); + p(sctps_datadropchklmt, "\t{:dropped-chunk-limit/%ju} " + "{N:/number of in data drop%s due to chunk limit reached}\n"); + p(sctps_datadroprwnd, "\t{:dropped-rwnd-limit/%ju} " + "{N:/number of in data drop%s due to rwnd limit reached}\n"); + p(sctps_ecnereducedcwnd, "\t{:ecn-reduced-cwnd/%ju} " + "{N:/time%s a ECN reduced the cwnd}\n"); + p1a(sctps_vtagexpress, "\t{:v-tag-express-lookup/%ju} " + "{N:/used express lookup via vtag}\n"); + p1a(sctps_vtagbogus, "\t{:v-tag-collision/%ju} " + "{N:/collision in express lookup}\n"); + p(sctps_primary_randry, "\t{:sender-ran-dry/%ju} " + "{N:/time%s the sender ran dry of user data on primary}\n"); + p1a(sctps_cmt_randry, "\t{:cmt-ran-dry/%ju} " + "{N:/same for above}\n"); + p(sctps_slowpath_sack, "\t{:slow-path-sack/%ju} " + "{N:/sack%s the slow way}\n"); + p(sctps_wu_sacks_sent, "\t{:sent-window-update-only-sack/%ju} " + "{N:/window update only sack%s sent}\n"); + p(sctps_sends_with_flags, "\t{:sent-with-sinfo/%ju} " + "{N:/send%s with sinfo_flags !=0}\n"); + p(sctps_sends_with_unord, "\t{:sent-with-unordered/%ju} " + "{N:/unordered send%s}\n"); + p(sctps_sends_with_eof, "\t{:sent-with-eof/%ju} " + "{N:/send%s with EOF flag set}\n"); + p(sctps_sends_with_abort, "\t{:sent-with-abort/%ju} " + "{N:/send%s with ABORT flag set}\n"); + p(sctps_protocol_drain_calls, "\t{:protocol-drain-called/%ju} " + "{N:/time%s protocol drain called}\n"); + p(sctps_protocol_drains_done, "\t{:protocol-drain/%ju} " + "{N:/time%s we did a protocol drain}\n"); + p(sctps_read_peeks, "\t{:read-with-peek/%ju} " + "{N:/time%s recv was called with peek}\n"); + p(sctps_cached_chk, "\t{:cached-chunks/%ju} " + "{N:/cached chunk%s used}\n"); + p1a(sctps_cached_strmoq, "\t{:cached-output-queue-used/%ju} " + "{N:/cached stream oq's used}\n"); + p(sctps_left_abandon, "\t{:messages-abandoned/%ju} " + "{N:/unread message%s abandonded by close}\n"); + p1a(sctps_send_burst_avoid, "\t{:send-burst-avoidance/%ju} " + "{N:/send burst avoidance, already max burst inflight to net}\n"); + p1a(sctps_send_cwnd_avoid, "\t{:send-cwnd-avoidance/%ju} " + "{N:/send cwnd full avoidance, already max burst inflight " + "to net}\n"); + p(sctps_fwdtsn_map_over, "\t{:tsn-map-overruns/%ju} " + "{N:/number of map array over-run%s via fwd-tsn's}\n"); #undef p #undef p1a + xo_close_container(name); } #endif /* SCTP */ |