2 * SPDX-License-Identifier: BSD-3-Clause
4 * Copyright (c) 2001-2007, by Weongyo Jeong. All rights reserved.
5 * Copyright (c) 2011, by Michael Tuexen. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
10 * a) Redistributions of source code must retain the above copyright notice,
11 * this list of conditions and the following disclaimer.
13 * b) Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the distribution.
17 * c) Neither the name of Cisco Systems, Inc. nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
34 #include <sys/param.h>
35 #include <sys/queue.h>
36 #include <sys/types.h>
37 #include <sys/socket.h>
38 #include <sys/socketvar.h>
39 #include <sys/sysctl.h>
40 #include <sys/protosw.h>
42 #include <netinet/in.h>
43 #include <netinet/sctp.h>
44 #include <netinet/sctp_constants.h>
45 #include <arpa/inet.h>
62 static void sctp_statesprint(uint32_t state);
64 #define NETSTAT_SCTP_STATES_CLOSED 0x0
65 #define NETSTAT_SCTP_STATES_BOUND 0x1
66 #define NETSTAT_SCTP_STATES_LISTEN 0x2
67 #define NETSTAT_SCTP_STATES_COOKIE_WAIT 0x3
68 #define NETSTAT_SCTP_STATES_COOKIE_ECHOED 0x4
69 #define NETSTAT_SCTP_STATES_ESTABLISHED 0x5
70 #define NETSTAT_SCTP_STATES_SHUTDOWN_SENT 0x6
71 #define NETSTAT_SCTP_STATES_SHUTDOWN_RECEIVED 0x7
72 #define NETSTAT_SCTP_STATES_SHUTDOWN_ACK_SENT 0x8
73 #define NETSTAT_SCTP_STATES_SHUTDOWN_PENDING 0x9
75 static const char *sctpstates[] = {
88 static LIST_HEAD(xladdr_list, xladdr_entry) xladdr_head;
90 struct xsctp_laddr *xladdr;
91 LIST_ENTRY(xladdr_entry) xladdr_entries;
94 static LIST_HEAD(xraddr_list, xraddr_entry) xraddr_head;
96 struct xsctp_raddr *xraddr;
97 LIST_ENTRY(xraddr_entry) xraddr_entries;
101 sctp_print_address(const char *container, union sctp_sockstore *address,
102 int port, int num_port)
104 struct servent *sp = 0;
110 xo_open_container(container);
112 switch (address->sa.sa_family) {
115 snprintf(line, sizeof(line), "%.*s.",
116 Wflag ? 39 : 16, inetname(&address->sin.sin_addr));
121 snprintf(line, sizeof(line), "%.*s.",
122 Wflag ? 39 : 16, inet6name(&address->sin6.sin6_addr));
126 snprintf(line, sizeof(line), "%.*s.",
127 Wflag ? 39 : 16, "");
132 if (!num_port && port)
133 sp = getservbyport((int)port, "sctp");
135 snprintf(cp, sizeof(line) - alen,
136 "%.15s ", sp ? sp->s_name : "*");
138 snprintf(cp, sizeof(line) - alen,
139 "%d ", ntohs((u_short)port));
140 width = Wflag ? 45 : 22;
141 xo_emit("{d:target/%-*.*s} ", width, width, line);
143 plen = strlen(cp) - 1;
145 xo_emit("{e:address/%*.*s}{e:port/%*.*s}", alen, alen, line, plen,
149 xo_close_container(container);
153 sctp_skip_xinpcb_ifneed(char *buf, const size_t buflen, size_t *offset)
156 struct xsctp_tcb *xstcb;
157 struct xsctp_raddr *xraddr;
158 struct xsctp_laddr *xladdr;
160 while (*offset < buflen) {
161 xladdr = (struct xsctp_laddr *)(buf + *offset);
162 *offset += sizeof(struct xsctp_laddr);
163 if (xladdr->last == 1)
167 while (*offset < buflen) {
168 xstcb = (struct xsctp_tcb *)(buf + *offset);
169 *offset += sizeof(struct xsctp_tcb);
170 if (xstcb->last == 1)
175 while (*offset < buflen) {
176 xladdr = (struct xsctp_laddr *)(buf + *offset);
177 *offset += sizeof(struct xsctp_laddr);
178 if (xladdr->last == 1)
182 while (*offset < buflen) {
183 xraddr = (struct xsctp_raddr *)(buf + *offset);
184 *offset += sizeof(struct xsctp_raddr);
185 if (xraddr->last == 1)
191 * If Lflag is set, we don't care about the return value.
200 sctp_process_tcb(struct xsctp_tcb *xstcb,
201 char *buf, const size_t buflen, size_t *offset, int *indent)
203 int i, xl_total = 0, xr_total = 0, x_max;
204 struct xsctp_raddr *xraddr;
205 struct xsctp_laddr *xladdr;
206 struct xladdr_entry *prev_xl = NULL, *xl = NULL, *xl_tmp;
207 struct xraddr_entry *prev_xr = NULL, *xr = NULL, *xr_tmp;
209 LIST_INIT(&xladdr_head);
210 LIST_INIT(&xraddr_head);
213 * Make `struct xladdr_list' list and `struct xraddr_list' list
214 * to handle the address flexibly.
216 while (*offset < buflen) {
217 xladdr = (struct xsctp_laddr *)(buf + *offset);
218 *offset += sizeof(struct xsctp_laddr);
219 if (xladdr->last == 1)
223 xl = malloc(sizeof(struct xladdr_entry));
225 xo_warnx("malloc %lu bytes",
226 (u_long)sizeof(struct xladdr_entry));
231 LIST_INSERT_HEAD(&xladdr_head, xl, xladdr_entries);
233 LIST_INSERT_AFTER(prev_xl, xl, xladdr_entries);
237 while (*offset < buflen) {
238 xraddr = (struct xsctp_raddr *)(buf + *offset);
239 *offset += sizeof(struct xsctp_raddr);
240 if (xraddr->last == 1)
244 xr = malloc(sizeof(struct xraddr_entry));
246 xo_warnx("malloc %lu bytes",
247 (u_long)sizeof(struct xraddr_entry));
252 LIST_INSERT_HEAD(&xraddr_head, xr, xraddr_entries);
254 LIST_INSERT_AFTER(prev_xr, xr, xraddr_entries);
259 * Let's print the address infos.
261 xo_open_list("address");
262 xl = LIST_FIRST(&xladdr_head);
263 xr = LIST_FIRST(&xraddr_head);
264 x_max = MAX(xl_total, xr_total);
265 for (i = 0; i < x_max; i++) {
266 xo_open_instance("address");
268 if (((*indent == 0) && i > 0) || *indent > 0)
269 xo_emit("{P:/%-12s} ", " ");
272 sctp_print_address("local", &(xl->xladdr->address),
273 htons(xstcb->local_port), numeric_port);
276 xo_emit("{P:/%-45s} ", " ");
278 xo_emit("{P:/%-22s} ", " ");
282 if (xr != NULL && !Lflag) {
283 sctp_print_address("remote", &(xr->xraddr->address),
284 htons(xstcb->remote_port), numeric_port);
288 xl = LIST_NEXT(xl, xladdr_entries);
290 xr = LIST_NEXT(xr, xraddr_entries);
292 if (i == 0 && !Lflag)
293 sctp_statesprint(xstcb->state);
297 xo_close_instance("address");
302 * Free the list which be used to handle the address.
304 xl = LIST_FIRST(&xladdr_head);
306 xl_tmp = LIST_NEXT(xl, xladdr_entries);
311 xr = LIST_FIRST(&xraddr_head);
313 xr_tmp = LIST_NEXT(xr, xraddr_entries);
320 sctp_process_inpcb(struct xsctp_inpcb *xinpcb,
321 char *buf, const size_t buflen, size_t *offset)
323 int indent = 0, xladdr_total = 0, is_listening = 0;
324 static int first = 1;
325 const char *tname, *pname;
326 struct xsctp_tcb *xstcb;
327 struct xsctp_laddr *xladdr;
331 if (xinpcb->maxqlen > 0)
336 xo_emit("Active SCTP associations");
338 xo_emit(" (including servers)");
340 xo_emit("Current listen queue sizes (qlen/maxqlen)");
343 xo_emit("{T:/%-6.6s} {T:/%-5.5s} {T:/%-8.8s} "
345 "Proto", "Type", "Listen", "Local Address");
348 xo_emit("{T:/%-6.6s} {T:/%-5.5s} {T:/%-45.45s} "
349 "{T:/%-45.45s} {T:/%s}\n",
351 "Local Address", "Foreign Address",
354 xo_emit("{T:/%-6.6s} {T:/%-5.5s} {T:/%-22.22s} "
355 "{T:/%-22.22s} {T:/%s}\n",
357 "Local Address", "Foreign Address",
361 xladdr = (struct xsctp_laddr *)(buf + *offset);
362 if ((!aflag && is_listening) ||
363 (Lflag && !is_listening)) {
364 sctp_skip_xinpcb_ifneed(buf, buflen, offset);
368 if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) {
369 /* Can't distinguish between sctp46 and sctp6 */
375 if (xinpcb->flags & SCTP_PCB_FLAGS_TCPTYPE)
377 else if (xinpcb->flags & SCTP_PCB_FLAGS_UDPTYPE)
385 snprintf(buf1, sizeof buf1, "%u/%u",
386 xinpcb->qlen, xinpcb->maxqlen);
387 xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ",
389 xo_emit("{d:queues/%-8.8s}{e:queue-len/%hu}"
390 "{e:max-queue-len/%hu} ",
391 buf1, xinpcb->qlen, xinpcb->maxqlen);
394 offset_laddr = *offset;
397 xo_open_list("local-address");
399 while (*offset < buflen) {
400 xladdr = (struct xsctp_laddr *)(buf + *offset);
401 *offset += sizeof(struct xsctp_laddr);
403 if (aflag && !Lflag && (xladdr_total == 0) && process_closed) {
404 xo_open_instance("local-address");
406 xo_emit("{:protocol/%-6.6s/%s} "
407 "{:type/%-5.5s/%s} ", pname, tname);
409 xo_emit("{P:/%-91.91s/%s} "
410 "{:state/CLOSED}", " ");
412 xo_emit("{P:/%-45.45s/%s} "
413 "{:state/CLOSED}", " ");
415 xo_close_instance("local-address");
417 if (process_closed || is_listening) {
423 if (!Lflag && !is_listening && !process_closed)
426 xo_open_instance("local-address");
428 if (xladdr_total == 0) {
430 xo_emit("{:protocol/%-6.6s/%s} "
431 "{:type/%-5.5s/%s} ", pname, tname);
435 xo_emit(Lflag ? "{P:/%-21.21s} " : "{P:/%-12.12s} ",
438 sctp_print_address("local", &(xladdr->address),
439 htons(xinpcb->local_port), numeric_port);
440 if (aflag && !Lflag && xladdr_total == 0) {
442 if (process_closed) {
443 xo_emit("{P:/%-45.45s} "
444 "{:state/CLOSED}", " ");
446 xo_emit("{P:/%-45.45s} "
447 "{:state/LISTEN}", " ");
450 if (process_closed) {
451 xo_emit("{P:/%-22.22s} "
452 "{:state/CLOSED}", " ");
454 xo_emit("{P:/%-22.22s} "
455 "{:state/LISTEN}", " ");
460 xo_close_instance("local-address");
463 xstcb = (struct xsctp_tcb *)(buf + *offset);
464 *offset += sizeof(struct xsctp_tcb);
465 if (aflag && (xladdr_total == 0) && xstcb->last && !process_closed) {
467 *offset = offset_laddr;
470 while (xstcb->last == 0 && *offset < buflen) {
471 xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ",
473 sctp_process_tcb(xstcb, buf, buflen, offset, &indent);
475 xstcb = (struct xsctp_tcb *)(buf + *offset);
476 *offset += sizeof(struct xsctp_tcb);
479 xo_close_list("local-address");
483 * Print a summary of SCTP connections related to an Internet
487 sctp_protopr(u_long off __unused,
488 const char *name __unused, int af1 __unused, int proto)
491 const char *mibvar = "net.inet.sctp.assoclist";
494 struct xsctp_inpcb *xinpcb;
496 if (proto != IPPROTO_SCTP)
499 if (sysctlbyname(mibvar, 0, &len, 0, 0) < 0) {
501 xo_warn("sysctl: %s", mibvar);
504 if ((buf = malloc(len)) == NULL) {
505 xo_warnx("malloc %lu bytes", (u_long)len);
508 if (sysctlbyname(mibvar, buf, &len, 0, 0) < 0) {
509 xo_warn("sysctl: %s", mibvar);
514 xinpcb = (struct xsctp_inpcb *)(buf + offset);
515 offset += sizeof(struct xsctp_inpcb);
516 while (xinpcb->last == 0 && offset < len) {
517 sctp_process_inpcb(xinpcb, buf, (const size_t)len,
520 xinpcb = (struct xsctp_inpcb *)(buf + offset);
521 offset += sizeof(struct xsctp_inpcb);
528 sctp_statesprint(uint32_t state)
534 idx = NETSTAT_SCTP_STATES_CLOSED;
537 idx = NETSTAT_SCTP_STATES_BOUND;
540 idx = NETSTAT_SCTP_STATES_LISTEN;
542 case SCTP_COOKIE_WAIT:
543 idx = NETSTAT_SCTP_STATES_COOKIE_WAIT;
545 case SCTP_COOKIE_ECHOED:
546 idx = NETSTAT_SCTP_STATES_COOKIE_ECHOED;
548 case SCTP_ESTABLISHED:
549 idx = NETSTAT_SCTP_STATES_ESTABLISHED;
551 case SCTP_SHUTDOWN_SENT:
552 idx = NETSTAT_SCTP_STATES_SHUTDOWN_SENT;
554 case SCTP_SHUTDOWN_RECEIVED:
555 idx = NETSTAT_SCTP_STATES_SHUTDOWN_RECEIVED;
557 case SCTP_SHUTDOWN_ACK_SENT:
558 idx = NETSTAT_SCTP_STATES_SHUTDOWN_ACK_SENT;
560 case SCTP_SHUTDOWN_PENDING:
561 idx = NETSTAT_SCTP_STATES_SHUTDOWN_PENDING;
564 xo_emit("UNKNOWN {:state/0x%08x}", state);
568 xo_emit("{:state/%s}", sctpstates[idx]);
572 * Dump SCTP statistics structure.
575 sctp_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
577 struct sctpstat sctpstat;
579 if (fetch_stats("net.inet.sctp.stats", off, &sctpstat,
580 sizeof(sctpstat), kread) != 0)
583 xo_open_container(name);
584 xo_emit("{T:/%s}:\n", name);
586 #define p(f, m) if (sctpstat.f || sflag <= 1) \
587 xo_emit(m, (uintmax_t)sctpstat.f, plural(sctpstat.f))
588 #define p1a(f, m) if (sctpstat.f || sflag <= 1) \
589 xo_emit(m, (uintmax_t)sctpstat.f)
594 p(sctps_recvpackets, "\t{:received-packets/%ju} "
595 "{N:/input packet%s}\n");
596 p(sctps_recvdatagrams, "\t\t{:received-datagrams/%ju} "
597 "{N:/datagram%s}\n");
598 p(sctps_recvpktwithdata, "\t\t{:received-with-data/%ju} "
599 "{N:/packet%s that had data}\n");
600 p(sctps_recvsacks, "\t\t{:received-sack-chunks/%ju} "
601 "{N:/input SACK chunk%s}\n");
602 p(sctps_recvdata, "\t\t{:received-data-chunks/%ju} "
603 "{N:/input DATA chunk%s}\n");
604 p(sctps_recvdupdata, "\t\t{:received-duplicate-data-chunks/%ju} "
605 "{N:/duplicate DATA chunk%s}\n");
606 p(sctps_recvheartbeat, "\t\t{:received-hb-chunks/%ju} "
607 "{N:/input HB chunk%s}\n");
608 p(sctps_recvheartbeatack, "\t\t{:received-hb-ack-chunks/%ju} "
609 "{N:/HB-ACK chunk%s}\n");
610 p(sctps_recvecne, "\t\t{:received-ecne-chunks/%ju} "
611 "{N:/input ECNE chunk%s}\n");
612 p(sctps_recvauth, "\t\t{:received-auth-chunks/%ju} "
613 "{N:/input AUTH chunk%s}\n");
614 p(sctps_recvauthmissing, "\t\t{:dropped-missing-auth/%ju} "
615 "{N:/chunk%s missing AUTH}\n");
616 p(sctps_recvivalhmacid, "\t\t{:dropped-invalid-hmac/%ju} "
617 "{N:/invalid HMAC id%s received}\n");
618 p(sctps_recvivalkeyid, "\t\t{:dropped-invalid-secret/%ju} "
619 "{N:/invalid secret id%s received}\n");
620 p1a(sctps_recvauthfailed, "\t\t{:dropped-auth-failed/%ju} "
621 "{N:/auth failed}\n");
622 p1a(sctps_recvexpress, "\t\t{:received-fast-path/%ju} "
623 "{N:/fast path receives all one chunk}\n");
624 p1a(sctps_recvexpressm, "\t\t{:receives-fast-path-multipart/%ju} "
625 "{N:/fast path multi-part data}\n");
630 p(sctps_sendpackets, "\t{:sent-packets/%ju} "
631 "{N:/output packet%s}\n");
632 p(sctps_sendsacks, "\t\t{:sent-sacks/%ju} "
633 "{N:/output SACK%s}\n");
634 p(sctps_senddata, "\t\t{:sent-data-chunks/%ju} "
635 "{N:/output DATA chunk%s}\n");
636 p(sctps_sendretransdata, "\t\t{:sent-retransmitted-data-chunks/%ju} "
637 "{N:/retransmitted DATA chunk%s}\n");
638 p(sctps_sendfastretrans, "\t\t"
639 "{:sent-fast-retransmitted-data-chunks/%ju} "
640 "{N:/fast retransmitted DATA chunk%s}\n");
641 p(sctps_sendmultfastretrans, "\t\t"
642 "{:sent-fast-retransmitted-data-chunk-multiple-times/%ju} "
643 "{N:/FR'%s that happened more than once to same chunk}\n");
644 p(sctps_sendheartbeat, "\t\t{:sent-hb-chunks/%ju} "
645 "{N:/output HB chunk%s}\n");
646 p(sctps_sendecne, "\t\t{:sent-ecne-chunks/%ju} "
647 "{N:/output ECNE chunk%s}\n");
648 p(sctps_sendauth, "\t\t{:sent-auth-chunks/%ju} "
649 "{N:/output AUTH chunk%s}\n");
650 p1a(sctps_senderrors, "\t\t{:send-errors/%ju} "
651 "{N:/ip_output error counter}\n");
654 * PCKDROPREP statistics
656 xo_emit("\t{T:Packet drop statistics}:\n");
657 xo_open_container("drop-statistics");
658 p1a(sctps_pdrpfmbox, "\t\t{:middle-box/%ju} "
659 "{N:/from middle box}\n");
660 p1a(sctps_pdrpfehos, "\t\t{:end-host/%ju} "
661 "{N:/from end host}\n");
662 p1a(sctps_pdrpmbda, "\t\t{:with-data/%ju} "
664 p1a(sctps_pdrpmbct, "\t\t{:non-data/%ju} "
665 "{N:/non-data, non-endhost}\n");
666 p1a(sctps_pdrpbwrpt, "\t\t{:non-endhost/%ju} "
667 "{N:/non-endhost, bandwidth rep only}\n");
668 p1a(sctps_pdrpcrupt, "\t\t{:short-header/%ju} "
669 "{N:/not enough for chunk header}\n");
670 p1a(sctps_pdrpnedat, "\t\t{:short-data/%ju} "
671 "{N:/not enough data to confirm}\n");
672 p1a(sctps_pdrppdbrk, "\t\t{:chunk-break/%ju} "
673 "{N:/where process_chunk_drop said break}\n");
674 p1a(sctps_pdrptsnnf, "\t\t{:tsn-not-found/%ju} "
675 "{N:/failed to find TSN}\n");
676 p1a(sctps_pdrpdnfnd, "\t\t{:reverse-tsn/%ju} "
677 "{N:/attempt reverse TSN lookup}\n");
678 p1a(sctps_pdrpdiwnp, "\t\t{:confirmed-zero-window/%ju} "
679 "{N:/e-host confirms zero-rwnd}\n");
680 p1a(sctps_pdrpdizrw, "\t\t{:middle-box-no-space/%ju} "
681 "{N:/midbox confirms no space}\n");
682 p1a(sctps_pdrpbadd, "\t\t{:bad-data/%ju} "
683 "{N:/data did not match TSN}\n");
684 p(sctps_pdrpmark, "\t\t{:tsn-marked-fast-retransmission/%ju} "
685 "{N:/TSN'%s marked for Fast Retran}\n");
686 xo_close_container("drop-statistics");
691 xo_emit("\t{T:Timeouts}:\n");
692 xo_open_container("timeouts");
693 p(sctps_timoiterator, "\t\t{:iterator/%ju} "
694 "{N:/iterator timer%s fired}\n");
695 p(sctps_timodata, "\t\t{:t3-data/%ju} "
696 "{N:/T3 data time out%s}\n");
697 p(sctps_timowindowprobe, "\t\t{:window-probe/%ju} "
698 "{N:/window probe (T3) timer%s fired}\n");
699 p(sctps_timoinit, "\t\t{:init-timer/%ju} "
700 "{N:/INIT timer%s fired}\n");
701 p(sctps_timosack, "\t\t{:sack-timer/%ju} "
702 "{N:/sack timer%s fired}\n");
703 p(sctps_timoshutdown, "\t\t{:shutdown-timer/%ju} "
704 "{N:/shutdown timer%s fired}\n");
705 p(sctps_timoheartbeat, "\t\t{:heartbeat-timer/%ju} "
706 "{N:/heartbeat timer%s fired}\n");
707 p1a(sctps_timocookie, "\t\t{:cookie-timer/%ju} "
708 "{N:/a cookie timeout fired}\n");
709 p1a(sctps_timosecret, "\t\t{:endpoint-changed-cookie/%ju} "
710 "{N:/an endpoint changed its cook}ie"
712 p(sctps_timopathmtu, "\t\t{:pmtu-timer/%ju} "
713 "{N:/PMTU timer%s fired}\n");
714 p(sctps_timoshutdownack, "\t\t{:shutdown-timer/%ju} "
715 "{N:/shutdown ack timer%s fired}\n");
716 p(sctps_timoshutdownguard, "\t\t{:shutdown-guard-timer/%ju} "
717 "{N:/shutdown guard timer%s fired}\n");
718 p(sctps_timostrmrst, "\t\t{:stream-reset-timer/%ju} "
719 "{N:/stream reset timer%s fired}\n");
720 p(sctps_timoearlyfr, "\t\t{:early-fast-retransmission-timer/%ju} "
721 "{N:/early FR timer%s fired}\n");
722 p1a(sctps_timoasconf, "\t\t{:asconf-timer/%ju} "
723 "{N:/an asconf timer fired}\n");
724 p1a(sctps_timoautoclose, "\t\t{:auto-close-timer/%ju} "
725 "{N:/auto close timer fired}\n");
726 p(sctps_timoassockill, "\t\t{:asoc-free-timer/%ju} "
727 "{N:/asoc free timer%s expired}\n");
728 p(sctps_timoinpkill, "\t\t{:input-free-timer/%ju} "
729 "{N:/inp free timer%s expired}\n");
730 xo_close_container("timeouts");
734 * Early fast retransmission counters
736 p(sctps_earlyfrstart, "\t%ju TODO:sctps_earlyfrstart\n");
737 p(sctps_earlyfrstop, "\t%ju TODO:sctps_earlyfrstop\n");
738 p(sctps_earlyfrmrkretrans, "\t%ju TODO:sctps_earlyfrmrkretrans\n");
739 p(sctps_earlyfrstpout, "\t%ju TODO:sctps_earlyfrstpout\n");
740 p(sctps_earlyfrstpidsck1, "\t%ju TODO:sctps_earlyfrstpidsck1\n");
741 p(sctps_earlyfrstpidsck2, "\t%ju TODO:sctps_earlyfrstpidsck2\n");
742 p(sctps_earlyfrstpidsck3, "\t%ju TODO:sctps_earlyfrstpidsck3\n");
743 p(sctps_earlyfrstpidsck4, "\t%ju TODO:sctps_earlyfrstpidsck4\n");
744 p(sctps_earlyfrstrid, "\t%ju TODO:sctps_earlyfrstrid\n");
745 p(sctps_earlyfrstrout, "\t%ju TODO:sctps_earlyfrstrout\n");
746 p(sctps_earlyfrstrtmr, "\t%ju TODO:sctps_earlyfrstrtmr\n");
752 p1a(sctps_hdrops, "\t{:dropped-too-short/%ju} "
753 "{N:/packet shorter than header}\n");
754 p1a(sctps_badsum, "\t{:dropped-bad-checksum/%ju} "
755 "{N:/checksum error}\n");
756 p1a(sctps_noport, "\t{:dropped-no-endpoint/%ju} "
757 "{N:/no endpoint for port}\n");
758 p1a(sctps_badvtag, "\t{:dropped-bad-v-tag/%ju} "
760 p1a(sctps_badsid, "\t{:dropped-bad-sid/%ju} "
762 p1a(sctps_nomem, "\t{:dropped-no-memory/%ju} "
764 p1a(sctps_fastretransinrtt, "\t{:multiple-fast-retransmits-in-rtt/%ju} "
765 "{N:/number of multiple FR in a RT}T window\n");
767 p(sctps_markedretrans, "\t%ju TODO:sctps_markedretrans\n");
769 p1a(sctps_naglesent, "\t{:rfc813-sent/%ju} "
770 "{N:/RFC813 allowed sending}\n");
771 p1a(sctps_naglequeued, "\t{:rfc813-queued/%ju} "
772 "{N:/RFC813 does not allow sending}\n");
773 p1a(sctps_maxburstqueued, "\t{:max-burst-queued/%ju} "
774 "{N:/times max burst prohibited sending}\n");
775 p1a(sctps_ifnomemqueued, "\t{:no-memory-in-interface/%ju} "
776 "{N:/look ahead tells us no memory in interface}\n");
777 p(sctps_windowprobed, "\t{:sent-window-probes/%ju} "
778 "{N:/number%s of window probes sent}\n");
779 p(sctps_lowlevelerr, "\t{:low-level-err/%ju} "
780 "{N:/time%s an output error to clamp down on next user send}\n");
781 p(sctps_lowlevelerrusr, "\t{:low-level-user-error/%ju} "
782 "{N:/time%s sctp_senderrors were caused from a user}\n");
783 p(sctps_datadropchklmt, "\t{:dropped-chunk-limit/%ju} "
784 "{N:/number of in data drop%s due to chunk limit reached}\n");
785 p(sctps_datadroprwnd, "\t{:dropped-rwnd-limit/%ju} "
786 "{N:/number of in data drop%s due to rwnd limit reached}\n");
787 p(sctps_ecnereducedcwnd, "\t{:ecn-reduced-cwnd/%ju} "
788 "{N:/time%s a ECN reduced the cwnd}\n");
789 p1a(sctps_vtagexpress, "\t{:v-tag-express-lookup/%ju} "
790 "{N:/used express lookup via vtag}\n");
791 p1a(sctps_vtagbogus, "\t{:v-tag-collision/%ju} "
792 "{N:/collision in express lookup}\n");
793 p(sctps_primary_randry, "\t{:sender-ran-dry/%ju} "
794 "{N:/time%s the sender ran dry of user data on primary}\n");
795 p1a(sctps_cmt_randry, "\t{:cmt-ran-dry/%ju} "
796 "{N:/same for above}\n");
797 p(sctps_slowpath_sack, "\t{:slow-path-sack/%ju} "
798 "{N:/sack%s the slow way}\n");
799 p(sctps_wu_sacks_sent, "\t{:sent-window-update-only-sack/%ju} "
800 "{N:/window update only sack%s sent}\n");
801 p(sctps_sends_with_flags, "\t{:sent-with-sinfo/%ju} "
802 "{N:/send%s with sinfo_flags !=0}\n");
803 p(sctps_sends_with_unord, "\t{:sent-with-unordered/%ju} "
804 "{N:/unordered send%s}\n");
805 p(sctps_sends_with_eof, "\t{:sent-with-eof/%ju} "
806 "{N:/send%s with EOF flag set}\n");
807 p(sctps_sends_with_abort, "\t{:sent-with-abort/%ju} "
808 "{N:/send%s with ABORT flag set}\n");
809 p(sctps_protocol_drain_calls, "\t{:protocol-drain-called/%ju} "
810 "{N:/time%s protocol drain called}\n");
811 p(sctps_protocol_drains_done, "\t{:protocol-drain/%ju} "
812 "{N:/time%s we did a protocol drain}\n");
813 p(sctps_read_peeks, "\t{:read-with-peek/%ju} "
814 "{N:/time%s recv was called with peek}\n");
815 p(sctps_cached_chk, "\t{:cached-chunks/%ju} "
816 "{N:/cached chunk%s used}\n");
817 p1a(sctps_cached_strmoq, "\t{:cached-output-queue-used/%ju} "
818 "{N:/cached stream oq's used}\n");
819 p(sctps_left_abandon, "\t{:messages-abandoned/%ju} "
820 "{N:/unread message%s abandonded by close}\n");
821 p1a(sctps_send_burst_avoid, "\t{:send-burst-avoidance/%ju} "
822 "{N:/send burst avoidance, already max burst inflight to net}\n");
823 p1a(sctps_send_cwnd_avoid, "\t{:send-cwnd-avoidance/%ju} "
824 "{N:/send cwnd full avoidance, already max burst inflight "
826 p(sctps_fwdtsn_map_over, "\t{:tsn-map-overruns/%ju} "
827 "{N:/number of map array over-run%s via fwd-tsn's}\n");
831 xo_close_container(name);