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.
36 static char sccsid[] = "@(#)sctp.c 0.1 (Berkeley) 4/18/2007";
40 #include <sys/cdefs.h>
41 __FBSDID("$FreeBSD$");
43 #include <sys/param.h>
44 #include <sys/queue.h>
45 #include <sys/types.h>
46 #include <sys/socket.h>
47 #include <sys/socketvar.h>
48 #include <sys/sysctl.h>
49 #include <sys/protosw.h>
51 #include <netinet/in.h>
52 #include <netinet/sctp.h>
53 #include <netinet/sctp_constants.h>
54 #include <arpa/inet.h>
71 static void sctp_statesprint(uint32_t state);
73 #define NETSTAT_SCTP_STATES_CLOSED 0x0
74 #define NETSTAT_SCTP_STATES_BOUND 0x1
75 #define NETSTAT_SCTP_STATES_LISTEN 0x2
76 #define NETSTAT_SCTP_STATES_COOKIE_WAIT 0x3
77 #define NETSTAT_SCTP_STATES_COOKIE_ECHOED 0x4
78 #define NETSTAT_SCTP_STATES_ESTABLISHED 0x5
79 #define NETSTAT_SCTP_STATES_SHUTDOWN_SENT 0x6
80 #define NETSTAT_SCTP_STATES_SHUTDOWN_RECEIVED 0x7
81 #define NETSTAT_SCTP_STATES_SHUTDOWN_ACK_SENT 0x8
82 #define NETSTAT_SCTP_STATES_SHUTDOWN_PENDING 0x9
84 static const char *sctpstates[] = {
97 static LIST_HEAD(xladdr_list, xladdr_entry) xladdr_head;
99 struct xsctp_laddr *xladdr;
100 LIST_ENTRY(xladdr_entry) xladdr_entries;
103 static LIST_HEAD(xraddr_list, xraddr_entry) xraddr_head;
104 struct xraddr_entry {
105 struct xsctp_raddr *xraddr;
106 LIST_ENTRY(xraddr_entry) xraddr_entries;
110 sctp_print_address(const char *container, union sctp_sockstore *address,
111 int port, int num_port)
113 struct servent *sp = 0;
119 xo_open_container(container);
121 switch (address->sa.sa_family) {
124 snprintf(line, sizeof(line), "%.*s.",
125 Wflag ? 39 : 16, inetname(&address->sin.sin_addr));
130 snprintf(line, sizeof(line), "%.*s.",
131 Wflag ? 39 : 16, inet6name(&address->sin6.sin6_addr));
135 snprintf(line, sizeof(line), "%.*s.",
136 Wflag ? 39 : 16, "");
141 if (!num_port && port)
142 sp = getservbyport((int)port, "sctp");
144 snprintf(cp, sizeof(line) - alen,
145 "%.15s ", sp ? sp->s_name : "*");
147 snprintf(cp, sizeof(line) - alen,
148 "%d ", ntohs((u_short)port));
149 width = Wflag ? 45 : 22;
150 xo_emit("{d:target/%-*.*s} ", width, width, line);
152 plen = strlen(cp) - 1;
154 xo_emit("{e:address/%*.*s}{e:port/%*.*s}", alen, alen, line, plen,
158 xo_close_container(container);
162 sctp_skip_xinpcb_ifneed(char *buf, const size_t buflen, size_t *offset)
165 struct xsctp_tcb *xstcb;
166 struct xsctp_raddr *xraddr;
167 struct xsctp_laddr *xladdr;
169 while (*offset < buflen) {
170 xladdr = (struct xsctp_laddr *)(buf + *offset);
171 *offset += sizeof(struct xsctp_laddr);
172 if (xladdr->last == 1)
176 while (*offset < buflen) {
177 xstcb = (struct xsctp_tcb *)(buf + *offset);
178 *offset += sizeof(struct xsctp_tcb);
179 if (xstcb->last == 1)
184 while (*offset < buflen) {
185 xladdr = (struct xsctp_laddr *)(buf + *offset);
186 *offset += sizeof(struct xsctp_laddr);
187 if (xladdr->last == 1)
191 while (*offset < buflen) {
192 xraddr = (struct xsctp_raddr *)(buf + *offset);
193 *offset += sizeof(struct xsctp_raddr);
194 if (xraddr->last == 1)
200 * If Lflag is set, we don't care about the return value.
209 sctp_process_tcb(struct xsctp_tcb *xstcb,
210 char *buf, const size_t buflen, size_t *offset, int *indent)
212 int i, xl_total = 0, xr_total = 0, x_max;
213 struct xsctp_raddr *xraddr;
214 struct xsctp_laddr *xladdr;
215 struct xladdr_entry *prev_xl = NULL, *xl = NULL, *xl_tmp;
216 struct xraddr_entry *prev_xr = NULL, *xr = NULL, *xr_tmp;
218 LIST_INIT(&xladdr_head);
219 LIST_INIT(&xraddr_head);
222 * Make `struct xladdr_list' list and `struct xraddr_list' list
223 * to handle the address flexibly.
225 while (*offset < buflen) {
226 xladdr = (struct xsctp_laddr *)(buf + *offset);
227 *offset += sizeof(struct xsctp_laddr);
228 if (xladdr->last == 1)
232 xl = malloc(sizeof(struct xladdr_entry));
234 xo_warnx("malloc %lu bytes",
235 (u_long)sizeof(struct xladdr_entry));
240 LIST_INSERT_HEAD(&xladdr_head, xl, xladdr_entries);
242 LIST_INSERT_AFTER(prev_xl, xl, xladdr_entries);
246 while (*offset < buflen) {
247 xraddr = (struct xsctp_raddr *)(buf + *offset);
248 *offset += sizeof(struct xsctp_raddr);
249 if (xraddr->last == 1)
253 xr = malloc(sizeof(struct xraddr_entry));
255 xo_warnx("malloc %lu bytes",
256 (u_long)sizeof(struct xraddr_entry));
261 LIST_INSERT_HEAD(&xraddr_head, xr, xraddr_entries);
263 LIST_INSERT_AFTER(prev_xr, xr, xraddr_entries);
268 * Let's print the address infos.
270 xo_open_list("address");
271 xl = LIST_FIRST(&xladdr_head);
272 xr = LIST_FIRST(&xraddr_head);
273 x_max = MAX(xl_total, xr_total);
274 for (i = 0; i < x_max; i++) {
275 xo_open_instance("address");
277 if (((*indent == 0) && i > 0) || *indent > 0)
278 xo_emit("{P:/%-12s} ", " ");
281 sctp_print_address("local", &(xl->xladdr->address),
282 htons(xstcb->local_port), numeric_port);
285 xo_emit("{P:/%-45s} ", " ");
287 xo_emit("{P:/%-22s} ", " ");
291 if (xr != NULL && !Lflag) {
292 sctp_print_address("remote", &(xr->xraddr->address),
293 htons(xstcb->remote_port), numeric_port);
297 xl = LIST_NEXT(xl, xladdr_entries);
299 xr = LIST_NEXT(xr, xraddr_entries);
301 if (i == 0 && !Lflag)
302 sctp_statesprint(xstcb->state);
306 xo_close_instance("address");
311 * Free the list which be used to handle the address.
313 xl = LIST_FIRST(&xladdr_head);
315 xl_tmp = LIST_NEXT(xl, xladdr_entries);
320 xr = LIST_FIRST(&xraddr_head);
322 xr_tmp = LIST_NEXT(xr, xraddr_entries);
329 sctp_process_inpcb(struct xsctp_inpcb *xinpcb,
330 char *buf, const size_t buflen, size_t *offset)
332 int indent = 0, xladdr_total = 0, is_listening = 0;
333 static int first = 1;
334 const char *tname, *pname;
335 struct xsctp_tcb *xstcb;
336 struct xsctp_laddr *xladdr;
340 if (xinpcb->maxqlen > 0)
345 xo_emit("Active SCTP associations");
347 xo_emit(" (including servers)");
349 xo_emit("Current listen queue sizes (qlen/maxqlen)");
352 xo_emit("{T:/%-6.6s} {T:/%-5.5s} {T:/%-8.8s} "
354 "Proto", "Type", "Listen", "Local Address");
357 xo_emit("{T:/%-6.6s} {T:/%-5.5s} {T:/%-45.45s} "
358 "{T:/%-45.45s} {T:/%s}\n",
360 "Local Address", "Foreign Address",
363 xo_emit("{T:/%-6.6s} {T:/%-5.5s} {T:/%-22.22s} "
364 "{T:/%-22.22s} {T:/%s}\n",
366 "Local Address", "Foreign Address",
370 xladdr = (struct xsctp_laddr *)(buf + *offset);
371 if ((!aflag && is_listening) ||
372 (Lflag && !is_listening)) {
373 sctp_skip_xinpcb_ifneed(buf, buflen, offset);
377 if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) {
378 /* Can't distinguish between sctp46 and sctp6 */
384 if (xinpcb->flags & SCTP_PCB_FLAGS_TCPTYPE)
386 else if (xinpcb->flags & SCTP_PCB_FLAGS_UDPTYPE)
394 snprintf(buf1, sizeof buf1, "%u/%u",
395 xinpcb->qlen, xinpcb->maxqlen);
396 xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ",
398 xo_emit("{d:queues/%-8.8s}{e:queue-len/%hu}"
399 "{e:max-queue-len/%hu} ",
400 buf1, xinpcb->qlen, xinpcb->maxqlen);
403 offset_laddr = *offset;
406 xo_open_list("local-address");
408 while (*offset < buflen) {
409 xladdr = (struct xsctp_laddr *)(buf + *offset);
410 *offset += sizeof(struct xsctp_laddr);
412 if (aflag && !Lflag && (xladdr_total == 0) && process_closed) {
413 xo_open_instance("local-address");
415 xo_emit("{:protocol/%-6.6s/%s} "
416 "{:type/%-5.5s/%s} ", pname, tname);
418 xo_emit("{P:/%-91.91s/%s} "
419 "{:state/CLOSED}", " ");
421 xo_emit("{P:/%-45.45s/%s} "
422 "{:state/CLOSED}", " ");
424 xo_close_instance("local-address");
426 if (process_closed || is_listening) {
432 if (!Lflag && !is_listening && !process_closed)
435 xo_open_instance("local-address");
437 if (xladdr_total == 0) {
439 xo_emit("{:protocol/%-6.6s/%s} "
440 "{:type/%-5.5s/%s} ", pname, tname);
444 xo_emit(Lflag ? "{P:/%-21.21s} " : "{P:/%-12.12s} ",
447 sctp_print_address("local", &(xladdr->address),
448 htons(xinpcb->local_port), numeric_port);
449 if (aflag && !Lflag && xladdr_total == 0) {
451 if (process_closed) {
452 xo_emit("{P:/%-45.45s} "
453 "{:state/CLOSED}", " ");
455 xo_emit("{P:/%-45.45s} "
456 "{:state/LISTEN}", " ");
459 if (process_closed) {
460 xo_emit("{P:/%-22.22s} "
461 "{:state/CLOSED}", " ");
463 xo_emit("{P:/%-22.22s} "
464 "{:state/LISTEN}", " ");
469 xo_close_instance("local-address");
472 xstcb = (struct xsctp_tcb *)(buf + *offset);
473 *offset += sizeof(struct xsctp_tcb);
474 if (aflag && (xladdr_total == 0) && xstcb->last && !process_closed) {
476 *offset = offset_laddr;
479 while (xstcb->last == 0 && *offset < buflen) {
480 xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ",
482 sctp_process_tcb(xstcb, buf, buflen, offset, &indent);
484 xstcb = (struct xsctp_tcb *)(buf + *offset);
485 *offset += sizeof(struct xsctp_tcb);
488 xo_close_list("local-address");
492 * Print a summary of SCTP connections related to an Internet
496 sctp_protopr(u_long off __unused,
497 const char *name __unused, int af1 __unused, int proto)
500 const char *mibvar = "net.inet.sctp.assoclist";
503 struct xsctp_inpcb *xinpcb;
505 if (proto != IPPROTO_SCTP)
508 if (sysctlbyname(mibvar, 0, &len, 0, 0) < 0) {
510 xo_warn("sysctl: %s", mibvar);
513 if ((buf = malloc(len)) == NULL) {
514 xo_warnx("malloc %lu bytes", (u_long)len);
517 if (sysctlbyname(mibvar, buf, &len, 0, 0) < 0) {
518 xo_warn("sysctl: %s", mibvar);
523 xinpcb = (struct xsctp_inpcb *)(buf + offset);
524 offset += sizeof(struct xsctp_inpcb);
525 while (xinpcb->last == 0 && offset < len) {
526 sctp_process_inpcb(xinpcb, buf, (const size_t)len,
529 xinpcb = (struct xsctp_inpcb *)(buf + offset);
530 offset += sizeof(struct xsctp_inpcb);
537 sctp_statesprint(uint32_t state)
543 idx = NETSTAT_SCTP_STATES_CLOSED;
546 idx = NETSTAT_SCTP_STATES_BOUND;
549 idx = NETSTAT_SCTP_STATES_LISTEN;
551 case SCTP_COOKIE_WAIT:
552 idx = NETSTAT_SCTP_STATES_COOKIE_WAIT;
554 case SCTP_COOKIE_ECHOED:
555 idx = NETSTAT_SCTP_STATES_COOKIE_ECHOED;
557 case SCTP_ESTABLISHED:
558 idx = NETSTAT_SCTP_STATES_ESTABLISHED;
560 case SCTP_SHUTDOWN_SENT:
561 idx = NETSTAT_SCTP_STATES_SHUTDOWN_SENT;
563 case SCTP_SHUTDOWN_RECEIVED:
564 idx = NETSTAT_SCTP_STATES_SHUTDOWN_RECEIVED;
566 case SCTP_SHUTDOWN_ACK_SENT:
567 idx = NETSTAT_SCTP_STATES_SHUTDOWN_ACK_SENT;
569 case SCTP_SHUTDOWN_PENDING:
570 idx = NETSTAT_SCTP_STATES_SHUTDOWN_PENDING;
573 xo_emit("UNKNOWN {:state/0x%08x}", state);
577 xo_emit("{:state/%s}", sctpstates[idx]);
581 * Dump SCTP statistics structure.
584 sctp_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
586 struct sctpstat sctpstat;
588 if (fetch_stats("net.inet.sctp.stats", off, &sctpstat,
589 sizeof(sctpstat), kread) != 0)
592 xo_open_container(name);
593 xo_emit("{T:/%s}:\n", name);
595 #define p(f, m) if (sctpstat.f || sflag <= 1) \
596 xo_emit(m, (uintmax_t)sctpstat.f, plural(sctpstat.f))
597 #define p1a(f, m) if (sctpstat.f || sflag <= 1) \
598 xo_emit(m, (uintmax_t)sctpstat.f)
603 p(sctps_recvpackets, "\t{:received-packets/%ju} "
604 "{N:/input packet%s}\n");
605 p(sctps_recvdatagrams, "\t\t{:received-datagrams/%ju} "
606 "{N:/datagram%s}\n");
607 p(sctps_recvpktwithdata, "\t\t{:received-with-data/%ju} "
608 "{N:/packet%s that had data}\n");
609 p(sctps_recvsacks, "\t\t{:received-sack-chunks/%ju} "
610 "{N:/input SACK chunk%s}\n");
611 p(sctps_recvdata, "\t\t{:received-data-chunks/%ju} "
612 "{N:/input DATA chunk%s}\n");
613 p(sctps_recvdupdata, "\t\t{:received-duplicate-data-chunks/%ju} "
614 "{N:/duplicate DATA chunk%s}\n");
615 p(sctps_recvheartbeat, "\t\t{:received-hb-chunks/%ju} "
616 "{N:/input HB chunk%s}\n");
617 p(sctps_recvheartbeatack, "\t\t{:received-hb-ack-chunks/%ju} "
618 "{N:/HB-ACK chunk%s}\n");
619 p(sctps_recvecne, "\t\t{:received-ecne-chunks/%ju} "
620 "{N:/input ECNE chunk%s}\n");
621 p(sctps_recvauth, "\t\t{:received-auth-chunks/%ju} "
622 "{N:/input AUTH chunk%s}\n");
623 p(sctps_recvauthmissing, "\t\t{:dropped-missing-auth/%ju} "
624 "{N:/chunk%s missing AUTH}\n");
625 p(sctps_recvivalhmacid, "\t\t{:dropped-invalid-hmac/%ju} "
626 "{N:/invalid HMAC id%s received}\n");
627 p(sctps_recvivalkeyid, "\t\t{:dropped-invalid-secret/%ju} "
628 "{N:/invalid secret id%s received}\n");
629 p1a(sctps_recvauthfailed, "\t\t{:dropped-auth-failed/%ju} "
630 "{N:/auth failed}\n");
631 p1a(sctps_recvexpress, "\t\t{:received-fast-path/%ju} "
632 "{N:/fast path receives all one chunk}\n");
633 p1a(sctps_recvexpressm, "\t\t{:receives-fast-path-multipart/%ju} "
634 "{N:/fast path multi-part data}\n");
639 p(sctps_sendpackets, "\t{:sent-packets/%ju} "
640 "{N:/output packet%s}\n");
641 p(sctps_sendsacks, "\t\t{:sent-sacks/%ju} "
642 "{N:/output SACK%s}\n");
643 p(sctps_senddata, "\t\t{:sent-data-chunks/%ju} "
644 "{N:/output DATA chunk%s}\n");
645 p(sctps_sendretransdata, "\t\t{:sent-retransmitted-data-chunks/%ju} "
646 "{N:/retransmitted DATA chunk%s}\n");
647 p(sctps_sendfastretrans, "\t\t"
648 "{:sent-fast-retransmitted-data-chunks/%ju} "
649 "{N:/fast retransmitted DATA chunk%s}\n");
650 p(sctps_sendmultfastretrans, "\t\t"
651 "{:sent-fast-retransmitted-data-chunk-multiple-times/%ju} "
652 "{N:/FR'%s that happened more than once to same chunk}\n");
653 p(sctps_sendheartbeat, "\t\t{:sent-hb-chunks/%ju} "
654 "{N:/output HB chunk%s}\n");
655 p(sctps_sendecne, "\t\t{:sent-ecne-chunks/%ju} "
656 "{N:/output ECNE chunk%s}\n");
657 p(sctps_sendauth, "\t\t{:sent-auth-chunks/%ju} "
658 "{N:/output AUTH chunk%s}\n");
659 p1a(sctps_senderrors, "\t\t{:send-errors/%ju} "
660 "{N:/ip_output error counter}\n");
663 * PCKDROPREP statistics
665 xo_emit("\t{T:Packet drop statistics}:\n");
666 xo_open_container("drop-statistics");
667 p1a(sctps_pdrpfmbox, "\t\t{:middle-box/%ju} "
668 "{N:/from middle box}\n");
669 p1a(sctps_pdrpfehos, "\t\t{:end-host/%ju} "
670 "{N:/from end host}\n");
671 p1a(sctps_pdrpmbda, "\t\t{:with-data/%ju} "
673 p1a(sctps_pdrpmbct, "\t\t{:non-data/%ju} "
674 "{N:/non-data, non-endhost}\n");
675 p1a(sctps_pdrpbwrpt, "\t\t{:non-endhost/%ju} "
676 "{N:/non-endhost, bandwidth rep only}\n");
677 p1a(sctps_pdrpcrupt, "\t\t{:short-header/%ju} "
678 "{N:/not enough for chunk header}\n");
679 p1a(sctps_pdrpnedat, "\t\t{:short-data/%ju} "
680 "{N:/not enough data to confirm}\n");
681 p1a(sctps_pdrppdbrk, "\t\t{:chunk-break/%ju} "
682 "{N:/where process_chunk_drop said break}\n");
683 p1a(sctps_pdrptsnnf, "\t\t{:tsn-not-found/%ju} "
684 "{N:/failed to find TSN}\n");
685 p1a(sctps_pdrpdnfnd, "\t\t{:reverse-tsn/%ju} "
686 "{N:/attempt reverse TSN lookup}\n");
687 p1a(sctps_pdrpdiwnp, "\t\t{:confirmed-zero-window/%ju} "
688 "{N:/e-host confirms zero-rwnd}\n");
689 p1a(sctps_pdrpdizrw, "\t\t{:middle-box-no-space/%ju} "
690 "{N:/midbox confirms no space}\n");
691 p1a(sctps_pdrpbadd, "\t\t{:bad-data/%ju} "
692 "{N:/data did not match TSN}\n");
693 p(sctps_pdrpmark, "\t\t{:tsn-marked-fast-retransmission/%ju} "
694 "{N:/TSN'%s marked for Fast Retran}\n");
695 xo_close_container("drop-statistics");
700 xo_emit("\t{T:Timeouts}:\n");
701 xo_open_container("timeouts");
702 p(sctps_timoiterator, "\t\t{:iterator/%ju} "
703 "{N:/iterator timer%s fired}\n");
704 p(sctps_timodata, "\t\t{:t3-data/%ju} "
705 "{N:/T3 data time out%s}\n");
706 p(sctps_timowindowprobe, "\t\t{:window-probe/%ju} "
707 "{N:/window probe (T3) timer%s fired}\n");
708 p(sctps_timoinit, "\t\t{:init-timer/%ju} "
709 "{N:/INIT timer%s fired}\n");
710 p(sctps_timosack, "\t\t{:sack-timer/%ju} "
711 "{N:/sack timer%s fired}\n");
712 p(sctps_timoshutdown, "\t\t{:shutdown-timer/%ju} "
713 "{N:/shutdown timer%s fired}\n");
714 p(sctps_timoheartbeat, "\t\t{:heartbeat-timer/%ju} "
715 "{N:/heartbeat timer%s fired}\n");
716 p1a(sctps_timocookie, "\t\t{:cookie-timer/%ju} "
717 "{N:/a cookie timeout fired}\n");
718 p1a(sctps_timosecret, "\t\t{:endpoint-changed-cookie/%ju} "
719 "{N:/an endpoint changed its cook}ie"
721 p(sctps_timopathmtu, "\t\t{:pmtu-timer/%ju} "
722 "{N:/PMTU timer%s fired}\n");
723 p(sctps_timoshutdownack, "\t\t{:shutdown-timer/%ju} "
724 "{N:/shutdown ack timer%s fired}\n");
725 p(sctps_timoshutdownguard, "\t\t{:shutdown-guard-timer/%ju} "
726 "{N:/shutdown guard timer%s fired}\n");
727 p(sctps_timostrmrst, "\t\t{:stream-reset-timer/%ju} "
728 "{N:/stream reset timer%s fired}\n");
729 p(sctps_timoearlyfr, "\t\t{:early-fast-retransmission-timer/%ju} "
730 "{N:/early FR timer%s fired}\n");
731 p1a(sctps_timoasconf, "\t\t{:asconf-timer/%ju} "
732 "{N:/an asconf timer fired}\n");
733 p1a(sctps_timoautoclose, "\t\t{:auto-close-timer/%ju} "
734 "{N:/auto close timer fired}\n");
735 p(sctps_timoassockill, "\t\t{:asoc-free-timer/%ju} "
736 "{N:/asoc free timer%s expired}\n");
737 p(sctps_timoinpkill, "\t\t{:input-free-timer/%ju} "
738 "{N:/inp free timer%s expired}\n");
739 xo_close_container("timeouts");
743 * Early fast retransmission counters
745 p(sctps_earlyfrstart, "\t%ju TODO:sctps_earlyfrstart\n");
746 p(sctps_earlyfrstop, "\t%ju TODO:sctps_earlyfrstop\n");
747 p(sctps_earlyfrmrkretrans, "\t%ju TODO:sctps_earlyfrmrkretrans\n");
748 p(sctps_earlyfrstpout, "\t%ju TODO:sctps_earlyfrstpout\n");
749 p(sctps_earlyfrstpidsck1, "\t%ju TODO:sctps_earlyfrstpidsck1\n");
750 p(sctps_earlyfrstpidsck2, "\t%ju TODO:sctps_earlyfrstpidsck2\n");
751 p(sctps_earlyfrstpidsck3, "\t%ju TODO:sctps_earlyfrstpidsck3\n");
752 p(sctps_earlyfrstpidsck4, "\t%ju TODO:sctps_earlyfrstpidsck4\n");
753 p(sctps_earlyfrstrid, "\t%ju TODO:sctps_earlyfrstrid\n");
754 p(sctps_earlyfrstrout, "\t%ju TODO:sctps_earlyfrstrout\n");
755 p(sctps_earlyfrstrtmr, "\t%ju TODO:sctps_earlyfrstrtmr\n");
761 p1a(sctps_hdrops, "\t{:dropped-too-short/%ju} "
762 "{N:/packet shorter than header}\n");
763 p1a(sctps_badsum, "\t{:dropped-bad-checksum/%ju} "
764 "{N:/checksum error}\n");
765 p1a(sctps_noport, "\t{:dropped-no-endpoint/%ju} "
766 "{N:/no endpoint for port}\n");
767 p1a(sctps_badvtag, "\t{:dropped-bad-v-tag/%ju} "
769 p1a(sctps_badsid, "\t{:dropped-bad-sid/%ju} "
771 p1a(sctps_nomem, "\t{:dropped-no-memory/%ju} "
773 p1a(sctps_fastretransinrtt, "\t{:multiple-fast-retransmits-in-rtt/%ju} "
774 "{N:/number of multiple FR in a RT}T window\n");
776 p(sctps_markedretrans, "\t%ju TODO:sctps_markedretrans\n");
778 p1a(sctps_naglesent, "\t{:rfc813-sent/%ju} "
779 "{N:/RFC813 allowed sending}\n");
780 p1a(sctps_naglequeued, "\t{:rfc813-queued/%ju} "
781 "{N:/RFC813 does not allow sending}\n");
782 p1a(sctps_maxburstqueued, "\t{:max-burst-queued/%ju} "
783 "{N:/times max burst prohibited sending}\n");
784 p1a(sctps_ifnomemqueued, "\t{:no-memory-in-interface/%ju} "
785 "{N:/look ahead tells us no memory in interface}\n");
786 p(sctps_windowprobed, "\t{:sent-window-probes/%ju} "
787 "{N:/number%s of window probes sent}\n");
788 p(sctps_lowlevelerr, "\t{:low-level-err/%ju} "
789 "{N:/time%s an output error to clamp down on next user send}\n");
790 p(sctps_lowlevelerrusr, "\t{:low-level-user-error/%ju} "
791 "{N:/time%s sctp_senderrors were caused from a user}\n");
792 p(sctps_datadropchklmt, "\t{:dropped-chunk-limit/%ju} "
793 "{N:/number of in data drop%s due to chunk limit reached}\n");
794 p(sctps_datadroprwnd, "\t{:dropped-rwnd-limit/%ju} "
795 "{N:/number of in data drop%s due to rwnd limit reached}\n");
796 p(sctps_ecnereducedcwnd, "\t{:ecn-reduced-cwnd/%ju} "
797 "{N:/time%s a ECN reduced the cwnd}\n");
798 p1a(sctps_vtagexpress, "\t{:v-tag-express-lookup/%ju} "
799 "{N:/used express lookup via vtag}\n");
800 p1a(sctps_vtagbogus, "\t{:v-tag-collision/%ju} "
801 "{N:/collision in express lookup}\n");
802 p(sctps_primary_randry, "\t{:sender-ran-dry/%ju} "
803 "{N:/time%s the sender ran dry of user data on primary}\n");
804 p1a(sctps_cmt_randry, "\t{:cmt-ran-dry/%ju} "
805 "{N:/same for above}\n");
806 p(sctps_slowpath_sack, "\t{:slow-path-sack/%ju} "
807 "{N:/sack%s the slow way}\n");
808 p(sctps_wu_sacks_sent, "\t{:sent-window-update-only-sack/%ju} "
809 "{N:/window update only sack%s sent}\n");
810 p(sctps_sends_with_flags, "\t{:sent-with-sinfo/%ju} "
811 "{N:/send%s with sinfo_flags !=0}\n");
812 p(sctps_sends_with_unord, "\t{:sent-with-unordered/%ju} "
813 "{N:/unordered send%s}\n");
814 p(sctps_sends_with_eof, "\t{:sent-with-eof/%ju} "
815 "{N:/send%s with EOF flag set}\n");
816 p(sctps_sends_with_abort, "\t{:sent-with-abort/%ju} "
817 "{N:/send%s with ABORT flag set}\n");
818 p(sctps_protocol_drain_calls, "\t{:protocol-drain-called/%ju} "
819 "{N:/time%s protocol drain called}\n");
820 p(sctps_protocol_drains_done, "\t{:protocol-drain/%ju} "
821 "{N:/time%s we did a protocol drain}\n");
822 p(sctps_read_peeks, "\t{:read-with-peek/%ju} "
823 "{N:/time%s recv was called with peek}\n");
824 p(sctps_cached_chk, "\t{:cached-chunks/%ju} "
825 "{N:/cached chunk%s used}\n");
826 p1a(sctps_cached_strmoq, "\t{:cached-output-queue-used/%ju} "
827 "{N:/cached stream oq's used}\n");
828 p(sctps_left_abandon, "\t{:messages-abandoned/%ju} "
829 "{N:/unread message%s abandonded by close}\n");
830 p1a(sctps_send_burst_avoid, "\t{:send-burst-avoidance/%ju} "
831 "{N:/send burst avoidance, already max burst inflight to net}\n");
832 p1a(sctps_send_cwnd_avoid, "\t{:send-cwnd-avoidance/%ju} "
833 "{N:/send cwnd full avoidance, already max burst inflight "
835 p(sctps_fwdtsn_map_over, "\t{:tsn-map-overruns/%ju} "
836 "{N:/number of map array over-run%s via fwd-tsn's}\n");
840 xo_close_container(name);