2 * Copyright (c) 2001-2007, by Weongyo Jeong. All rights reserved.
3 * Copyright (c) 2011, by Michael Tuexen. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
8 * a) Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
11 * b) Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in
13 * the documentation and/or other materials provided with the distribution.
15 * c) Neither the name of Cisco Systems, Inc. nor the names of its
16 * contributors may be used to endorse or promote products derived
17 * from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
29 * THE POSSIBILITY OF SUCH DAMAGE.
34 static char sccsid[] = "@(#)sctp.c 0.1 (Berkeley) 4/18/2007";
38 #include <sys/cdefs.h>
39 __FBSDID("$FreeBSD$");
41 #include <sys/param.h>
42 #include <sys/queue.h>
43 #include <sys/types.h>
44 #include <sys/socket.h>
45 #include <sys/socketvar.h>
46 #include <sys/sysctl.h>
47 #include <sys/protosw.h>
49 #include <netinet/in.h>
50 #include <netinet/sctp.h>
51 #include <netinet/sctp_constants.h>
52 #include <arpa/inet.h>
69 static void sctp_statesprint(uint32_t state);
71 #define NETSTAT_SCTP_STATES_CLOSED 0x0
72 #define NETSTAT_SCTP_STATES_BOUND 0x1
73 #define NETSTAT_SCTP_STATES_LISTEN 0x2
74 #define NETSTAT_SCTP_STATES_COOKIE_WAIT 0x3
75 #define NETSTAT_SCTP_STATES_COOKIE_ECHOED 0x4
76 #define NETSTAT_SCTP_STATES_ESTABLISHED 0x5
77 #define NETSTAT_SCTP_STATES_SHUTDOWN_SENT 0x6
78 #define NETSTAT_SCTP_STATES_SHUTDOWN_RECEIVED 0x7
79 #define NETSTAT_SCTP_STATES_SHUTDOWN_ACK_SENT 0x8
80 #define NETSTAT_SCTP_STATES_SHUTDOWN_PENDING 0x9
82 static const char *sctpstates[] = {
95 static LIST_HEAD(xladdr_list, xladdr_entry) xladdr_head;
97 struct xsctp_laddr *xladdr;
98 LIST_ENTRY(xladdr_entry) xladdr_entries;
101 static LIST_HEAD(xraddr_list, xraddr_entry) xraddr_head;
102 struct xraddr_entry {
103 struct xsctp_raddr *xraddr;
104 LIST_ENTRY(xraddr_entry) xraddr_entries;
108 sctp_print_address(const char *container, union sctp_sockstore *address,
109 int port, int num_port)
111 struct servent *sp = 0;
117 xo_open_container(container);
119 switch (address->sa.sa_family) {
122 snprintf(line, sizeof(line), "%.*s.",
123 Wflag ? 39 : 16, inetname(&address->sin.sin_addr));
128 snprintf(line, sizeof(line), "%.*s.",
129 Wflag ? 39 : 16, inet6name(&address->sin6.sin6_addr));
133 snprintf(line, sizeof(line), "%.*s.",
134 Wflag ? 39 : 16, "");
139 if (!num_port && port)
140 sp = getservbyport((int)port, "sctp");
142 snprintf(cp, sizeof(line) - alen,
143 "%.15s ", sp ? sp->s_name : "*");
145 snprintf(cp, sizeof(line) - alen,
146 "%d ", ntohs((u_short)port));
147 width = Wflag ? 45 : 22;
148 xo_emit("{d:target/%-*.*s} ", width, width, line);
150 plen = strlen(cp) - 1;
152 xo_emit("{e:address/%*.*s}{e:port/%*.*s}", alen, alen, line, plen,
156 xo_close_container(container);
160 sctp_skip_xinpcb_ifneed(char *buf, const size_t buflen, size_t *offset)
163 struct xsctp_tcb *xstcb;
164 struct xsctp_raddr *xraddr;
165 struct xsctp_laddr *xladdr;
167 while (*offset < buflen) {
168 xladdr = (struct xsctp_laddr *)(buf + *offset);
169 *offset += sizeof(struct xsctp_laddr);
170 if (xladdr->last == 1)
174 while (*offset < buflen) {
175 xstcb = (struct xsctp_tcb *)(buf + *offset);
176 *offset += sizeof(struct xsctp_tcb);
177 if (xstcb->last == 1)
182 while (*offset < buflen) {
183 xladdr = (struct xsctp_laddr *)(buf + *offset);
184 *offset += sizeof(struct xsctp_laddr);
185 if (xladdr->last == 1)
189 while (*offset < buflen) {
190 xraddr = (struct xsctp_raddr *)(buf + *offset);
191 *offset += sizeof(struct xsctp_raddr);
192 if (xraddr->last == 1)
198 * If Lflag is set, we don't care about the return value.
207 sctp_process_tcb(struct xsctp_tcb *xstcb,
208 char *buf, const size_t buflen, size_t *offset, int *indent)
210 int i, xl_total = 0, xr_total = 0, x_max;
211 struct xsctp_raddr *xraddr;
212 struct xsctp_laddr *xladdr;
213 struct xladdr_entry *prev_xl = NULL, *xl = NULL, *xl_tmp;
214 struct xraddr_entry *prev_xr = NULL, *xr = NULL, *xr_tmp;
216 LIST_INIT(&xladdr_head);
217 LIST_INIT(&xraddr_head);
220 * Make `struct xladdr_list' list and `struct xraddr_list' list
221 * to handle the address flexibly.
223 while (*offset < buflen) {
224 xladdr = (struct xsctp_laddr *)(buf + *offset);
225 *offset += sizeof(struct xsctp_laddr);
226 if (xladdr->last == 1)
230 xl = malloc(sizeof(struct xladdr_entry));
232 xo_warnx("malloc %lu bytes",
233 (u_long)sizeof(struct xladdr_entry));
238 LIST_INSERT_HEAD(&xladdr_head, xl, xladdr_entries);
240 LIST_INSERT_AFTER(prev_xl, xl, xladdr_entries);
244 while (*offset < buflen) {
245 xraddr = (struct xsctp_raddr *)(buf + *offset);
246 *offset += sizeof(struct xsctp_raddr);
247 if (xraddr->last == 1)
251 xr = malloc(sizeof(struct xraddr_entry));
253 xo_warnx("malloc %lu bytes",
254 (u_long)sizeof(struct xraddr_entry));
259 LIST_INSERT_HEAD(&xraddr_head, xr, xraddr_entries);
261 LIST_INSERT_AFTER(prev_xr, xr, xraddr_entries);
266 * Let's print the address infos.
268 xo_open_list("address");
269 xl = LIST_FIRST(&xladdr_head);
270 xr = LIST_FIRST(&xraddr_head);
271 x_max = MAX(xl_total, xr_total);
272 for (i = 0; i < x_max; i++) {
273 xo_open_instance("address");
275 if (((*indent == 0) && i > 0) || *indent > 0)
276 xo_emit("{P:/%-12s} ", " ");
279 sctp_print_address("local", &(xl->xladdr->address),
280 htons(xstcb->local_port), numeric_port);
283 xo_emit("{P:/%-45s} ", " ");
285 xo_emit("{P:/%-22s} ", " ");
289 if (xr != NULL && !Lflag) {
290 sctp_print_address("remote", &(xr->xraddr->address),
291 htons(xstcb->remote_port), numeric_port);
295 xl = LIST_NEXT(xl, xladdr_entries);
297 xr = LIST_NEXT(xr, xraddr_entries);
299 if (i == 0 && !Lflag)
300 sctp_statesprint(xstcb->state);
304 xo_close_instance("address");
309 * Free the list which be used to handle the address.
311 xl = LIST_FIRST(&xladdr_head);
313 xl_tmp = LIST_NEXT(xl, xladdr_entries);
318 xr = LIST_FIRST(&xraddr_head);
320 xr_tmp = LIST_NEXT(xr, xraddr_entries);
327 sctp_process_inpcb(struct xsctp_inpcb *xinpcb,
328 char *buf, const size_t buflen, size_t *offset)
330 int indent = 0, xladdr_total = 0, is_listening = 0;
331 static int first = 1;
332 const char *tname, *pname;
333 struct xsctp_tcb *xstcb;
334 struct xsctp_laddr *xladdr;
338 if (xinpcb->maxqlen > 0)
343 xo_emit("Active SCTP associations");
345 xo_emit(" (including servers)");
347 xo_emit("Current listen queue sizes (qlen/maxqlen)");
350 xo_emit("{T:/%-6.6s} {T:/%-5.5s} {T:/%-8.8s} "
352 "Proto", "Type", "Listen", "Local Address");
355 xo_emit("{T:/%-6.6s} {T:/%-5.5s} {T:/%-45.45s} "
356 "{T:/%-45.45s} {T:/%s}\n",
358 "Local Address", "Foreign Address",
361 xo_emit("{T:/%-6.6s} {T:/%-5.5s} {T:/%-22.22s} "
362 "{T:/%-22.22s} {T:/%s}\n",
364 "Local Address", "Foreign Address",
368 xladdr = (struct xsctp_laddr *)(buf + *offset);
369 if ((!aflag && is_listening) ||
370 (Lflag && !is_listening)) {
371 sctp_skip_xinpcb_ifneed(buf, buflen, offset);
375 if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) {
376 /* Can't distinguish between sctp46 and sctp6 */
382 if (xinpcb->flags & SCTP_PCB_FLAGS_TCPTYPE)
384 else if (xinpcb->flags & SCTP_PCB_FLAGS_UDPTYPE)
392 snprintf(buf1, sizeof buf1, "%u/%u",
393 xinpcb->qlen, xinpcb->maxqlen);
394 xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ",
396 xo_emit("{d:queues/%-8.8s}{e:queue-len/%hu}"
397 "{e:max-queue-len/%hu} ",
398 buf1, xinpcb->qlen, xinpcb->maxqlen);
401 offset_laddr = *offset;
404 xo_open_list("local-address");
406 while (*offset < buflen) {
407 xladdr = (struct xsctp_laddr *)(buf + *offset);
408 *offset += sizeof(struct xsctp_laddr);
410 if (aflag && !Lflag && (xladdr_total == 0) && process_closed) {
411 xo_open_instance("local-address");
413 xo_emit("{:protocol/%-6.6s/%s} "
414 "{:type/%-5.5s/%s} ", pname, tname);
416 xo_emit("{P:/%-91.91s/%s} "
417 "{:state/CLOSED}", " ");
419 xo_emit("{P:/%-45.45s/%s} "
420 "{:state/CLOSED}", " ");
422 xo_close_instance("local-address");
424 if (process_closed || is_listening) {
430 if (!Lflag && !is_listening && !process_closed)
433 xo_open_instance("local-address");
435 if (xladdr_total == 0) {
437 xo_emit("{:protocol/%-6.6s/%s} "
438 "{:type/%-5.5s/%s} ", pname, tname);
442 xo_emit(Lflag ? "{P:/%-21.21s} " : "{P:/%-12.12s} ",
445 sctp_print_address("local", &(xladdr->address),
446 htons(xinpcb->local_port), numeric_port);
447 if (aflag && !Lflag && xladdr_total == 0) {
449 if (process_closed) {
450 xo_emit("{P:/%-45.45s} "
451 "{:state/CLOSED}", " ");
453 xo_emit("{P:/%-45.45s} "
454 "{:state/LISTEN}", " ");
457 if (process_closed) {
458 xo_emit("{P:/%-22.22s} "
459 "{:state/CLOSED}", " ");
461 xo_emit("{P:/%-22.22s} "
462 "{:state/LISTEN}", " ");
467 xo_close_instance("local-address");
470 xstcb = (struct xsctp_tcb *)(buf + *offset);
471 *offset += sizeof(struct xsctp_tcb);
472 if (aflag && (xladdr_total == 0) && xstcb->last && !process_closed) {
474 *offset = offset_laddr;
477 while (xstcb->last == 0 && *offset < buflen) {
478 xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ",
480 sctp_process_tcb(xstcb, buf, buflen, offset, &indent);
482 xstcb = (struct xsctp_tcb *)(buf + *offset);
483 *offset += sizeof(struct xsctp_tcb);
486 xo_close_list("local-address");
490 * Print a summary of SCTP connections related to an Internet
494 sctp_protopr(u_long off __unused,
495 const char *name __unused, int af1 __unused, int proto)
498 const char *mibvar = "net.inet.sctp.assoclist";
501 struct xsctp_inpcb *xinpcb;
503 if (proto != IPPROTO_SCTP)
506 if (sysctlbyname(mibvar, 0, &len, 0, 0) < 0) {
508 xo_warn("sysctl: %s", mibvar);
511 if ((buf = malloc(len)) == NULL) {
512 xo_warnx("malloc %lu bytes", (u_long)len);
515 if (sysctlbyname(mibvar, buf, &len, 0, 0) < 0) {
516 xo_warn("sysctl: %s", mibvar);
521 xinpcb = (struct xsctp_inpcb *)(buf + offset);
522 offset += sizeof(struct xsctp_inpcb);
523 while (xinpcb->last == 0 && offset < len) {
524 sctp_process_inpcb(xinpcb, buf, (const size_t)len,
527 xinpcb = (struct xsctp_inpcb *)(buf + offset);
528 offset += sizeof(struct xsctp_inpcb);
535 sctp_statesprint(uint32_t state)
541 idx = NETSTAT_SCTP_STATES_CLOSED;
544 idx = NETSTAT_SCTP_STATES_BOUND;
547 idx = NETSTAT_SCTP_STATES_LISTEN;
549 case SCTP_COOKIE_WAIT:
550 idx = NETSTAT_SCTP_STATES_COOKIE_WAIT;
552 case SCTP_COOKIE_ECHOED:
553 idx = NETSTAT_SCTP_STATES_COOKIE_ECHOED;
555 case SCTP_ESTABLISHED:
556 idx = NETSTAT_SCTP_STATES_ESTABLISHED;
558 case SCTP_SHUTDOWN_SENT:
559 idx = NETSTAT_SCTP_STATES_SHUTDOWN_SENT;
561 case SCTP_SHUTDOWN_RECEIVED:
562 idx = NETSTAT_SCTP_STATES_SHUTDOWN_RECEIVED;
564 case SCTP_SHUTDOWN_ACK_SENT:
565 idx = NETSTAT_SCTP_STATES_SHUTDOWN_ACK_SENT;
567 case SCTP_SHUTDOWN_PENDING:
568 idx = NETSTAT_SCTP_STATES_SHUTDOWN_PENDING;
571 xo_emit("UNKNOWN {:state/0x%08x}", state);
575 xo_emit("{:state/%s}", sctpstates[idx]);
579 * Dump SCTP statistics structure.
582 sctp_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
584 struct sctpstat sctpstat;
586 if (fetch_stats("net.inet.sctp.stats", off, &sctpstat,
587 sizeof(sctpstat), kread) != 0)
590 xo_open_container(name);
591 xo_emit("{T:/%s}:\n", name);
593 #define p(f, m) if (sctpstat.f || sflag <= 1) \
594 xo_emit(m, (uintmax_t)sctpstat.f, plural(sctpstat.f))
595 #define p1a(f, m) if (sctpstat.f || sflag <= 1) \
596 xo_emit(m, (uintmax_t)sctpstat.f)
601 p(sctps_recvpackets, "\t{:received-packets/%ju} "
602 "{N:/input packet%s}\n");
603 p(sctps_recvdatagrams, "\t\t{:received-datagrams/%ju} "
604 "{N:/datagram%s}\n");
605 p(sctps_recvpktwithdata, "\t\t{:received-with-data/%ju} "
606 "{N:/packet%s that had data}\n");
607 p(sctps_recvsacks, "\t\t{:received-sack-chunks/%ju} "
608 "{N:/input SACK chunk%s}\n");
609 p(sctps_recvdata, "\t\t{:received-data-chunks/%ju} "
610 "{N:/input DATA chunk%s}\n");
611 p(sctps_recvdupdata, "\t\t{:received-duplicate-data-chunks/%ju} "
612 "{N:/duplicate DATA chunk%s}\n");
613 p(sctps_recvheartbeat, "\t\t{:received-hb-chunks/%ju} "
614 "{N:/input HB chunk%s}\n");
615 p(sctps_recvheartbeatack, "\t\t{:received-hb-ack-chunks/%ju} "
616 "{N:/HB-ACK chunk%s}\n");
617 p(sctps_recvecne, "\t\t{:received-ecne-chunks/%ju} "
618 "{N:/input ECNE chunk%s}\n");
619 p(sctps_recvauth, "\t\t{:received-auth-chunks/%ju} "
620 "{N:/input AUTH chunk%s}\n");
621 p(sctps_recvauthmissing, "\t\t{:dropped-missing-auth/%ju} "
622 "{N:/chunk%s missing AUTH}\n");
623 p(sctps_recvivalhmacid, "\t\t{:dropped-invalid-hmac/%ju} "
624 "{N:/invalid HMAC id%s received}\n");
625 p(sctps_recvivalkeyid, "\t\t{:dropped-invalid-secret/%ju} "
626 "{N:/invalid secret id%s received}\n");
627 p1a(sctps_recvauthfailed, "\t\t{:dropped-auth-failed/%ju} "
628 "{N:/auth failed}\n");
629 p1a(sctps_recvexpress, "\t\t{:received-fast-path/%ju} "
630 "{N:/fast path receives all one chunk}\n");
631 p1a(sctps_recvexpressm, "\t\t{:receives-fast-path-multipart/%ju} "
632 "{N:/fast path multi-part data}\n");
637 p(sctps_sendpackets, "\t{:sent-packets/%ju} "
638 "{N:/output packet%s}\n");
639 p(sctps_sendsacks, "\t\t{:sent-sacks/%ju} "
640 "{N:/output SACK%s}\n");
641 p(sctps_senddata, "\t\t{:sent-data-chunks/%ju} "
642 "{N:/output DATA chunk%s}\n");
643 p(sctps_sendretransdata, "\t\t{:sent-retransmitted-data-chunks/%ju} "
644 "{N:/retransmitted DATA chunk%s}\n");
645 p(sctps_sendfastretrans, "\t\t"
646 "{:sent-fast-retransmitted-data-chunks/%ju} "
647 "{N:/fast retransmitted DATA chunk%s}\n");
648 p(sctps_sendmultfastretrans, "\t\t"
649 "{:sent-fast-retransmitted-data-chunk-multiple-times/%ju} "
650 "{N:/FR'%s that happened more than once to same chunk}\n");
651 p(sctps_sendheartbeat, "\t\t{:sent-hb-chunks/%ju} "
652 "{N:/output HB chunk%s}\n");
653 p(sctps_sendecne, "\t\t{:sent-ecne-chunks/%ju} "
654 "{N:/output ECNE chunk%s}\n");
655 p(sctps_sendauth, "\t\t{:sent-auth-chunks/%ju} "
656 "{N:/output AUTH chunk%s}\n");
657 p1a(sctps_senderrors, "\t\t{:send-errors/%ju} "
658 "{N:/ip_output error counter}\n");
661 * PCKDROPREP statistics
663 xo_emit("\t{T:Packet drop statistics}:\n");
664 xo_open_container("drop-statistics");
665 p1a(sctps_pdrpfmbox, "\t\t{:middle-box/%ju} "
666 "{N:/from middle box}\n");
667 p1a(sctps_pdrpfehos, "\t\t{:end-host/%ju} "
668 "{N:/from end host}\n");
669 p1a(sctps_pdrpmbda, "\t\t{:with-data/%ju} "
671 p1a(sctps_pdrpmbct, "\t\t{:non-data/%ju} "
672 "{N:/non-data, non-endhost}\n");
673 p1a(sctps_pdrpbwrpt, "\t\t{:non-endhost/%ju} "
674 "{N:/non-endhost, bandwidth rep only}\n");
675 p1a(sctps_pdrpcrupt, "\t\t{:short-header/%ju} "
676 "{N:/not enough for chunk header}\n");
677 p1a(sctps_pdrpnedat, "\t\t{:short-data/%ju} "
678 "{N:/not enough data to confirm}\n");
679 p1a(sctps_pdrppdbrk, "\t\t{:chunk-break/%ju} "
680 "{N:/where process_chunk_drop said break}\n");
681 p1a(sctps_pdrptsnnf, "\t\t{:tsn-not-found/%ju} "
682 "{N:/failed to find TSN}\n");
683 p1a(sctps_pdrpdnfnd, "\t\t{:reverse-tsn/%ju} "
684 "{N:/attempt reverse TSN lookup}\n");
685 p1a(sctps_pdrpdiwnp, "\t\t{:confirmed-zero-window/%ju} "
686 "{N:/e-host confirms zero-rwnd}\n");
687 p1a(sctps_pdrpdizrw, "\t\t{:middle-box-no-space/%ju} "
688 "{N:/midbox confirms no space}\n");
689 p1a(sctps_pdrpbadd, "\t\t{:bad-data/%ju} "
690 "{N:/data did not match TSN}\n");
691 p(sctps_pdrpmark, "\t\t{:tsn-marked-fast-retransmission/%ju} "
692 "{N:/TSN'%s marked for Fast Retran}\n");
693 xo_close_container("drop-statistics");
698 xo_emit("\t{T:Timeouts}:\n");
699 xo_open_container("timeouts");
700 p(sctps_timoiterator, "\t\t{:iterator/%ju} "
701 "{N:/iterator timer%s fired}\n");
702 p(sctps_timodata, "\t\t{:t3-data/%ju} "
703 "{N:/T3 data time out%s}\n");
704 p(sctps_timowindowprobe, "\t\t{:window-probe/%ju} "
705 "{N:/window probe (T3) timer%s fired}\n");
706 p(sctps_timoinit, "\t\t{:init-timer/%ju} "
707 "{N:/INIT timer%s fired}\n");
708 p(sctps_timosack, "\t\t{:sack-timer/%ju} "
709 "{N:/sack timer%s fired}\n");
710 p(sctps_timoshutdown, "\t\t{:shutdown-timer/%ju} "
711 "{N:/shutdown timer%s fired}\n");
712 p(sctps_timoheartbeat, "\t\t{:heartbeat-timer/%ju} "
713 "{N:/heartbeat timer%s fired}\n");
714 p1a(sctps_timocookie, "\t\t{:cookie-timer/%ju} "
715 "{N:/a cookie timeout fired}\n");
716 p1a(sctps_timosecret, "\t\t{:endpoint-changed-cookie/%ju} "
717 "{N:/an endpoint changed its cook}ie"
719 p(sctps_timopathmtu, "\t\t{:pmtu-timer/%ju} "
720 "{N:/PMTU timer%s fired}\n");
721 p(sctps_timoshutdownack, "\t\t{:shutdown-timer/%ju} "
722 "{N:/shutdown ack timer%s fired}\n");
723 p(sctps_timoshutdownguard, "\t\t{:shutdown-guard-timer/%ju} "
724 "{N:/shutdown guard timer%s fired}\n");
725 p(sctps_timostrmrst, "\t\t{:stream-reset-timer/%ju} "
726 "{N:/stream reset timer%s fired}\n");
727 p(sctps_timoearlyfr, "\t\t{:early-fast-retransmission-timer/%ju} "
728 "{N:/early FR timer%s fired}\n");
729 p1a(sctps_timoasconf, "\t\t{:asconf-timer/%ju} "
730 "{N:/an asconf timer fired}\n");
731 p1a(sctps_timoautoclose, "\t\t{:auto-close-timer/%ju} "
732 "{N:/auto close timer fired}\n");
733 p(sctps_timoassockill, "\t\t{:asoc-free-timer/%ju} "
734 "{N:/asoc free timer%s expired}\n");
735 p(sctps_timoinpkill, "\t\t{:input-free-timer/%ju} "
736 "{N:/inp free timer%s expired}\n");
737 xo_close_container("timeouts");
741 * Early fast retransmission counters
743 p(sctps_earlyfrstart, "\t%ju TODO:sctps_earlyfrstart\n");
744 p(sctps_earlyfrstop, "\t%ju TODO:sctps_earlyfrstop\n");
745 p(sctps_earlyfrmrkretrans, "\t%ju TODO:sctps_earlyfrmrkretrans\n");
746 p(sctps_earlyfrstpout, "\t%ju TODO:sctps_earlyfrstpout\n");
747 p(sctps_earlyfrstpidsck1, "\t%ju TODO:sctps_earlyfrstpidsck1\n");
748 p(sctps_earlyfrstpidsck2, "\t%ju TODO:sctps_earlyfrstpidsck2\n");
749 p(sctps_earlyfrstpidsck3, "\t%ju TODO:sctps_earlyfrstpidsck3\n");
750 p(sctps_earlyfrstpidsck4, "\t%ju TODO:sctps_earlyfrstpidsck4\n");
751 p(sctps_earlyfrstrid, "\t%ju TODO:sctps_earlyfrstrid\n");
752 p(sctps_earlyfrstrout, "\t%ju TODO:sctps_earlyfrstrout\n");
753 p(sctps_earlyfrstrtmr, "\t%ju TODO:sctps_earlyfrstrtmr\n");
759 p1a(sctps_hdrops, "\t{:dropped-too-short/%ju} "
760 "{N:/packet shorter than header}\n");
761 p1a(sctps_badsum, "\t{:dropped-bad-checksum/%ju} "
762 "{N:/checksum error}\n");
763 p1a(sctps_noport, "\t{:dropped-no-endpoint/%ju} "
764 "{N:/no endpoint for port}\n");
765 p1a(sctps_badvtag, "\t{:dropped-bad-v-tag/%ju} "
767 p1a(sctps_badsid, "\t{:dropped-bad-sid/%ju} "
769 p1a(sctps_nomem, "\t{:dropped-no-memory/%ju} "
771 p1a(sctps_fastretransinrtt, "\t{:multiple-fast-retransmits-in-rtt/%ju} "
772 "{N:/number of multiple FR in a RT}T window\n");
774 p(sctps_markedretrans, "\t%ju TODO:sctps_markedretrans\n");
776 p1a(sctps_naglesent, "\t{:rfc813-sent/%ju} "
777 "{N:/RFC813 allowed sending}\n");
778 p1a(sctps_naglequeued, "\t{:rfc813-queued/%ju} "
779 "{N:/RFC813 does not allow sending}\n");
780 p1a(sctps_maxburstqueued, "\t{:max-burst-queued/%ju} "
781 "{N:/times max burst prohibited sending}\n");
782 p1a(sctps_ifnomemqueued, "\t{:no-memory-in-interface/%ju} "
783 "{N:/look ahead tells us no memory in interface}\n");
784 p(sctps_windowprobed, "\t{:sent-window-probes/%ju} "
785 "{N:/number%s of window probes sent}\n");
786 p(sctps_lowlevelerr, "\t{:low-level-err/%ju} "
787 "{N:/time%s an output error to clamp down on next user send}\n");
788 p(sctps_lowlevelerrusr, "\t{:low-level-user-error/%ju} "
789 "{N:/time%s sctp_senderrors were caused from a user}\n");
790 p(sctps_datadropchklmt, "\t{:dropped-chunk-limit/%ju} "
791 "{N:/number of in data drop%s due to chunk limit reached}\n");
792 p(sctps_datadroprwnd, "\t{:dropped-rwnd-limit/%ju} "
793 "{N:/number of in data drop%s due to rwnd limit reached}\n");
794 p(sctps_ecnereducedcwnd, "\t{:ecn-reduced-cwnd/%ju} "
795 "{N:/time%s a ECN reduced the cwnd}\n");
796 p1a(sctps_vtagexpress, "\t{:v-tag-express-lookup/%ju} "
797 "{N:/used express lookup via vtag}\n");
798 p1a(sctps_vtagbogus, "\t{:v-tag-collision/%ju} "
799 "{N:/collision in express lookup}\n");
800 p(sctps_primary_randry, "\t{:sender-ran-dry/%ju} "
801 "{N:/time%s the sender ran dry of user data on primary}\n");
802 p1a(sctps_cmt_randry, "\t{:cmt-ran-dry/%ju} "
803 "{N:/same for above}\n");
804 p(sctps_slowpath_sack, "\t{:slow-path-sack/%ju} "
805 "{N:/sack%s the slow way}\n");
806 p(sctps_wu_sacks_sent, "\t{:sent-window-update-only-sack/%ju} "
807 "{N:/window update only sack%s sent}\n");
808 p(sctps_sends_with_flags, "\t{:sent-with-sinfo/%ju} "
809 "{N:/send%s with sinfo_flags !=0}\n");
810 p(sctps_sends_with_unord, "\t{:sent-with-unordered/%ju} "
811 "{N:/unordered send%s}\n");
812 p(sctps_sends_with_eof, "\t{:sent-with-eof/%ju} "
813 "{N:/send%s with EOF flag set}\n");
814 p(sctps_sends_with_abort, "\t{:sent-with-abort/%ju} "
815 "{N:/send%s with ABORT flag set}\n");
816 p(sctps_protocol_drain_calls, "\t{:protocol-drain-called/%ju} "
817 "{N:/time%s protocol drain called}\n");
818 p(sctps_protocol_drains_done, "\t{:protocol-drain/%ju} "
819 "{N:/time%s we did a protocol drain}\n");
820 p(sctps_read_peeks, "\t{:read-with-peek/%ju} "
821 "{N:/time%s recv was called with peek}\n");
822 p(sctps_cached_chk, "\t{:cached-chunks/%ju} "
823 "{N:/cached chunk%s used}\n");
824 p1a(sctps_cached_strmoq, "\t{:cached-output-queue-used/%ju} "
825 "{N:/cached stream oq's used}\n");
826 p(sctps_left_abandon, "\t{:messages-abandoned/%ju} "
827 "{N:/unread message%s abandonded by close}\n");
828 p1a(sctps_send_burst_avoid, "\t{:send-burst-avoidance/%ju} "
829 "{N:/send burst avoidance, already max burst inflight to net}\n");
830 p1a(sctps_send_cwnd_avoid, "\t{:send-cwnd-avoidance/%ju} "
831 "{N:/send cwnd full avoidance, already max burst inflight "
833 p(sctps_fwdtsn_map_over, "\t{:tsn-map-overruns/%ju} "
834 "{N:/number of map array over-run%s via fwd-tsn's}\n");
838 xo_close_container(name);