2 * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
10 * b) Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the distribution.
14 * c) Neither the name of Cisco Systems, Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived
16 * from this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
31 #include <sys/cdefs.h>
32 __FBSDID("$FreeBSD$");
34 #include <netinet/sctp_os.h>
35 #include <netinet/sctp_constants.h>
36 #include <netinet/sctp_sysctl.h>
37 #include <netinet/sctp_pcb.h>
38 #include <netinet/sctputil.h>
39 #include <netinet/sctp_output.h>
41 * sysctl tunable variables
43 uint32_t sctp_sendspace = (128 * 1024);
44 uint32_t sctp_recvspace = 128 * (1024 +
46 sizeof(struct sockaddr_in6)
48 sizeof(struct sockaddr_in)
51 uint32_t sctp_mbuf_threshold_count = SCTP_DEFAULT_MBUFS_IN_CHAIN;
52 uint32_t sctp_auto_asconf = SCTP_DEFAULT_AUTO_ASCONF;
53 uint32_t sctp_ecn_enable = 1;
54 uint32_t sctp_ecn_nonce = 0;
55 uint32_t sctp_strict_sacks = 0;
56 uint32_t sctp_no_csum_on_loopback = 1;
57 uint32_t sctp_strict_init = 1;
58 uint32_t sctp_abort_if_one_2_one_hits_limit = 0;
59 uint32_t sctp_strict_data_order = 0;
61 uint32_t sctp_peer_chunk_oh = SCTPCTL_PEER_CHKOH_DEFAULT;
62 uint32_t sctp_max_burst_default = SCTP_DEF_MAX_BURST;
63 uint32_t sctp_use_cwnd_based_maxburst = 1;
64 uint32_t sctp_do_drain = 1;
65 uint32_t sctp_hb_maxburst = SCTP_DEF_MAX_BURST;
66 uint32_t sctp_logging_level = SCTPCTL_LOGGING_LEVEL_DEFAULT;
69 uint32_t sctp_max_chunks_on_queue = SCTP_ASOC_MAX_CHUNKS_ON_QUEUE;
70 uint32_t sctp_delayed_sack_time_default = SCTP_RECV_MSEC;
71 uint32_t sctp_sack_freq_default = SCTP_DEFAULT_SACK_FREQ;
72 uint32_t sctp_heartbeat_interval_default = SCTP_HB_DEFAULT_MSEC;
73 uint32_t sctp_pmtu_raise_time_default = SCTP_DEF_PMTU_RAISE_SEC;
74 uint32_t sctp_shutdown_guard_time_default = SCTP_DEF_MAX_SHUTDOWN_SEC;
75 uint32_t sctp_secret_lifetime_default = SCTP_DEFAULT_SECRET_LIFE_SEC;
76 uint32_t sctp_rto_max_default = SCTP_RTO_UPPER_BOUND;
77 uint32_t sctp_rto_min_default = SCTP_RTO_LOWER_BOUND;
78 uint32_t sctp_rto_initial_default = SCTP_RTO_INITIAL;
79 uint32_t sctp_init_rto_max_default = SCTP_RTO_UPPER_BOUND;
80 uint32_t sctp_valid_cookie_life_default = SCTP_DEFAULT_COOKIE_LIFE;
81 uint32_t sctp_init_rtx_max_default = SCTP_DEF_MAX_INIT;
82 uint32_t sctp_assoc_rtx_max_default = SCTP_DEF_MAX_SEND;
83 uint32_t sctp_path_rtx_max_default = SCTP_DEF_MAX_PATH_RTX;
84 uint32_t sctp_nr_outgoing_streams_default = SCTP_OSTREAM_INITIAL;
85 uint32_t sctp_add_more_threshold = SCTP_DEFAULT_ADD_MORE;
86 uint32_t sctp_asoc_free_resc_limit = SCTP_DEF_ASOC_RESC_LIMIT;
87 uint32_t sctp_system_free_resc_limit = SCTP_DEF_SYSTEM_RESC_LIMIT;
89 uint32_t sctp_min_split_point = SCTP_DEFAULT_SPLIT_POINT_MIN;
90 uint32_t sctp_pcbtblsize = SCTP_PCBHASHSIZE;
91 uint32_t sctp_hashtblsize = SCTP_TCBHASHSIZE;
92 uint32_t sctp_chunkscale = SCTP_CHUNKQUEUE_SCALE;
94 uint32_t sctp_cmt_on_off = 0;
95 uint32_t sctp_cmt_use_dac = 0;
96 uint32_t sctp_max_retran_chunk = SCTPCTL_MAX_RETRAN_CHUNK_DEFAULT;
99 uint32_t sctp_L2_abc_variable = 1;
100 uint32_t sctp_early_fr = 0;
101 uint32_t sctp_early_fr_msec = SCTP_MINFR_MSEC_TIMER;
102 uint32_t sctp_says_check_for_deadlock = 0;
103 uint32_t sctp_asconf_auth_nochk = 0;
104 uint32_t sctp_auth_disable = 0;
105 uint32_t sctp_nat_friendly = 1;
106 uint32_t sctp_min_residual = SCTPCTL_MIN_RESIDUAL_DEFAULT;;
109 struct sctpstat sctpstat;
112 uint32_t sctp_debug_on = 0;
118 /* It returns an upper limit. No filtering is done here */
120 number_of_addresses(struct sctp_inpcb *inp)
123 struct sctp_vrf *vrf;
124 struct sctp_ifn *sctp_ifn;
125 struct sctp_ifa *sctp_ifa;
126 struct sctp_laddr *laddr;
129 /* neither Mac OS X nor FreeBSD support mulitple routing functions */
130 if ((vrf = sctp_find_vrf(inp->def_vrf_id)) == NULL) {
133 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
134 LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) {
135 LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) {
136 if ((sctp_ifa->address.sa.sa_family == AF_INET) ||
137 (sctp_ifa->address.sa.sa_family == AF_INET6)) {
143 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
144 if ((laddr->ifa->address.sa.sa_family == AF_INET) ||
145 (laddr->ifa->address.sa.sa_family == AF_INET6)) {
154 copy_out_local_addresses(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sysctl_req *req)
156 struct sctp_ifn *sctp_ifn;
157 struct sctp_ifa *sctp_ifa;
158 int loopback_scope, ipv4_local_scope, local_scope, site_scope;
159 int ipv4_addr_legal, ipv6_addr_legal;
160 struct sctp_vrf *vrf;
161 struct xsctp_laddr xladdr;
162 struct sctp_laddr *laddr;
165 /* Turn on all the appropriate scope */
167 /* use association specific values */
168 loopback_scope = stcb->asoc.loopback_scope;
169 ipv4_local_scope = stcb->asoc.ipv4_local_scope;
170 local_scope = stcb->asoc.local_scope;
171 site_scope = stcb->asoc.site_scope;
173 /* use generic values for endpoints */
175 ipv4_local_scope = 1;
180 /* use only address families of interest */
181 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
183 if (SCTP_IPV6_V6ONLY(inp)) {
195 /* neither Mac OS X nor FreeBSD support mulitple routing functions */
196 if ((vrf = sctp_find_vrf(inp->def_vrf_id)) == NULL) {
197 SCTP_INP_RUNLOCK(inp);
198 SCTP_INP_INFO_RUNLOCK();
201 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
202 LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) {
203 if ((loopback_scope == 0) && SCTP_IFN_IS_IFT_LOOP(sctp_ifn))
204 /* Skip loopback if loopback_scope not set */
206 LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) {
209 * ignore if blacklisted at
212 if (sctp_is_addr_restricted(stcb, sctp_ifa))
215 if ((sctp_ifa->address.sa.sa_family == AF_INET) && (ipv4_addr_legal)) {
216 struct sockaddr_in *sin;
218 sin = (struct sockaddr_in *)&sctp_ifa->address.sa;
219 if (sin->sin_addr.s_addr == 0)
221 if ((ipv4_local_scope == 0) && (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)))
223 } else if ((sctp_ifa->address.sa.sa_family == AF_INET6) && (ipv6_addr_legal)) {
224 struct sockaddr_in6 *sin6;
226 sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sa;
227 if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr))
229 if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
230 if (local_scope == 0)
232 if (sin6->sin6_scope_id == 0) {
237 if (sa6_recoverscope(sin6) != 0)
241 if ((site_scope == 0) && (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)))
245 memset((void *)&xladdr, 0, sizeof(union sctp_sockstore));
246 memcpy((void *)&xladdr.address, (const void *)&sctp_ifa->address, sizeof(union sctp_sockstore));
247 (void)SCTP_GETTIME_TIMEVAL(&xladdr.start_time);
248 SCTP_INP_RUNLOCK(inp);
249 SCTP_INP_INFO_RUNLOCK();
250 error = SYSCTL_OUT(req, &xladdr, sizeof(struct xsctp_laddr));
254 SCTP_INP_INFO_RLOCK();
260 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
261 /* ignore if blacklisted at association level */
262 if (stcb && sctp_is_addr_restricted(stcb, laddr->ifa))
264 memset((void *)&xladdr, 0, sizeof(union sctp_sockstore));
265 memcpy((void *)&xladdr.address, (const void *)&laddr->ifa->address, sizeof(union sctp_sockstore));
266 xladdr.start_time = laddr->start_time;
267 SCTP_INP_RUNLOCK(inp);
268 SCTP_INP_INFO_RUNLOCK();
269 error = SYSCTL_OUT(req, &xladdr, sizeof(struct xsctp_laddr));
273 SCTP_INP_INFO_RLOCK();
278 memset((void *)&xladdr, 0, sizeof(union sctp_sockstore));
280 SCTP_INP_RUNLOCK(inp);
281 SCTP_INP_INFO_RUNLOCK();
282 error = SYSCTL_OUT(req, &xladdr, sizeof(struct xsctp_laddr));
288 SCTP_INP_INFO_RLOCK();
298 sctp_assoclist(SYSCTL_HANDLER_ARGS)
300 unsigned int number_of_endpoints;
301 unsigned int number_of_local_addresses;
302 unsigned int number_of_associations;
303 unsigned int number_of_remote_addresses;
306 struct sctp_inpcb *inp;
307 struct sctp_tcb *stcb;
308 struct sctp_nets *net;
309 struct xsctp_inpcb xinpcb;
310 struct xsctp_tcb xstcb;
311 struct xsctp_raddr xraddr;
313 number_of_endpoints = 0;
314 number_of_local_addresses = 0;
315 number_of_associations = 0;
316 number_of_remote_addresses = 0;
318 SCTP_INP_INFO_RLOCK();
319 if (req->oldptr == USER_ADDR_NULL) {
320 LIST_FOREACH(inp, &sctppcbinfo.listhead, sctp_list) {
322 number_of_endpoints++;
323 number_of_local_addresses += number_of_addresses(inp);
324 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
325 number_of_associations++;
326 number_of_local_addresses += number_of_addresses(inp);
327 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
328 number_of_remote_addresses++;
331 SCTP_INP_RUNLOCK(inp);
333 SCTP_INP_INFO_RUNLOCK();
334 n = (number_of_endpoints + 1) * sizeof(struct xsctp_inpcb) +
335 (number_of_local_addresses + number_of_endpoints + number_of_associations) * sizeof(struct xsctp_laddr) +
336 (number_of_associations + number_of_endpoints) * sizeof(struct xsctp_tcb) +
337 (number_of_remote_addresses + number_of_associations) * sizeof(struct xsctp_raddr);
339 /* request some more memory than needed */
340 req->oldidx = (n + n / 8);
343 if (req->newptr != USER_ADDR_NULL) {
344 SCTP_INP_INFO_RUNLOCK();
347 LIST_FOREACH(inp, &sctppcbinfo.listhead, sctp_list) {
350 xinpcb.local_port = ntohs(inp->sctp_lport);
351 xinpcb.flags = inp->sctp_flags;
352 xinpcb.features = inp->sctp_features;
353 xinpcb.total_sends = inp->total_sends;
354 xinpcb.total_recvs = inp->total_recvs;
355 xinpcb.total_nospaces = inp->total_nospaces;
356 xinpcb.fragmentation_point = inp->sctp_frag_point;
357 xinpcb.qlen = inp->sctp_socket->so_qlen;
358 xinpcb.maxqlen = inp->sctp_socket->so_qlimit;
359 SCTP_INP_INCR_REF(inp);
360 SCTP_INP_RUNLOCK(inp);
361 SCTP_INP_INFO_RUNLOCK();
362 error = SYSCTL_OUT(req, &xinpcb, sizeof(struct xsctp_inpcb));
364 SCTP_INP_DECR_REF(inp);
367 SCTP_INP_INFO_RLOCK();
369 error = copy_out_local_addresses(inp, NULL, req);
371 SCTP_INP_DECR_REF(inp);
374 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
376 atomic_add_int(&stcb->asoc.refcnt, 1);
377 SCTP_TCB_UNLOCK(stcb);
379 xstcb.local_port = ntohs(inp->sctp_lport);
380 xstcb.remote_port = ntohs(stcb->rport);
381 if (stcb->asoc.primary_destination != NULL)
382 xstcb.primary_addr = stcb->asoc.primary_destination->ro._l_addr;
383 xstcb.heartbeat_interval = stcb->asoc.heart_beat_delay;
384 xstcb.state = SCTP_GET_STATE(&stcb->asoc); /* FIXME */
385 xstcb.in_streams = stcb->asoc.streamincnt;
386 xstcb.out_streams = stcb->asoc.streamoutcnt;
387 xstcb.max_nr_retrans = stcb->asoc.overall_error_count;
388 xstcb.primary_process = 0; /* not really supported
390 xstcb.T1_expireries = stcb->asoc.timoinit + stcb->asoc.timocookie;
391 xstcb.T2_expireries = stcb->asoc.timoshutdown + stcb->asoc.timoshutdownack;
392 xstcb.retransmitted_tsns = stcb->asoc.marked_retrans;
393 xstcb.start_time = stcb->asoc.start_time;
394 xstcb.discontinuity_time = stcb->asoc.discontinuity_time;
396 xstcb.total_sends = stcb->total_sends;
397 xstcb.total_recvs = stcb->total_recvs;
398 xstcb.local_tag = stcb->asoc.my_vtag;
399 xstcb.remote_tag = stcb->asoc.peer_vtag;
400 xstcb.initial_tsn = stcb->asoc.init_seq_number;
401 xstcb.highest_tsn = stcb->asoc.sending_seq - 1;
402 xstcb.cumulative_tsn = stcb->asoc.last_acked_seq;
403 xstcb.cumulative_tsn_ack = stcb->asoc.cumulative_tsn;
404 xstcb.mtu = stcb->asoc.smallest_mtu;
405 xstcb.refcnt = stcb->asoc.refcnt;
406 SCTP_INP_RUNLOCK(inp);
407 SCTP_INP_INFO_RUNLOCK();
408 error = SYSCTL_OUT(req, &xstcb, sizeof(struct xsctp_tcb));
410 SCTP_INP_DECR_REF(inp);
411 atomic_add_int(&stcb->asoc.refcnt, -1);
414 SCTP_INP_INFO_RLOCK();
416 error = copy_out_local_addresses(inp, stcb, req);
418 SCTP_INP_DECR_REF(inp);
419 atomic_add_int(&stcb->asoc.refcnt, -1);
422 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
424 xraddr.address = net->ro._l_addr;
425 xraddr.active = ((net->dest_state & SCTP_ADDR_REACHABLE) == SCTP_ADDR_REACHABLE);
426 xraddr.confirmed = ((net->dest_state & SCTP_ADDR_UNCONFIRMED) == 0);
427 xraddr.heartbeat_enabled = ((net->dest_state & SCTP_ADDR_NOHB) == 0);
428 xraddr.rto = net->RTO;
429 xraddr.max_path_rtx = net->failure_threshold;
430 xraddr.rtx = net->marked_retrans;
431 xraddr.error_counter = net->error_count;
432 xraddr.cwnd = net->cwnd;
433 xraddr.flight_size = net->flight_size;
434 xraddr.mtu = net->mtu;
435 xraddr.start_time = net->start_time;
436 SCTP_INP_RUNLOCK(inp);
437 SCTP_INP_INFO_RUNLOCK();
438 error = SYSCTL_OUT(req, &xraddr, sizeof(struct xsctp_raddr));
440 SCTP_INP_DECR_REF(inp);
441 atomic_add_int(&stcb->asoc.refcnt, -1);
444 SCTP_INP_INFO_RLOCK();
447 atomic_add_int(&stcb->asoc.refcnt, -1);
448 memset((void *)&xraddr, 0, sizeof(struct xsctp_raddr));
450 SCTP_INP_RUNLOCK(inp);
451 SCTP_INP_INFO_RUNLOCK();
452 error = SYSCTL_OUT(req, &xraddr, sizeof(struct xsctp_raddr));
454 SCTP_INP_DECR_REF(inp);
457 SCTP_INP_INFO_RLOCK();
460 SCTP_INP_RUNLOCK(inp);
461 SCTP_INP_INFO_RUNLOCK();
462 memset((void *)&xstcb, 0, sizeof(struct xsctp_tcb));
464 error = SYSCTL_OUT(req, &xstcb, sizeof(struct xsctp_tcb));
468 SCTP_INP_INFO_RLOCK();
469 SCTP_INP_DECR_REF(inp);
471 SCTP_INP_INFO_RUNLOCK();
473 memset((void *)&xinpcb, 0, sizeof(struct xsctp_inpcb));
475 error = SYSCTL_OUT(req, &xinpcb, sizeof(struct xsctp_inpcb));
484 SYSCTL_INT(_net_inet_sctp, OID_AUTO, sendspace, CTLFLAG_RW,
485 &sctp_sendspace, 0, "Maximum outgoing SCTP buffer size");
487 SYSCTL_INT(_net_inet_sctp, OID_AUTO, recvspace, CTLFLAG_RW,
488 &sctp_recvspace, 0, "Maximum incoming SCTP buffer size");
490 #if defined(__FreeBSD__) || defined(SCTP_APPLE_AUTO_ASCONF)
491 SYSCTL_INT(_net_inet_sctp, OID_AUTO, auto_asconf, CTLFLAG_RW,
492 &sctp_auto_asconf, 0, "Enable SCTP Auto-ASCONF");
495 SYSCTL_INT(_net_inet_sctp, OID_AUTO, ecn_enable, CTLFLAG_RW,
496 &sctp_ecn_enable, 0, "Enable SCTP ECN");
498 SYSCTL_INT(_net_inet_sctp, OID_AUTO, ecn_nonce, CTLFLAG_RW,
499 &sctp_ecn_nonce, 0, "Enable SCTP ECN Nonce");
501 SYSCTL_INT(_net_inet_sctp, OID_AUTO, strict_sacks, CTLFLAG_RW,
502 &sctp_strict_sacks, 0, "Enable SCTP Strict SACK checking");
504 SYSCTL_INT(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLFLAG_RW,
505 &sctp_no_csum_on_loopback, 0,
506 "Enable NO Csum on packets sent on loopback");
508 SYSCTL_INT(_net_inet_sctp, OID_AUTO, strict_init, CTLFLAG_RW,
509 &sctp_strict_init, 0,
510 "Enable strict INIT/INIT-ACK singleton enforcement");
512 SYSCTL_INT(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLFLAG_RW,
513 &sctp_peer_chunk_oh, 0,
514 "Amount to debit peers rwnd per chunk sent");
516 SYSCTL_INT(_net_inet_sctp, OID_AUTO, maxburst, CTLFLAG_RW,
517 &sctp_max_burst_default, 0,
518 "Default max burst for sctp endpoints");
520 SYSCTL_INT(_net_inet_sctp, OID_AUTO, maxchunks, CTLFLAG_RW,
521 &sctp_max_chunks_on_queue, 0,
522 "Default max chunks on queue per asoc");
524 SYSCTL_INT(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLFLAG_RW,
525 &sctp_hashtblsize, 0,
526 "Tuneable for Hash table sizes");
528 SYSCTL_INT(_net_inet_sctp, OID_AUTO, min_split_point, CTLFLAG_RW,
529 &sctp_min_split_point, 0,
530 "Minimum size when splitting a chunk");
532 SYSCTL_INT(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLFLAG_RW,
534 "Tuneable for PCB Hash table sizes");
536 SYSCTL_INT(_net_inet_sctp, OID_AUTO, sys_resource, CTLFLAG_RW,
537 &sctp_system_free_resc_limit, 0,
538 "Max number of cached resources in the system");
540 SYSCTL_INT(_net_inet_sctp, OID_AUTO, asoc_resource, CTLFLAG_RW,
541 &sctp_asoc_free_resc_limit, 0,
542 "Max number of cached resources in an asoc");
544 SYSCTL_INT(_net_inet_sctp, OID_AUTO, chunkscale, CTLFLAG_RW,
546 "Tuneable for Scaling of number of chunks and messages");
548 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLFLAG_RW,
549 &sctp_delayed_sack_time_default, 0,
550 "Default delayed SACK timer in msec");
552 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, sack_freq, CTLFLAG_RW,
553 &sctp_sack_freq_default, 0,
554 "Default SACK frequency");
556 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLFLAG_RW,
557 &sctp_heartbeat_interval_default, 0,
558 "Default heartbeat interval in msec");
560 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLFLAG_RW,
561 &sctp_pmtu_raise_time_default, 0,
562 "Default PMTU raise timer in sec");
564 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLFLAG_RW,
565 &sctp_shutdown_guard_time_default, 0,
566 "Default shutdown guard timer in sec");
568 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLFLAG_RW,
569 &sctp_secret_lifetime_default, 0,
570 "Default secret lifetime in sec");
572 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, rto_max, CTLFLAG_RW,
573 &sctp_rto_max_default, 0,
574 "Default maximum retransmission timeout in msec");
576 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, rto_min, CTLFLAG_RW,
577 &sctp_rto_min_default, 0,
578 "Default minimum retransmission timeout in msec");
580 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, rto_initial, CTLFLAG_RW,
581 &sctp_rto_initial_default, 0,
582 "Default initial retransmission timeout in msec");
584 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, init_rto_max, CTLFLAG_RW,
585 &sctp_init_rto_max_default, 0,
586 "Default maximum retransmission timeout during association setup in msec");
588 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLFLAG_RW,
589 &sctp_valid_cookie_life_default, 0,
590 "Default cookie lifetime in ticks");
592 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLFLAG_RW,
593 &sctp_init_rtx_max_default, 0,
594 "Default maximum number of retransmission for INIT chunks");
596 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLFLAG_RW,
597 &sctp_assoc_rtx_max_default, 0,
598 "Default maximum number of retransmissions per association");
600 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLFLAG_RW,
601 &sctp_path_rtx_max_default, 0,
602 "Default maximum of retransmissions per path");
604 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLFLAG_RW,
605 &sctp_add_more_threshold, 0,
606 "When space wise is it worthwhile to try to add more to a socket send buffer");
608 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLFLAG_RW,
609 &sctp_nr_outgoing_streams_default, 0,
610 "Default number of outgoing streams");
612 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLFLAG_RW,
616 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLFLAG_RW,
617 &sctp_use_cwnd_based_maxburst, 0,
618 "Use a CWND adjusting maxburst");
620 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, early_fast_retran, CTLFLAG_RW,
622 "Early Fast Retransmit with timer");
624 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, deadlock_detect, CTLFLAG_RW,
625 &sctp_says_check_for_deadlock, 0,
626 "SMP Deadlock detection on/off");
628 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, early_fast_retran_msec, CTLFLAG_RW,
629 &sctp_early_fr_msec, 0,
630 "Early Fast Retransmit minimum timer value");
632 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, asconf_auth_nochk, CTLFLAG_RW,
633 &sctp_asconf_auth_nochk, 0,
634 "Disable SCTP ASCONF AUTH requirement");
636 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, auth_disable, CTLFLAG_RW,
637 &sctp_auth_disable, 0,
638 "Disable SCTP AUTH function");
640 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, nat_friendly, CTLFLAG_RW,
641 &sctp_nat_friendly, 0,
642 "SCTP NAT friendly operation");
644 SYSCTL_INT(_net_inet_sctp, OID_AUTO, abc_l_var, CTLFLAG_RW,
645 &sctp_L2_abc_variable, 0,
646 "SCTP ABC max increase per SACK (L)");
648 SYSCTL_INT(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLFLAG_RW,
649 &sctp_mbuf_threshold_count, 0,
650 "Default max number of small mbufs on a chain");
652 SYSCTL_UINT(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLFLAG_RW,
653 &sctp_cmt_use_dac, 0,
654 "CMT DAC ON/OFF flag");
656 SYSCTL_INT(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLFLAG_RW,
658 "Should SCTP respond to the drain calls");
660 SYSCTL_INT(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLFLAG_RW,
661 &sctp_hb_maxburst, 0,
662 "Confirmation Heartbeat max burst?");
664 SYSCTL_INT(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLFLAG_RW,
665 &sctp_abort_if_one_2_one_hits_limit, 0,
666 "When one-2-one hits qlimit abort");
668 SYSCTL_INT(_net_inet_sctp, OID_AUTO, strict_data_order, CTLFLAG_RW,
669 &sctp_strict_data_order, 0,
670 "Enforce strict data ordering, abort if control inside data");
672 SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_RW,
674 "SCTP statistics (struct sctps_stat, netinet/sctp.h");
676 SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLFLAG_RD,
677 0, 0, sctp_assoclist,
678 "S,xassoc", "List of active SCTP associations");
680 SYSCTL_INT(_net_inet_sctp, OID_AUTO, min_residual, CTLFLAG_RW,
681 &sctp_min_residual, 0,
682 SCTPCTL_MIN_RESIDUAL_DESC);
684 SYSCTL_INT(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLFLAG_RW,
685 &sctp_max_retran_chunk, 0,
686 SCTPCTL_MAX_RETRAN_CHUNK_DESC);
688 SYSCTL_INT(_net_inet_sctp, OID_AUTO, sctp_logging, CTLFLAG_RW,
689 &sctp_logging_level, 0,
690 SCTPCTL_LOGGING_LEVEL_DESC);
694 SYSCTL_INT(_net_inet_sctp, OID_AUTO, debug, CTLFLAG_RW,
695 &sctp_debug_on, 0, "Configure debug output");
696 #endif /* SCTP_DEBUG */