142551e99SRandall Stewart /*- 2b1006367SRandall Stewart * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved. 35d40cf5dSRandall Stewart * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. 45d40cf5dSRandall Stewart * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. 542551e99SRandall Stewart * 642551e99SRandall Stewart * Redistribution and use in source and binary forms, with or without 742551e99SRandall Stewart * modification, are permitted provided that the following conditions are met: 842551e99SRandall Stewart * 942551e99SRandall Stewart * a) Redistributions of source code must retain the above copyright notice, 1042551e99SRandall Stewart * this list of conditions and the following disclaimer. 1142551e99SRandall Stewart * 1242551e99SRandall Stewart * b) Redistributions in binary form must reproduce the above copyright 1342551e99SRandall Stewart * notice, this list of conditions and the following disclaimer in 1442551e99SRandall Stewart * the documentation and/or other materials provided with the distribution. 1542551e99SRandall Stewart * 1642551e99SRandall Stewart * c) Neither the name of Cisco Systems, Inc. nor the names of its 1742551e99SRandall Stewart * contributors may be used to endorse or promote products derived 1842551e99SRandall Stewart * from this software without specific prior written permission. 1942551e99SRandall Stewart * 2042551e99SRandall Stewart * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2142551e99SRandall Stewart * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 2242551e99SRandall Stewart * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2342551e99SRandall Stewart * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 2442551e99SRandall Stewart * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2542551e99SRandall Stewart * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2642551e99SRandall Stewart * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2742551e99SRandall Stewart * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2842551e99SRandall Stewart * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2942551e99SRandall Stewart * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 3042551e99SRandall Stewart * THE POSSIBILITY OF SUCH DAMAGE. 3142551e99SRandall Stewart */ 3242551e99SRandall Stewart 3342551e99SRandall Stewart #include <sys/cdefs.h> 3442551e99SRandall Stewart __FBSDID("$FreeBSD$"); 3542551e99SRandall Stewart 3642551e99SRandall Stewart #include <netinet/sctp_os.h> 37b3f1ea41SRandall Stewart #include <netinet/sctp.h> 3842551e99SRandall Stewart #include <netinet/sctp_constants.h> 3942551e99SRandall Stewart #include <netinet/sctp_sysctl.h> 4042551e99SRandall Stewart #include <netinet/sctp_pcb.h> 4142551e99SRandall Stewart #include <netinet/sctputil.h> 42d61a0ae0SRandall Stewart #include <netinet/sctp_output.h> 43ff014514SRandall Stewart #include <sys/smp.h> 44b3f1ea41SRandall Stewart 4542551e99SRandall Stewart /* 4642551e99SRandall Stewart * sysctl tunable variables 4742551e99SRandall Stewart */ 485e54f665SRandall Stewart 49b3f1ea41SRandall Stewart void 50b3f1ea41SRandall Stewart sctp_init_sysctls() 51b3f1ea41SRandall Stewart { 52b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_sendspace) = SCTPCTL_MAXDGRAM_DEFAULT; 53b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_recvspace) = SCTPCTL_RECVSPACE_DEFAULT; 54b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_auto_asconf) = SCTPCTL_AUTOASCONF_DEFAULT; 55b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_multiple_asconfs) = SCTPCTL_MULTIPLEASCONFS_DEFAULT; 56b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_ecn_enable) = SCTPCTL_ECN_ENABLE_DEFAULT; 57b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_strict_sacks) = SCTPCTL_STRICT_SACKS_DEFAULT; 589c7635e1SMichael Tuexen #if !defined(SCTP_WITH_NO_CSUM) 59b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) = SCTPCTL_LOOPBACK_NOCSUM_DEFAULT; 609c7635e1SMichael Tuexen #endif 61b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_strict_init) = SCTPCTL_STRICT_INIT_DEFAULT; 62b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT; 63b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT; 64899288aeSRandall Stewart SCTP_BASE_SYSCTL(sctp_fr_max_burst_default) = SCTPCTL_FRMAXBURST_DEFAULT; 65b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue) = SCTPCTL_MAXCHUNKS_DEFAULT; 66b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_hashtblsize) = SCTPCTL_TCBHASHSIZE_DEFAULT; 67b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_pcbtblsize) = SCTPCTL_PCBHASHSIZE_DEFAULT; 68b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_min_split_point) = SCTPCTL_MIN_SPLIT_POINT_DEFAULT; 69b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_chunkscale) = SCTPCTL_CHUNKSCALE_DEFAULT; 70b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default) = SCTPCTL_DELAYED_SACK_TIME_DEFAULT; 71b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_sack_freq_default) = SCTPCTL_SACK_FREQ_DEFAULT; 72b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_system_free_resc_limit) = SCTPCTL_SYS_RESOURCE_DEFAULT; 73b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit) = SCTPCTL_ASOC_RESOURCE_DEFAULT; 74b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default) = SCTPCTL_HEARTBEAT_INTERVAL_DEFAULT; 75b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default) = SCTPCTL_PMTU_RAISE_TIME_DEFAULT; 76b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default) = SCTPCTL_SHUTDOWN_GUARD_TIME_DEFAULT; 77b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_secret_lifetime_default) = SCTPCTL_SECRET_LIFETIME_DEFAULT; 78b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_rto_max_default) = SCTPCTL_RTO_MAX_DEFAULT; 79b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_rto_min_default) = SCTPCTL_RTO_MIN_DEFAULT; 80b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_rto_initial_default) = SCTPCTL_RTO_INITIAL_DEFAULT; 81b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_init_rto_max_default) = SCTPCTL_INIT_RTO_MAX_DEFAULT; 82b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default) = SCTPCTL_VALID_COOKIE_LIFE_DEFAULT; 83b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_init_rtx_max_default) = SCTPCTL_INIT_RTX_MAX_DEFAULT; 84b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default) = SCTPCTL_ASSOC_RTX_MAX_DEFAULT; 85b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_path_rtx_max_default) = SCTPCTL_PATH_RTX_MAX_DEFAULT; 86b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_add_more_threshold) = SCTPCTL_ADD_MORE_ON_OUTPUT_DEFAULT; 87b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default) = SCTPCTL_OUTGOING_STREAMS_DEFAULT; 88b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_cmt_on_off) = SCTPCTL_CMT_ON_OFF_DEFAULT; 89830d754dSRandall Stewart /* EY */ 90830d754dSRandall Stewart SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) = SCTPCTL_NR_SACK_ON_OFF_DEFAULT; 91b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_cmt_use_dac) = SCTPCTL_CMT_USE_DAC_DEFAULT; 92b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_cmt_pf) = SCTPCTL_CMT_PF_DEFAULT; 93b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst) = SCTPCTL_CWND_MAXBURST_DEFAULT; 94b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_early_fr) = SCTPCTL_EARLY_FAST_RETRAN_DEFAULT; 95b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_early_fr_msec) = SCTPCTL_EARLY_FAST_RETRAN_MSEC_DEFAULT; 96b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_asconf_auth_nochk) = SCTPCTL_ASCONF_AUTH_NOCHK_DEFAULT; 97b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_DEFAULT; 98b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_nat_friendly) = SCTPCTL_NAT_FRIENDLY_DEFAULT; 99b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_L2_abc_variable) = SCTPCTL_ABC_L_VAR_DEFAULT; 100b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count) = SCTPCTL_MAX_CHAINED_MBUFS_DEFAULT; 101b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_do_drain) = SCTPCTL_DO_SCTP_DRAIN_DEFAULT; 102b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_hb_maxburst) = SCTPCTL_HB_MAX_BURST_DEFAULT; 103b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit) = SCTPCTL_ABORT_AT_LIMIT_DEFAULT; 104b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_strict_data_order) = SCTPCTL_STRICT_DATA_ORDER_DEFAULT; 105b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_min_residual) = SCTPCTL_MIN_RESIDUAL_DEFAULT; 106b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_max_retran_chunk) = SCTPCTL_MAX_RETRAN_CHUNK_DEFAULT; 107b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_logging_level) = SCTPCTL_LOGGING_LEVEL_DEFAULT; 108b54d3a6cSRandall Stewart /* JRS - Variable for default congestion control module */ 109b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_default_cc_module) = SCTPCTL_DEFAULT_CC_MODULE_DEFAULT; 110f7a77f6fSMichael Tuexen /* RS - Variable for default stream scheduling module */ 111f7a77f6fSMichael Tuexen SCTP_BASE_SYSCTL(sctp_default_ss_module) = SCTPCTL_DEFAULT_SS_MODULE_DEFAULT; 112b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_default_frag_interleave) = SCTPCTL_DEFAULT_FRAG_INTERLEAVE_DEFAULT; 113b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_mobility_base) = SCTPCTL_MOBILITY_BASE_DEFAULT; 114b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff) = SCTPCTL_MOBILITY_FASTHANDOFF_DEFAULT; 115a16ccdceSRandall Stewart SCTP_BASE_SYSCTL(sctp_vtag_time_wait) = SCTPCTL_TIME_WAIT_DEFAULT; 11625a2a187SMichael Tuexen SCTP_BASE_SYSCTL(sctp_buffer_splitting) = SCTPCTL_BUFFER_SPLITTING_DEFAULT; 117dcfc0625SMichael Tuexen SCTP_BASE_SYSCTL(sctp_initial_cwnd) = SCTPCTL_INITIAL_CWND_DEFAULT; 118b27a6b7dSRandall Stewart #if defined(SCTP_LOCAL_TRACE_BUF) 119b3f1ea41SRandall Stewart memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); 120b27a6b7dSRandall Stewart #endif 121b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable) = SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DEFAULT; 122b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) = SCTPCTL_UDP_TUNNELING_PORT_DEFAULT; 123b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_enable_sack_immediately) = SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT; 124bf3d5177SMichael Tuexen SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly) = SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT; 125b3f1ea41SRandall Stewart #if defined(SCTP_DEBUG) 126b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_debug_on) = SCTPCTL_DEBUG_DEFAULT; 12742551e99SRandall Stewart #endif 128b3f1ea41SRandall Stewart #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) 129b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_output_unlocked) = SCTPCTL_OUTPUT_UNLOCKED_DEFAULT; 130b3f1ea41SRandall Stewart #endif 131b3f1ea41SRandall Stewart } 132d61a0ae0SRandall Stewart 133a99b6783SRandall Stewart 134d61a0ae0SRandall Stewart /* It returns an upper limit. No filtering is done here */ 135d61a0ae0SRandall Stewart static unsigned int 136d61a0ae0SRandall Stewart number_of_addresses(struct sctp_inpcb *inp) 137d61a0ae0SRandall Stewart { 138d61a0ae0SRandall Stewart int cnt; 139d61a0ae0SRandall Stewart struct sctp_vrf *vrf; 140d61a0ae0SRandall Stewart struct sctp_ifn *sctp_ifn; 141d61a0ae0SRandall Stewart struct sctp_ifa *sctp_ifa; 142d61a0ae0SRandall Stewart struct sctp_laddr *laddr; 143d61a0ae0SRandall Stewart 144d61a0ae0SRandall Stewart cnt = 0; 145d61a0ae0SRandall Stewart /* neither Mac OS X nor FreeBSD support mulitple routing functions */ 146d61a0ae0SRandall Stewart if ((vrf = sctp_find_vrf(inp->def_vrf_id)) == NULL) { 147d61a0ae0SRandall Stewart return (0); 148d61a0ae0SRandall Stewart } 149d61a0ae0SRandall Stewart if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) { 150d61a0ae0SRandall Stewart LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { 151d61a0ae0SRandall Stewart LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { 152d61a0ae0SRandall Stewart if ((sctp_ifa->address.sa.sa_family == AF_INET) || 153d61a0ae0SRandall Stewart (sctp_ifa->address.sa.sa_family == AF_INET6)) { 154d61a0ae0SRandall Stewart cnt++; 155d61a0ae0SRandall Stewart } 156d61a0ae0SRandall Stewart } 157d61a0ae0SRandall Stewart } 158d61a0ae0SRandall Stewart } else { 159d61a0ae0SRandall Stewart LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) { 160d61a0ae0SRandall Stewart if ((laddr->ifa->address.sa.sa_family == AF_INET) || 161d61a0ae0SRandall Stewart (laddr->ifa->address.sa.sa_family == AF_INET6)) { 162d61a0ae0SRandall Stewart cnt++; 163d61a0ae0SRandall Stewart } 164d61a0ae0SRandall Stewart } 165d61a0ae0SRandall Stewart } 166d61a0ae0SRandall Stewart return (cnt); 167d61a0ae0SRandall Stewart } 168d61a0ae0SRandall Stewart 169d61a0ae0SRandall Stewart static int 170d61a0ae0SRandall Stewart copy_out_local_addresses(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sysctl_req *req) 171d61a0ae0SRandall Stewart { 172d61a0ae0SRandall Stewart struct sctp_ifn *sctp_ifn; 173d61a0ae0SRandall Stewart struct sctp_ifa *sctp_ifa; 174d61a0ae0SRandall Stewart int loopback_scope, ipv4_local_scope, local_scope, site_scope; 175d61a0ae0SRandall Stewart int ipv4_addr_legal, ipv6_addr_legal; 176d61a0ae0SRandall Stewart struct sctp_vrf *vrf; 177d61a0ae0SRandall Stewart struct xsctp_laddr xladdr; 178d61a0ae0SRandall Stewart struct sctp_laddr *laddr; 179d61a0ae0SRandall Stewart int error; 180d61a0ae0SRandall Stewart 181d61a0ae0SRandall Stewart /* Turn on all the appropriate scope */ 182d61a0ae0SRandall Stewart if (stcb) { 183d61a0ae0SRandall Stewart /* use association specific values */ 184d61a0ae0SRandall Stewart loopback_scope = stcb->asoc.loopback_scope; 185d61a0ae0SRandall Stewart ipv4_local_scope = stcb->asoc.ipv4_local_scope; 186d61a0ae0SRandall Stewart local_scope = stcb->asoc.local_scope; 187d61a0ae0SRandall Stewart site_scope = stcb->asoc.site_scope; 188d61a0ae0SRandall Stewart } else { 189d61a0ae0SRandall Stewart /* use generic values for endpoints */ 190d61a0ae0SRandall Stewart loopback_scope = 1; 191d61a0ae0SRandall Stewart ipv4_local_scope = 1; 192d61a0ae0SRandall Stewart local_scope = 1; 193d61a0ae0SRandall Stewart site_scope = 1; 194d61a0ae0SRandall Stewart } 195d61a0ae0SRandall Stewart 196d61a0ae0SRandall Stewart /* use only address families of interest */ 197d61a0ae0SRandall Stewart if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { 198d61a0ae0SRandall Stewart ipv6_addr_legal = 1; 199d61a0ae0SRandall Stewart if (SCTP_IPV6_V6ONLY(inp)) { 200d61a0ae0SRandall Stewart ipv4_addr_legal = 0; 201d61a0ae0SRandall Stewart } else { 202d61a0ae0SRandall Stewart ipv4_addr_legal = 1; 203d61a0ae0SRandall Stewart } 204d61a0ae0SRandall Stewart } else { 205d61a0ae0SRandall Stewart ipv4_addr_legal = 1; 206d61a0ae0SRandall Stewart ipv6_addr_legal = 0; 207d61a0ae0SRandall Stewart } 208d61a0ae0SRandall Stewart 209d61a0ae0SRandall Stewart /* neither Mac OS X nor FreeBSD support mulitple routing functions */ 210d61a0ae0SRandall Stewart if ((vrf = sctp_find_vrf(inp->def_vrf_id)) == NULL) { 2115f26a41dSRandall Stewart SCTP_INP_RUNLOCK(inp); 2125f26a41dSRandall Stewart SCTP_INP_INFO_RUNLOCK(); 213d61a0ae0SRandall Stewart return (-1); 214d61a0ae0SRandall Stewart } 215d61a0ae0SRandall Stewart if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) { 216d61a0ae0SRandall Stewart LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { 217d61a0ae0SRandall Stewart if ((loopback_scope == 0) && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) 218d61a0ae0SRandall Stewart /* Skip loopback if loopback_scope not set */ 219d61a0ae0SRandall Stewart continue; 220d61a0ae0SRandall Stewart LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { 221d61a0ae0SRandall Stewart if (stcb) { 222d61a0ae0SRandall Stewart /* 223d61a0ae0SRandall Stewart * ignore if blacklisted at 224d61a0ae0SRandall Stewart * association level 225d61a0ae0SRandall Stewart */ 226d61a0ae0SRandall Stewart if (sctp_is_addr_restricted(stcb, sctp_ifa)) 227d61a0ae0SRandall Stewart continue; 228d61a0ae0SRandall Stewart } 2295e2c2d87SRandall Stewart switch (sctp_ifa->address.sa.sa_family) { 2305e2c2d87SRandall Stewart case AF_INET: 2315e2c2d87SRandall Stewart if (ipv4_addr_legal) { 232d61a0ae0SRandall Stewart struct sockaddr_in *sin; 233d61a0ae0SRandall Stewart 234d61a0ae0SRandall Stewart sin = (struct sockaddr_in *)&sctp_ifa->address.sa; 235d61a0ae0SRandall Stewart if (sin->sin_addr.s_addr == 0) 236d61a0ae0SRandall Stewart continue; 237d61a0ae0SRandall Stewart if ((ipv4_local_scope == 0) && (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) 238d61a0ae0SRandall Stewart continue; 2395e2c2d87SRandall Stewart } else { 2405e2c2d87SRandall Stewart continue; 2415e2c2d87SRandall Stewart } 2425e2c2d87SRandall Stewart break; 2435e2c2d87SRandall Stewart #ifdef INET6 2445e2c2d87SRandall Stewart case AF_INET6: 2455e2c2d87SRandall Stewart if (ipv6_addr_legal) { 246d61a0ae0SRandall Stewart struct sockaddr_in6 *sin6; 247d61a0ae0SRandall Stewart 248d61a0ae0SRandall Stewart sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sa; 249d61a0ae0SRandall Stewart if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) 250d61a0ae0SRandall Stewart continue; 251d61a0ae0SRandall Stewart if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { 252d61a0ae0SRandall Stewart if (local_scope == 0) 253d61a0ae0SRandall Stewart continue; 254d61a0ae0SRandall Stewart if (sin6->sin6_scope_id == 0) { 255d61a0ae0SRandall Stewart /* 2565e2c2d87SRandall Stewart * bad link 2575e2c2d87SRandall Stewart * local 258d61a0ae0SRandall Stewart * address 259d61a0ae0SRandall Stewart */ 260d61a0ae0SRandall Stewart if (sa6_recoverscope(sin6) != 0) 261d61a0ae0SRandall Stewart continue; 262d61a0ae0SRandall Stewart } 263d61a0ae0SRandall Stewart } 264d61a0ae0SRandall Stewart if ((site_scope == 0) && (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) 265d61a0ae0SRandall Stewart continue; 2665e2c2d87SRandall Stewart } else { 267d61a0ae0SRandall Stewart continue; 2685e2c2d87SRandall Stewart } 2695e2c2d87SRandall Stewart break; 2705e2c2d87SRandall Stewart #endif 2715e2c2d87SRandall Stewart default: 2725e2c2d87SRandall Stewart continue; 2735e2c2d87SRandall Stewart } 274851b7298SRandall Stewart memset((void *)&xladdr, 0, sizeof(struct xsctp_laddr)); 275d61a0ae0SRandall Stewart memcpy((void *)&xladdr.address, (const void *)&sctp_ifa->address, sizeof(union sctp_sockstore)); 276d61a0ae0SRandall Stewart SCTP_INP_RUNLOCK(inp); 277d61a0ae0SRandall Stewart SCTP_INP_INFO_RUNLOCK(); 278d61a0ae0SRandall Stewart error = SYSCTL_OUT(req, &xladdr, sizeof(struct xsctp_laddr)); 279851b7298SRandall Stewart if (error) { 280d61a0ae0SRandall Stewart return (error); 281851b7298SRandall Stewart } else { 282d61a0ae0SRandall Stewart SCTP_INP_INFO_RLOCK(); 283d61a0ae0SRandall Stewart SCTP_INP_RLOCK(inp); 284d61a0ae0SRandall Stewart } 285d61a0ae0SRandall Stewart } 286d61a0ae0SRandall Stewart } 287d61a0ae0SRandall Stewart } else { 288d61a0ae0SRandall Stewart LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) { 289d61a0ae0SRandall Stewart /* ignore if blacklisted at association level */ 290d61a0ae0SRandall Stewart if (stcb && sctp_is_addr_restricted(stcb, laddr->ifa)) 291d61a0ae0SRandall Stewart continue; 292851b7298SRandall Stewart memset((void *)&xladdr, 0, sizeof(struct xsctp_laddr)); 293d61a0ae0SRandall Stewart memcpy((void *)&xladdr.address, (const void *)&laddr->ifa->address, sizeof(union sctp_sockstore)); 294851b7298SRandall Stewart xladdr.start_time.tv_sec = (uint32_t) laddr->start_time.tv_sec; 295851b7298SRandall Stewart xladdr.start_time.tv_usec = (uint32_t) laddr->start_time.tv_usec; 296d61a0ae0SRandall Stewart SCTP_INP_RUNLOCK(inp); 297d61a0ae0SRandall Stewart SCTP_INP_INFO_RUNLOCK(); 298d61a0ae0SRandall Stewart error = SYSCTL_OUT(req, &xladdr, sizeof(struct xsctp_laddr)); 299851b7298SRandall Stewart if (error) { 300d61a0ae0SRandall Stewart return (error); 301851b7298SRandall Stewart } else { 302d61a0ae0SRandall Stewart SCTP_INP_INFO_RLOCK(); 303d61a0ae0SRandall Stewart SCTP_INP_RLOCK(inp); 304d61a0ae0SRandall Stewart } 305d61a0ae0SRandall Stewart } 306d61a0ae0SRandall Stewart } 307851b7298SRandall Stewart memset((void *)&xladdr, 0, sizeof(struct xsctp_laddr)); 308d61a0ae0SRandall Stewart xladdr.last = 1; 3095f26a41dSRandall Stewart SCTP_INP_RUNLOCK(inp); 3105f26a41dSRandall Stewart SCTP_INP_INFO_RUNLOCK(); 311d61a0ae0SRandall Stewart error = SYSCTL_OUT(req, &xladdr, sizeof(struct xsctp_laddr)); 3125f26a41dSRandall Stewart 313851b7298SRandall Stewart if (error) { 314d61a0ae0SRandall Stewart return (error); 315851b7298SRandall Stewart } else { 3165f26a41dSRandall Stewart SCTP_INP_INFO_RLOCK(); 3175f26a41dSRandall Stewart SCTP_INP_RLOCK(inp); 318d61a0ae0SRandall Stewart return (0); 319d61a0ae0SRandall Stewart } 3205f26a41dSRandall Stewart } 321d61a0ae0SRandall Stewart 32242551e99SRandall Stewart /* 32342551e99SRandall Stewart * sysctl functions 32442551e99SRandall Stewart */ 32542551e99SRandall Stewart static int 32642551e99SRandall Stewart sctp_assoclist(SYSCTL_HANDLER_ARGS) 32742551e99SRandall Stewart { 32842551e99SRandall Stewart unsigned int number_of_endpoints; 32942551e99SRandall Stewart unsigned int number_of_local_addresses; 33042551e99SRandall Stewart unsigned int number_of_associations; 33142551e99SRandall Stewart unsigned int number_of_remote_addresses; 33242551e99SRandall Stewart unsigned int n; 33342551e99SRandall Stewart int error; 33442551e99SRandall Stewart struct sctp_inpcb *inp; 33542551e99SRandall Stewart struct sctp_tcb *stcb; 33642551e99SRandall Stewart struct sctp_nets *net; 33742551e99SRandall Stewart struct xsctp_inpcb xinpcb; 33842551e99SRandall Stewart struct xsctp_tcb xstcb; 33942551e99SRandall Stewart struct xsctp_raddr xraddr; 3408ce4a9a2SRandall Stewart struct socket *so; 34142551e99SRandall Stewart 34242551e99SRandall Stewart number_of_endpoints = 0; 34342551e99SRandall Stewart number_of_local_addresses = 0; 34442551e99SRandall Stewart number_of_associations = 0; 34542551e99SRandall Stewart number_of_remote_addresses = 0; 34642551e99SRandall Stewart 34742551e99SRandall Stewart SCTP_INP_INFO_RLOCK(); 34842551e99SRandall Stewart if (req->oldptr == USER_ADDR_NULL) { 349b3f1ea41SRandall Stewart LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { 35042551e99SRandall Stewart SCTP_INP_RLOCK(inp); 35142551e99SRandall Stewart number_of_endpoints++; 352d61a0ae0SRandall Stewart number_of_local_addresses += number_of_addresses(inp); 35342551e99SRandall Stewart LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { 35442551e99SRandall Stewart number_of_associations++; 355d61a0ae0SRandall Stewart number_of_local_addresses += number_of_addresses(inp); 35642551e99SRandall Stewart TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { 35742551e99SRandall Stewart number_of_remote_addresses++; 35842551e99SRandall Stewart } 35942551e99SRandall Stewart } 36042551e99SRandall Stewart SCTP_INP_RUNLOCK(inp); 36142551e99SRandall Stewart } 36242551e99SRandall Stewart SCTP_INP_INFO_RUNLOCK(); 36342551e99SRandall Stewart n = (number_of_endpoints + 1) * sizeof(struct xsctp_inpcb) + 364d61a0ae0SRandall Stewart (number_of_local_addresses + number_of_endpoints + number_of_associations) * sizeof(struct xsctp_laddr) + 365d61a0ae0SRandall Stewart (number_of_associations + number_of_endpoints) * sizeof(struct xsctp_tcb) + 366d61a0ae0SRandall Stewart (number_of_remote_addresses + number_of_associations) * sizeof(struct xsctp_raddr); 367d61a0ae0SRandall Stewart 36842551e99SRandall Stewart /* request some more memory than needed */ 36942551e99SRandall Stewart req->oldidx = (n + n / 8); 37042551e99SRandall Stewart return 0; 37142551e99SRandall Stewart } 37242551e99SRandall Stewart if (req->newptr != USER_ADDR_NULL) { 37342551e99SRandall Stewart SCTP_INP_INFO_RUNLOCK(); 374c4739e2fSRandall Stewart SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_SYSCTL, EPERM); 37542551e99SRandall Stewart return EPERM; 37642551e99SRandall Stewart } 377b3f1ea41SRandall Stewart LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { 37842551e99SRandall Stewart SCTP_INP_RLOCK(inp); 3798ce4a9a2SRandall Stewart if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { 3808ce4a9a2SRandall Stewart /* if its allgone it is being freed - skip it */ 3818ce4a9a2SRandall Stewart goto skip; 3828ce4a9a2SRandall Stewart } 38342551e99SRandall Stewart xinpcb.last = 0; 38442551e99SRandall Stewart xinpcb.local_port = ntohs(inp->sctp_lport); 38542551e99SRandall Stewart xinpcb.flags = inp->sctp_flags; 38642551e99SRandall Stewart xinpcb.features = inp->sctp_features; 38742551e99SRandall Stewart xinpcb.total_sends = inp->total_sends; 38842551e99SRandall Stewart xinpcb.total_recvs = inp->total_recvs; 38942551e99SRandall Stewart xinpcb.total_nospaces = inp->total_nospaces; 39017205eccSRandall Stewart xinpcb.fragmentation_point = inp->sctp_frag_point; 3918ce4a9a2SRandall Stewart so = inp->sctp_socket; 3928ce4a9a2SRandall Stewart if ((so == NULL) || 393851b7298SRandall Stewart (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { 394851b7298SRandall Stewart xinpcb.qlen = 0; 395851b7298SRandall Stewart xinpcb.maxqlen = 0; 396851b7298SRandall Stewart } else { 3978ce4a9a2SRandall Stewart xinpcb.qlen = so->so_qlen; 3988ce4a9a2SRandall Stewart xinpcb.maxqlen = so->so_qlimit; 399851b7298SRandall Stewart } 40042551e99SRandall Stewart SCTP_INP_INCR_REF(inp); 40142551e99SRandall Stewart SCTP_INP_RUNLOCK(inp); 40242551e99SRandall Stewart SCTP_INP_INFO_RUNLOCK(); 40342551e99SRandall Stewart error = SYSCTL_OUT(req, &xinpcb, sizeof(struct xsctp_inpcb)); 40442551e99SRandall Stewart if (error) { 405d61a0ae0SRandall Stewart SCTP_INP_DECR_REF(inp); 40642551e99SRandall Stewart return error; 40742551e99SRandall Stewart } 40842551e99SRandall Stewart SCTP_INP_INFO_RLOCK(); 40942551e99SRandall Stewart SCTP_INP_RLOCK(inp); 410d61a0ae0SRandall Stewart error = copy_out_local_addresses(inp, NULL, req); 411d61a0ae0SRandall Stewart if (error) { 412d61a0ae0SRandall Stewart SCTP_INP_DECR_REF(inp); 413d61a0ae0SRandall Stewart return error; 414d61a0ae0SRandall Stewart } 41542551e99SRandall Stewart LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { 41642551e99SRandall Stewart SCTP_TCB_LOCK(stcb); 41742551e99SRandall Stewart atomic_add_int(&stcb->asoc.refcnt, 1); 41842551e99SRandall Stewart SCTP_TCB_UNLOCK(stcb); 419d61a0ae0SRandall Stewart xstcb.last = 0; 420d61a0ae0SRandall Stewart xstcb.local_port = ntohs(inp->sctp_lport); 421d61a0ae0SRandall Stewart xstcb.remote_port = ntohs(stcb->rport); 42242551e99SRandall Stewart if (stcb->asoc.primary_destination != NULL) 423d61a0ae0SRandall Stewart xstcb.primary_addr = stcb->asoc.primary_destination->ro._l_addr; 424d61a0ae0SRandall Stewart xstcb.heartbeat_interval = stcb->asoc.heart_beat_delay; 425d61a0ae0SRandall Stewart xstcb.state = SCTP_GET_STATE(&stcb->asoc); /* FIXME */ 4264f6b4933SRandall Stewart /* 7.0 does not support these */ 427a99b6783SRandall Stewart xstcb.assoc_id = sctp_get_associd(stcb); 4284f6b4933SRandall Stewart xstcb.peers_rwnd = stcb->asoc.peers_rwnd; 429d61a0ae0SRandall Stewart xstcb.in_streams = stcb->asoc.streamincnt; 430d61a0ae0SRandall Stewart xstcb.out_streams = stcb->asoc.streamoutcnt; 431d61a0ae0SRandall Stewart xstcb.max_nr_retrans = stcb->asoc.overall_error_count; 432d61a0ae0SRandall Stewart xstcb.primary_process = 0; /* not really supported 433d61a0ae0SRandall Stewart * yet */ 434d61a0ae0SRandall Stewart xstcb.T1_expireries = stcb->asoc.timoinit + stcb->asoc.timocookie; 435d61a0ae0SRandall Stewart xstcb.T2_expireries = stcb->asoc.timoshutdown + stcb->asoc.timoshutdownack; 436d61a0ae0SRandall Stewart xstcb.retransmitted_tsns = stcb->asoc.marked_retrans; 437851b7298SRandall Stewart xstcb.start_time.tv_sec = (uint32_t) stcb->asoc.start_time.tv_sec; 438851b7298SRandall Stewart xstcb.start_time.tv_usec = (uint32_t) stcb->asoc.start_time.tv_usec; 439851b7298SRandall Stewart xstcb.discontinuity_time.tv_sec = (uint32_t) stcb->asoc.discontinuity_time.tv_sec; 440851b7298SRandall Stewart xstcb.discontinuity_time.tv_usec = (uint32_t) stcb->asoc.discontinuity_time.tv_usec; 44142551e99SRandall Stewart xstcb.total_sends = stcb->total_sends; 44242551e99SRandall Stewart xstcb.total_recvs = stcb->total_recvs; 44342551e99SRandall Stewart xstcb.local_tag = stcb->asoc.my_vtag; 44442551e99SRandall Stewart xstcb.remote_tag = stcb->asoc.peer_vtag; 44542551e99SRandall Stewart xstcb.initial_tsn = stcb->asoc.init_seq_number; 44642551e99SRandall Stewart xstcb.highest_tsn = stcb->asoc.sending_seq - 1; 44742551e99SRandall Stewart xstcb.cumulative_tsn = stcb->asoc.last_acked_seq; 44842551e99SRandall Stewart xstcb.cumulative_tsn_ack = stcb->asoc.cumulative_tsn; 44917205eccSRandall Stewart xstcb.mtu = stcb->asoc.smallest_mtu; 450207304d4SRandall Stewart xstcb.refcnt = stcb->asoc.refcnt; 45142551e99SRandall Stewart SCTP_INP_RUNLOCK(inp); 45242551e99SRandall Stewart SCTP_INP_INFO_RUNLOCK(); 45342551e99SRandall Stewart error = SYSCTL_OUT(req, &xstcb, sizeof(struct xsctp_tcb)); 45442551e99SRandall Stewart if (error) { 455d61a0ae0SRandall Stewart SCTP_INP_DECR_REF(inp); 456851b7298SRandall Stewart atomic_subtract_int(&stcb->asoc.refcnt, 1); 457d61a0ae0SRandall Stewart return error; 458d61a0ae0SRandall Stewart } 459d61a0ae0SRandall Stewart SCTP_INP_INFO_RLOCK(); 460d61a0ae0SRandall Stewart SCTP_INP_RLOCK(inp); 461d61a0ae0SRandall Stewart error = copy_out_local_addresses(inp, stcb, req); 462d61a0ae0SRandall Stewart if (error) { 463d61a0ae0SRandall Stewart SCTP_INP_DECR_REF(inp); 464851b7298SRandall Stewart atomic_subtract_int(&stcb->asoc.refcnt, 1); 46542551e99SRandall Stewart return error; 46642551e99SRandall Stewart } 46742551e99SRandall Stewart TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { 468d61a0ae0SRandall Stewart xraddr.last = 0; 469d61a0ae0SRandall Stewart xraddr.address = net->ro._l_addr; 470d61a0ae0SRandall Stewart xraddr.active = ((net->dest_state & SCTP_ADDR_REACHABLE) == SCTP_ADDR_REACHABLE); 471d61a0ae0SRandall Stewart xraddr.confirmed = ((net->dest_state & SCTP_ADDR_UNCONFIRMED) == 0); 472d61a0ae0SRandall Stewart xraddr.heartbeat_enabled = ((net->dest_state & SCTP_ADDR_NOHB) == 0); 473d61a0ae0SRandall Stewart xraddr.rto = net->RTO; 474d61a0ae0SRandall Stewart xraddr.max_path_rtx = net->failure_threshold; 475d61a0ae0SRandall Stewart xraddr.rtx = net->marked_retrans; 476d61a0ae0SRandall Stewart xraddr.error_counter = net->error_count; 477d61a0ae0SRandall Stewart xraddr.cwnd = net->cwnd; 478d61a0ae0SRandall Stewart xraddr.flight_size = net->flight_size; 479d61a0ae0SRandall Stewart xraddr.mtu = net->mtu; 480*be1d9176SMichael Tuexen xraddr.rtt = net->rtt / 1000; 481851b7298SRandall Stewart xraddr.start_time.tv_sec = (uint32_t) net->start_time.tv_sec; 482851b7298SRandall Stewart xraddr.start_time.tv_usec = (uint32_t) net->start_time.tv_usec; 483d61a0ae0SRandall Stewart SCTP_INP_RUNLOCK(inp); 484d61a0ae0SRandall Stewart SCTP_INP_INFO_RUNLOCK(); 48542551e99SRandall Stewart error = SYSCTL_OUT(req, &xraddr, sizeof(struct xsctp_raddr)); 48642551e99SRandall Stewart if (error) { 487d61a0ae0SRandall Stewart SCTP_INP_DECR_REF(inp); 488851b7298SRandall Stewart atomic_subtract_int(&stcb->asoc.refcnt, 1); 48942551e99SRandall Stewart return error; 49042551e99SRandall Stewart } 49142551e99SRandall Stewart SCTP_INP_INFO_RLOCK(); 49242551e99SRandall Stewart SCTP_INP_RLOCK(inp); 49342551e99SRandall Stewart } 494851b7298SRandall Stewart atomic_subtract_int(&stcb->asoc.refcnt, 1); 495d61a0ae0SRandall Stewart memset((void *)&xraddr, 0, sizeof(struct xsctp_raddr)); 496d61a0ae0SRandall Stewart xraddr.last = 1; 49742551e99SRandall Stewart SCTP_INP_RUNLOCK(inp); 498d61a0ae0SRandall Stewart SCTP_INP_INFO_RUNLOCK(); 499d61a0ae0SRandall Stewart error = SYSCTL_OUT(req, &xraddr, sizeof(struct xsctp_raddr)); 500d61a0ae0SRandall Stewart if (error) { 501d61a0ae0SRandall Stewart SCTP_INP_DECR_REF(inp); 502d61a0ae0SRandall Stewart return error; 503d61a0ae0SRandall Stewart } 504d61a0ae0SRandall Stewart SCTP_INP_INFO_RLOCK(); 505d61a0ae0SRandall Stewart SCTP_INP_RLOCK(inp); 506d61a0ae0SRandall Stewart } 507851b7298SRandall Stewart SCTP_INP_DECR_REF(inp); 508d61a0ae0SRandall Stewart SCTP_INP_RUNLOCK(inp); 509d61a0ae0SRandall Stewart SCTP_INP_INFO_RUNLOCK(); 510d61a0ae0SRandall Stewart memset((void *)&xstcb, 0, sizeof(struct xsctp_tcb)); 511d61a0ae0SRandall Stewart xstcb.last = 1; 512d61a0ae0SRandall Stewart error = SYSCTL_OUT(req, &xstcb, sizeof(struct xsctp_tcb)); 513d61a0ae0SRandall Stewart if (error) { 514d61a0ae0SRandall Stewart return error; 515d61a0ae0SRandall Stewart } 5168ce4a9a2SRandall Stewart skip: 517d61a0ae0SRandall Stewart SCTP_INP_INFO_RLOCK(); 51842551e99SRandall Stewart } 51942551e99SRandall Stewart SCTP_INP_INFO_RUNLOCK(); 52042551e99SRandall Stewart 521d61a0ae0SRandall Stewart memset((void *)&xinpcb, 0, sizeof(struct xsctp_inpcb)); 52242551e99SRandall Stewart xinpcb.last = 1; 52342551e99SRandall Stewart error = SYSCTL_OUT(req, &xinpcb, sizeof(struct xsctp_inpcb)); 52442551e99SRandall Stewart return error; 52542551e99SRandall Stewart } 52642551e99SRandall Stewart 527c54a18d2SRandall Stewart 528851b7298SRandall Stewart #define RANGECHK(var, min, max) \ 529851b7298SRandall Stewart if ((var) < (min)) { (var) = (min); } \ 530851b7298SRandall Stewart else if ((var) > (max)) { (var) = (max); } 531851b7298SRandall Stewart 532851b7298SRandall Stewart static int 533c54a18d2SRandall Stewart sysctl_sctp_udp_tunneling_check(SYSCTL_HANDLER_ARGS) 534c54a18d2SRandall Stewart { 535c54a18d2SRandall Stewart int error; 536c54a18d2SRandall Stewart uint32_t old_sctp_udp_tunneling_port; 537c54a18d2SRandall Stewart 538be27fdd0SRandall Stewart SCTP_INP_INFO_RLOCK(); 539b3f1ea41SRandall Stewart old_sctp_udp_tunneling_port = SCTP_BASE_SYSCTL(sctp_udp_tunneling_port); 540be27fdd0SRandall Stewart SCTP_INP_INFO_RUNLOCK(); 541c54a18d2SRandall Stewart error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); 542c54a18d2SRandall Stewart if (error == 0) { 543b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), SCTPCTL_UDP_TUNNELING_PORT_MIN, SCTPCTL_UDP_TUNNELING_PORT_MAX); 544a99b6783SRandall Stewart if (old_sctp_udp_tunneling_port == SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) { 545a99b6783SRandall Stewart error = 0; 546a99b6783SRandall Stewart goto out; 547a99b6783SRandall Stewart } 548be27fdd0SRandall Stewart SCTP_INP_INFO_WLOCK(); 549c54a18d2SRandall Stewart if (old_sctp_udp_tunneling_port) { 550c54a18d2SRandall Stewart sctp_over_udp_stop(); 551c54a18d2SRandall Stewart } 552b3f1ea41SRandall Stewart if (SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) { 553c54a18d2SRandall Stewart if (sctp_over_udp_start()) { 554b3f1ea41SRandall Stewart SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) = 0; 555c54a18d2SRandall Stewart } 556c54a18d2SRandall Stewart } 557be27fdd0SRandall Stewart SCTP_INP_INFO_WUNLOCK(); 558c54a18d2SRandall Stewart } 559a99b6783SRandall Stewart out: 560c54a18d2SRandall Stewart return (error); 561c54a18d2SRandall Stewart } 562c54a18d2SRandall Stewart 563b3f1ea41SRandall Stewart 564c54a18d2SRandall Stewart static int 565851b7298SRandall Stewart sysctl_sctp_check(SYSCTL_HANDLER_ARGS) 566851b7298SRandall Stewart { 567851b7298SRandall Stewart int error; 568851b7298SRandall Stewart 569f0878bdcSMichael Tuexen #ifdef VIMAGE 570f0878bdcSMichael Tuexen error = vnet_sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); 571f0878bdcSMichael Tuexen #else 572851b7298SRandall Stewart error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); 573f0878bdcSMichael Tuexen #endif 574851b7298SRandall Stewart if (error == 0) { 575b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_sendspace), SCTPCTL_MAXDGRAM_MIN, SCTPCTL_MAXDGRAM_MAX); 576b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_recvspace), SCTPCTL_RECVSPACE_MIN, SCTPCTL_RECVSPACE_MAX); 577b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_auto_asconf), SCTPCTL_AUTOASCONF_MIN, SCTPCTL_AUTOASCONF_MAX); 578b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_ecn_enable), SCTPCTL_ECN_ENABLE_MIN, SCTPCTL_ECN_ENABLE_MAX); 579b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_sacks), SCTPCTL_STRICT_SACKS_MIN, SCTPCTL_STRICT_SACKS_MAX); 5809c7635e1SMichael Tuexen #if !defined(SCTP_WITH_NO_CSUM) 581b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), SCTPCTL_LOOPBACK_NOCSUM_MIN, SCTPCTL_LOOPBACK_NOCSUM_MAX); 5829c7635e1SMichael Tuexen #endif 583b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_init), SCTPCTL_STRICT_INIT_MIN, SCTPCTL_STRICT_INIT_MAX); 584b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); 585b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); 586899288aeSRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), SCTPCTL_FRMAXBURST_MIN, SCTPCTL_FRMAXBURST_MAX); 587b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), SCTPCTL_MAXCHUNKS_MIN, SCTPCTL_MAXCHUNKS_MAX); 588b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_hashtblsize), SCTPCTL_TCBHASHSIZE_MIN, SCTPCTL_TCBHASHSIZE_MAX); 589b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_pcbtblsize), SCTPCTL_PCBHASHSIZE_MIN, SCTPCTL_PCBHASHSIZE_MAX); 590b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_min_split_point), SCTPCTL_MIN_SPLIT_POINT_MIN, SCTPCTL_MIN_SPLIT_POINT_MAX); 591b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_chunkscale), SCTPCTL_CHUNKSCALE_MIN, SCTPCTL_CHUNKSCALE_MAX); 592b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default), SCTPCTL_DELAYED_SACK_TIME_MIN, SCTPCTL_DELAYED_SACK_TIME_MAX); 593b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_sack_freq_default), SCTPCTL_SACK_FREQ_MIN, SCTPCTL_SACK_FREQ_MAX); 594b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_system_free_resc_limit), SCTPCTL_SYS_RESOURCE_MIN, SCTPCTL_SYS_RESOURCE_MAX); 595b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit), SCTPCTL_ASOC_RESOURCE_MIN, SCTPCTL_ASOC_RESOURCE_MAX); 596b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default), SCTPCTL_HEARTBEAT_INTERVAL_MIN, SCTPCTL_HEARTBEAT_INTERVAL_MAX); 597b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default), SCTPCTL_PMTU_RAISE_TIME_MIN, SCTPCTL_PMTU_RAISE_TIME_MAX); 598b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default), SCTPCTL_SHUTDOWN_GUARD_TIME_MIN, SCTPCTL_SHUTDOWN_GUARD_TIME_MAX); 599b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_secret_lifetime_default), SCTPCTL_SECRET_LIFETIME_MIN, SCTPCTL_SECRET_LIFETIME_MAX); 600b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_rto_max_default), SCTPCTL_RTO_MAX_MIN, SCTPCTL_RTO_MAX_MAX); 601b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_rto_min_default), SCTPCTL_RTO_MIN_MIN, SCTPCTL_RTO_MIN_MAX); 602b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_rto_initial_default), SCTPCTL_RTO_INITIAL_MIN, SCTPCTL_RTO_INITIAL_MAX); 603b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_init_rto_max_default), SCTPCTL_INIT_RTO_MAX_MIN, SCTPCTL_INIT_RTO_MAX_MAX); 604b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default), SCTPCTL_VALID_COOKIE_LIFE_MIN, SCTPCTL_VALID_COOKIE_LIFE_MAX); 605b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_init_rtx_max_default), SCTPCTL_INIT_RTX_MAX_MIN, SCTPCTL_INIT_RTX_MAX_MAX); 606b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default), SCTPCTL_ASSOC_RTX_MAX_MIN, SCTPCTL_ASSOC_RTX_MAX_MAX); 607b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), SCTPCTL_PATH_RTX_MAX_MIN, SCTPCTL_PATH_RTX_MAX_MAX); 608b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_add_more_threshold), SCTPCTL_ADD_MORE_ON_OUTPUT_MIN, SCTPCTL_ADD_MORE_ON_OUTPUT_MAX); 609b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), SCTPCTL_OUTGOING_STREAMS_MIN, SCTPCTL_OUTGOING_STREAMS_MAX); 610b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_on_off), SCTPCTL_CMT_ON_OFF_MIN, SCTPCTL_CMT_ON_OFF_MAX); 611830d754dSRandall Stewart /* EY */ 612830d754dSRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_sack_on_off), SCTPCTL_NR_SACK_ON_OFF_MIN, SCTPCTL_NR_SACK_ON_OFF_MAX); 613b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_use_dac), SCTPCTL_CMT_USE_DAC_MIN, SCTPCTL_CMT_USE_DAC_MAX); 614b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_pf), SCTPCTL_CMT_PF_MIN, SCTPCTL_CMT_PF_MAX); 615b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), SCTPCTL_CWND_MAXBURST_MIN, SCTPCTL_CWND_MAXBURST_MAX); 616b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_early_fr), SCTPCTL_EARLY_FAST_RETRAN_MIN, SCTPCTL_EARLY_FAST_RETRAN_MAX); 617b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_early_fr_msec), SCTPCTL_EARLY_FAST_RETRAN_MSEC_MIN, SCTPCTL_EARLY_FAST_RETRAN_MSEC_MAX); 618b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_asconf_auth_nochk), SCTPCTL_ASCONF_AUTH_NOCHK_MIN, SCTPCTL_ASCONF_AUTH_NOCHK_MAX); 619b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_auth_disable), SCTPCTL_AUTH_DISABLE_MIN, SCTPCTL_AUTH_DISABLE_MAX); 620b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_nat_friendly), SCTPCTL_NAT_FRIENDLY_MIN, SCTPCTL_NAT_FRIENDLY_MAX); 621b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_L2_abc_variable), SCTPCTL_ABC_L_VAR_MIN, SCTPCTL_ABC_L_VAR_MAX); 622b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count), SCTPCTL_MAX_CHAINED_MBUFS_MIN, SCTPCTL_MAX_CHAINED_MBUFS_MAX); 623b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_do_drain), SCTPCTL_DO_SCTP_DRAIN_MIN, SCTPCTL_DO_SCTP_DRAIN_MAX); 624b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_hb_maxburst), SCTPCTL_HB_MAX_BURST_MIN, SCTPCTL_HB_MAX_BURST_MAX); 625b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit), SCTPCTL_ABORT_AT_LIMIT_MIN, SCTPCTL_ABORT_AT_LIMIT_MAX); 626b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_data_order), SCTPCTL_STRICT_DATA_ORDER_MIN, SCTPCTL_STRICT_DATA_ORDER_MAX); 627b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_min_residual), SCTPCTL_MIN_RESIDUAL_MIN, SCTPCTL_MIN_RESIDUAL_MAX); 628b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_max_retran_chunk), SCTPCTL_MAX_RETRAN_CHUNK_MIN, SCTPCTL_MAX_RETRAN_CHUNK_MAX); 629b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_logging_level), SCTPCTL_LOGGING_LEVEL_MIN, SCTPCTL_LOGGING_LEVEL_MAX); 630b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_default_cc_module), SCTPCTL_DEFAULT_CC_MODULE_MIN, SCTPCTL_DEFAULT_CC_MODULE_MAX); 631f7a77f6fSMichael Tuexen RANGECHK(SCTP_BASE_SYSCTL(sctp_default_ss_module), SCTPCTL_DEFAULT_SS_MODULE_MIN, SCTPCTL_DEFAULT_SS_MODULE_MAX); 632b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_default_frag_interleave), SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MIN, SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MAX); 633a16ccdceSRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_vtag_time_wait), SCTPCTL_TIME_WAIT_MIN, SCTPCTL_TIME_WAIT_MAX); 63425a2a187SMichael Tuexen RANGECHK(SCTP_BASE_SYSCTL(sctp_buffer_splitting), SCTPCTL_BUFFER_SPLITTING_MIN, SCTPCTL_BUFFER_SPLITTING_MAX); 635dcfc0625SMichael Tuexen RANGECHK(SCTP_BASE_SYSCTL(sctp_initial_cwnd), SCTPCTL_INITIAL_CWND_MIN, SCTPCTL_INITIAL_CWND_MAX); 636b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX); 637b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX); 638b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN, SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX); 639b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN, SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX); 640bf3d5177SMichael Tuexen RANGECHK(SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), SCTPCTL_NAT_FRIENDLY_INITS_MIN, SCTPCTL_NAT_FRIENDLY_INITS_MAX); 641830d754dSRandall Stewart 642851b7298SRandall Stewart #ifdef SCTP_DEBUG 643b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_debug_on), SCTPCTL_DEBUG_MIN, SCTPCTL_DEBUG_MAX); 644b3f1ea41SRandall Stewart #endif 645b3f1ea41SRandall Stewart #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) 646b3f1ea41SRandall Stewart RANGECHK(SCTP_BASE_SYSCTL(sctp_output_unlocked), SCTPCTL_OUTPUT_UNLOCKED_MIN, SCTPCTL_OUTPUT_UNLOCKED_MAX); 647851b7298SRandall Stewart #endif 648851b7298SRandall Stewart } 649851b7298SRandall Stewart return (error); 650851b7298SRandall Stewart } 65142551e99SRandall Stewart 652ff014514SRandall Stewart #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) 653ff014514SRandall Stewart static int 654ff014514SRandall Stewart sysctl_stat_get(SYSCTL_HANDLER_ARGS) 655ff014514SRandall Stewart { 656ff014514SRandall Stewart int cpu, error; 657ae26e0a4SRandall Stewart struct sctpstat sb, *sarry, *cpin = NULL; 658b3f1ea41SRandall Stewart 659ae26e0a4SRandall Stewart if ((req->newptr) && (req->newlen == sizeof(struct sctpstat))) { 660ae26e0a4SRandall Stewart /* 661ae26e0a4SRandall Stewart * User wants us to clear or at least reset the counters to 662ae26e0a4SRandall Stewart * the specified values. 663ae26e0a4SRandall Stewart */ 664ae26e0a4SRandall Stewart cpin = (struct sctpstat *)req->newptr; 665ae26e0a4SRandall Stewart } else if (req->newptr) { 666ae26e0a4SRandall Stewart /* Must be a stat structure */ 667ae26e0a4SRandall Stewart return (EINVAL); 668ae26e0a4SRandall Stewart } 669ff014514SRandall Stewart memset(&sb, 0, sizeof(sb)); 670dec0177dSRandall Stewart for (cpu = 0; cpu < mp_maxid; cpu++) { 671ff014514SRandall Stewart sarry = &SCTP_BASE_STATS[cpu]; 672ff014514SRandall Stewart if (sarry->sctps_discontinuitytime.tv_sec > sb.sctps_discontinuitytime.tv_sec) { 673ff014514SRandall Stewart sb.sctps_discontinuitytime.tv_sec = sarry->sctps_discontinuitytime.tv_sec; 674ff014514SRandall Stewart sb.sctps_discontinuitytime.tv_usec = sarry->sctps_discontinuitytime.tv_usec; 675ff014514SRandall Stewart } 676ff014514SRandall Stewart sb.sctps_currestab += sarry->sctps_currestab; 677ff014514SRandall Stewart sb.sctps_activeestab += sarry->sctps_activeestab; 678ff014514SRandall Stewart sb.sctps_restartestab += sarry->sctps_restartestab; 679ff014514SRandall Stewart sb.sctps_collisionestab += sarry->sctps_collisionestab; 680ff014514SRandall Stewart sb.sctps_passiveestab += sarry->sctps_passiveestab; 681ff014514SRandall Stewart sb.sctps_aborted += sarry->sctps_aborted; 682ff014514SRandall Stewart sb.sctps_shutdown += sarry->sctps_shutdown; 683ff014514SRandall Stewart sb.sctps_outoftheblue += sarry->sctps_outoftheblue; 684ff014514SRandall Stewart sb.sctps_checksumerrors += sarry->sctps_checksumerrors; 685ff014514SRandall Stewart sb.sctps_outcontrolchunks += sarry->sctps_outcontrolchunks; 686ff014514SRandall Stewart sb.sctps_outorderchunks += sarry->sctps_outorderchunks; 687ff014514SRandall Stewart sb.sctps_outunorderchunks += sarry->sctps_outunorderchunks; 688ff014514SRandall Stewart sb.sctps_incontrolchunks += sarry->sctps_incontrolchunks; 689ff014514SRandall Stewart sb.sctps_inorderchunks += sarry->sctps_inorderchunks; 690ff014514SRandall Stewart sb.sctps_inunorderchunks += sarry->sctps_inunorderchunks; 691ff014514SRandall Stewart sb.sctps_fragusrmsgs += sarry->sctps_fragusrmsgs; 692ff014514SRandall Stewart sb.sctps_reasmusrmsgs += sarry->sctps_reasmusrmsgs; 693ff014514SRandall Stewart sb.sctps_outpackets += sarry->sctps_outpackets; 694ff014514SRandall Stewart sb.sctps_inpackets += sarry->sctps_inpackets; 695ff014514SRandall Stewart sb.sctps_recvpackets += sarry->sctps_recvpackets; 696ff014514SRandall Stewart sb.sctps_recvdatagrams += sarry->sctps_recvdatagrams; 697ff014514SRandall Stewart sb.sctps_recvpktwithdata += sarry->sctps_recvpktwithdata; 698ff014514SRandall Stewart sb.sctps_recvsacks += sarry->sctps_recvsacks; 699ff014514SRandall Stewart sb.sctps_recvdata += sarry->sctps_recvdata; 700ff014514SRandall Stewart sb.sctps_recvdupdata += sarry->sctps_recvdupdata; 701ff014514SRandall Stewart sb.sctps_recvheartbeat += sarry->sctps_recvheartbeat; 702ff014514SRandall Stewart sb.sctps_recvheartbeatack += sarry->sctps_recvheartbeatack; 703ff014514SRandall Stewart sb.sctps_recvecne += sarry->sctps_recvecne; 704ff014514SRandall Stewart sb.sctps_recvauth += sarry->sctps_recvauth; 705ff014514SRandall Stewart sb.sctps_recvauthmissing += sarry->sctps_recvauthmissing; 706ff014514SRandall Stewart sb.sctps_recvivalhmacid += sarry->sctps_recvivalhmacid; 707ff014514SRandall Stewart sb.sctps_recvivalkeyid += sarry->sctps_recvivalkeyid; 708ff014514SRandall Stewart sb.sctps_recvauthfailed += sarry->sctps_recvauthfailed; 709ff014514SRandall Stewart sb.sctps_recvexpress += sarry->sctps_recvexpress; 710ff014514SRandall Stewart sb.sctps_recvexpressm += sarry->sctps_recvexpressm; 711ff014514SRandall Stewart sb.sctps_recvnocrc += sarry->sctps_recvnocrc; 712ff014514SRandall Stewart sb.sctps_recvswcrc += sarry->sctps_recvswcrc; 713ff014514SRandall Stewart sb.sctps_recvhwcrc += sarry->sctps_recvhwcrc; 714ff014514SRandall Stewart sb.sctps_sendpackets += sarry->sctps_sendpackets; 715ff014514SRandall Stewart sb.sctps_sendsacks += sarry->sctps_sendsacks; 716ff014514SRandall Stewart sb.sctps_senddata += sarry->sctps_senddata; 717ff014514SRandall Stewart sb.sctps_sendretransdata += sarry->sctps_sendretransdata; 718ff014514SRandall Stewart sb.sctps_sendfastretrans += sarry->sctps_sendfastretrans; 719ff014514SRandall Stewart sb.sctps_sendmultfastretrans += sarry->sctps_sendmultfastretrans; 720ff014514SRandall Stewart sb.sctps_sendheartbeat += sarry->sctps_sendheartbeat; 721ff014514SRandall Stewart sb.sctps_sendecne += sarry->sctps_sendecne; 722ff014514SRandall Stewart sb.sctps_sendauth += sarry->sctps_sendauth; 723ff014514SRandall Stewart sb.sctps_senderrors += sarry->sctps_senderrors; 724ff014514SRandall Stewart sb.sctps_sendnocrc += sarry->sctps_sendnocrc; 725ff014514SRandall Stewart sb.sctps_sendswcrc += sarry->sctps_sendswcrc; 726ff014514SRandall Stewart sb.sctps_sendhwcrc += sarry->sctps_sendhwcrc; 727ff014514SRandall Stewart sb.sctps_pdrpfmbox += sarry->sctps_pdrpfmbox; 728ff014514SRandall Stewart sb.sctps_pdrpfehos += sarry->sctps_pdrpfehos; 729ff014514SRandall Stewart sb.sctps_pdrpmbda += sarry->sctps_pdrpmbda; 730ff014514SRandall Stewart sb.sctps_pdrpmbct += sarry->sctps_pdrpmbct; 731ff014514SRandall Stewart sb.sctps_pdrpbwrpt += sarry->sctps_pdrpbwrpt; 732ff014514SRandall Stewart sb.sctps_pdrpcrupt += sarry->sctps_pdrpcrupt; 733ff014514SRandall Stewart sb.sctps_pdrpnedat += sarry->sctps_pdrpnedat; 734ff014514SRandall Stewart sb.sctps_pdrppdbrk += sarry->sctps_pdrppdbrk; 735ff014514SRandall Stewart sb.sctps_pdrptsnnf += sarry->sctps_pdrptsnnf; 736ff014514SRandall Stewart sb.sctps_pdrpdnfnd += sarry->sctps_pdrpdnfnd; 737ff014514SRandall Stewart sb.sctps_pdrpdiwnp += sarry->sctps_pdrpdiwnp; 738ff014514SRandall Stewart sb.sctps_pdrpdizrw += sarry->sctps_pdrpdizrw; 739ff014514SRandall Stewart sb.sctps_pdrpbadd += sarry->sctps_pdrpbadd; 740ff014514SRandall Stewart sb.sctps_pdrpmark += sarry->sctps_pdrpmark; 741ff014514SRandall Stewart sb.sctps_timoiterator += sarry->sctps_timoiterator; 742ff014514SRandall Stewart sb.sctps_timodata += sarry->sctps_timodata; 743ff014514SRandall Stewart sb.sctps_timowindowprobe += sarry->sctps_timowindowprobe; 744ff014514SRandall Stewart sb.sctps_timoinit += sarry->sctps_timoinit; 745ff014514SRandall Stewart sb.sctps_timosack += sarry->sctps_timosack; 746ff014514SRandall Stewart sb.sctps_timoshutdown += sarry->sctps_timoshutdown; 747ff014514SRandall Stewart sb.sctps_timoheartbeat += sarry->sctps_timoheartbeat; 748ff014514SRandall Stewart sb.sctps_timocookie += sarry->sctps_timocookie; 749ff014514SRandall Stewart sb.sctps_timosecret += sarry->sctps_timosecret; 750ff014514SRandall Stewart sb.sctps_timopathmtu += sarry->sctps_timopathmtu; 751ff014514SRandall Stewart sb.sctps_timoshutdownack += sarry->sctps_timoshutdownack; 752ff014514SRandall Stewart sb.sctps_timoshutdownguard += sarry->sctps_timoshutdownguard; 753ff014514SRandall Stewart sb.sctps_timostrmrst += sarry->sctps_timostrmrst; 754ff014514SRandall Stewart sb.sctps_timoearlyfr += sarry->sctps_timoearlyfr; 755ff014514SRandall Stewart sb.sctps_timoasconf += sarry->sctps_timoasconf; 756ff014514SRandall Stewart sb.sctps_timodelprim += sarry->sctps_timodelprim; 757ff014514SRandall Stewart sb.sctps_timoautoclose += sarry->sctps_timoautoclose; 758ff014514SRandall Stewart sb.sctps_timoassockill += sarry->sctps_timoassockill; 759ff014514SRandall Stewart sb.sctps_timoinpkill += sarry->sctps_timoinpkill; 760ff014514SRandall Stewart sb.sctps_earlyfrstart += sarry->sctps_earlyfrstart; 761ff014514SRandall Stewart sb.sctps_earlyfrstop += sarry->sctps_earlyfrstop; 762ff014514SRandall Stewart sb.sctps_earlyfrmrkretrans += sarry->sctps_earlyfrmrkretrans; 763ff014514SRandall Stewart sb.sctps_earlyfrstpout += sarry->sctps_earlyfrstpout; 764ff014514SRandall Stewart sb.sctps_earlyfrstpidsck1 += sarry->sctps_earlyfrstpidsck1; 765ff014514SRandall Stewart sb.sctps_earlyfrstpidsck2 += sarry->sctps_earlyfrstpidsck2; 766ff014514SRandall Stewart sb.sctps_earlyfrstpidsck3 += sarry->sctps_earlyfrstpidsck3; 767ff014514SRandall Stewart sb.sctps_earlyfrstpidsck4 += sarry->sctps_earlyfrstpidsck4; 768ff014514SRandall Stewart sb.sctps_earlyfrstrid += sarry->sctps_earlyfrstrid; 769ff014514SRandall Stewart sb.sctps_earlyfrstrout += sarry->sctps_earlyfrstrout; 770ff014514SRandall Stewart sb.sctps_earlyfrstrtmr += sarry->sctps_earlyfrstrtmr; 771ff014514SRandall Stewart sb.sctps_hdrops += sarry->sctps_hdrops; 772ff014514SRandall Stewart sb.sctps_badsum += sarry->sctps_badsum; 773ff014514SRandall Stewart sb.sctps_noport += sarry->sctps_noport; 774ff014514SRandall Stewart sb.sctps_badvtag += sarry->sctps_badvtag; 775ff014514SRandall Stewart sb.sctps_badsid += sarry->sctps_badsid; 776ff014514SRandall Stewart sb.sctps_nomem += sarry->sctps_nomem; 777ff014514SRandall Stewart sb.sctps_fastretransinrtt += sarry->sctps_fastretransinrtt; 778ff014514SRandall Stewart sb.sctps_markedretrans += sarry->sctps_markedretrans; 779ff014514SRandall Stewart sb.sctps_naglesent += sarry->sctps_naglesent; 780ff014514SRandall Stewart sb.sctps_naglequeued += sarry->sctps_naglequeued; 781ff014514SRandall Stewart sb.sctps_maxburstqueued += sarry->sctps_maxburstqueued; 782ff014514SRandall Stewart sb.sctps_ifnomemqueued += sarry->sctps_ifnomemqueued; 783ff014514SRandall Stewart sb.sctps_windowprobed += sarry->sctps_windowprobed; 784ff014514SRandall Stewart sb.sctps_lowlevelerr += sarry->sctps_lowlevelerr; 785ff014514SRandall Stewart sb.sctps_lowlevelerrusr += sarry->sctps_lowlevelerrusr; 786ff014514SRandall Stewart sb.sctps_datadropchklmt += sarry->sctps_datadropchklmt; 787ff014514SRandall Stewart sb.sctps_datadroprwnd += sarry->sctps_datadroprwnd; 788ff014514SRandall Stewart sb.sctps_ecnereducedcwnd += sarry->sctps_ecnereducedcwnd; 789ff014514SRandall Stewart sb.sctps_vtagexpress += sarry->sctps_vtagexpress; 790ff014514SRandall Stewart sb.sctps_vtagbogus += sarry->sctps_vtagbogus; 791ff014514SRandall Stewart sb.sctps_primary_randry += sarry->sctps_primary_randry; 792ff014514SRandall Stewart sb.sctps_cmt_randry += sarry->sctps_cmt_randry; 793ff014514SRandall Stewart sb.sctps_slowpath_sack += sarry->sctps_slowpath_sack; 794ff014514SRandall Stewart sb.sctps_wu_sacks_sent += sarry->sctps_wu_sacks_sent; 795ff014514SRandall Stewart sb.sctps_sends_with_flags += sarry->sctps_sends_with_flags; 796ff014514SRandall Stewart sb.sctps_sends_with_unord += sarry->sctps_sends_with_unord; 797ff014514SRandall Stewart sb.sctps_sends_with_eof += sarry->sctps_sends_with_eof; 798ff014514SRandall Stewart sb.sctps_sends_with_abort += sarry->sctps_sends_with_abort; 799ff014514SRandall Stewart sb.sctps_protocol_drain_calls += sarry->sctps_protocol_drain_calls; 800ff014514SRandall Stewart sb.sctps_protocol_drains_done += sarry->sctps_protocol_drains_done; 801ff014514SRandall Stewart sb.sctps_read_peeks += sarry->sctps_read_peeks; 802ff014514SRandall Stewart sb.sctps_cached_chk += sarry->sctps_cached_chk; 803ff014514SRandall Stewart sb.sctps_cached_strmoq += sarry->sctps_cached_strmoq; 804ff014514SRandall Stewart sb.sctps_left_abandon += sarry->sctps_left_abandon; 805ff014514SRandall Stewart sb.sctps_send_burst_avoid += sarry->sctps_send_burst_avoid; 806ff014514SRandall Stewart sb.sctps_send_cwnd_avoid += sarry->sctps_send_cwnd_avoid; 807ff014514SRandall Stewart sb.sctps_fwdtsn_map_over += sarry->sctps_fwdtsn_map_over; 808ae26e0a4SRandall Stewart if (cpin) { 809ae26e0a4SRandall Stewart memcpy(sarry, cpin, sizeof(struct sctpstat)); 810ae26e0a4SRandall Stewart } 811ff014514SRandall Stewart } 812ff014514SRandall Stewart error = SYSCTL_OUT(req, &sb, sizeof(sb)); 813ff014514SRandall Stewart return (error); 814ff014514SRandall Stewart } 815ff014514SRandall Stewart 816ff014514SRandall Stewart #endif 817b3f1ea41SRandall Stewart 818b3f1ea41SRandall Stewart #if defined(SCTP_LOCAL_TRACE_BUF) 819b3f1ea41SRandall Stewart static int 820b3f1ea41SRandall Stewart sysctl_sctp_cleartrace(SYSCTL_HANDLER_ARGS) 821b3f1ea41SRandall Stewart { 822a99b6783SRandall Stewart int error = 0; 823a99b6783SRandall Stewart 824b3f1ea41SRandall Stewart memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); 825a99b6783SRandall Stewart return (error); 826b3f1ea41SRandall Stewart } 827b3f1ea41SRandall Stewart 828b3f1ea41SRandall Stewart #endif 829b3f1ea41SRandall Stewart 830b3f1ea41SRandall Stewart 83142551e99SRandall Stewart /* 83242551e99SRandall Stewart * sysctl definitions 83342551e99SRandall Stewart */ 83442551e99SRandall Stewart 835f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_UINT | CTLFLAG_RW, 836b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_sendspace), 0, sysctl_sctp_check, "IU", 837851b7298SRandall Stewart SCTPCTL_MAXDGRAM_DESC); 83842551e99SRandall Stewart 839f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_UINT | CTLFLAG_RW, 840b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_recvspace), 0, sysctl_sctp_check, "IU", 841851b7298SRandall Stewart SCTPCTL_RECVSPACE_DESC); 84242551e99SRandall Stewart 843f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_UINT | CTLFLAG_RW, 844b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_auto_asconf), 0, sysctl_sctp_check, "IU", 845851b7298SRandall Stewart SCTPCTL_AUTOASCONF_DESC); 84642551e99SRandall Stewart 847f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_UINT | CTLFLAG_RW, 848b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_ecn_enable), 0, sysctl_sctp_check, "IU", 849851b7298SRandall Stewart SCTPCTL_ECN_ENABLE_DESC); 85042551e99SRandall Stewart 851f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT | CTLFLAG_RW, 852b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU", 853851b7298SRandall Stewart SCTPCTL_STRICT_SACKS_DESC); 85442551e99SRandall Stewart 8559c7635e1SMichael Tuexen #if !defined(SCTP_WITH_NO_CSUM) 856f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | CTLFLAG_RW, 857b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sysctl_sctp_check, "IU", 858851b7298SRandall Stewart SCTPCTL_LOOPBACK_NOCSUM_DESC); 8599c7635e1SMichael Tuexen #endif 86042551e99SRandall Stewart 861f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_UINT | CTLFLAG_RW, 862b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_strict_init), 0, sysctl_sctp_check, "IU", 863851b7298SRandall Stewart SCTPCTL_STRICT_INIT_DESC); 86442551e99SRandall Stewart 865f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, 866b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, "IU", 867851b7298SRandall Stewart SCTPCTL_PEER_CHKOH_DESC); 86842551e99SRandall Stewart 869f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_UINT | CTLFLAG_RW, 870b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_max_burst_default), 0, sysctl_sctp_check, "IU", 871851b7298SRandall Stewart SCTPCTL_MAXBURST_DESC); 87242551e99SRandall Stewart 873f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, fr_maxburst, CTLTYPE_UINT | CTLFLAG_RW, 874899288aeSRandall Stewart &SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), 0, sysctl_sctp_check, "IU", 875899288aeSRandall Stewart SCTPCTL_FRMAXBURST_DESC); 876899288aeSRandall Stewart 877f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_UINT | CTLFLAG_RW, 878b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), 0, sysctl_sctp_check, "IU", 879851b7298SRandall Stewart SCTPCTL_MAXCHUNKS_DESC); 88042551e99SRandall Stewart 881f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, 882b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_hashtblsize), 0, sysctl_sctp_check, "IU", 883851b7298SRandall Stewart SCTPCTL_TCBHASHSIZE_DESC); 88442551e99SRandall Stewart 885f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_UINT | CTLFLAG_RW, 886b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_pcbtblsize), 0, sysctl_sctp_check, "IU", 887851b7298SRandall Stewart SCTPCTL_PCBHASHSIZE_DESC); 88842551e99SRandall Stewart 889f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_UINT | CTLFLAG_RW, 890b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_min_split_point), 0, sysctl_sctp_check, "IU", 891851b7298SRandall Stewart SCTPCTL_MIN_SPLIT_POINT_DESC); 89242551e99SRandall Stewart 893f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, chunkscale, CTLTYPE_UINT | CTLFLAG_RW, 894b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_chunkscale), 0, sysctl_sctp_check, "IU", 895851b7298SRandall Stewart SCTPCTL_CHUNKSCALE_DESC); 89642551e99SRandall Stewart 897f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLTYPE_UINT | CTLFLAG_RW, 898b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default), 0, sysctl_sctp_check, "IU", 899851b7298SRandall Stewart SCTPCTL_DELAYED_SACK_TIME_DESC); 90042551e99SRandall Stewart 901f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sack_freq, CTLTYPE_UINT | CTLFLAG_RW, 902b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_sack_freq_default), 0, sysctl_sctp_check, "IU", 903851b7298SRandall Stewart SCTPCTL_SACK_FREQ_DESC); 90442551e99SRandall Stewart 905f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sys_resource, CTLTYPE_UINT | CTLFLAG_RW, 906b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_system_free_resc_limit), 0, sysctl_sctp_check, "IU", 907851b7298SRandall Stewart SCTPCTL_SYS_RESOURCE_DESC); 90842551e99SRandall Stewart 909f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, asoc_resource, CTLTYPE_UINT | CTLFLAG_RW, 910b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit), 0, sysctl_sctp_check, "IU", 911851b7298SRandall Stewart SCTPCTL_ASOC_RESOURCE_DESC); 91242551e99SRandall Stewart 913f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLTYPE_UINT | CTLFLAG_RW, 914b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default), 0, sysctl_sctp_check, "IU", 915851b7298SRandall Stewart SCTPCTL_HEARTBEAT_INTERVAL_DESC); 91642551e99SRandall Stewart 917f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLTYPE_UINT | CTLFLAG_RW, 918b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default), 0, sysctl_sctp_check, "IU", 919851b7298SRandall Stewart SCTPCTL_PMTU_RAISE_TIME_DESC); 92042551e99SRandall Stewart 921f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLTYPE_UINT | CTLFLAG_RW, 922b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default), 0, sysctl_sctp_check, "IU", 923851b7298SRandall Stewart SCTPCTL_SHUTDOWN_GUARD_TIME_DESC); 92442551e99SRandall Stewart 925f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLTYPE_UINT | CTLFLAG_RW, 926b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_secret_lifetime_default), 0, sysctl_sctp_check, "IU", 927851b7298SRandall Stewart SCTPCTL_SECRET_LIFETIME_DESC); 92842551e99SRandall Stewart 929f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_max, CTLTYPE_UINT | CTLFLAG_RW, 930b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_rto_max_default), 0, sysctl_sctp_check, "IU", 931851b7298SRandall Stewart SCTPCTL_RTO_MAX_DESC); 93242551e99SRandall Stewart 933f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_min, CTLTYPE_UINT | CTLFLAG_RW, 934b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_rto_min_default), 0, sysctl_sctp_check, "IU", 935851b7298SRandall Stewart SCTPCTL_RTO_MIN_DESC); 93642551e99SRandall Stewart 937f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_initial, CTLTYPE_UINT | CTLFLAG_RW, 938b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_rto_initial_default), 0, sysctl_sctp_check, "IU", 939851b7298SRandall Stewart SCTPCTL_RTO_INITIAL_DESC); 94042551e99SRandall Stewart 941f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, init_rto_max, CTLTYPE_UINT | CTLFLAG_RW, 942b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_init_rto_max_default), 0, sysctl_sctp_check, "IU", 943851b7298SRandall Stewart SCTPCTL_INIT_RTO_MAX_DESC); 94442551e99SRandall Stewart 945f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLTYPE_UINT | CTLFLAG_RW, 946b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default), 0, sysctl_sctp_check, "IU", 947851b7298SRandall Stewart SCTPCTL_VALID_COOKIE_LIFE_DESC); 94842551e99SRandall Stewart 949f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, 950b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_init_rtx_max_default), 0, sysctl_sctp_check, "IU", 951851b7298SRandall Stewart SCTPCTL_INIT_RTX_MAX_DESC); 95242551e99SRandall Stewart 953f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, 954b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default), 0, sysctl_sctp_check, "IU", 955851b7298SRandall Stewart SCTPCTL_ASSOC_RTX_MAX_DESC); 95642551e99SRandall Stewart 957f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLTYPE_UINT | CTLFLAG_RW, 958b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), 0, sysctl_sctp_check, "IU", 959851b7298SRandall Stewart SCTPCTL_PATH_RTX_MAX_DESC); 96042551e99SRandall Stewart 961f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLTYPE_UINT | CTLFLAG_RW, 962b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_add_more_threshold), 0, sysctl_sctp_check, "IU", 963851b7298SRandall Stewart SCTPCTL_ADD_MORE_ON_OUTPUT_DESC); 96442551e99SRandall Stewart 965f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_UINT | CTLFLAG_RW, 966b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), 0, sysctl_sctp_check, "IU", 967851b7298SRandall Stewart SCTPCTL_OUTGOING_STREAMS_DESC); 96842551e99SRandall Stewart 969f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLTYPE_UINT | CTLFLAG_RW, 970b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_cmt_on_off), 0, sysctl_sctp_check, "IU", 971851b7298SRandall Stewart SCTPCTL_CMT_ON_OFF_DESC); 97242551e99SRandall Stewart 973f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_UINT | CTLFLAG_RW, 974830d754dSRandall Stewart &SCTP_BASE_SYSCTL(sctp_nr_sack_on_off), 0, sysctl_sctp_check, "IU", 975830d754dSRandall Stewart SCTPCTL_NR_SACK_ON_OFF_DESC); 976830d754dSRandall Stewart 977f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLTYPE_UINT | CTLFLAG_RW, 978b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_cmt_use_dac), 0, sysctl_sctp_check, "IU", 979851b7298SRandall Stewart SCTPCTL_CMT_USE_DAC_DESC); 980b54d3a6cSRandall Stewart 981f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_pf, CTLTYPE_UINT | CTLFLAG_RW, 982b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_cmt_pf), 0, sysctl_sctp_check, "IU", 983851b7298SRandall Stewart SCTPCTL_CMT_PF_DESC); 984b54d3a6cSRandall Stewart 985f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLTYPE_UINT | CTLFLAG_RW, 986b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), 0, sysctl_sctp_check, "IU", 987851b7298SRandall Stewart SCTPCTL_CWND_MAXBURST_DESC); 988c4739e2fSRandall Stewart 989f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran, CTLTYPE_UINT | CTLFLAG_RW, 990b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_early_fr), 0, sysctl_sctp_check, "IU", 991851b7298SRandall Stewart SCTPCTL_EARLY_FAST_RETRAN_DESC); 992851b7298SRandall Stewart 993f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, early_fast_retran_msec, CTLTYPE_UINT | CTLFLAG_RW, 994b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_early_fr_msec), 0, sysctl_sctp_check, "IU", 995851b7298SRandall Stewart SCTPCTL_EARLY_FAST_RETRAN_MSEC_DESC); 996851b7298SRandall Stewart 997f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, asconf_auth_nochk, CTLTYPE_UINT | CTLFLAG_RW, 998b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_asconf_auth_nochk), 0, sysctl_sctp_check, "IU", 999851b7298SRandall Stewart SCTPCTL_ASCONF_AUTH_NOCHK_DESC); 1000851b7298SRandall Stewart 1001f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_UINT | CTLFLAG_RW, 1002b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_auth_disable), 0, sysctl_sctp_check, "IU", 1003851b7298SRandall Stewart SCTPCTL_AUTH_DISABLE_DESC); 1004851b7298SRandall Stewart 1005f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nat_friendly, CTLTYPE_UINT | CTLFLAG_RW, 1006b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_nat_friendly), 0, sysctl_sctp_check, "IU", 1007851b7298SRandall Stewart SCTPCTL_NAT_FRIENDLY_DESC); 1008851b7298SRandall Stewart 1009f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, abc_l_var, CTLTYPE_UINT | CTLFLAG_RW, 1010b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_L2_abc_variable), 0, sysctl_sctp_check, "IU", 1011851b7298SRandall Stewart SCTPCTL_ABC_L_VAR_DESC); 1012851b7298SRandall Stewart 1013f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLTYPE_UINT | CTLFLAG_RW, 1014b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count), 0, sysctl_sctp_check, "IU", 1015851b7298SRandall Stewart SCTPCTL_MAX_CHAINED_MBUFS_DESC); 1016851b7298SRandall Stewart 1017f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLTYPE_UINT | CTLFLAG_RW, 1018b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_do_drain), 0, sysctl_sctp_check, "IU", 1019851b7298SRandall Stewart SCTPCTL_DO_SCTP_DRAIN_DESC); 1020851b7298SRandall Stewart 1021f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLTYPE_UINT | CTLFLAG_RW, 1022b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_hb_maxburst), 0, sysctl_sctp_check, "IU", 1023851b7298SRandall Stewart SCTPCTL_HB_MAX_BURST_DESC); 1024851b7298SRandall Stewart 1025f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLTYPE_UINT | CTLFLAG_RW, 1026b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit), 0, sysctl_sctp_check, "IU", 1027851b7298SRandall Stewart SCTPCTL_ABORT_AT_LIMIT_DESC); 1028851b7298SRandall Stewart 1029f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_data_order, CTLTYPE_UINT | CTLFLAG_RW, 1030b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_strict_data_order), 0, sysctl_sctp_check, "IU", 1031851b7298SRandall Stewart SCTPCTL_STRICT_DATA_ORDER_DESC); 1032851b7298SRandall Stewart 1033f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, min_residual, CTLTYPE_UINT | CTLFLAG_RW, 1034b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_min_residual), 0, sysctl_sctp_check, "IU", 1035851b7298SRandall Stewart SCTPCTL_MIN_RESIDUAL_DESC); 1036851b7298SRandall Stewart 1037f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLTYPE_UINT | CTLFLAG_RW, 1038b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_max_retran_chunk), 0, sysctl_sctp_check, "IU", 1039851b7298SRandall Stewart SCTPCTL_MAX_RETRAN_CHUNK_DESC); 1040851b7298SRandall Stewart 1041f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, log_level, CTLTYPE_UINT | CTLFLAG_RW, 1042b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_logging_level), 0, sysctl_sctp_check, "IU", 1043851b7298SRandall Stewart SCTPCTL_LOGGING_LEVEL_DESC); 1044851b7298SRandall Stewart 1045f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_cc_module, CTLTYPE_UINT | CTLFLAG_RW, 1046b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_default_cc_module), 0, sysctl_sctp_check, "IU", 1047851b7298SRandall Stewart SCTPCTL_DEFAULT_CC_MODULE_DESC); 1048851b7298SRandall Stewart 1049f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_ss_module, CTLTYPE_UINT | CTLFLAG_RW, 1050f7a77f6fSMichael Tuexen &SCTP_BASE_SYSCTL(sctp_default_ss_module), 0, sysctl_sctp_check, "IU", 1051f7a77f6fSMichael Tuexen SCTPCTL_DEFAULT_SS_MODULE_DESC); 1052f7a77f6fSMichael Tuexen 1053f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_frag_interleave, CTLTYPE_UINT | CTLFLAG_RW, 1054b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_default_frag_interleave), 0, sysctl_sctp_check, "IU", 1055c4739e2fSRandall Stewart SCTPCTL_DEFAULT_FRAG_INTERLEAVE_DESC); 1056c4739e2fSRandall Stewart 1057f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, mobility_base, CTLTYPE_UINT | CTLFLAG_RW, 1058b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_mobility_base), 0, sysctl_sctp_check, "IU", 1059851b7298SRandall Stewart SCTPCTL_MOBILITY_BASE_DESC); 106042551e99SRandall Stewart 1061f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, mobility_fasthandoff, CTLTYPE_UINT | CTLFLAG_RW, 1062b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), 0, sysctl_sctp_check, "IU", 1063851b7298SRandall Stewart SCTPCTL_MOBILITY_FASTHANDOFF_DESC); 106442551e99SRandall Stewart 1065b27a6b7dSRandall Stewart #if defined(SCTP_LOCAL_TRACE_BUF) 1066f0878bdcSMichael Tuexen SYSCTL_VNET_STRUCT(_net_inet_sctp, OID_AUTO, log, CTLFLAG_RD, 1067b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_log), sctp_log, 1068b27a6b7dSRandall Stewart "SCTP logging (struct sctp_log)"); 1069b3f1ea41SRandall Stewart 1070f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLTYPE_UINT | CTLFLAG_RW, 1071b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_log), 0, sysctl_sctp_cleartrace, "IU", 1072b3f1ea41SRandall Stewart "Clear SCTP Logging buffer"); 1073b27a6b7dSRandall Stewart #endif 1074b27a6b7dSRandall Stewart 1075f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_for_client_enable, CTLTYPE_UINT | CTLFLAG_RW, 1076b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), 0, sysctl_sctp_check, "IU", 1077c54a18d2SRandall Stewart SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_DESC); 1078c54a18d2SRandall Stewart 1079f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_UINT | CTLFLAG_RW, 1080b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), 0, sysctl_sctp_udp_tunneling_check, "IU", 1081c54a18d2SRandall Stewart SCTPCTL_UDP_TUNNELING_PORT_DESC); 1082c54a18d2SRandall Stewart 1083f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_UINT | CTLFLAG_RW, 1084b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), 0, sysctl_sctp_check, "IU", 1085b3f1ea41SRandall Stewart SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC); 1086b3f1ea41SRandall Stewart 1087f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nat_friendly_init, CTLTYPE_UINT | CTLFLAG_RW, 1088830d754dSRandall Stewart &SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), 0, sysctl_sctp_check, "IU", 1089bf3d5177SMichael Tuexen SCTPCTL_NAT_FRIENDLY_INITS_DESC); 1090830d754dSRandall Stewart 1091f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_UINT | CTLFLAG_RW, 1092a16ccdceSRandall Stewart &SCTP_BASE_SYSCTL(sctp_vtag_time_wait), 0, sysctl_sctp_check, "IU", 1093a16ccdceSRandall Stewart SCTPCTL_TIME_WAIT_DESC); 1094a16ccdceSRandall Stewart 1095f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_UINT | CTLFLAG_RW, 109625a2a187SMichael Tuexen &SCTP_BASE_SYSCTL(sctp_buffer_splitting), 0, sysctl_sctp_check, "IU", 109725a2a187SMichael Tuexen SCTPCTL_BUFFER_SPLITTING_DESC); 109825a2a187SMichael Tuexen 1099f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_UINT | CTLFLAG_RW, 1100dcfc0625SMichael Tuexen &SCTP_BASE_SYSCTL(sctp_initial_cwnd), 0, sysctl_sctp_check, "IU", 1101dcfc0625SMichael Tuexen SCTPCTL_INITIAL_CWND_DESC); 1102dcfc0625SMichael Tuexen 1103851b7298SRandall Stewart #ifdef SCTP_DEBUG 1104f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, 1105b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", 1106851b7298SRandall Stewart SCTPCTL_DEBUG_DESC); 1107f0878bdcSMichael Tuexen #endif 110842551e99SRandall Stewart 110942551e99SRandall Stewart 1110b3f1ea41SRandall Stewart #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) 1111f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_UINT | CTLFLAG_RW, 1112b3f1ea41SRandall Stewart &SCTP_BASE_SYSCTL(sctp_output_unlocked), 0, sysctl_sctp_check, "IU", 1113b3f1ea41SRandall Stewart SCTPCTL_OUTPUT_UNLOCKED_DESC); 1114b3f1ea41SRandall Stewart #endif 1115f0878bdcSMichael Tuexen 1116ff014514SRandall Stewart #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) 1117f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, stats, 1118ae26e0a4SRandall Stewart CTLTYPE_STRUCT | CTLFLAG_RW, 1119ff014514SRandall Stewart 0, 0, sysctl_stat_get, "S,sctpstat", 1120ff014514SRandall Stewart "SCTP statistics (struct sctp_stat)"); 1121ff014514SRandall Stewart #else 1122f0878bdcSMichael Tuexen SYSCTL_VNET_STRUCT(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_RW, 11238518270eSMichael Tuexen &SCTP_BASE_STATS_SYSCTL, sctpstat, 1124b27a6b7dSRandall Stewart "SCTP statistics (struct sctp_stat)"); 1125ff014514SRandall Stewart #endif 112642551e99SRandall Stewart 1127f0878bdcSMichael Tuexen SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLTYPE_OPAQUE | CTLFLAG_RD, 112842551e99SRandall Stewart 0, 0, sctp_assoclist, 112942551e99SRandall Stewart "S,xassoc", "List of active SCTP associations"); 1130