Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | /*- |
michael@0 | 2 | * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved. |
michael@0 | 3 | * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. |
michael@0 | 4 | * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. |
michael@0 | 5 | * |
michael@0 | 6 | * Redistribution and use in source and binary forms, with or without |
michael@0 | 7 | * modification, are permitted provided that the following conditions are met: |
michael@0 | 8 | * |
michael@0 | 9 | * a) Redistributions of source code must retain the above copyright notice, |
michael@0 | 10 | * this list of conditions and the following disclaimer. |
michael@0 | 11 | * |
michael@0 | 12 | * b) Redistributions in binary form must reproduce the above copyright |
michael@0 | 13 | * notice, this list of conditions and the following disclaimer in |
michael@0 | 14 | * the documentation and/or other materials provided with the distribution. |
michael@0 | 15 | * |
michael@0 | 16 | * c) Neither the name of Cisco Systems, Inc. nor the names of its |
michael@0 | 17 | * contributors may be used to endorse or promote products derived |
michael@0 | 18 | * from this software without specific prior written permission. |
michael@0 | 19 | * |
michael@0 | 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
michael@0 | 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
michael@0 | 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
michael@0 | 23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
michael@0 | 24 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
michael@0 | 25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
michael@0 | 26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
michael@0 | 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
michael@0 | 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
michael@0 | 29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
michael@0 | 30 | * THE POSSIBILITY OF SUCH DAMAGE. |
michael@0 | 31 | */ |
michael@0 | 32 | |
michael@0 | 33 | #ifdef __FreeBSD__ |
michael@0 | 34 | #include <sys/cdefs.h> |
michael@0 | 35 | __FBSDID("$FreeBSD: head/sys/netinet/sctp_sysctl.c 254672 2013-08-22 20:29:57Z tuexen $"); |
michael@0 | 36 | #endif |
michael@0 | 37 | |
michael@0 | 38 | #include <netinet/sctp_os.h> |
michael@0 | 39 | #include <netinet/sctp.h> |
michael@0 | 40 | #include <netinet/sctp_constants.h> |
michael@0 | 41 | #include <netinet/sctp_sysctl.h> |
michael@0 | 42 | #include <netinet/sctp_pcb.h> |
michael@0 | 43 | #include <netinet/sctputil.h> |
michael@0 | 44 | #include <netinet/sctp_output.h> |
michael@0 | 45 | #ifdef __FreeBSD__ |
michael@0 | 46 | #include <sys/smp.h> |
michael@0 | 47 | #endif |
michael@0 | 48 | #if defined(__APPLE__) |
michael@0 | 49 | #include <netinet/sctp_bsd_addr.h> |
michael@0 | 50 | #endif |
michael@0 | 51 | |
michael@0 | 52 | /* |
michael@0 | 53 | * sysctl tunable variables |
michael@0 | 54 | */ |
michael@0 | 55 | |
michael@0 | 56 | void |
michael@0 | 57 | sctp_init_sysctls() |
michael@0 | 58 | { |
michael@0 | 59 | SCTP_BASE_SYSCTL(sctp_sendspace) = SCTPCTL_MAXDGRAM_DEFAULT; |
michael@0 | 60 | SCTP_BASE_SYSCTL(sctp_recvspace) = SCTPCTL_RECVSPACE_DEFAULT; |
michael@0 | 61 | SCTP_BASE_SYSCTL(sctp_auto_asconf) = SCTPCTL_AUTOASCONF_DEFAULT; |
michael@0 | 62 | SCTP_BASE_SYSCTL(sctp_multiple_asconfs) = SCTPCTL_MULTIPLEASCONFS_DEFAULT; |
michael@0 | 63 | SCTP_BASE_SYSCTL(sctp_ecn_enable) = SCTPCTL_ECN_ENABLE_DEFAULT; |
michael@0 | 64 | SCTP_BASE_SYSCTL(sctp_strict_sacks) = SCTPCTL_STRICT_SACKS_DEFAULT; |
michael@0 | 65 | #if !(defined(__FreeBSD__) && __FreeBSD_version >= 800000) |
michael@0 | 66 | #if !defined(SCTP_WITH_NO_CSUM) |
michael@0 | 67 | SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) = SCTPCTL_LOOPBACK_NOCSUM_DEFAULT; |
michael@0 | 68 | #endif |
michael@0 | 69 | #endif |
michael@0 | 70 | SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT; |
michael@0 | 71 | SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT; |
michael@0 | 72 | SCTP_BASE_SYSCTL(sctp_fr_max_burst_default) = SCTPCTL_FRMAXBURST_DEFAULT; |
michael@0 | 73 | SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue) = SCTPCTL_MAXCHUNKS_DEFAULT; |
michael@0 | 74 | SCTP_BASE_SYSCTL(sctp_hashtblsize) = SCTPCTL_TCBHASHSIZE_DEFAULT; |
michael@0 | 75 | SCTP_BASE_SYSCTL(sctp_pcbtblsize) = SCTPCTL_PCBHASHSIZE_DEFAULT; |
michael@0 | 76 | SCTP_BASE_SYSCTL(sctp_min_split_point) = SCTPCTL_MIN_SPLIT_POINT_DEFAULT; |
michael@0 | 77 | SCTP_BASE_SYSCTL(sctp_chunkscale) = SCTPCTL_CHUNKSCALE_DEFAULT; |
michael@0 | 78 | SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default) = SCTPCTL_DELAYED_SACK_TIME_DEFAULT; |
michael@0 | 79 | SCTP_BASE_SYSCTL(sctp_sack_freq_default) = SCTPCTL_SACK_FREQ_DEFAULT; |
michael@0 | 80 | SCTP_BASE_SYSCTL(sctp_system_free_resc_limit) = SCTPCTL_SYS_RESOURCE_DEFAULT; |
michael@0 | 81 | SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit) = SCTPCTL_ASOC_RESOURCE_DEFAULT; |
michael@0 | 82 | SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default) = SCTPCTL_HEARTBEAT_INTERVAL_DEFAULT; |
michael@0 | 83 | SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default) = SCTPCTL_PMTU_RAISE_TIME_DEFAULT; |
michael@0 | 84 | SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default) = SCTPCTL_SHUTDOWN_GUARD_TIME_DEFAULT; |
michael@0 | 85 | SCTP_BASE_SYSCTL(sctp_secret_lifetime_default) = SCTPCTL_SECRET_LIFETIME_DEFAULT; |
michael@0 | 86 | SCTP_BASE_SYSCTL(sctp_rto_max_default) = SCTPCTL_RTO_MAX_DEFAULT; |
michael@0 | 87 | SCTP_BASE_SYSCTL(sctp_rto_min_default) = SCTPCTL_RTO_MIN_DEFAULT; |
michael@0 | 88 | SCTP_BASE_SYSCTL(sctp_rto_initial_default) = SCTPCTL_RTO_INITIAL_DEFAULT; |
michael@0 | 89 | SCTP_BASE_SYSCTL(sctp_init_rto_max_default) = SCTPCTL_INIT_RTO_MAX_DEFAULT; |
michael@0 | 90 | SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default) = SCTPCTL_VALID_COOKIE_LIFE_DEFAULT; |
michael@0 | 91 | SCTP_BASE_SYSCTL(sctp_init_rtx_max_default) = SCTPCTL_INIT_RTX_MAX_DEFAULT; |
michael@0 | 92 | SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default) = SCTPCTL_ASSOC_RTX_MAX_DEFAULT; |
michael@0 | 93 | SCTP_BASE_SYSCTL(sctp_path_rtx_max_default) = SCTPCTL_PATH_RTX_MAX_DEFAULT; |
michael@0 | 94 | SCTP_BASE_SYSCTL(sctp_path_pf_threshold) = SCTPCTL_PATH_PF_THRESHOLD_DEFAULT; |
michael@0 | 95 | SCTP_BASE_SYSCTL(sctp_add_more_threshold) = SCTPCTL_ADD_MORE_ON_OUTPUT_DEFAULT; |
michael@0 | 96 | SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default) = SCTPCTL_INCOMING_STREAMS_DEFAULT; |
michael@0 | 97 | SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default) = SCTPCTL_OUTGOING_STREAMS_DEFAULT; |
michael@0 | 98 | SCTP_BASE_SYSCTL(sctp_cmt_on_off) = SCTPCTL_CMT_ON_OFF_DEFAULT; |
michael@0 | 99 | /* EY */ |
michael@0 | 100 | SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) = SCTPCTL_NR_SACK_ON_OFF_DEFAULT; |
michael@0 | 101 | SCTP_BASE_SYSCTL(sctp_cmt_use_dac) = SCTPCTL_CMT_USE_DAC_DEFAULT; |
michael@0 | 102 | SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst) = SCTPCTL_CWND_MAXBURST_DEFAULT; |
michael@0 | 103 | SCTP_BASE_SYSCTL(sctp_asconf_auth_nochk) = SCTPCTL_ASCONF_AUTH_NOCHK_DEFAULT; |
michael@0 | 104 | SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_DEFAULT; |
michael@0 | 105 | SCTP_BASE_SYSCTL(sctp_nat_friendly) = SCTPCTL_NAT_FRIENDLY_DEFAULT; |
michael@0 | 106 | SCTP_BASE_SYSCTL(sctp_L2_abc_variable) = SCTPCTL_ABC_L_VAR_DEFAULT; |
michael@0 | 107 | SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count) = SCTPCTL_MAX_CHAINED_MBUFS_DEFAULT; |
michael@0 | 108 | SCTP_BASE_SYSCTL(sctp_do_drain) = SCTPCTL_DO_SCTP_DRAIN_DEFAULT; |
michael@0 | 109 | SCTP_BASE_SYSCTL(sctp_hb_maxburst) = SCTPCTL_HB_MAX_BURST_DEFAULT; |
michael@0 | 110 | SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit) = SCTPCTL_ABORT_AT_LIMIT_DEFAULT; |
michael@0 | 111 | SCTP_BASE_SYSCTL(sctp_strict_data_order) = SCTPCTL_STRICT_DATA_ORDER_DEFAULT; |
michael@0 | 112 | SCTP_BASE_SYSCTL(sctp_min_residual) = SCTPCTL_MIN_RESIDUAL_DEFAULT; |
michael@0 | 113 | SCTP_BASE_SYSCTL(sctp_max_retran_chunk) = SCTPCTL_MAX_RETRAN_CHUNK_DEFAULT; |
michael@0 | 114 | SCTP_BASE_SYSCTL(sctp_logging_level) = SCTPCTL_LOGGING_LEVEL_DEFAULT; |
michael@0 | 115 | /* JRS - Variable for default congestion control module */ |
michael@0 | 116 | SCTP_BASE_SYSCTL(sctp_default_cc_module) = SCTPCTL_DEFAULT_CC_MODULE_DEFAULT; |
michael@0 | 117 | /* RS - Variable for default stream scheduling module */ |
michael@0 | 118 | SCTP_BASE_SYSCTL(sctp_default_ss_module) = SCTPCTL_DEFAULT_SS_MODULE_DEFAULT; |
michael@0 | 119 | SCTP_BASE_SYSCTL(sctp_default_frag_interleave) = SCTPCTL_DEFAULT_FRAG_INTERLEAVE_DEFAULT; |
michael@0 | 120 | SCTP_BASE_SYSCTL(sctp_mobility_base) = SCTPCTL_MOBILITY_BASE_DEFAULT; |
michael@0 | 121 | SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff) = SCTPCTL_MOBILITY_FASTHANDOFF_DEFAULT; |
michael@0 | 122 | SCTP_BASE_SYSCTL(sctp_vtag_time_wait) = SCTPCTL_TIME_WAIT_DEFAULT; |
michael@0 | 123 | SCTP_BASE_SYSCTL(sctp_buffer_splitting) = SCTPCTL_BUFFER_SPLITTING_DEFAULT; |
michael@0 | 124 | SCTP_BASE_SYSCTL(sctp_initial_cwnd) = SCTPCTL_INITIAL_CWND_DEFAULT; |
michael@0 | 125 | SCTP_BASE_SYSCTL(sctp_rttvar_bw) = SCTPCTL_RTTVAR_BW_DEFAULT; |
michael@0 | 126 | SCTP_BASE_SYSCTL(sctp_rttvar_rtt) = SCTPCTL_RTTVAR_RTT_DEFAULT; |
michael@0 | 127 | SCTP_BASE_SYSCTL(sctp_rttvar_eqret) = SCTPCTL_RTTVAR_EQRET_DEFAULT; |
michael@0 | 128 | SCTP_BASE_SYSCTL(sctp_steady_step) = SCTPCTL_RTTVAR_STEADYS_DEFAULT; |
michael@0 | 129 | SCTP_BASE_SYSCTL(sctp_use_dccc_ecn) = SCTPCTL_RTTVAR_DCCCECN_DEFAULT; |
michael@0 | 130 | SCTP_BASE_SYSCTL(sctp_blackhole) = SCTPCTL_BLACKHOLE_DEFAULT; |
michael@0 | 131 | |
michael@0 | 132 | #if defined(SCTP_LOCAL_TRACE_BUF) |
michael@0 | 133 | #if defined(__Windows__) |
michael@0 | 134 | /* On Windows, the resource for global variables is limited. */ |
michael@0 | 135 | MALLOC(SCTP_BASE_SYSCTL(sctp_log), struct sctp_log *, sizeof(struct sctp_log), M_SYSCTL, M_ZERO); |
michael@0 | 136 | #else |
michael@0 | 137 | memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); |
michael@0 | 138 | #endif |
michael@0 | 139 | #endif |
michael@0 | 140 | SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) = SCTPCTL_UDP_TUNNELING_PORT_DEFAULT; |
michael@0 | 141 | SCTP_BASE_SYSCTL(sctp_enable_sack_immediately) = SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT; |
michael@0 | 142 | SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly) = SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT; |
michael@0 | 143 | #if defined(SCTP_DEBUG) |
michael@0 | 144 | SCTP_BASE_SYSCTL(sctp_debug_on) = SCTPCTL_DEBUG_DEFAULT; |
michael@0 | 145 | #endif |
michael@0 | 146 | #if defined(__APPLE__) |
michael@0 | 147 | SCTP_BASE_SYSCTL(sctp_ignore_vmware_interfaces) = SCTPCTL_IGNORE_VMWARE_INTERFACES_DEFAULT; |
michael@0 | 148 | SCTP_BASE_SYSCTL(sctp_main_timer) = SCTPCTL_MAIN_TIMER_DEFAULT; |
michael@0 | 149 | SCTP_BASE_SYSCTL(sctp_addr_watchdog_limit) = SCTPCTL_ADDR_WATCHDOG_LIMIT_DEFAULT; |
michael@0 | 150 | SCTP_BASE_SYSCTL(sctp_vtag_watchdog_limit) = SCTPCTL_VTAG_WATCHDOG_LIMIT_DEFAULT; |
michael@0 | 151 | #endif |
michael@0 | 152 | #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) |
michael@0 | 153 | SCTP_BASE_SYSCTL(sctp_output_unlocked) = SCTPCTL_OUTPUT_UNLOCKED_DEFAULT; |
michael@0 | 154 | #endif |
michael@0 | 155 | } |
michael@0 | 156 | |
michael@0 | 157 | #if defined(__Windows__) |
michael@0 | 158 | void |
michael@0 | 159 | sctp_finish_sysctls() |
michael@0 | 160 | { |
michael@0 | 161 | #if defined(SCTP_LOCAL_TRACE_BUF) |
michael@0 | 162 | if (SCTP_BASE_SYSCTL(sctp_log) != NULL) { |
michael@0 | 163 | FREE(SCTP_BASE_SYSCTL(sctp_log), M_SYSCTL); |
michael@0 | 164 | SCTP_BASE_SYSCTL(sctp_log) = NULL; |
michael@0 | 165 | } |
michael@0 | 166 | #endif |
michael@0 | 167 | } |
michael@0 | 168 | #endif |
michael@0 | 169 | |
michael@0 | 170 | #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__Windows__) |
michael@0 | 171 | /* It returns an upper limit. No filtering is done here */ |
michael@0 | 172 | static unsigned int |
michael@0 | 173 | number_of_addresses(struct sctp_inpcb *inp) |
michael@0 | 174 | { |
michael@0 | 175 | unsigned int cnt; |
michael@0 | 176 | struct sctp_vrf *vrf; |
michael@0 | 177 | struct sctp_ifn *sctp_ifn; |
michael@0 | 178 | struct sctp_ifa *sctp_ifa; |
michael@0 | 179 | struct sctp_laddr *laddr; |
michael@0 | 180 | |
michael@0 | 181 | cnt = 0; |
michael@0 | 182 | /* neither Mac OS X nor FreeBSD support mulitple routing functions */ |
michael@0 | 183 | if ((vrf = sctp_find_vrf(inp->def_vrf_id)) == NULL) { |
michael@0 | 184 | return (0); |
michael@0 | 185 | } |
michael@0 | 186 | if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) { |
michael@0 | 187 | LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { |
michael@0 | 188 | LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { |
michael@0 | 189 | switch (sctp_ifa->address.sa.sa_family) { |
michael@0 | 190 | #ifdef INET |
michael@0 | 191 | case AF_INET: |
michael@0 | 192 | #endif |
michael@0 | 193 | #ifdef INET6 |
michael@0 | 194 | case AF_INET6: |
michael@0 | 195 | #endif |
michael@0 | 196 | cnt++; |
michael@0 | 197 | break; |
michael@0 | 198 | default: |
michael@0 | 199 | break; |
michael@0 | 200 | } |
michael@0 | 201 | } |
michael@0 | 202 | } |
michael@0 | 203 | } else { |
michael@0 | 204 | LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) { |
michael@0 | 205 | switch (laddr->ifa->address.sa.sa_family) { |
michael@0 | 206 | #ifdef INET |
michael@0 | 207 | case AF_INET: |
michael@0 | 208 | #endif |
michael@0 | 209 | #ifdef INET6 |
michael@0 | 210 | case AF_INET6: |
michael@0 | 211 | #endif |
michael@0 | 212 | cnt++; |
michael@0 | 213 | break; |
michael@0 | 214 | default: |
michael@0 | 215 | break; |
michael@0 | 216 | } |
michael@0 | 217 | } |
michael@0 | 218 | } |
michael@0 | 219 | return (cnt); |
michael@0 | 220 | } |
michael@0 | 221 | |
michael@0 | 222 | static int |
michael@0 | 223 | copy_out_local_addresses(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sysctl_req *req) |
michael@0 | 224 | { |
michael@0 | 225 | struct sctp_ifn *sctp_ifn; |
michael@0 | 226 | struct sctp_ifa *sctp_ifa; |
michael@0 | 227 | int loopback_scope, ipv4_local_scope, local_scope, site_scope; |
michael@0 | 228 | int ipv4_addr_legal, ipv6_addr_legal; |
michael@0 | 229 | #if defined(__Userspace__) |
michael@0 | 230 | int conn_addr_legal; |
michael@0 | 231 | #endif |
michael@0 | 232 | struct sctp_vrf *vrf; |
michael@0 | 233 | struct xsctp_laddr xladdr; |
michael@0 | 234 | struct sctp_laddr *laddr; |
michael@0 | 235 | int error; |
michael@0 | 236 | |
michael@0 | 237 | /* Turn on all the appropriate scope */ |
michael@0 | 238 | if (stcb) { |
michael@0 | 239 | /* use association specific values */ |
michael@0 | 240 | loopback_scope = stcb->asoc.scope.loopback_scope; |
michael@0 | 241 | ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; |
michael@0 | 242 | local_scope = stcb->asoc.scope.local_scope; |
michael@0 | 243 | site_scope = stcb->asoc.scope.site_scope; |
michael@0 | 244 | ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; |
michael@0 | 245 | ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; |
michael@0 | 246 | #if defined(__Userspace__) |
michael@0 | 247 | conn_addr_legal = stcb->asoc.scope.conn_addr_legal; |
michael@0 | 248 | #endif |
michael@0 | 249 | } else { |
michael@0 | 250 | /* Use generic values for endpoints. */ |
michael@0 | 251 | loopback_scope = 1; |
michael@0 | 252 | ipv4_local_scope = 1; |
michael@0 | 253 | local_scope = 1; |
michael@0 | 254 | site_scope = 1; |
michael@0 | 255 | if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { |
michael@0 | 256 | ipv6_addr_legal = 1; |
michael@0 | 257 | if (SCTP_IPV6_V6ONLY(inp)) { |
michael@0 | 258 | ipv4_addr_legal = 0; |
michael@0 | 259 | } else { |
michael@0 | 260 | ipv4_addr_legal = 1; |
michael@0 | 261 | } |
michael@0 | 262 | #if defined(__Userspace__) |
michael@0 | 263 | conn_addr_legal = 0; |
michael@0 | 264 | #endif |
michael@0 | 265 | } else { |
michael@0 | 266 | ipv6_addr_legal = 0; |
michael@0 | 267 | #if defined(__Userspace__) |
michael@0 | 268 | if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_CONN) { |
michael@0 | 269 | conn_addr_legal = 1; |
michael@0 | 270 | ipv4_addr_legal = 0; |
michael@0 | 271 | } else { |
michael@0 | 272 | conn_addr_legal = 0; |
michael@0 | 273 | ipv4_addr_legal = 1; |
michael@0 | 274 | } |
michael@0 | 275 | #else |
michael@0 | 276 | ipv4_addr_legal = 1; |
michael@0 | 277 | #endif |
michael@0 | 278 | } |
michael@0 | 279 | } |
michael@0 | 280 | |
michael@0 | 281 | /* neither Mac OS X nor FreeBSD support mulitple routing functions */ |
michael@0 | 282 | if ((vrf = sctp_find_vrf(inp->def_vrf_id)) == NULL) { |
michael@0 | 283 | SCTP_INP_RUNLOCK(inp); |
michael@0 | 284 | SCTP_INP_INFO_RUNLOCK(); |
michael@0 | 285 | return (-1); |
michael@0 | 286 | } |
michael@0 | 287 | if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) { |
michael@0 | 288 | LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { |
michael@0 | 289 | if ((loopback_scope == 0) && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) |
michael@0 | 290 | /* Skip loopback if loopback_scope not set */ |
michael@0 | 291 | continue; |
michael@0 | 292 | LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { |
michael@0 | 293 | if (stcb) { |
michael@0 | 294 | /* |
michael@0 | 295 | * ignore if blacklisted at |
michael@0 | 296 | * association level |
michael@0 | 297 | */ |
michael@0 | 298 | if (sctp_is_addr_restricted(stcb, sctp_ifa)) |
michael@0 | 299 | continue; |
michael@0 | 300 | } |
michael@0 | 301 | switch (sctp_ifa->address.sa.sa_family) { |
michael@0 | 302 | #ifdef INET |
michael@0 | 303 | case AF_INET: |
michael@0 | 304 | if (ipv4_addr_legal) { |
michael@0 | 305 | struct sockaddr_in *sin; |
michael@0 | 306 | |
michael@0 | 307 | sin = (struct sockaddr_in *)&sctp_ifa->address.sa; |
michael@0 | 308 | if (sin->sin_addr.s_addr == 0) |
michael@0 | 309 | continue; |
michael@0 | 310 | if ((ipv4_local_scope == 0) && (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) |
michael@0 | 311 | continue; |
michael@0 | 312 | } else { |
michael@0 | 313 | continue; |
michael@0 | 314 | } |
michael@0 | 315 | break; |
michael@0 | 316 | #endif |
michael@0 | 317 | #ifdef INET6 |
michael@0 | 318 | case AF_INET6: |
michael@0 | 319 | if (ipv6_addr_legal) { |
michael@0 | 320 | struct sockaddr_in6 *sin6; |
michael@0 | 321 | |
michael@0 | 322 | #if defined(SCTP_EMBEDDED_V6_SCOPE) && !defined(SCTP_KAME) |
michael@0 | 323 | struct sockaddr_in6 lsa6; |
michael@0 | 324 | #endif |
michael@0 | 325 | sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sa; |
michael@0 | 326 | if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) |
michael@0 | 327 | continue; |
michael@0 | 328 | if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { |
michael@0 | 329 | if (local_scope == 0) |
michael@0 | 330 | continue; |
michael@0 | 331 | #if defined(SCTP_EMBEDDED_V6_SCOPE) |
michael@0 | 332 | if (sin6->sin6_scope_id == 0) { |
michael@0 | 333 | #ifdef SCTP_KAME |
michael@0 | 334 | /* bad link local address */ |
michael@0 | 335 | if (sa6_recoverscope(sin6) != 0) |
michael@0 | 336 | continue; |
michael@0 | 337 | #else |
michael@0 | 338 | lsa6 = *sin6; |
michael@0 | 339 | /* bad link local address */ |
michael@0 | 340 | if (in6_recoverscope(&lsa6, &lsa6.sin6_addr, NULL)) |
michael@0 | 341 | continue; |
michael@0 | 342 | sin6 = &lsa6; |
michael@0 | 343 | #endif /* SCTP_KAME */ |
michael@0 | 344 | } |
michael@0 | 345 | #endif /* SCTP_EMBEDDED_V6_SCOPE */ |
michael@0 | 346 | } |
michael@0 | 347 | if ((site_scope == 0) && (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) |
michael@0 | 348 | continue; |
michael@0 | 349 | } else { |
michael@0 | 350 | continue; |
michael@0 | 351 | } |
michael@0 | 352 | break; |
michael@0 | 353 | #endif |
michael@0 | 354 | #if defined(__Userspace__) |
michael@0 | 355 | case AF_CONN: |
michael@0 | 356 | if (!conn_addr_legal) { |
michael@0 | 357 | continue; |
michael@0 | 358 | } |
michael@0 | 359 | break; |
michael@0 | 360 | #endif |
michael@0 | 361 | default: |
michael@0 | 362 | continue; |
michael@0 | 363 | } |
michael@0 | 364 | memset((void *)&xladdr, 0, sizeof(struct xsctp_laddr)); |
michael@0 | 365 | memcpy((void *)&xladdr.address, (const void *)&sctp_ifa->address, sizeof(union sctp_sockstore)); |
michael@0 | 366 | SCTP_INP_RUNLOCK(inp); |
michael@0 | 367 | SCTP_INP_INFO_RUNLOCK(); |
michael@0 | 368 | error = SYSCTL_OUT(req, &xladdr, sizeof(struct xsctp_laddr)); |
michael@0 | 369 | if (error) { |
michael@0 | 370 | return (error); |
michael@0 | 371 | } else { |
michael@0 | 372 | SCTP_INP_INFO_RLOCK(); |
michael@0 | 373 | SCTP_INP_RLOCK(inp); |
michael@0 | 374 | } |
michael@0 | 375 | } |
michael@0 | 376 | } |
michael@0 | 377 | } else { |
michael@0 | 378 | LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) { |
michael@0 | 379 | /* ignore if blacklisted at association level */ |
michael@0 | 380 | if (stcb && sctp_is_addr_restricted(stcb, laddr->ifa)) |
michael@0 | 381 | continue; |
michael@0 | 382 | memset((void *)&xladdr, 0, sizeof(struct xsctp_laddr)); |
michael@0 | 383 | memcpy((void *)&xladdr.address, (const void *)&laddr->ifa->address, sizeof(union sctp_sockstore)); |
michael@0 | 384 | xladdr.start_time.tv_sec = (uint32_t)laddr->start_time.tv_sec; |
michael@0 | 385 | xladdr.start_time.tv_usec = (uint32_t)laddr->start_time.tv_usec; |
michael@0 | 386 | SCTP_INP_RUNLOCK(inp); |
michael@0 | 387 | SCTP_INP_INFO_RUNLOCK(); |
michael@0 | 388 | error = SYSCTL_OUT(req, &xladdr, sizeof(struct xsctp_laddr)); |
michael@0 | 389 | if (error) { |
michael@0 | 390 | return (error); |
michael@0 | 391 | } else { |
michael@0 | 392 | SCTP_INP_INFO_RLOCK(); |
michael@0 | 393 | SCTP_INP_RLOCK(inp); |
michael@0 | 394 | } |
michael@0 | 395 | } |
michael@0 | 396 | } |
michael@0 | 397 | memset((void *)&xladdr, 0, sizeof(struct xsctp_laddr)); |
michael@0 | 398 | xladdr.last = 1; |
michael@0 | 399 | SCTP_INP_RUNLOCK(inp); |
michael@0 | 400 | SCTP_INP_INFO_RUNLOCK(); |
michael@0 | 401 | error = SYSCTL_OUT(req, &xladdr, sizeof(struct xsctp_laddr)); |
michael@0 | 402 | |
michael@0 | 403 | if (error) { |
michael@0 | 404 | return (error); |
michael@0 | 405 | } else { |
michael@0 | 406 | SCTP_INP_INFO_RLOCK(); |
michael@0 | 407 | SCTP_INP_RLOCK(inp); |
michael@0 | 408 | return (0); |
michael@0 | 409 | } |
michael@0 | 410 | } |
michael@0 | 411 | |
michael@0 | 412 | /* |
michael@0 | 413 | * sysctl functions |
michael@0 | 414 | */ |
michael@0 | 415 | #if defined(__APPLE__) |
michael@0 | 416 | static int |
michael@0 | 417 | sctp_assoclist SYSCTL_HANDLER_ARGS |
michael@0 | 418 | { |
michael@0 | 419 | #pragma unused(oidp, arg1, arg2) |
michael@0 | 420 | #else |
michael@0 | 421 | static int |
michael@0 | 422 | sctp_assoclist(SYSCTL_HANDLER_ARGS) |
michael@0 | 423 | { |
michael@0 | 424 | #endif |
michael@0 | 425 | unsigned int number_of_endpoints; |
michael@0 | 426 | unsigned int number_of_local_addresses; |
michael@0 | 427 | unsigned int number_of_associations; |
michael@0 | 428 | unsigned int number_of_remote_addresses; |
michael@0 | 429 | unsigned int n; |
michael@0 | 430 | int error; |
michael@0 | 431 | struct sctp_inpcb *inp; |
michael@0 | 432 | struct sctp_tcb *stcb; |
michael@0 | 433 | struct sctp_nets *net; |
michael@0 | 434 | struct xsctp_inpcb xinpcb; |
michael@0 | 435 | struct xsctp_tcb xstcb; |
michael@0 | 436 | struct xsctp_raddr xraddr; |
michael@0 | 437 | struct socket *so; |
michael@0 | 438 | |
michael@0 | 439 | number_of_endpoints = 0; |
michael@0 | 440 | number_of_local_addresses = 0; |
michael@0 | 441 | number_of_associations = 0; |
michael@0 | 442 | number_of_remote_addresses = 0; |
michael@0 | 443 | |
michael@0 | 444 | SCTP_INP_INFO_RLOCK(); |
michael@0 | 445 | #if !defined(__Windows__) |
michael@0 | 446 | if (req->oldptr == USER_ADDR_NULL) { |
michael@0 | 447 | #else |
michael@0 | 448 | if (req->data == NULL) { |
michael@0 | 449 | #endif |
michael@0 | 450 | LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { |
michael@0 | 451 | SCTP_INP_RLOCK(inp); |
michael@0 | 452 | number_of_endpoints++; |
michael@0 | 453 | number_of_local_addresses += number_of_addresses(inp); |
michael@0 | 454 | LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { |
michael@0 | 455 | number_of_associations++; |
michael@0 | 456 | number_of_local_addresses += number_of_addresses(inp); |
michael@0 | 457 | TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { |
michael@0 | 458 | number_of_remote_addresses++; |
michael@0 | 459 | } |
michael@0 | 460 | } |
michael@0 | 461 | SCTP_INP_RUNLOCK(inp); |
michael@0 | 462 | } |
michael@0 | 463 | SCTP_INP_INFO_RUNLOCK(); |
michael@0 | 464 | n = (number_of_endpoints + 1) * sizeof(struct xsctp_inpcb) + |
michael@0 | 465 | (number_of_local_addresses + number_of_endpoints + number_of_associations) * sizeof(struct xsctp_laddr) + |
michael@0 | 466 | (number_of_associations + number_of_endpoints) * sizeof(struct xsctp_tcb) + |
michael@0 | 467 | (number_of_remote_addresses + number_of_associations) * sizeof(struct xsctp_raddr); |
michael@0 | 468 | |
michael@0 | 469 | /* request some more memory than needed */ |
michael@0 | 470 | #if !defined(__Windows__) |
michael@0 | 471 | req->oldidx = (n + n / 8); |
michael@0 | 472 | #else |
michael@0 | 473 | req->dataidx = (n + n / 8); |
michael@0 | 474 | #endif |
michael@0 | 475 | return (0); |
michael@0 | 476 | } |
michael@0 | 477 | #if !defined(__Windows__) |
michael@0 | 478 | if (req->newptr != USER_ADDR_NULL) { |
michael@0 | 479 | #else |
michael@0 | 480 | if (req->new_data != NULL) { |
michael@0 | 481 | #endif |
michael@0 | 482 | SCTP_INP_INFO_RUNLOCK(); |
michael@0 | 483 | SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_SYSCTL, EPERM); |
michael@0 | 484 | return (EPERM); |
michael@0 | 485 | } |
michael@0 | 486 | LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { |
michael@0 | 487 | SCTP_INP_RLOCK(inp); |
michael@0 | 488 | if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { |
michael@0 | 489 | /* if its allgone it is being freed - skip it */ |
michael@0 | 490 | goto skip; |
michael@0 | 491 | } |
michael@0 | 492 | xinpcb.last = 0; |
michael@0 | 493 | xinpcb.local_port = ntohs(inp->sctp_lport); |
michael@0 | 494 | xinpcb.flags = inp->sctp_flags; |
michael@0 | 495 | #if defined(__FreeBSD__) && __FreeBSD_version < 1000048 |
michael@0 | 496 | xinpcb.features = (uint32_t)inp->sctp_features; |
michael@0 | 497 | #else |
michael@0 | 498 | xinpcb.features = inp->sctp_features; |
michael@0 | 499 | #endif |
michael@0 | 500 | xinpcb.total_sends = inp->total_sends; |
michael@0 | 501 | xinpcb.total_recvs = inp->total_recvs; |
michael@0 | 502 | xinpcb.total_nospaces = inp->total_nospaces; |
michael@0 | 503 | xinpcb.fragmentation_point = inp->sctp_frag_point; |
michael@0 | 504 | so = inp->sctp_socket; |
michael@0 | 505 | if ((so == NULL) || |
michael@0 | 506 | (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { |
michael@0 | 507 | xinpcb.qlen = 0; |
michael@0 | 508 | xinpcb.maxqlen = 0; |
michael@0 | 509 | } else { |
michael@0 | 510 | xinpcb.qlen = so->so_qlen; |
michael@0 | 511 | xinpcb.maxqlen = so->so_qlimit; |
michael@0 | 512 | } |
michael@0 | 513 | SCTP_INP_INCR_REF(inp); |
michael@0 | 514 | SCTP_INP_RUNLOCK(inp); |
michael@0 | 515 | SCTP_INP_INFO_RUNLOCK(); |
michael@0 | 516 | error = SYSCTL_OUT(req, &xinpcb, sizeof(struct xsctp_inpcb)); |
michael@0 | 517 | if (error) { |
michael@0 | 518 | SCTP_INP_DECR_REF(inp); |
michael@0 | 519 | return (error); |
michael@0 | 520 | } |
michael@0 | 521 | SCTP_INP_INFO_RLOCK(); |
michael@0 | 522 | SCTP_INP_RLOCK(inp); |
michael@0 | 523 | error = copy_out_local_addresses(inp, NULL, req); |
michael@0 | 524 | if (error) { |
michael@0 | 525 | SCTP_INP_DECR_REF(inp); |
michael@0 | 526 | return (error); |
michael@0 | 527 | } |
michael@0 | 528 | LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { |
michael@0 | 529 | SCTP_TCB_LOCK(stcb); |
michael@0 | 530 | atomic_add_int(&stcb->asoc.refcnt, 1); |
michael@0 | 531 | SCTP_TCB_UNLOCK(stcb); |
michael@0 | 532 | xstcb.last = 0; |
michael@0 | 533 | xstcb.local_port = ntohs(inp->sctp_lport); |
michael@0 | 534 | xstcb.remote_port = ntohs(stcb->rport); |
michael@0 | 535 | if (stcb->asoc.primary_destination != NULL) |
michael@0 | 536 | xstcb.primary_addr = stcb->asoc.primary_destination->ro._l_addr; |
michael@0 | 537 | xstcb.heartbeat_interval = stcb->asoc.heart_beat_delay; |
michael@0 | 538 | xstcb.state = SCTP_GET_STATE(&stcb->asoc); /* FIXME */ |
michael@0 | 539 | #if defined(__FreeBSD__) |
michael@0 | 540 | #if __FreeBSD_version >= 800000 |
michael@0 | 541 | /* 7.0 does not support these */ |
michael@0 | 542 | xstcb.assoc_id = sctp_get_associd(stcb); |
michael@0 | 543 | xstcb.peers_rwnd = stcb->asoc.peers_rwnd; |
michael@0 | 544 | #endif |
michael@0 | 545 | #else |
michael@0 | 546 | xstcb.assoc_id = sctp_get_associd(stcb); |
michael@0 | 547 | xstcb.peers_rwnd = stcb->asoc.peers_rwnd; |
michael@0 | 548 | #endif |
michael@0 | 549 | xstcb.in_streams = stcb->asoc.streamincnt; |
michael@0 | 550 | xstcb.out_streams = stcb->asoc.streamoutcnt; |
michael@0 | 551 | xstcb.max_nr_retrans = stcb->asoc.overall_error_count; |
michael@0 | 552 | xstcb.primary_process = 0; /* not really supported yet */ |
michael@0 | 553 | xstcb.T1_expireries = stcb->asoc.timoinit + stcb->asoc.timocookie; |
michael@0 | 554 | xstcb.T2_expireries = stcb->asoc.timoshutdown + stcb->asoc.timoshutdownack; |
michael@0 | 555 | xstcb.retransmitted_tsns = stcb->asoc.marked_retrans; |
michael@0 | 556 | xstcb.start_time.tv_sec = (uint32_t)stcb->asoc.start_time.tv_sec; |
michael@0 | 557 | xstcb.start_time.tv_usec = (uint32_t)stcb->asoc.start_time.tv_usec; |
michael@0 | 558 | xstcb.discontinuity_time.tv_sec = (uint32_t)stcb->asoc.discontinuity_time.tv_sec; |
michael@0 | 559 | xstcb.discontinuity_time.tv_usec = (uint32_t)stcb->asoc.discontinuity_time.tv_usec; |
michael@0 | 560 | xstcb.total_sends = stcb->total_sends; |
michael@0 | 561 | xstcb.total_recvs = stcb->total_recvs; |
michael@0 | 562 | xstcb.local_tag = stcb->asoc.my_vtag; |
michael@0 | 563 | xstcb.remote_tag = stcb->asoc.peer_vtag; |
michael@0 | 564 | xstcb.initial_tsn = stcb->asoc.init_seq_number; |
michael@0 | 565 | xstcb.highest_tsn = stcb->asoc.sending_seq - 1; |
michael@0 | 566 | xstcb.cumulative_tsn = stcb->asoc.last_acked_seq; |
michael@0 | 567 | xstcb.cumulative_tsn_ack = stcb->asoc.cumulative_tsn; |
michael@0 | 568 | xstcb.mtu = stcb->asoc.smallest_mtu; |
michael@0 | 569 | xstcb.refcnt = stcb->asoc.refcnt; |
michael@0 | 570 | SCTP_INP_RUNLOCK(inp); |
michael@0 | 571 | SCTP_INP_INFO_RUNLOCK(); |
michael@0 | 572 | error = SYSCTL_OUT(req, &xstcb, sizeof(struct xsctp_tcb)); |
michael@0 | 573 | if (error) { |
michael@0 | 574 | SCTP_INP_DECR_REF(inp); |
michael@0 | 575 | atomic_subtract_int(&stcb->asoc.refcnt, 1); |
michael@0 | 576 | return (error); |
michael@0 | 577 | } |
michael@0 | 578 | SCTP_INP_INFO_RLOCK(); |
michael@0 | 579 | SCTP_INP_RLOCK(inp); |
michael@0 | 580 | error = copy_out_local_addresses(inp, stcb, req); |
michael@0 | 581 | if (error) { |
michael@0 | 582 | SCTP_INP_DECR_REF(inp); |
michael@0 | 583 | atomic_subtract_int(&stcb->asoc.refcnt, 1); |
michael@0 | 584 | return (error); |
michael@0 | 585 | } |
michael@0 | 586 | TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { |
michael@0 | 587 | xraddr.last = 0; |
michael@0 | 588 | xraddr.address = net->ro._l_addr; |
michael@0 | 589 | xraddr.active = ((net->dest_state & SCTP_ADDR_REACHABLE) == SCTP_ADDR_REACHABLE); |
michael@0 | 590 | xraddr.confirmed = ((net->dest_state & SCTP_ADDR_UNCONFIRMED) == 0); |
michael@0 | 591 | xraddr.heartbeat_enabled = ((net->dest_state & SCTP_ADDR_NOHB) == 0); |
michael@0 | 592 | xraddr.potentially_failed = ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF); |
michael@0 | 593 | xraddr.rto = net->RTO; |
michael@0 | 594 | xraddr.max_path_rtx = net->failure_threshold; |
michael@0 | 595 | xraddr.rtx = net->marked_retrans; |
michael@0 | 596 | xraddr.error_counter = net->error_count; |
michael@0 | 597 | xraddr.cwnd = net->cwnd; |
michael@0 | 598 | xraddr.flight_size = net->flight_size; |
michael@0 | 599 | xraddr.mtu = net->mtu; |
michael@0 | 600 | #if defined(__FreeBSD__) |
michael@0 | 601 | #if __FreeBSD_version >= 800000 |
michael@0 | 602 | xraddr.rtt = net->rtt / 1000; |
michael@0 | 603 | xraddr.heartbeat_interval = net->heart_beat_delay; |
michael@0 | 604 | #endif |
michael@0 | 605 | #else |
michael@0 | 606 | xraddr.rtt = net->rtt / 1000; |
michael@0 | 607 | xraddr.heartbeat_interval = net->heart_beat_delay; |
michael@0 | 608 | #endif |
michael@0 | 609 | xraddr.start_time.tv_sec = (uint32_t)net->start_time.tv_sec; |
michael@0 | 610 | xraddr.start_time.tv_usec = (uint32_t)net->start_time.tv_usec; |
michael@0 | 611 | SCTP_INP_RUNLOCK(inp); |
michael@0 | 612 | SCTP_INP_INFO_RUNLOCK(); |
michael@0 | 613 | error = SYSCTL_OUT(req, &xraddr, sizeof(struct xsctp_raddr)); |
michael@0 | 614 | if (error) { |
michael@0 | 615 | SCTP_INP_DECR_REF(inp); |
michael@0 | 616 | atomic_subtract_int(&stcb->asoc.refcnt, 1); |
michael@0 | 617 | return (error); |
michael@0 | 618 | } |
michael@0 | 619 | SCTP_INP_INFO_RLOCK(); |
michael@0 | 620 | SCTP_INP_RLOCK(inp); |
michael@0 | 621 | } |
michael@0 | 622 | atomic_subtract_int(&stcb->asoc.refcnt, 1); |
michael@0 | 623 | memset((void *)&xraddr, 0, sizeof(struct xsctp_raddr)); |
michael@0 | 624 | xraddr.last = 1; |
michael@0 | 625 | SCTP_INP_RUNLOCK(inp); |
michael@0 | 626 | SCTP_INP_INFO_RUNLOCK(); |
michael@0 | 627 | error = SYSCTL_OUT(req, &xraddr, sizeof(struct xsctp_raddr)); |
michael@0 | 628 | if (error) { |
michael@0 | 629 | SCTP_INP_DECR_REF(inp); |
michael@0 | 630 | return (error); |
michael@0 | 631 | } |
michael@0 | 632 | SCTP_INP_INFO_RLOCK(); |
michael@0 | 633 | SCTP_INP_RLOCK(inp); |
michael@0 | 634 | } |
michael@0 | 635 | SCTP_INP_DECR_REF(inp); |
michael@0 | 636 | SCTP_INP_RUNLOCK(inp); |
michael@0 | 637 | SCTP_INP_INFO_RUNLOCK(); |
michael@0 | 638 | memset((void *)&xstcb, 0, sizeof(struct xsctp_tcb)); |
michael@0 | 639 | xstcb.last = 1; |
michael@0 | 640 | error = SYSCTL_OUT(req, &xstcb, sizeof(struct xsctp_tcb)); |
michael@0 | 641 | if (error) { |
michael@0 | 642 | return (error); |
michael@0 | 643 | } |
michael@0 | 644 | skip: |
michael@0 | 645 | SCTP_INP_INFO_RLOCK(); |
michael@0 | 646 | } |
michael@0 | 647 | SCTP_INP_INFO_RUNLOCK(); |
michael@0 | 648 | |
michael@0 | 649 | memset((void *)&xinpcb, 0, sizeof(struct xsctp_inpcb)); |
michael@0 | 650 | xinpcb.last = 1; |
michael@0 | 651 | error = SYSCTL_OUT(req, &xinpcb, sizeof(struct xsctp_inpcb)); |
michael@0 | 652 | return (error); |
michael@0 | 653 | } |
michael@0 | 654 | |
michael@0 | 655 | |
michael@0 | 656 | #if !defined(__Windows__) |
michael@0 | 657 | #define RANGECHK(var, min, max) \ |
michael@0 | 658 | if ((var) < (min)) { (var) = (min); } \ |
michael@0 | 659 | else if ((var) > (max)) { (var) = (max); } |
michael@0 | 660 | #else |
michael@0 | 661 | #define RANGECHK(var, min, max) \ |
michael@0 | 662 | if ((var) <= (min)) { (var) = (min); } \ |
michael@0 | 663 | else if ((var) >= (max)) { (var) = (max); } |
michael@0 | 664 | #endif |
michael@0 | 665 | |
michael@0 | 666 | #if defined(__APPLE__) |
michael@0 | 667 | static int |
michael@0 | 668 | sysctl_sctp_udp_tunneling_check SYSCTL_HANDLER_ARGS |
michael@0 | 669 | { |
michael@0 | 670 | #pragma unused(arg1, arg2) |
michael@0 | 671 | #else |
michael@0 | 672 | static int |
michael@0 | 673 | sysctl_sctp_udp_tunneling_check(SYSCTL_HANDLER_ARGS) |
michael@0 | 674 | { |
michael@0 | 675 | #endif |
michael@0 | 676 | int error; |
michael@0 | 677 | uint32_t old_sctp_udp_tunneling_port; |
michael@0 | 678 | |
michael@0 | 679 | SCTP_INP_INFO_RLOCK(); |
michael@0 | 680 | old_sctp_udp_tunneling_port = SCTP_BASE_SYSCTL(sctp_udp_tunneling_port); |
michael@0 | 681 | SCTP_INP_INFO_RUNLOCK(); |
michael@0 | 682 | error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); |
michael@0 | 683 | if (error == 0) { |
michael@0 | 684 | RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), SCTPCTL_UDP_TUNNELING_PORT_MIN, SCTPCTL_UDP_TUNNELING_PORT_MAX); |
michael@0 | 685 | #if !defined(__Windows__) |
michael@0 | 686 | if (old_sctp_udp_tunneling_port == SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) { |
michael@0 | 687 | error = 0; |
michael@0 | 688 | goto out; |
michael@0 | 689 | } |
michael@0 | 690 | SCTP_INP_INFO_WLOCK(); |
michael@0 | 691 | if (old_sctp_udp_tunneling_port) { |
michael@0 | 692 | sctp_over_udp_stop(); |
michael@0 | 693 | } |
michael@0 | 694 | if (SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) { |
michael@0 | 695 | if (sctp_over_udp_start()) { |
michael@0 | 696 | SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) = 0; |
michael@0 | 697 | } |
michael@0 | 698 | } |
michael@0 | 699 | #else |
michael@0 | 700 | SCTP_INP_INFO_WLOCK(); |
michael@0 | 701 | sctp_over_udp_restart(); |
michael@0 | 702 | #endif |
michael@0 | 703 | SCTP_INP_INFO_WUNLOCK(); |
michael@0 | 704 | } |
michael@0 | 705 | out: |
michael@0 | 706 | return (error); |
michael@0 | 707 | } |
michael@0 | 708 | |
michael@0 | 709 | #if defined(__APPLE__) |
michael@0 | 710 | int sctp_is_vmware_interface(struct ifnet *); |
michael@0 | 711 | |
michael@0 | 712 | static int |
michael@0 | 713 | sysctl_sctp_vmware_interfaces_check SYSCTL_HANDLER_ARGS |
michael@0 | 714 | { |
michael@0 | 715 | #pragma unused(arg1, arg2) |
michael@0 | 716 | int error; |
michael@0 | 717 | uint32_t old_sctp_ignore_vmware_interfaces; |
michael@0 | 718 | |
michael@0 | 719 | old_sctp_ignore_vmware_interfaces = SCTP_BASE_SYSCTL(sctp_ignore_vmware_interfaces); |
michael@0 | 720 | error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); |
michael@0 | 721 | if (error == 0) { |
michael@0 | 722 | RANGECHK(SCTP_BASE_SYSCTL(sctp_ignore_vmware_interfaces), SCTPCTL_IGNORE_VMWARE_INTERFACES_MIN, SCTPCTL_IGNORE_VMWARE_INTERFACES_MAX); |
michael@0 | 723 | if (old_sctp_ignore_vmware_interfaces && !SCTP_BASE_SYSCTL(sctp_ignore_vmware_interfaces)) { |
michael@0 | 724 | sctp_add_or_del_interfaces(sctp_is_vmware_interface, 1); |
michael@0 | 725 | } |
michael@0 | 726 | if (!old_sctp_ignore_vmware_interfaces && SCTP_BASE_SYSCTL(sctp_ignore_vmware_interfaces)) { |
michael@0 | 727 | sctp_add_or_del_interfaces(sctp_is_vmware_interface, 0); |
michael@0 | 728 | } |
michael@0 | 729 | } |
michael@0 | 730 | return (error); |
michael@0 | 731 | } |
michael@0 | 732 | #endif |
michael@0 | 733 | |
michael@0 | 734 | #if defined(__APPLE__) |
michael@0 | 735 | static int |
michael@0 | 736 | sysctl_sctp_check SYSCTL_HANDLER_ARGS |
michael@0 | 737 | { |
michael@0 | 738 | #pragma unused(arg1, arg2) |
michael@0 | 739 | #else |
michael@0 | 740 | static int |
michael@0 | 741 | sysctl_sctp_check(SYSCTL_HANDLER_ARGS) |
michael@0 | 742 | { |
michael@0 | 743 | #endif |
michael@0 | 744 | int error; |
michael@0 | 745 | |
michael@0 | 746 | #if defined(__FreeBSD__) && __FreeBSD_version >= 800056 |
michael@0 | 747 | #ifdef VIMAGE |
michael@0 | 748 | error = vnet_sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); |
michael@0 | 749 | #else |
michael@0 | 750 | error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); |
michael@0 | 751 | #endif |
michael@0 | 752 | #else |
michael@0 | 753 | error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); |
michael@0 | 754 | #endif |
michael@0 | 755 | if (error == 0) { |
michael@0 | 756 | RANGECHK(SCTP_BASE_SYSCTL(sctp_sendspace), SCTPCTL_MAXDGRAM_MIN, SCTPCTL_MAXDGRAM_MAX); |
michael@0 | 757 | RANGECHK(SCTP_BASE_SYSCTL(sctp_recvspace), SCTPCTL_RECVSPACE_MIN, SCTPCTL_RECVSPACE_MAX); |
michael@0 | 758 | #if defined(__FreeBSD__) |
michael@0 | 759 | RANGECHK(SCTP_BASE_SYSCTL(sctp_auto_asconf), SCTPCTL_AUTOASCONF_MIN, SCTPCTL_AUTOASCONF_MAX); |
michael@0 | 760 | #elif defined(SCTP_APPLE_AUTO_ASCONF) |
michael@0 | 761 | RANGECHK(SCTP_BASE_SYSCTL(sctp_auto_asconf), SCTPCTL_AUTOASCONF_MIN, SCTPCTL_AUTOASCONF_MAX); |
michael@0 | 762 | #endif |
michael@0 | 763 | RANGECHK(SCTP_BASE_SYSCTL(sctp_ecn_enable), SCTPCTL_ECN_ENABLE_MIN, SCTPCTL_ECN_ENABLE_MAX); |
michael@0 | 764 | RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_sacks), SCTPCTL_STRICT_SACKS_MIN, SCTPCTL_STRICT_SACKS_MAX); |
michael@0 | 765 | #if !(defined(__FreeBSD__) && __FreeBSD_version >= 800000) |
michael@0 | 766 | #if !defined(SCTP_WITH_NO_CSUM) |
michael@0 | 767 | RANGECHK(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), SCTPCTL_LOOPBACK_NOCSUM_MIN, SCTPCTL_LOOPBACK_NOCSUM_MAX); |
michael@0 | 768 | #endif |
michael@0 | 769 | #endif |
michael@0 | 770 | RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); |
michael@0 | 771 | RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); |
michael@0 | 772 | RANGECHK(SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), SCTPCTL_FRMAXBURST_MIN, SCTPCTL_FRMAXBURST_MAX); |
michael@0 | 773 | RANGECHK(SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), SCTPCTL_MAXCHUNKS_MIN, SCTPCTL_MAXCHUNKS_MAX); |
michael@0 | 774 | RANGECHK(SCTP_BASE_SYSCTL(sctp_hashtblsize), SCTPCTL_TCBHASHSIZE_MIN, SCTPCTL_TCBHASHSIZE_MAX); |
michael@0 | 775 | RANGECHK(SCTP_BASE_SYSCTL(sctp_pcbtblsize), SCTPCTL_PCBHASHSIZE_MIN, SCTPCTL_PCBHASHSIZE_MAX); |
michael@0 | 776 | RANGECHK(SCTP_BASE_SYSCTL(sctp_min_split_point), SCTPCTL_MIN_SPLIT_POINT_MIN, SCTPCTL_MIN_SPLIT_POINT_MAX); |
michael@0 | 777 | RANGECHK(SCTP_BASE_SYSCTL(sctp_chunkscale), SCTPCTL_CHUNKSCALE_MIN, SCTPCTL_CHUNKSCALE_MAX); |
michael@0 | 778 | RANGECHK(SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default), SCTPCTL_DELAYED_SACK_TIME_MIN, SCTPCTL_DELAYED_SACK_TIME_MAX); |
michael@0 | 779 | RANGECHK(SCTP_BASE_SYSCTL(sctp_sack_freq_default), SCTPCTL_SACK_FREQ_MIN, SCTPCTL_SACK_FREQ_MAX); |
michael@0 | 780 | RANGECHK(SCTP_BASE_SYSCTL(sctp_system_free_resc_limit), SCTPCTL_SYS_RESOURCE_MIN, SCTPCTL_SYS_RESOURCE_MAX); |
michael@0 | 781 | RANGECHK(SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit), SCTPCTL_ASOC_RESOURCE_MIN, SCTPCTL_ASOC_RESOURCE_MAX); |
michael@0 | 782 | RANGECHK(SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default), SCTPCTL_HEARTBEAT_INTERVAL_MIN, SCTPCTL_HEARTBEAT_INTERVAL_MAX); |
michael@0 | 783 | RANGECHK(SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default), SCTPCTL_PMTU_RAISE_TIME_MIN, SCTPCTL_PMTU_RAISE_TIME_MAX); |
michael@0 | 784 | RANGECHK(SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default), SCTPCTL_SHUTDOWN_GUARD_TIME_MIN, SCTPCTL_SHUTDOWN_GUARD_TIME_MAX); |
michael@0 | 785 | RANGECHK(SCTP_BASE_SYSCTL(sctp_secret_lifetime_default), SCTPCTL_SECRET_LIFETIME_MIN, SCTPCTL_SECRET_LIFETIME_MAX); |
michael@0 | 786 | RANGECHK(SCTP_BASE_SYSCTL(sctp_rto_max_default), SCTPCTL_RTO_MAX_MIN, SCTPCTL_RTO_MAX_MAX); |
michael@0 | 787 | RANGECHK(SCTP_BASE_SYSCTL(sctp_rto_min_default), SCTPCTL_RTO_MIN_MIN, SCTPCTL_RTO_MIN_MAX); |
michael@0 | 788 | RANGECHK(SCTP_BASE_SYSCTL(sctp_rto_initial_default), SCTPCTL_RTO_INITIAL_MIN, SCTPCTL_RTO_INITIAL_MAX); |
michael@0 | 789 | RANGECHK(SCTP_BASE_SYSCTL(sctp_init_rto_max_default), SCTPCTL_INIT_RTO_MAX_MIN, SCTPCTL_INIT_RTO_MAX_MAX); |
michael@0 | 790 | RANGECHK(SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default), SCTPCTL_VALID_COOKIE_LIFE_MIN, SCTPCTL_VALID_COOKIE_LIFE_MAX); |
michael@0 | 791 | RANGECHK(SCTP_BASE_SYSCTL(sctp_init_rtx_max_default), SCTPCTL_INIT_RTX_MAX_MIN, SCTPCTL_INIT_RTX_MAX_MAX); |
michael@0 | 792 | RANGECHK(SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default), SCTPCTL_ASSOC_RTX_MAX_MIN, SCTPCTL_ASSOC_RTX_MAX_MAX); |
michael@0 | 793 | RANGECHK(SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), SCTPCTL_PATH_RTX_MAX_MIN, SCTPCTL_PATH_RTX_MAX_MAX); |
michael@0 | 794 | RANGECHK(SCTP_BASE_SYSCTL(sctp_path_pf_threshold), SCTPCTL_PATH_PF_THRESHOLD_MIN, SCTPCTL_PATH_PF_THRESHOLD_MAX); |
michael@0 | 795 | RANGECHK(SCTP_BASE_SYSCTL(sctp_add_more_threshold), SCTPCTL_ADD_MORE_ON_OUTPUT_MIN, SCTPCTL_ADD_MORE_ON_OUTPUT_MAX); |
michael@0 | 796 | RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default), SCTPCTL_INCOMING_STREAMS_MIN, SCTPCTL_INCOMING_STREAMS_MAX); |
michael@0 | 797 | RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), SCTPCTL_OUTGOING_STREAMS_MIN, SCTPCTL_OUTGOING_STREAMS_MAX); |
michael@0 | 798 | RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_on_off), SCTPCTL_CMT_ON_OFF_MIN, SCTPCTL_CMT_ON_OFF_MAX); |
michael@0 | 799 | /* EY */ |
michael@0 | 800 | RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_sack_on_off), SCTPCTL_NR_SACK_ON_OFF_MIN, SCTPCTL_NR_SACK_ON_OFF_MAX); |
michael@0 | 801 | RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_use_dac), SCTPCTL_CMT_USE_DAC_MIN, SCTPCTL_CMT_USE_DAC_MAX); |
michael@0 | 802 | RANGECHK(SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), SCTPCTL_CWND_MAXBURST_MIN, SCTPCTL_CWND_MAXBURST_MAX); |
michael@0 | 803 | RANGECHK(SCTP_BASE_SYSCTL(sctp_asconf_auth_nochk), SCTPCTL_ASCONF_AUTH_NOCHK_MIN, SCTPCTL_ASCONF_AUTH_NOCHK_MAX); |
michael@0 | 804 | RANGECHK(SCTP_BASE_SYSCTL(sctp_auth_disable), SCTPCTL_AUTH_DISABLE_MIN, SCTPCTL_AUTH_DISABLE_MAX); |
michael@0 | 805 | RANGECHK(SCTP_BASE_SYSCTL(sctp_nat_friendly), SCTPCTL_NAT_FRIENDLY_MIN, SCTPCTL_NAT_FRIENDLY_MAX); |
michael@0 | 806 | RANGECHK(SCTP_BASE_SYSCTL(sctp_L2_abc_variable), SCTPCTL_ABC_L_VAR_MIN, SCTPCTL_ABC_L_VAR_MAX); |
michael@0 | 807 | RANGECHK(SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count), SCTPCTL_MAX_CHAINED_MBUFS_MIN, SCTPCTL_MAX_CHAINED_MBUFS_MAX); |
michael@0 | 808 | RANGECHK(SCTP_BASE_SYSCTL(sctp_do_drain), SCTPCTL_DO_SCTP_DRAIN_MIN, SCTPCTL_DO_SCTP_DRAIN_MAX); |
michael@0 | 809 | RANGECHK(SCTP_BASE_SYSCTL(sctp_hb_maxburst), SCTPCTL_HB_MAX_BURST_MIN, SCTPCTL_HB_MAX_BURST_MAX); |
michael@0 | 810 | RANGECHK(SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit), SCTPCTL_ABORT_AT_LIMIT_MIN, SCTPCTL_ABORT_AT_LIMIT_MAX); |
michael@0 | 811 | RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_data_order), SCTPCTL_STRICT_DATA_ORDER_MIN, SCTPCTL_STRICT_DATA_ORDER_MAX); |
michael@0 | 812 | RANGECHK(SCTP_BASE_SYSCTL(sctp_min_residual), SCTPCTL_MIN_RESIDUAL_MIN, SCTPCTL_MIN_RESIDUAL_MAX); |
michael@0 | 813 | RANGECHK(SCTP_BASE_SYSCTL(sctp_max_retran_chunk), SCTPCTL_MAX_RETRAN_CHUNK_MIN, SCTPCTL_MAX_RETRAN_CHUNK_MAX); |
michael@0 | 814 | RANGECHK(SCTP_BASE_SYSCTL(sctp_logging_level), SCTPCTL_LOGGING_LEVEL_MIN, SCTPCTL_LOGGING_LEVEL_MAX); |
michael@0 | 815 | RANGECHK(SCTP_BASE_SYSCTL(sctp_default_cc_module), SCTPCTL_DEFAULT_CC_MODULE_MIN, SCTPCTL_DEFAULT_CC_MODULE_MAX); |
michael@0 | 816 | RANGECHK(SCTP_BASE_SYSCTL(sctp_default_ss_module), SCTPCTL_DEFAULT_SS_MODULE_MIN, SCTPCTL_DEFAULT_SS_MODULE_MAX); |
michael@0 | 817 | RANGECHK(SCTP_BASE_SYSCTL(sctp_default_frag_interleave), SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MIN, SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MAX); |
michael@0 | 818 | RANGECHK(SCTP_BASE_SYSCTL(sctp_vtag_time_wait), SCTPCTL_TIME_WAIT_MIN, SCTPCTL_TIME_WAIT_MAX); |
michael@0 | 819 | RANGECHK(SCTP_BASE_SYSCTL(sctp_buffer_splitting), SCTPCTL_BUFFER_SPLITTING_MIN, SCTPCTL_BUFFER_SPLITTING_MAX); |
michael@0 | 820 | RANGECHK(SCTP_BASE_SYSCTL(sctp_initial_cwnd), SCTPCTL_INITIAL_CWND_MIN, SCTPCTL_INITIAL_CWND_MAX); |
michael@0 | 821 | RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_bw), SCTPCTL_RTTVAR_BW_MIN, SCTPCTL_RTTVAR_BW_MAX); |
michael@0 | 822 | RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_rtt), SCTPCTL_RTTVAR_RTT_MIN, SCTPCTL_RTTVAR_RTT_MAX); |
michael@0 | 823 | RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_eqret), SCTPCTL_RTTVAR_EQRET_MIN, SCTPCTL_RTTVAR_EQRET_MAX); |
michael@0 | 824 | RANGECHK(SCTP_BASE_SYSCTL(sctp_steady_step), SCTPCTL_RTTVAR_STEADYS_MIN, SCTPCTL_RTTVAR_STEADYS_MAX); |
michael@0 | 825 | RANGECHK(SCTP_BASE_SYSCTL(sctp_use_dccc_ecn), SCTPCTL_RTTVAR_DCCCECN_MIN, SCTPCTL_RTTVAR_DCCCECN_MAX); |
michael@0 | 826 | #if defined(__FreeBSD__) |
michael@0 | 827 | RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX); |
michael@0 | 828 | #elif defined(SCTP_APPLE_MOBILITY_BASE) |
michael@0 | 829 | RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX); |
michael@0 | 830 | #endif |
michael@0 | 831 | #if defined(__FreeBSD__) |
michael@0 | 832 | RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX); |
michael@0 | 833 | #elif defined(__FreeBSD__) || defined(SCTP_APPLE_MOBILITY_FASTHANDOFF) |
michael@0 | 834 | RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX); |
michael@0 | 835 | #endif |
michael@0 | 836 | RANGECHK(SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN, SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX); |
michael@0 | 837 | RANGECHK(SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), SCTPCTL_NAT_FRIENDLY_INITS_MIN, SCTPCTL_NAT_FRIENDLY_INITS_MAX); |
michael@0 | 838 | RANGECHK(SCTP_BASE_SYSCTL(sctp_blackhole), SCTPCTL_BLACKHOLE_MIN, SCTPCTL_BLACKHOLE_MAX); |
michael@0 | 839 | |
michael@0 | 840 | #ifdef SCTP_DEBUG |
michael@0 | 841 | RANGECHK(SCTP_BASE_SYSCTL(sctp_debug_on), SCTPCTL_DEBUG_MIN, SCTPCTL_DEBUG_MAX); |
michael@0 | 842 | #endif |
michael@0 | 843 | #if defined(__APPLE__) |
michael@0 | 844 | RANGECHK(SCTP_BASE_SYSCTL(sctp_main_timer), SCTPCTL_MAIN_TIMER_MIN, SCTPCTL_MAIN_TIMER_MAX); |
michael@0 | 845 | RANGECHK(SCTP_BASE_SYSCTL(sctp_addr_watchdog_limit), SCTPCTL_ADDR_WATCHDOG_LIMIT_MIN, SCTPCTL_ADDR_WATCHDOG_LIMIT_MAX); |
michael@0 | 846 | RANGECHK(SCTP_BASE_SYSCTL(sctp_vtag_watchdog_limit), SCTPCTL_VTAG_WATCHDOG_LIMIT_MIN, SCTPCTL_VTAG_WATCHDOG_LIMIT_MAX); |
michael@0 | 847 | #endif |
michael@0 | 848 | #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) |
michael@0 | 849 | RANGECHK(SCTP_BASE_SYSCTL(sctp_output_unlocked), SCTPCTL_OUTPUT_UNLOCKED_MIN, SCTPCTL_OUTPUT_UNLOCKED_MAX); |
michael@0 | 850 | #endif |
michael@0 | 851 | } |
michael@0 | 852 | return (error); |
michael@0 | 853 | } |
michael@0 | 854 | |
michael@0 | 855 | #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) |
michael@0 | 856 | static int |
michael@0 | 857 | sysctl_stat_get(SYSCTL_HANDLER_ARGS) |
michael@0 | 858 | { |
michael@0 | 859 | int cpu, error; |
michael@0 | 860 | struct sctpstat sb, *sarry, *cpin = NULL; |
michael@0 | 861 | |
michael@0 | 862 | if ((req->newptr) && (req->newlen == sizeof(struct sctpstat))) { |
michael@0 | 863 | /* User wants us to clear or at least |
michael@0 | 864 | * reset the counters to the specified values. |
michael@0 | 865 | */ |
michael@0 | 866 | cpin = (struct sctpstat *)req->newptr; |
michael@0 | 867 | } else if (req->newptr) { |
michael@0 | 868 | /* Must be a stat structure */ |
michael@0 | 869 | return (EINVAL); |
michael@0 | 870 | } |
michael@0 | 871 | memset(&sb, 0, sizeof(sb)); |
michael@0 | 872 | for (cpu = 0; cpu < mp_maxid; cpu++) { |
michael@0 | 873 | sarry = &SCTP_BASE_STATS[cpu]; |
michael@0 | 874 | if (sarry->sctps_discontinuitytime.tv_sec > sb.sctps_discontinuitytime.tv_sec) { |
michael@0 | 875 | sb.sctps_discontinuitytime.tv_sec = sarry->sctps_discontinuitytime.tv_sec; |
michael@0 | 876 | sb.sctps_discontinuitytime.tv_usec = sarry->sctps_discontinuitytime.tv_usec; |
michael@0 | 877 | } |
michael@0 | 878 | sb.sctps_currestab += sarry->sctps_currestab; |
michael@0 | 879 | sb.sctps_activeestab += sarry->sctps_activeestab; |
michael@0 | 880 | sb.sctps_restartestab += sarry->sctps_restartestab; |
michael@0 | 881 | sb.sctps_collisionestab += sarry->sctps_collisionestab; |
michael@0 | 882 | sb.sctps_passiveestab += sarry->sctps_passiveestab; |
michael@0 | 883 | sb.sctps_aborted += sarry->sctps_aborted; |
michael@0 | 884 | sb.sctps_shutdown += sarry->sctps_shutdown; |
michael@0 | 885 | sb.sctps_outoftheblue += sarry->sctps_outoftheblue; |
michael@0 | 886 | sb.sctps_checksumerrors += sarry->sctps_checksumerrors; |
michael@0 | 887 | sb.sctps_outcontrolchunks += sarry->sctps_outcontrolchunks; |
michael@0 | 888 | sb.sctps_outorderchunks += sarry->sctps_outorderchunks; |
michael@0 | 889 | sb.sctps_outunorderchunks += sarry->sctps_outunorderchunks; |
michael@0 | 890 | sb.sctps_incontrolchunks += sarry->sctps_incontrolchunks; |
michael@0 | 891 | sb.sctps_inorderchunks += sarry->sctps_inorderchunks; |
michael@0 | 892 | sb.sctps_inunorderchunks += sarry->sctps_inunorderchunks; |
michael@0 | 893 | sb.sctps_fragusrmsgs += sarry->sctps_fragusrmsgs; |
michael@0 | 894 | sb.sctps_reasmusrmsgs += sarry->sctps_reasmusrmsgs; |
michael@0 | 895 | sb.sctps_outpackets += sarry->sctps_outpackets; |
michael@0 | 896 | sb.sctps_inpackets += sarry->sctps_inpackets; |
michael@0 | 897 | sb.sctps_recvpackets += sarry->sctps_recvpackets; |
michael@0 | 898 | sb.sctps_recvdatagrams += sarry->sctps_recvdatagrams; |
michael@0 | 899 | sb.sctps_recvpktwithdata += sarry->sctps_recvpktwithdata; |
michael@0 | 900 | sb.sctps_recvsacks += sarry->sctps_recvsacks; |
michael@0 | 901 | sb.sctps_recvdata += sarry->sctps_recvdata; |
michael@0 | 902 | sb.sctps_recvdupdata += sarry->sctps_recvdupdata; |
michael@0 | 903 | sb.sctps_recvheartbeat += sarry->sctps_recvheartbeat; |
michael@0 | 904 | sb.sctps_recvheartbeatack += sarry->sctps_recvheartbeatack; |
michael@0 | 905 | sb.sctps_recvecne += sarry->sctps_recvecne; |
michael@0 | 906 | sb.sctps_recvauth += sarry->sctps_recvauth; |
michael@0 | 907 | sb.sctps_recvauthmissing += sarry->sctps_recvauthmissing; |
michael@0 | 908 | sb.sctps_recvivalhmacid += sarry->sctps_recvivalhmacid; |
michael@0 | 909 | sb.sctps_recvivalkeyid += sarry->sctps_recvivalkeyid; |
michael@0 | 910 | sb.sctps_recvauthfailed += sarry->sctps_recvauthfailed; |
michael@0 | 911 | sb.sctps_recvexpress += sarry->sctps_recvexpress; |
michael@0 | 912 | sb.sctps_recvexpressm += sarry->sctps_recvexpressm; |
michael@0 | 913 | sb.sctps_recvnocrc += sarry->sctps_recvnocrc; |
michael@0 | 914 | sb.sctps_recvswcrc += sarry->sctps_recvswcrc; |
michael@0 | 915 | sb.sctps_recvhwcrc += sarry->sctps_recvhwcrc; |
michael@0 | 916 | sb.sctps_sendpackets += sarry->sctps_sendpackets; |
michael@0 | 917 | sb.sctps_sendsacks += sarry->sctps_sendsacks; |
michael@0 | 918 | sb.sctps_senddata += sarry->sctps_senddata; |
michael@0 | 919 | sb.sctps_sendretransdata += sarry->sctps_sendretransdata; |
michael@0 | 920 | sb.sctps_sendfastretrans += sarry->sctps_sendfastretrans; |
michael@0 | 921 | sb.sctps_sendmultfastretrans += sarry->sctps_sendmultfastretrans; |
michael@0 | 922 | sb.sctps_sendheartbeat += sarry->sctps_sendheartbeat; |
michael@0 | 923 | sb.sctps_sendecne += sarry->sctps_sendecne; |
michael@0 | 924 | sb.sctps_sendauth += sarry->sctps_sendauth; |
michael@0 | 925 | sb.sctps_senderrors += sarry->sctps_senderrors; |
michael@0 | 926 | sb.sctps_sendnocrc += sarry->sctps_sendnocrc; |
michael@0 | 927 | sb.sctps_sendswcrc += sarry->sctps_sendswcrc; |
michael@0 | 928 | sb.sctps_sendhwcrc += sarry->sctps_sendhwcrc; |
michael@0 | 929 | sb.sctps_pdrpfmbox += sarry->sctps_pdrpfmbox; |
michael@0 | 930 | sb.sctps_pdrpfehos += sarry->sctps_pdrpfehos; |
michael@0 | 931 | sb.sctps_pdrpmbda += sarry->sctps_pdrpmbda; |
michael@0 | 932 | sb.sctps_pdrpmbct += sarry->sctps_pdrpmbct; |
michael@0 | 933 | sb.sctps_pdrpbwrpt += sarry->sctps_pdrpbwrpt; |
michael@0 | 934 | sb.sctps_pdrpcrupt += sarry->sctps_pdrpcrupt; |
michael@0 | 935 | sb.sctps_pdrpnedat += sarry->sctps_pdrpnedat; |
michael@0 | 936 | sb.sctps_pdrppdbrk += sarry->sctps_pdrppdbrk; |
michael@0 | 937 | sb.sctps_pdrptsnnf += sarry->sctps_pdrptsnnf; |
michael@0 | 938 | sb.sctps_pdrpdnfnd += sarry->sctps_pdrpdnfnd; |
michael@0 | 939 | sb.sctps_pdrpdiwnp += sarry->sctps_pdrpdiwnp; |
michael@0 | 940 | sb.sctps_pdrpdizrw += sarry->sctps_pdrpdizrw; |
michael@0 | 941 | sb.sctps_pdrpbadd += sarry->sctps_pdrpbadd; |
michael@0 | 942 | sb.sctps_pdrpmark += sarry->sctps_pdrpmark; |
michael@0 | 943 | sb.sctps_timoiterator += sarry->sctps_timoiterator; |
michael@0 | 944 | sb.sctps_timodata += sarry->sctps_timodata; |
michael@0 | 945 | sb.sctps_timowindowprobe += sarry->sctps_timowindowprobe; |
michael@0 | 946 | sb.sctps_timoinit += sarry->sctps_timoinit; |
michael@0 | 947 | sb.sctps_timosack += sarry->sctps_timosack; |
michael@0 | 948 | sb.sctps_timoshutdown += sarry->sctps_timoshutdown; |
michael@0 | 949 | sb.sctps_timoheartbeat += sarry->sctps_timoheartbeat; |
michael@0 | 950 | sb.sctps_timocookie += sarry->sctps_timocookie; |
michael@0 | 951 | sb.sctps_timosecret += sarry->sctps_timosecret; |
michael@0 | 952 | sb.sctps_timopathmtu += sarry->sctps_timopathmtu; |
michael@0 | 953 | sb.sctps_timoshutdownack += sarry->sctps_timoshutdownack; |
michael@0 | 954 | sb.sctps_timoshutdownguard += sarry->sctps_timoshutdownguard; |
michael@0 | 955 | sb.sctps_timostrmrst += sarry->sctps_timostrmrst; |
michael@0 | 956 | sb.sctps_timoearlyfr += sarry->sctps_timoearlyfr; |
michael@0 | 957 | sb.sctps_timoasconf += sarry->sctps_timoasconf; |
michael@0 | 958 | sb.sctps_timodelprim += sarry->sctps_timodelprim; |
michael@0 | 959 | sb.sctps_timoautoclose += sarry->sctps_timoautoclose; |
michael@0 | 960 | sb.sctps_timoassockill += sarry->sctps_timoassockill; |
michael@0 | 961 | sb.sctps_timoinpkill += sarry->sctps_timoinpkill; |
michael@0 | 962 | sb.sctps_hdrops += sarry->sctps_hdrops; |
michael@0 | 963 | sb.sctps_badsum += sarry->sctps_badsum; |
michael@0 | 964 | sb.sctps_noport += sarry->sctps_noport; |
michael@0 | 965 | sb.sctps_badvtag += sarry->sctps_badvtag; |
michael@0 | 966 | sb.sctps_badsid += sarry->sctps_badsid; |
michael@0 | 967 | sb.sctps_nomem += sarry->sctps_nomem; |
michael@0 | 968 | sb.sctps_fastretransinrtt += sarry->sctps_fastretransinrtt; |
michael@0 | 969 | sb.sctps_markedretrans += sarry->sctps_markedretrans; |
michael@0 | 970 | sb.sctps_naglesent += sarry->sctps_naglesent; |
michael@0 | 971 | sb.sctps_naglequeued += sarry->sctps_naglequeued; |
michael@0 | 972 | sb.sctps_maxburstqueued += sarry->sctps_maxburstqueued; |
michael@0 | 973 | sb.sctps_ifnomemqueued += sarry->sctps_ifnomemqueued; |
michael@0 | 974 | sb.sctps_windowprobed += sarry->sctps_windowprobed; |
michael@0 | 975 | sb.sctps_lowlevelerr += sarry->sctps_lowlevelerr; |
michael@0 | 976 | sb.sctps_lowlevelerrusr += sarry->sctps_lowlevelerrusr; |
michael@0 | 977 | sb.sctps_datadropchklmt += sarry->sctps_datadropchklmt; |
michael@0 | 978 | sb.sctps_datadroprwnd += sarry->sctps_datadroprwnd; |
michael@0 | 979 | sb.sctps_ecnereducedcwnd += sarry->sctps_ecnereducedcwnd; |
michael@0 | 980 | sb.sctps_vtagexpress += sarry->sctps_vtagexpress; |
michael@0 | 981 | sb.sctps_vtagbogus += sarry->sctps_vtagbogus; |
michael@0 | 982 | sb.sctps_primary_randry += sarry->sctps_primary_randry; |
michael@0 | 983 | sb.sctps_cmt_randry += sarry->sctps_cmt_randry; |
michael@0 | 984 | sb.sctps_slowpath_sack += sarry->sctps_slowpath_sack; |
michael@0 | 985 | sb.sctps_wu_sacks_sent += sarry->sctps_wu_sacks_sent; |
michael@0 | 986 | sb.sctps_sends_with_flags += sarry->sctps_sends_with_flags; |
michael@0 | 987 | sb.sctps_sends_with_unord += sarry->sctps_sends_with_unord; |
michael@0 | 988 | sb.sctps_sends_with_eof += sarry->sctps_sends_with_eof; |
michael@0 | 989 | sb.sctps_sends_with_abort += sarry->sctps_sends_with_abort; |
michael@0 | 990 | sb.sctps_protocol_drain_calls += sarry->sctps_protocol_drain_calls; |
michael@0 | 991 | sb.sctps_protocol_drains_done += sarry->sctps_protocol_drains_done; |
michael@0 | 992 | sb.sctps_read_peeks += sarry->sctps_read_peeks; |
michael@0 | 993 | sb.sctps_cached_chk += sarry->sctps_cached_chk; |
michael@0 | 994 | sb.sctps_cached_strmoq += sarry->sctps_cached_strmoq; |
michael@0 | 995 | sb.sctps_left_abandon += sarry->sctps_left_abandon; |
michael@0 | 996 | sb.sctps_send_burst_avoid += sarry->sctps_send_burst_avoid; |
michael@0 | 997 | sb.sctps_send_cwnd_avoid += sarry->sctps_send_cwnd_avoid; |
michael@0 | 998 | sb.sctps_fwdtsn_map_over += sarry->sctps_fwdtsn_map_over; |
michael@0 | 999 | if (cpin) { |
michael@0 | 1000 | memcpy(sarry, cpin, sizeof(struct sctpstat)); |
michael@0 | 1001 | } |
michael@0 | 1002 | } |
michael@0 | 1003 | error = SYSCTL_OUT(req, &sb, sizeof(sb)); |
michael@0 | 1004 | return (error); |
michael@0 | 1005 | } |
michael@0 | 1006 | #endif |
michael@0 | 1007 | |
michael@0 | 1008 | #if defined(SCTP_LOCAL_TRACE_BUF) |
michael@0 | 1009 | #if defined(__APPLE__) |
michael@0 | 1010 | static int |
michael@0 | 1011 | sysctl_sctp_cleartrace SYSCTL_HANDLER_ARGS |
michael@0 | 1012 | { |
michael@0 | 1013 | #pragma unused(arg1, arg2, req, oidp) |
michael@0 | 1014 | #else |
michael@0 | 1015 | static int |
michael@0 | 1016 | sysctl_sctp_cleartrace(SYSCTL_HANDLER_ARGS) |
michael@0 | 1017 | { |
michael@0 | 1018 | #endif |
michael@0 | 1019 | int error = 0; |
michael@0 | 1020 | #if defined(__Windows__) |
michael@0 | 1021 | int value = 0; |
michael@0 | 1022 | |
michael@0 | 1023 | if (req->new_data == NULL) { |
michael@0 | 1024 | return (error); |
michael@0 | 1025 | } |
michael@0 | 1026 | error = SYSCTL_IN(req, &value, sizeof(int)); |
michael@0 | 1027 | if (error == 0 && value != 0 && SCTP_BASE_SYSCTL(sctp_log) != NULL) { |
michael@0 | 1028 | memset(SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); |
michael@0 | 1029 | } |
michael@0 | 1030 | #else |
michael@0 | 1031 | |
michael@0 | 1032 | memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); |
michael@0 | 1033 | #endif |
michael@0 | 1034 | return (error); |
michael@0 | 1035 | } |
michael@0 | 1036 | #endif |
michael@0 | 1037 | |
michael@0 | 1038 | |
michael@0 | 1039 | #if defined(__APPLE__) || defined(__FreeBSD__) |
michael@0 | 1040 | #if defined(__APPLE__) |
michael@0 | 1041 | #define CTLTYPE_UINT CTLTYPE_INT |
michael@0 | 1042 | #define SYSCTL_VNET_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr) \ |
michael@0 | 1043 | SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr) |
michael@0 | 1044 | #define SYSCTL_VNET_STRUCT(parent, nbr, name, access, ptr, type, descr) \ |
michael@0 | 1045 | SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) |
michael@0 | 1046 | #endif |
michael@0 | 1047 | /* |
michael@0 | 1048 | * sysctl definitions |
michael@0 | 1049 | */ |
michael@0 | 1050 | |
michael@0 | 1051 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1052 | &SCTP_BASE_SYSCTL(sctp_sendspace), 0, sysctl_sctp_check, "IU", |
michael@0 | 1053 | SCTPCTL_MAXDGRAM_DESC); |
michael@0 | 1054 | |
michael@0 | 1055 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1056 | &SCTP_BASE_SYSCTL(sctp_recvspace), 0, sysctl_sctp_check, "IU", |
michael@0 | 1057 | SCTPCTL_RECVSPACE_DESC); |
michael@0 | 1058 | |
michael@0 | 1059 | #if defined(__FreeBSD__) |
michael@0 | 1060 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1061 | &SCTP_BASE_SYSCTL(sctp_auto_asconf), 0, sysctl_sctp_check, "IU", |
michael@0 | 1062 | SCTPCTL_AUTOASCONF_DESC); |
michael@0 | 1063 | #elif defined(SCTP_APPLE_AUTO_ASCONF) |
michael@0 | 1064 | SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1065 | &SCTP_BASE_SYSCTL(sctp_auto_asconf), 0, sysctl_sctp_check, "IU", |
michael@0 | 1066 | SCTPCTL_AUTOASCONF_DESC); |
michael@0 | 1067 | #endif |
michael@0 | 1068 | |
michael@0 | 1069 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1070 | &SCTP_BASE_SYSCTL(sctp_ecn_enable), 0, sysctl_sctp_check, "IU", |
michael@0 | 1071 | SCTPCTL_ECN_ENABLE_DESC); |
michael@0 | 1072 | |
michael@0 | 1073 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1074 | &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU", |
michael@0 | 1075 | SCTPCTL_STRICT_SACKS_DESC); |
michael@0 | 1076 | |
michael@0 | 1077 | #if !(defined(__FreeBSD__) && __FreeBSD_version >= 800000) |
michael@0 | 1078 | #if !defined(SCTP_WITH_NO_CSUM) |
michael@0 | 1079 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1080 | &SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sysctl_sctp_check, "IU", |
michael@0 | 1081 | SCTPCTL_LOOPBACK_NOCSUM_DESC); |
michael@0 | 1082 | #endif |
michael@0 | 1083 | #endif |
michael@0 | 1084 | |
michael@0 | 1085 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1086 | &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, "IU", |
michael@0 | 1087 | SCTPCTL_PEER_CHKOH_DESC); |
michael@0 | 1088 | |
michael@0 | 1089 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1090 | &SCTP_BASE_SYSCTL(sctp_max_burst_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1091 | SCTPCTL_MAXBURST_DESC); |
michael@0 | 1092 | |
michael@0 | 1093 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, fr_maxburst, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1094 | &SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1095 | SCTPCTL_FRMAXBURST_DESC); |
michael@0 | 1096 | |
michael@0 | 1097 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1098 | &SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), 0, sysctl_sctp_check, "IU", |
michael@0 | 1099 | SCTPCTL_MAXCHUNKS_DESC); |
michael@0 | 1100 | |
michael@0 | 1101 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1102 | &SCTP_BASE_SYSCTL(sctp_hashtblsize), 0, sysctl_sctp_check, "IU", |
michael@0 | 1103 | SCTPCTL_TCBHASHSIZE_DESC); |
michael@0 | 1104 | |
michael@0 | 1105 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1106 | &SCTP_BASE_SYSCTL(sctp_pcbtblsize), 0, sysctl_sctp_check, "IU", |
michael@0 | 1107 | SCTPCTL_PCBHASHSIZE_DESC); |
michael@0 | 1108 | |
michael@0 | 1109 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1110 | &SCTP_BASE_SYSCTL(sctp_min_split_point), 0, sysctl_sctp_check, "IU", |
michael@0 | 1111 | SCTPCTL_MIN_SPLIT_POINT_DESC); |
michael@0 | 1112 | |
michael@0 | 1113 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, chunkscale, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1114 | &SCTP_BASE_SYSCTL(sctp_chunkscale), 0, sysctl_sctp_check, "IU", |
michael@0 | 1115 | SCTPCTL_CHUNKSCALE_DESC); |
michael@0 | 1116 | |
michael@0 | 1117 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, delayed_sack_time, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1118 | &SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1119 | SCTPCTL_DELAYED_SACK_TIME_DESC); |
michael@0 | 1120 | |
michael@0 | 1121 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sack_freq, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1122 | &SCTP_BASE_SYSCTL(sctp_sack_freq_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1123 | SCTPCTL_SACK_FREQ_DESC); |
michael@0 | 1124 | |
michael@0 | 1125 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sys_resource, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1126 | &SCTP_BASE_SYSCTL(sctp_system_free_resc_limit), 0, sysctl_sctp_check, "IU", |
michael@0 | 1127 | SCTPCTL_SYS_RESOURCE_DESC); |
michael@0 | 1128 | |
michael@0 | 1129 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, asoc_resource, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1130 | &SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit), 0, sysctl_sctp_check, "IU", |
michael@0 | 1131 | SCTPCTL_ASOC_RESOURCE_DESC); |
michael@0 | 1132 | |
michael@0 | 1133 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, heartbeat_interval, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1134 | &SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1135 | SCTPCTL_HEARTBEAT_INTERVAL_DESC); |
michael@0 | 1136 | |
michael@0 | 1137 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pmtu_raise_time, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1138 | &SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1139 | SCTPCTL_PMTU_RAISE_TIME_DESC); |
michael@0 | 1140 | |
michael@0 | 1141 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, shutdown_guard_time, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1142 | &SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1143 | SCTPCTL_SHUTDOWN_GUARD_TIME_DESC); |
michael@0 | 1144 | |
michael@0 | 1145 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, secret_lifetime, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1146 | &SCTP_BASE_SYSCTL(sctp_secret_lifetime_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1147 | SCTPCTL_SECRET_LIFETIME_DESC); |
michael@0 | 1148 | |
michael@0 | 1149 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_max, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1150 | &SCTP_BASE_SYSCTL(sctp_rto_max_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1151 | SCTPCTL_RTO_MAX_DESC); |
michael@0 | 1152 | |
michael@0 | 1153 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_min, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1154 | &SCTP_BASE_SYSCTL(sctp_rto_min_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1155 | SCTPCTL_RTO_MIN_DESC); |
michael@0 | 1156 | |
michael@0 | 1157 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rto_initial, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1158 | &SCTP_BASE_SYSCTL(sctp_rto_initial_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1159 | SCTPCTL_RTO_INITIAL_DESC); |
michael@0 | 1160 | |
michael@0 | 1161 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, init_rto_max, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1162 | &SCTP_BASE_SYSCTL(sctp_init_rto_max_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1163 | SCTPCTL_INIT_RTO_MAX_DESC); |
michael@0 | 1164 | |
michael@0 | 1165 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, valid_cookie_life, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1166 | &SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1167 | SCTPCTL_VALID_COOKIE_LIFE_DESC); |
michael@0 | 1168 | |
michael@0 | 1169 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, init_rtx_max, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1170 | &SCTP_BASE_SYSCTL(sctp_init_rtx_max_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1171 | SCTPCTL_INIT_RTX_MAX_DESC); |
michael@0 | 1172 | |
michael@0 | 1173 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, assoc_rtx_max, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1174 | &SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1175 | SCTPCTL_ASSOC_RTX_MAX_DESC); |
michael@0 | 1176 | |
michael@0 | 1177 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, path_rtx_max, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1178 | &SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1179 | SCTPCTL_PATH_RTX_MAX_DESC); |
michael@0 | 1180 | |
michael@0 | 1181 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, path_pf_threshold, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1182 | &SCTP_BASE_SYSCTL(sctp_path_pf_threshold), 0, sysctl_sctp_check, "IU", |
michael@0 | 1183 | SCTPCTL_PATH_PF_THRESHOLD_DESC); |
michael@0 | 1184 | |
michael@0 | 1185 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, add_more_on_output, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1186 | &SCTP_BASE_SYSCTL(sctp_add_more_threshold), 0, sysctl_sctp_check, "IU", |
michael@0 | 1187 | SCTPCTL_ADD_MORE_ON_OUTPUT_DESC); |
michael@0 | 1188 | |
michael@0 | 1189 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, incoming_streams, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1190 | &SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1191 | SCTPCTL_INCOMING_STREAMS_DESC); |
michael@0 | 1192 | |
michael@0 | 1193 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1194 | &SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), 0, sysctl_sctp_check, "IU", |
michael@0 | 1195 | SCTPCTL_OUTGOING_STREAMS_DESC); |
michael@0 | 1196 | |
michael@0 | 1197 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_on_off, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1198 | &SCTP_BASE_SYSCTL(sctp_cmt_on_off), 0, sysctl_sctp_check, "IU", |
michael@0 | 1199 | SCTPCTL_CMT_ON_OFF_DESC); |
michael@0 | 1200 | |
michael@0 | 1201 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nr_sack_on_off, CTLTYPE_UINT | CTLFLAG_RW, |
michael@0 | 1202 | &SCTP_BASE_SYSCTL(sctp_nr_sack_on_off), 0, sysctl_sctp_check, "IU", |
michael@0 | 1203 | SCTPCTL_NR_SACK_ON_OFF_DESC); |
michael@0 | 1204 | |
michael@0 | 1205 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cmt_use_dac, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1206 | &SCTP_BASE_SYSCTL(sctp_cmt_use_dac), 0, sysctl_sctp_check, "IU", |
michael@0 | 1207 | SCTPCTL_CMT_USE_DAC_DESC); |
michael@0 | 1208 | |
michael@0 | 1209 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, cwnd_maxburst, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1210 | &SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), 0, sysctl_sctp_check, "IU", |
michael@0 | 1211 | SCTPCTL_CWND_MAXBURST_DESC); |
michael@0 | 1212 | |
michael@0 | 1213 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, asconf_auth_nochk, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1214 | &SCTP_BASE_SYSCTL(sctp_asconf_auth_nochk), 0, sysctl_sctp_check, "IU", |
michael@0 | 1215 | SCTPCTL_ASCONF_AUTH_NOCHK_DESC); |
michael@0 | 1216 | |
michael@0 | 1217 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1218 | &SCTP_BASE_SYSCTL(sctp_auth_disable), 0, sysctl_sctp_check, "IU", |
michael@0 | 1219 | SCTPCTL_AUTH_DISABLE_DESC); |
michael@0 | 1220 | |
michael@0 | 1221 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nat_friendly, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1222 | &SCTP_BASE_SYSCTL(sctp_nat_friendly), 0, sysctl_sctp_check, "IU", |
michael@0 | 1223 | SCTPCTL_NAT_FRIENDLY_DESC); |
michael@0 | 1224 | |
michael@0 | 1225 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, abc_l_var, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1226 | &SCTP_BASE_SYSCTL(sctp_L2_abc_variable), 0, sysctl_sctp_check, "IU", |
michael@0 | 1227 | SCTPCTL_ABC_L_VAR_DESC); |
michael@0 | 1228 | |
michael@0 | 1229 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, max_chained_mbufs, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1230 | &SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count), 0, sysctl_sctp_check, "IU", |
michael@0 | 1231 | SCTPCTL_MAX_CHAINED_MBUFS_DESC); |
michael@0 | 1232 | |
michael@0 | 1233 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, do_sctp_drain, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1234 | &SCTP_BASE_SYSCTL(sctp_do_drain), 0, sysctl_sctp_check, "IU", |
michael@0 | 1235 | SCTPCTL_DO_SCTP_DRAIN_DESC); |
michael@0 | 1236 | |
michael@0 | 1237 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, hb_max_burst, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1238 | &SCTP_BASE_SYSCTL(sctp_hb_maxburst), 0, sysctl_sctp_check, "IU", |
michael@0 | 1239 | SCTPCTL_HB_MAX_BURST_DESC); |
michael@0 | 1240 | |
michael@0 | 1241 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, abort_at_limit, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1242 | &SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit), 0, sysctl_sctp_check, "IU", |
michael@0 | 1243 | SCTPCTL_ABORT_AT_LIMIT_DESC); |
michael@0 | 1244 | |
michael@0 | 1245 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_data_order, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1246 | &SCTP_BASE_SYSCTL(sctp_strict_data_order), 0, sysctl_sctp_check, "IU", |
michael@0 | 1247 | SCTPCTL_STRICT_DATA_ORDER_DESC); |
michael@0 | 1248 | |
michael@0 | 1249 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, min_residual, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1250 | &SCTP_BASE_SYSCTL(sctp_min_residual), 0, sysctl_sctp_check, "IU", |
michael@0 | 1251 | SCTPCTL_MIN_RESIDUAL_DESC); |
michael@0 | 1252 | |
michael@0 | 1253 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, max_retran_chunk, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1254 | &SCTP_BASE_SYSCTL(sctp_max_retran_chunk), 0, sysctl_sctp_check, "IU", |
michael@0 | 1255 | SCTPCTL_MAX_RETRAN_CHUNK_DESC); |
michael@0 | 1256 | |
michael@0 | 1257 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, log_level, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1258 | &SCTP_BASE_SYSCTL(sctp_logging_level), 0, sysctl_sctp_check, "IU", |
michael@0 | 1259 | SCTPCTL_LOGGING_LEVEL_DESC); |
michael@0 | 1260 | |
michael@0 | 1261 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_cc_module, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1262 | &SCTP_BASE_SYSCTL(sctp_default_cc_module), 0, sysctl_sctp_check, "IU", |
michael@0 | 1263 | SCTPCTL_DEFAULT_CC_MODULE_DESC); |
michael@0 | 1264 | |
michael@0 | 1265 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_ss_module, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1266 | &SCTP_BASE_SYSCTL(sctp_default_ss_module), 0, sysctl_sctp_check, "IU", |
michael@0 | 1267 | SCTPCTL_DEFAULT_SS_MODULE_DESC); |
michael@0 | 1268 | |
michael@0 | 1269 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, default_frag_interleave, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1270 | &SCTP_BASE_SYSCTL(sctp_default_frag_interleave), 0, sysctl_sctp_check, "IU", |
michael@0 | 1271 | SCTPCTL_DEFAULT_FRAG_INTERLEAVE_DESC); |
michael@0 | 1272 | |
michael@0 | 1273 | #if defined(__FreeBSD__) |
michael@0 | 1274 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, mobility_base, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1275 | &SCTP_BASE_SYSCTL(sctp_mobility_base), 0, sysctl_sctp_check, "IU", |
michael@0 | 1276 | SCTPCTL_MOBILITY_BASE_DESC); |
michael@0 | 1277 | #elif defined(SCTP_APPLE_MOBILITY_BASE) |
michael@0 | 1278 | SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_base, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1279 | &SCTP_BASE_SYSCTL(sctp_mobility_base), 0, sysctl_sctp_check, "IU", |
michael@0 | 1280 | SCTPCTL_MOBILITY_BASE_DESC); |
michael@0 | 1281 | #endif |
michael@0 | 1282 | |
michael@0 | 1283 | #if defined(__FreeBSD__) |
michael@0 | 1284 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, mobility_fasthandoff, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1285 | &SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), 0, sysctl_sctp_check, "IU", |
michael@0 | 1286 | SCTPCTL_MOBILITY_FASTHANDOFF_DESC); |
michael@0 | 1287 | #elif defined(SCTP_APPLE_MOBILITY_FASTHANDOFF) |
michael@0 | 1288 | SYSCTL_PROC(_net_inet_sctp, OID_AUTO, mobility_fasthandoff, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1289 | &SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), 0, sysctl_sctp_check, "IU", |
michael@0 | 1290 | SCTPCTL_MOBILITY_FASTHANDOFF_DESC); |
michael@0 | 1291 | #endif |
michael@0 | 1292 | |
michael@0 | 1293 | #if defined(SCTP_LOCAL_TRACE_BUF) |
michael@0 | 1294 | SYSCTL_VNET_STRUCT(_net_inet_sctp, OID_AUTO, log, CTLFLAG_RD, |
michael@0 | 1295 | &SCTP_BASE_SYSCTL(sctp_log), sctp_log, |
michael@0 | 1296 | "SCTP logging (struct sctp_log)"); |
michael@0 | 1297 | |
michael@0 | 1298 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, clear_trace, CTLTYPE_UINT | CTLFLAG_RW, |
michael@0 | 1299 | &SCTP_BASE_SYSCTL(sctp_log), 0, sysctl_sctp_cleartrace, "IU", |
michael@0 | 1300 | "Clear SCTP Logging buffer"); |
michael@0 | 1301 | #endif |
michael@0 | 1302 | |
michael@0 | 1303 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1304 | &SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), 0, sysctl_sctp_udp_tunneling_check, "IU", |
michael@0 | 1305 | SCTPCTL_UDP_TUNNELING_PORT_DESC); |
michael@0 | 1306 | |
michael@0 | 1307 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1308 | &SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), 0, sysctl_sctp_check, "IU", |
michael@0 | 1309 | SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC); |
michael@0 | 1310 | |
michael@0 | 1311 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, nat_friendly_init, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1312 | &SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), 0, sysctl_sctp_check, "IU", |
michael@0 | 1313 | SCTPCTL_NAT_FRIENDLY_INITS_DESC); |
michael@0 | 1314 | |
michael@0 | 1315 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1316 | &SCTP_BASE_SYSCTL(sctp_vtag_time_wait), 0, sysctl_sctp_check, "IU", |
michael@0 | 1317 | SCTPCTL_TIME_WAIT_DESC); |
michael@0 | 1318 | |
michael@0 | 1319 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, buffer_splitting, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1320 | &SCTP_BASE_SYSCTL(sctp_buffer_splitting), 0, sysctl_sctp_check, "IU", |
michael@0 | 1321 | SCTPCTL_BUFFER_SPLITTING_DESC); |
michael@0 | 1322 | |
michael@0 | 1323 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, initial_cwnd, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1324 | &SCTP_BASE_SYSCTL(sctp_initial_cwnd), 0, sysctl_sctp_check, "IU", |
michael@0 | 1325 | SCTPCTL_INITIAL_CWND_DESC); |
michael@0 | 1326 | |
michael@0 | 1327 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rttvar_bw, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1328 | &SCTP_BASE_SYSCTL(sctp_rttvar_bw), 0, sysctl_sctp_check, "IU", |
michael@0 | 1329 | SCTPCTL_RTTVAR_BW_DESC); |
michael@0 | 1330 | |
michael@0 | 1331 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rttvar_rtt, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1332 | &SCTP_BASE_SYSCTL(sctp_rttvar_rtt), 0, sysctl_sctp_check, "IU", |
michael@0 | 1333 | SCTPCTL_RTTVAR_RTT_DESC); |
michael@0 | 1334 | |
michael@0 | 1335 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rttvar_eqret, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1336 | &SCTP_BASE_SYSCTL(sctp_rttvar_eqret), 0, sysctl_sctp_check, "IU", |
michael@0 | 1337 | SCTPCTL_RTTVAR_EQRET_DESC); |
michael@0 | 1338 | |
michael@0 | 1339 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rttvar_steady_step, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1340 | &SCTP_BASE_SYSCTL(sctp_steady_step), 0, sysctl_sctp_check, "IU", |
michael@0 | 1341 | SCTPCTL_RTTVAR_STEADYS_DESC); |
michael@0 | 1342 | |
michael@0 | 1343 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, use_dcccecn, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1344 | &SCTP_BASE_SYSCTL(sctp_use_dccc_ecn), 0, sysctl_sctp_check, "IU", |
michael@0 | 1345 | SCTPCTL_RTTVAR_DCCCECN_DESC); |
michael@0 | 1346 | |
michael@0 | 1347 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, blackhole, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1348 | &SCTP_BASE_SYSCTL(sctp_blackhole), 0, sysctl_sctp_check, "IU", |
michael@0 | 1349 | SCTPCTL_BLACKHOLE_DESC); |
michael@0 | 1350 | |
michael@0 | 1351 | #ifdef SCTP_DEBUG |
michael@0 | 1352 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1353 | &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", |
michael@0 | 1354 | SCTPCTL_DEBUG_DESC); |
michael@0 | 1355 | #endif |
michael@0 | 1356 | |
michael@0 | 1357 | #if defined(__APPLE__) |
michael@0 | 1358 | SYSCTL_INT(_net_inet_sctp, OID_AUTO, main_timer, CTLFLAG_RW, |
michael@0 | 1359 | &SCTP_BASE_SYSCTL(sctp_main_timer), 0, "Main timer interval in ms"); |
michael@0 | 1360 | |
michael@0 | 1361 | SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ignore_vmware_interfaces, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1362 | &SCTP_BASE_SYSCTL(sctp_ignore_vmware_interfaces), 0, sysctl_sctp_vmware_interfaces_check, "IU", |
michael@0 | 1363 | SCTPCTL_IGNORE_VMWARE_INTERFACES_DESC); |
michael@0 | 1364 | |
michael@0 | 1365 | SYSCTL_INT(_net_inet_sctp, OID_AUTO, addr_watchdog_limit, CTLFLAG_RW, |
michael@0 | 1366 | &SCTP_BASE_SYSCTL(sctp_addr_watchdog_limit), 0, "Addr watchdog intervall"); |
michael@0 | 1367 | |
michael@0 | 1368 | SYSCTL_INT(_net_inet_sctp, OID_AUTO, vtag_watchdog_limit, CTLFLAG_RW, |
michael@0 | 1369 | &SCTP_BASE_SYSCTL(sctp_vtag_watchdog_limit), 0, "Vtag watchdog intervall"); |
michael@0 | 1370 | #endif |
michael@0 | 1371 | |
michael@0 | 1372 | #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) |
michael@0 | 1373 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_UINT|CTLFLAG_RW, |
michael@0 | 1374 | &SCTP_BASE_SYSCTL(sctp_output_unlocked), 0, sysctl_sctp_check, "IU", |
michael@0 | 1375 | SCTPCTL_OUTPUT_UNLOCKED_DESC); |
michael@0 | 1376 | #endif |
michael@0 | 1377 | |
michael@0 | 1378 | #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) |
michael@0 | 1379 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, stats, |
michael@0 | 1380 | CTLTYPE_STRUCT|CTLFLAG_RW, |
michael@0 | 1381 | 0, 0, sysctl_stat_get, "S,sctpstat", |
michael@0 | 1382 | "SCTP statistics (struct sctp_stat)"); |
michael@0 | 1383 | #else |
michael@0 | 1384 | SYSCTL_VNET_STRUCT(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_RW, |
michael@0 | 1385 | &SCTP_BASE_STATS_SYSCTL, sctpstat, |
michael@0 | 1386 | "SCTP statistics (struct sctp_stat)"); |
michael@0 | 1387 | #endif |
michael@0 | 1388 | |
michael@0 | 1389 | SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLTYPE_OPAQUE | CTLFLAG_RD, |
michael@0 | 1390 | 0, 0, sctp_assoclist, |
michael@0 | 1391 | "S,xassoc", "List of active SCTP associations"); |
michael@0 | 1392 | |
michael@0 | 1393 | #elif defined(__Windows__) |
michael@0 | 1394 | void sysctl_setup_sctp(void) |
michael@0 | 1395 | { |
michael@0 | 1396 | sysctl_add_oid(&sysctl_oid_top, "sendspace", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1397 | &SCTP_BASE_SYSCTL(sctp_sendspace), 0, sysctl_sctp_check, |
michael@0 | 1398 | SCTPCTL_MAXDGRAM_DESC); |
michael@0 | 1399 | |
michael@0 | 1400 | sysctl_add_oid(&sysctl_oid_top, "recvspace", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1401 | &SCTP_BASE_SYSCTL(sctp_recvspace), 0, sysctl_sctp_check, |
michael@0 | 1402 | SCTPCTL_RECVSPACE_DESC); |
michael@0 | 1403 | |
michael@0 | 1404 | sysctl_add_oid(&sysctl_oid_top, "auto_asconf", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1405 | &SCTP_BASE_SYSCTL(sctp_auto_asconf), 0, sysctl_sctp_check, |
michael@0 | 1406 | SCTPCTL_AUTOASCONF_DESC); |
michael@0 | 1407 | |
michael@0 | 1408 | sysctl_add_oid(&sysctl_oid_top, "ecn_enable", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1409 | &SCTP_BASE_SYSCTL(sctp_ecn_enable), 0, sysctl_sctp_check, |
michael@0 | 1410 | SCTPCTL_ECN_ENABLE_DESC); |
michael@0 | 1411 | |
michael@0 | 1412 | sysctl_add_oid(&sysctl_oid_top, "strict_sacks", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1413 | &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, |
michael@0 | 1414 | SCTPCTL_STRICT_SACKS_DESC); |
michael@0 | 1415 | |
michael@0 | 1416 | #if !(defined(__FreeBSD__) && __FreeBSD_version >= 800000) |
michael@0 | 1417 | #if !defined(SCTP_WITH_NO_CSUM) |
michael@0 | 1418 | sysctl_add_oid(&sysctl_oid_top, "loopback_nocsum", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1419 | &SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sysctl_sctp_check, |
michael@0 | 1420 | SCTPCTL_LOOPBACK_NOCSUM_DESC); |
michael@0 | 1421 | #endif |
michael@0 | 1422 | #endif |
michael@0 | 1423 | |
michael@0 | 1424 | sysctl_add_oid(&sysctl_oid_top, "peer_chkoh", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1425 | &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, |
michael@0 | 1426 | SCTPCTL_PEER_CHKOH_DESC); |
michael@0 | 1427 | |
michael@0 | 1428 | sysctl_add_oid(&sysctl_oid_top, "maxburst", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1429 | &SCTP_BASE_SYSCTL(sctp_max_burst_default), 0, sysctl_sctp_check, |
michael@0 | 1430 | SCTPCTL_MAXBURST_DESC); |
michael@0 | 1431 | |
michael@0 | 1432 | sysctl_add_oid(&sysctl_oid_top, "fr_maxburst", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1433 | &SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), 0, sysctl_sctp_check, |
michael@0 | 1434 | SCTPCTL_FRMAXBURST_DESC); |
michael@0 | 1435 | |
michael@0 | 1436 | sysctl_add_oid(&sysctl_oid_top, "maxchunks", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1437 | &SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), 0, sysctl_sctp_check, |
michael@0 | 1438 | SCTPCTL_MAXCHUNKS_DESC); |
michael@0 | 1439 | |
michael@0 | 1440 | sysctl_add_oid(&sysctl_oid_top, "tcbhashsize", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1441 | &SCTP_BASE_SYSCTL(sctp_hashtblsize), 0, sysctl_sctp_check, |
michael@0 | 1442 | SCTPCTL_TCBHASHSIZE_DESC); |
michael@0 | 1443 | |
michael@0 | 1444 | sysctl_add_oid(&sysctl_oid_top, "pcbhashsize", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1445 | &SCTP_BASE_SYSCTL(sctp_pcbtblsize), 0, sysctl_sctp_check, |
michael@0 | 1446 | SCTPCTL_PCBHASHSIZE_DESC); |
michael@0 | 1447 | |
michael@0 | 1448 | sysctl_add_oid(&sysctl_oid_top, "min_split_point", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1449 | &SCTP_BASE_SYSCTL(sctp_min_split_point), 0, sysctl_sctp_check, |
michael@0 | 1450 | SCTPCTL_MIN_SPLIT_POINT_DESC); |
michael@0 | 1451 | |
michael@0 | 1452 | sysctl_add_oid(&sysctl_oid_top, "chunkscale", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1453 | &SCTP_BASE_SYSCTL(sctp_chunkscale), 0, sysctl_sctp_check, |
michael@0 | 1454 | SCTPCTL_CHUNKSCALE_DESC); |
michael@0 | 1455 | |
michael@0 | 1456 | sysctl_add_oid(&sysctl_oid_top, "delayed_sack_time", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1457 | &SCTP_BASE_SYSCTL(sctp_delayed_sack_time_default), 0, sysctl_sctp_check, |
michael@0 | 1458 | SCTPCTL_DELAYED_SACK_TIME_DESC); |
michael@0 | 1459 | |
michael@0 | 1460 | sysctl_add_oid(&sysctl_oid_top, "sack_freq", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1461 | &SCTP_BASE_SYSCTL(sctp_sack_freq_default), 0, sysctl_sctp_check, |
michael@0 | 1462 | SCTPCTL_SACK_FREQ_DESC); |
michael@0 | 1463 | |
michael@0 | 1464 | sysctl_add_oid(&sysctl_oid_top, "sys_resource", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1465 | &SCTP_BASE_SYSCTL(sctp_system_free_resc_limit), 0, sysctl_sctp_check, |
michael@0 | 1466 | SCTPCTL_SYS_RESOURCE_DESC); |
michael@0 | 1467 | |
michael@0 | 1468 | sysctl_add_oid(&sysctl_oid_top, "asoc_resource", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1469 | &SCTP_BASE_SYSCTL(sctp_asoc_free_resc_limit), 0, sysctl_sctp_check, |
michael@0 | 1470 | SCTPCTL_ASOC_RESOURCE_DESC); |
michael@0 | 1471 | |
michael@0 | 1472 | sysctl_add_oid(&sysctl_oid_top, "heartbeat_interval", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1473 | &SCTP_BASE_SYSCTL(sctp_heartbeat_interval_default), 0, sysctl_sctp_check, |
michael@0 | 1474 | SCTPCTL_HEARTBEAT_INTERVAL_DESC); |
michael@0 | 1475 | |
michael@0 | 1476 | sysctl_add_oid(&sysctl_oid_top, "pmtu_raise_time", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1477 | &SCTP_BASE_SYSCTL(sctp_pmtu_raise_time_default), 0, sysctl_sctp_check, |
michael@0 | 1478 | SCTPCTL_PMTU_RAISE_TIME_DESC); |
michael@0 | 1479 | |
michael@0 | 1480 | sysctl_add_oid(&sysctl_oid_top, "shutdown_guard_time", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1481 | &SCTP_BASE_SYSCTL(sctp_shutdown_guard_time_default), 0, sysctl_sctp_check, |
michael@0 | 1482 | SCTPCTL_SHUTDOWN_GUARD_TIME_DESC); |
michael@0 | 1483 | |
michael@0 | 1484 | sysctl_add_oid(&sysctl_oid_top, "secret_lifetime", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1485 | &SCTP_BASE_SYSCTL(sctp_secret_lifetime_default), 0, sysctl_sctp_check, |
michael@0 | 1486 | SCTPCTL_SECRET_LIFETIME_DESC); |
michael@0 | 1487 | |
michael@0 | 1488 | sysctl_add_oid(&sysctl_oid_top, "rto_max", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1489 | &SCTP_BASE_SYSCTL(sctp_rto_max_default), 0, sysctl_sctp_check, |
michael@0 | 1490 | SCTPCTL_RTO_MAX_DESC); |
michael@0 | 1491 | |
michael@0 | 1492 | sysctl_add_oid(&sysctl_oid_top, "rto_min", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1493 | &SCTP_BASE_SYSCTL(sctp_rto_min_default), 0, sysctl_sctp_check, |
michael@0 | 1494 | SCTPCTL_RTO_MIN_DESC); |
michael@0 | 1495 | |
michael@0 | 1496 | sysctl_add_oid(&sysctl_oid_top, "rto_initial", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1497 | &SCTP_BASE_SYSCTL(sctp_rto_initial_default), 0, sysctl_sctp_check, |
michael@0 | 1498 | SCTPCTL_RTO_INITIAL_DESC); |
michael@0 | 1499 | |
michael@0 | 1500 | sysctl_add_oid(&sysctl_oid_top, "init_rto_max", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1501 | &SCTP_BASE_SYSCTL(sctp_init_rto_max_default), 0, sysctl_sctp_check, |
michael@0 | 1502 | SCTPCTL_INIT_RTO_MAX_DESC); |
michael@0 | 1503 | |
michael@0 | 1504 | sysctl_add_oid(&sysctl_oid_top, "valid_cookie_life", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1505 | &SCTP_BASE_SYSCTL(sctp_valid_cookie_life_default), 0, sysctl_sctp_check, |
michael@0 | 1506 | SCTPCTL_VALID_COOKIE_LIFE_DESC); |
michael@0 | 1507 | |
michael@0 | 1508 | sysctl_add_oid(&sysctl_oid_top, "init_rtx_max", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1509 | &SCTP_BASE_SYSCTL(sctp_init_rtx_max_default), 0, sysctl_sctp_check, |
michael@0 | 1510 | SCTPCTL_INIT_RTX_MAX_DESC); |
michael@0 | 1511 | |
michael@0 | 1512 | sysctl_add_oid(&sysctl_oid_top, "assoc_rtx_max", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1513 | &SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default), 0, sysctl_sctp_check, |
michael@0 | 1514 | SCTPCTL_ASSOC_RTX_MAX_DESC); |
michael@0 | 1515 | |
michael@0 | 1516 | sysctl_add_oid(&sysctl_oid_top, "path_rtx_max", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1517 | &SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), 0, sysctl_sctp_check, |
michael@0 | 1518 | SCTPCTL_PATH_RTX_MAX_DESC); |
michael@0 | 1519 | |
michael@0 | 1520 | sysctl_add_oid(&sysctl_oid_top, "path_pf_threshold", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1521 | &SCTP_BASE_SYSCTL(sctp_path_pf_threshold), 0, sysctl_sctp_check, |
michael@0 | 1522 | SCTPCTL_PATH_PF_THRESHOLD_DESC); |
michael@0 | 1523 | |
michael@0 | 1524 | sysctl_add_oid(&sysctl_oid_top, "add_more_on_output", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1525 | &SCTP_BASE_SYSCTL(sctp_add_more_threshold), 0, sysctl_sctp_check, |
michael@0 | 1526 | SCTPCTL_ADD_MORE_ON_OUTPUT_DESC); |
michael@0 | 1527 | |
michael@0 | 1528 | sysctl_add_oid(&sysctl_oid_top, "incoming_streams", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1529 | &SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default), 0, sysctl_sctp_check, |
michael@0 | 1530 | SCTPCTL_INCOMING_STREAMS_DESC); |
michael@0 | 1531 | |
michael@0 | 1532 | sysctl_add_oid(&sysctl_oid_top, "outgoing_streams", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1533 | &SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), 0, sysctl_sctp_check, |
michael@0 | 1534 | SCTPCTL_OUTGOING_STREAMS_DESC); |
michael@0 | 1535 | |
michael@0 | 1536 | sysctl_add_oid(&sysctl_oid_top, "cmt_on_off", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1537 | &SCTP_BASE_SYSCTL(sctp_cmt_on_off), 0, sysctl_sctp_check, |
michael@0 | 1538 | SCTPCTL_CMT_ON_OFF_DESC); |
michael@0 | 1539 | |
michael@0 | 1540 | /* EY */ |
michael@0 | 1541 | sysctl_add_oid(&sysctl_oid_top, "nr_sack_on_off", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1542 | &SCTP_BASE_SYSCTL(sctp_nr_sack_on_off), 0, sysctl_sctp_check, |
michael@0 | 1543 | SCTPCTL_NR_SACK_ON_OFF_DESC); |
michael@0 | 1544 | |
michael@0 | 1545 | sysctl_add_oid(&sysctl_oid_top, "cmt_use_dac", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1546 | &SCTP_BASE_SYSCTL(sctp_cmt_use_dac), 0, sysctl_sctp_check, |
michael@0 | 1547 | SCTPCTL_CMT_USE_DAC_DESC); |
michael@0 | 1548 | |
michael@0 | 1549 | sysctl_add_oid(&sysctl_oid_top, "cwnd_maxburst", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1550 | &SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst), 0, sysctl_sctp_check, |
michael@0 | 1551 | SCTPCTL_CWND_MAXBURST_DESC); |
michael@0 | 1552 | |
michael@0 | 1553 | sysctl_add_oid(&sysctl_oid_top, "asconf_auth_nochk", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1554 | &SCTP_BASE_SYSCTL(sctp_asconf_auth_nochk), 0, sysctl_sctp_check, |
michael@0 | 1555 | SCTPCTL_ASCONF_AUTH_NOCHK_DESC); |
michael@0 | 1556 | |
michael@0 | 1557 | sysctl_add_oid(&sysctl_oid_top, "auth_disable", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1558 | &SCTP_BASE_SYSCTL(sctp_auth_disable), 0, sysctl_sctp_check, |
michael@0 | 1559 | SCTPCTL_AUTH_DISABLE_DESC); |
michael@0 | 1560 | |
michael@0 | 1561 | sysctl_add_oid(&sysctl_oid_top, "nat_friendly", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1562 | &SCTP_BASE_SYSCTL(sctp_nat_friendly), 0, sysctl_sctp_check, |
michael@0 | 1563 | SCTPCTL_NAT_FRIENDLY_DESC); |
michael@0 | 1564 | |
michael@0 | 1565 | sysctl_add_oid(&sysctl_oid_top, "abc_l_var", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1566 | &SCTP_BASE_SYSCTL(sctp_L2_abc_variable), 0, sysctl_sctp_check, |
michael@0 | 1567 | SCTPCTL_ABC_L_VAR_DESC); |
michael@0 | 1568 | |
michael@0 | 1569 | sysctl_add_oid(&sysctl_oid_top, "max_chained_mbufs", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1570 | &SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count), 0, sysctl_sctp_check, |
michael@0 | 1571 | SCTPCTL_MAX_CHAINED_MBUFS_DESC); |
michael@0 | 1572 | |
michael@0 | 1573 | sysctl_add_oid(&sysctl_oid_top, "do_sctp_drain", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1574 | &SCTP_BASE_SYSCTL(sctp_do_drain), 0, sysctl_sctp_check, |
michael@0 | 1575 | SCTPCTL_DO_SCTP_DRAIN_DESC); |
michael@0 | 1576 | |
michael@0 | 1577 | sysctl_add_oid(&sysctl_oid_top, "hb_max_burst", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1578 | &SCTP_BASE_SYSCTL(sctp_hb_maxburst), 0, sysctl_sctp_check, |
michael@0 | 1579 | SCTPCTL_HB_MAX_BURST_DESC); |
michael@0 | 1580 | |
michael@0 | 1581 | sysctl_add_oid(&sysctl_oid_top, "abort_at_limit", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1582 | &SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit), 0, sysctl_sctp_check, |
michael@0 | 1583 | SCTPCTL_ABORT_AT_LIMIT_DESC); |
michael@0 | 1584 | |
michael@0 | 1585 | sysctl_add_oid(&sysctl_oid_top, "strict_data_order", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1586 | &SCTP_BASE_SYSCTL(sctp_strict_data_order), 0, sysctl_sctp_check, |
michael@0 | 1587 | SCTPCTL_STRICT_DATA_ORDER_DESC); |
michael@0 | 1588 | |
michael@0 | 1589 | sysctl_add_oid(&sysctl_oid_top, "min_residual", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1590 | &SCTP_BASE_SYSCTL(sctp_min_residual), 0, sysctl_sctp_check, |
michael@0 | 1591 | SCTPCTL_MIN_RESIDUAL_DESC); |
michael@0 | 1592 | |
michael@0 | 1593 | sysctl_add_oid(&sysctl_oid_top, "max_retran_chunk", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1594 | &SCTP_BASE_SYSCTL(sctp_max_retran_chunk), 0, sysctl_sctp_check, |
michael@0 | 1595 | SCTPCTL_MAX_RETRAN_CHUNK_DESC); |
michael@0 | 1596 | |
michael@0 | 1597 | sysctl_add_oid(&sysctl_oid_top, "log_level", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1598 | &SCTP_BASE_SYSCTL(sctp_logging_level), 0, sysctl_sctp_check, |
michael@0 | 1599 | SCTPCTL_LOGGING_LEVEL_DESC); |
michael@0 | 1600 | |
michael@0 | 1601 | sysctl_add_oid(&sysctl_oid_top, "default_cc_module", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1602 | &SCTP_BASE_SYSCTL(sctp_default_cc_module), 0, sysctl_sctp_check, |
michael@0 | 1603 | SCTPCTL_DEFAULT_CC_MODULE_DESC); |
michael@0 | 1604 | |
michael@0 | 1605 | sysctl_add_oid(&sysctl_oid_top, "default_ss_module", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1606 | &SCTP_BASE_SYSCTL(sctp_default_ss_module), 0, sysctl_sctp_check, |
michael@0 | 1607 | SCTPCTL_DEFAULT_SS_MODULE_DESC); |
michael@0 | 1608 | |
michael@0 | 1609 | sysctl_add_oid(&sysctl_oid_top, "default_frag_interleave", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1610 | &SCTP_BASE_SYSCTL(sctp_default_frag_interleave), 0, sysctl_sctp_check, |
michael@0 | 1611 | SCTPCTL_DEFAULT_FRAG_INTERLEAVE_DESC); |
michael@0 | 1612 | |
michael@0 | 1613 | sysctl_add_oid(&sysctl_oid_top, "mobility_base", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1614 | &SCTP_BASE_SYSCTL(sctp_mobility_base), 0, sysctl_sctp_check, |
michael@0 | 1615 | SCTPCTL_MOBILITY_BASE_DESC); |
michael@0 | 1616 | |
michael@0 | 1617 | sysctl_add_oid(&sysctl_oid_top, "mobility_fasthandoff", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1618 | &SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), 0, sysctl_sctp_check, |
michael@0 | 1619 | SCTPCTL_MOBILITY_FASTHANDOFF_DESC); |
michael@0 | 1620 | |
michael@0 | 1621 | #if defined(SCTP_LOCAL_TRACE_BUF) |
michael@0 | 1622 | sysctl_add_oid(&sysctl_oid_top, "sctp_log", CTLTYPE_STRUCT|CTLFLAG_RD, |
michael@0 | 1623 | SCTP_BASE_SYSCTL(sctp_log), sizeof(struct sctp_log), NULL, |
michael@0 | 1624 | "SCTP logging (struct sctp_log)"); |
michael@0 | 1625 | |
michael@0 | 1626 | sysctl_add_oid(&sysctl_oid_top, "clear_trace", CTLTYPE_INT|CTLFLAG_WR, |
michael@0 | 1627 | NULL, 0, sysctl_sctp_cleartrace, |
michael@0 | 1628 | "Clear SCTP Logging buffer"); |
michael@0 | 1629 | #endif |
michael@0 | 1630 | |
michael@0 | 1631 | sysctl_add_oid(&sysctl_oid_top, "udp_tunneling_port", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1632 | &SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), 0, sysctl_sctp_udp_tunneling_check, |
michael@0 | 1633 | SCTPCTL_UDP_TUNNELING_PORT_DESC); |
michael@0 | 1634 | |
michael@0 | 1635 | sysctl_add_oid(&sysctl_oid_top, "enable_sack_immediately", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1636 | &SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), 0, sysctl_sctp_check, |
michael@0 | 1637 | SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC); |
michael@0 | 1638 | |
michael@0 | 1639 | sysctl_add_oid(&sysctl_oid_top, "nat_friendly_init", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1640 | &SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), 0, sysctl_sctp_check, |
michael@0 | 1641 | SCTPCTL_NAT_FRIENDLY_DESC); |
michael@0 | 1642 | |
michael@0 | 1643 | sysctl_add_oid(&sysctl_oid_top, "vtag_time_wait", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1644 | &SCTP_BASE_SYSCTL(sctp_vtag_time_wait), 0, sysctl_sctp_check, |
michael@0 | 1645 | SCTPCTL_TIME_WAIT_DESC); |
michael@0 | 1646 | |
michael@0 | 1647 | sysctl_add_oid(&sysctl_oid_top, "buffer_splitting", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1648 | &SCTP_BASE_SYSCTL(sctp_buffer_splitting), 0, sysctl_sctp_check, |
michael@0 | 1649 | SCTPCTL_BUFFER_SPLITTING_DESC); |
michael@0 | 1650 | |
michael@0 | 1651 | sysctl_add_oid(&sysctl_oid_top, "initial_cwnd", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1652 | &SCTP_BASE_SYSCTL(sctp_initial_cwnd), 0, sysctl_sctp_check, |
michael@0 | 1653 | SCTPCTL_INITIAL_CWND_DESC); |
michael@0 | 1654 | |
michael@0 | 1655 | sysctl_add_oid(&sysctl_oid_top, "rttvar_bw", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1656 | &SCTP_BASE_SYSCTL(sctp_rttvar_bw), 0, sysctl_sctp_check, |
michael@0 | 1657 | SCTPCTL_RTTVAR_BW_DESC); |
michael@0 | 1658 | |
michael@0 | 1659 | sysctl_add_oid(&sysctl_oid_top, "rttvar_rtt", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1660 | &SCTP_BASE_SYSCTL(sctp_rttvar_rtt), 0, sysctl_sctp_check, |
michael@0 | 1661 | SCTPCTL_RTTVAR_RTT_DESC); |
michael@0 | 1662 | |
michael@0 | 1663 | sysctl_add_oid(&sysctl_oid_top, "rttvar_eqret", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1664 | &SCTP_BASE_SYSCTL(sctp_rttvar_eqret), 0, sysctl_sctp_check, |
michael@0 | 1665 | SCTPCTL_RTTVAR_EQRET_DESC); |
michael@0 | 1666 | |
michael@0 | 1667 | sysctl_add_oid(&sysctl_oid_top, "rttvar_steady_step", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1668 | &SCTP_BASE_SYSCTL(sctp_steady_step), 0, sysctl_sctp_check, |
michael@0 | 1669 | SCTPCTL_RTTVAR_STEADYS_DESC); |
michael@0 | 1670 | |
michael@0 | 1671 | sysctl_add_oid(&sysctl_oid_top, "use_dcccecn", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1672 | &SCTP_BASE_SYSCTL(sctp_use_dccc_ecn), 0, sysctl_sctp_check, |
michael@0 | 1673 | SCTPCTL_RTTVAR_DCCCECN_DESC); |
michael@0 | 1674 | |
michael@0 | 1675 | sysctl_add_oid(&sysctl_oid_top, "blackhole", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1676 | &SCTP_BASE_SYSCTL(sctp_blackhole), 0, sysctl_sctp_check, |
michael@0 | 1677 | SCTPCTL_BLACKHOLE_DESC); |
michael@0 | 1678 | |
michael@0 | 1679 | #ifdef SCTP_DEBUG |
michael@0 | 1680 | sysctl_add_oid(&sysctl_oid_top, "debug", CTLTYPE_INT|CTLFLAG_RW, |
michael@0 | 1681 | &SCTP_BASE_SYSCTL(sctp_debug_on), sizeof(SCTP_BASE_SYSCTL(sctp_debug_on)), NULL, |
michael@0 | 1682 | SCTPCTL_DEBUG_DESC); |
michael@0 | 1683 | #endif /* SCTP_DEBUG */ |
michael@0 | 1684 | |
michael@0 | 1685 | sysctl_add_oid(&sysctl_oid_top, "stats", CTLTYPE_STRUCT|CTLFLAG_RW, |
michael@0 | 1686 | &SCTP_BASE_STATS, sizeof(SCTP_BASE_STATS), NULL, |
michael@0 | 1687 | "SCTP statistics (struct sctp_stat)"); |
michael@0 | 1688 | |
michael@0 | 1689 | sysctl_add_oid(&sysctl_oid_top, "assoclist", CTLTYPE_STRUCT|CTLFLAG_RD, |
michael@0 | 1690 | NULL, 0, sctp_assoclist, |
michael@0 | 1691 | "List of active SCTP associations"); |
michael@0 | 1692 | } |
michael@0 | 1693 | #endif |
michael@0 | 1694 | #endif |