112016SGirish.Moodalbail@Sun.COM /*
212016SGirish.Moodalbail@Sun.COM * CDDL HEADER START
312016SGirish.Moodalbail@Sun.COM *
412016SGirish.Moodalbail@Sun.COM * The contents of this file are subject to the terms of the
512016SGirish.Moodalbail@Sun.COM * Common Development and Distribution License (the "License").
612016SGirish.Moodalbail@Sun.COM * You may not use this file except in compliance with the License.
712016SGirish.Moodalbail@Sun.COM *
812016SGirish.Moodalbail@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
912016SGirish.Moodalbail@Sun.COM * or http://www.opensolaris.org/os/licensing.
1012016SGirish.Moodalbail@Sun.COM * See the License for the specific language governing permissions
1112016SGirish.Moodalbail@Sun.COM * and limitations under the License.
1212016SGirish.Moodalbail@Sun.COM *
1312016SGirish.Moodalbail@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each
1412016SGirish.Moodalbail@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1512016SGirish.Moodalbail@Sun.COM * If applicable, add the following below this CDDL HEADER, with the
1612016SGirish.Moodalbail@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying
1712016SGirish.Moodalbail@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner]
1812016SGirish.Moodalbail@Sun.COM *
1912016SGirish.Moodalbail@Sun.COM * CDDL HEADER END
2012016SGirish.Moodalbail@Sun.COM */
2112016SGirish.Moodalbail@Sun.COM /*
22*13125SGirish.Moodalbail@oracle.COM * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
2312016SGirish.Moodalbail@Sun.COM */
24*13125SGirish.Moodalbail@oracle.COM /* Copyright (c) 1990 Mentat Inc. */
2512016SGirish.Moodalbail@Sun.COM
2612016SGirish.Moodalbail@Sun.COM #include <inet/ip.h>
2712016SGirish.Moodalbail@Sun.COM #include <inet/tcp_impl.h>
2812016SGirish.Moodalbail@Sun.COM #include <sys/multidata.h>
2912016SGirish.Moodalbail@Sun.COM #include <sys/sunddi.h>
3012016SGirish.Moodalbail@Sun.COM
3112016SGirish.Moodalbail@Sun.COM /* Max size IP datagram is 64k - 1 */
3212016SGirish.Moodalbail@Sun.COM #define TCP_MSS_MAX_IPV4 (IP_MAXPACKET - (sizeof (ipha_t) + sizeof (tcpha_t)))
3312016SGirish.Moodalbail@Sun.COM #define TCP_MSS_MAX_IPV6 (IP_MAXPACKET - (sizeof (ip6_t) + sizeof (tcpha_t)))
3412016SGirish.Moodalbail@Sun.COM
3512016SGirish.Moodalbail@Sun.COM /* Max of the above */
3612016SGirish.Moodalbail@Sun.COM #define TCP_MSS_MAX TCP_MSS_MAX_IPV4
3712016SGirish.Moodalbail@Sun.COM
3812016SGirish.Moodalbail@Sun.COM #define TCP_XMIT_LOWATER 4096
3912016SGirish.Moodalbail@Sun.COM #define TCP_XMIT_HIWATER 49152
4012016SGirish.Moodalbail@Sun.COM #define TCP_RECV_LOWATER 2048
4112016SGirish.Moodalbail@Sun.COM #define TCP_RECV_HIWATER 128000
4212016SGirish.Moodalbail@Sun.COM
4312016SGirish.Moodalbail@Sun.COM /*
4412016SGirish.Moodalbail@Sun.COM * Set the RFC 1948 pass phrase
4512016SGirish.Moodalbail@Sun.COM */
4612016SGirish.Moodalbail@Sun.COM /* ARGSUSED */
4712016SGirish.Moodalbail@Sun.COM static int
tcp_set_1948phrase(void * cbarg,cred_t * cr,mod_prop_info_t * pinfo,const char * ifname,const void * pr_val,uint_t flags)4812016SGirish.Moodalbail@Sun.COM tcp_set_1948phrase(void *cbarg, cred_t *cr, mod_prop_info_t *pinfo,
4912016SGirish.Moodalbail@Sun.COM const char *ifname, const void* pr_val, uint_t flags)
5012016SGirish.Moodalbail@Sun.COM {
5112016SGirish.Moodalbail@Sun.COM tcp_stack_t *tcps = (tcp_stack_t *)cbarg;
5212016SGirish.Moodalbail@Sun.COM
5312016SGirish.Moodalbail@Sun.COM if (flags & MOD_PROP_DEFAULT)
5412016SGirish.Moodalbail@Sun.COM return (ENOTSUP);
5512016SGirish.Moodalbail@Sun.COM
5612016SGirish.Moodalbail@Sun.COM /*
5712016SGirish.Moodalbail@Sun.COM * Basically, value contains a new pass phrase. Pass it along!
5812016SGirish.Moodalbail@Sun.COM */
5912016SGirish.Moodalbail@Sun.COM tcp_iss_key_init((uint8_t *)pr_val, strlen(pr_val), tcps);
6012016SGirish.Moodalbail@Sun.COM return (0);
6112016SGirish.Moodalbail@Sun.COM }
6212016SGirish.Moodalbail@Sun.COM
6312016SGirish.Moodalbail@Sun.COM /*
6412016SGirish.Moodalbail@Sun.COM * returns the current list of listener limit configuration.
6512016SGirish.Moodalbail@Sun.COM */
6612016SGirish.Moodalbail@Sun.COM /* ARGSUSED */
6712016SGirish.Moodalbail@Sun.COM static int
tcp_listener_conf_get(void * cbarg,mod_prop_info_t * pinfo,const char * ifname,void * val,uint_t psize,uint_t flags)6812016SGirish.Moodalbail@Sun.COM tcp_listener_conf_get(void *cbarg, mod_prop_info_t *pinfo, const char *ifname,
6912016SGirish.Moodalbail@Sun.COM void *val, uint_t psize, uint_t flags)
7012016SGirish.Moodalbail@Sun.COM {
7112016SGirish.Moodalbail@Sun.COM tcp_stack_t *tcps = (tcp_stack_t *)cbarg;
7212016SGirish.Moodalbail@Sun.COM tcp_listener_t *tl;
7312016SGirish.Moodalbail@Sun.COM char *pval = val;
7412016SGirish.Moodalbail@Sun.COM size_t nbytes = 0, tbytes = 0;
7512016SGirish.Moodalbail@Sun.COM uint_t size;
7612016SGirish.Moodalbail@Sun.COM int err = 0;
7712016SGirish.Moodalbail@Sun.COM
7812016SGirish.Moodalbail@Sun.COM bzero(pval, psize);
7912016SGirish.Moodalbail@Sun.COM size = psize;
8012016SGirish.Moodalbail@Sun.COM
8112016SGirish.Moodalbail@Sun.COM if (flags & (MOD_PROP_DEFAULT|MOD_PROP_PERM|MOD_PROP_POSSIBLE))
8212016SGirish.Moodalbail@Sun.COM return (0);
8312016SGirish.Moodalbail@Sun.COM
8412016SGirish.Moodalbail@Sun.COM mutex_enter(&tcps->tcps_listener_conf_lock);
8512016SGirish.Moodalbail@Sun.COM for (tl = list_head(&tcps->tcps_listener_conf); tl != NULL;
8612016SGirish.Moodalbail@Sun.COM tl = list_next(&tcps->tcps_listener_conf, tl)) {
8712016SGirish.Moodalbail@Sun.COM if (psize == size)
8812016SGirish.Moodalbail@Sun.COM nbytes = snprintf(pval, size, "%d:%d", tl->tl_port,
8912016SGirish.Moodalbail@Sun.COM tl->tl_ratio);
9012016SGirish.Moodalbail@Sun.COM else
9112016SGirish.Moodalbail@Sun.COM nbytes = snprintf(pval, size, ",%d:%d", tl->tl_port,
9212016SGirish.Moodalbail@Sun.COM tl->tl_ratio);
9312016SGirish.Moodalbail@Sun.COM size -= nbytes;
9412016SGirish.Moodalbail@Sun.COM pval += nbytes;
9512016SGirish.Moodalbail@Sun.COM tbytes += nbytes;
9612016SGirish.Moodalbail@Sun.COM if (tbytes >= psize) {
9712016SGirish.Moodalbail@Sun.COM /* Buffer overflow, stop copying information */
9812016SGirish.Moodalbail@Sun.COM err = ENOBUFS;
9912016SGirish.Moodalbail@Sun.COM break;
10012016SGirish.Moodalbail@Sun.COM }
10112016SGirish.Moodalbail@Sun.COM }
10212869SKacheong.Poon@Sun.COM
10312016SGirish.Moodalbail@Sun.COM mutex_exit(&tcps->tcps_listener_conf_lock);
10412016SGirish.Moodalbail@Sun.COM return (err);
10512016SGirish.Moodalbail@Sun.COM }
10612016SGirish.Moodalbail@Sun.COM
10712016SGirish.Moodalbail@Sun.COM /*
10812016SGirish.Moodalbail@Sun.COM * add a new listener limit configuration.
10912016SGirish.Moodalbail@Sun.COM */
11012016SGirish.Moodalbail@Sun.COM /* ARGSUSED */
11112016SGirish.Moodalbail@Sun.COM static int
tcp_listener_conf_add(void * cbarg,cred_t * cr,mod_prop_info_t * pinfo,const char * ifname,const void * pval,uint_t flags)11212016SGirish.Moodalbail@Sun.COM tcp_listener_conf_add(void *cbarg, cred_t *cr, mod_prop_info_t *pinfo,
11312016SGirish.Moodalbail@Sun.COM const char *ifname, const void* pval, uint_t flags)
11412016SGirish.Moodalbail@Sun.COM {
11512016SGirish.Moodalbail@Sun.COM tcp_listener_t *new_tl;
11612016SGirish.Moodalbail@Sun.COM tcp_listener_t *tl;
11712016SGirish.Moodalbail@Sun.COM long lport;
11812016SGirish.Moodalbail@Sun.COM long ratio;
11912016SGirish.Moodalbail@Sun.COM char *colon;
12012016SGirish.Moodalbail@Sun.COM tcp_stack_t *tcps = (tcp_stack_t *)cbarg;
12112016SGirish.Moodalbail@Sun.COM
12212016SGirish.Moodalbail@Sun.COM if (flags & MOD_PROP_DEFAULT)
12312016SGirish.Moodalbail@Sun.COM return (ENOTSUP);
12412016SGirish.Moodalbail@Sun.COM
12512016SGirish.Moodalbail@Sun.COM if (ddi_strtol(pval, &colon, 10, &lport) != 0 || lport <= 0 ||
12612016SGirish.Moodalbail@Sun.COM lport > USHRT_MAX || *colon != ':') {
12712016SGirish.Moodalbail@Sun.COM return (EINVAL);
12812016SGirish.Moodalbail@Sun.COM }
12912016SGirish.Moodalbail@Sun.COM if (ddi_strtol(colon + 1, NULL, 10, &ratio) != 0 || ratio <= 0)
13012016SGirish.Moodalbail@Sun.COM return (EINVAL);
13112016SGirish.Moodalbail@Sun.COM
13212016SGirish.Moodalbail@Sun.COM mutex_enter(&tcps->tcps_listener_conf_lock);
13312016SGirish.Moodalbail@Sun.COM for (tl = list_head(&tcps->tcps_listener_conf); tl != NULL;
13412016SGirish.Moodalbail@Sun.COM tl = list_next(&tcps->tcps_listener_conf, tl)) {
13512016SGirish.Moodalbail@Sun.COM /* There is an existing entry, so update its ratio value. */
13612016SGirish.Moodalbail@Sun.COM if (tl->tl_port == lport) {
13712016SGirish.Moodalbail@Sun.COM tl->tl_ratio = ratio;
13812016SGirish.Moodalbail@Sun.COM mutex_exit(&tcps->tcps_listener_conf_lock);
13912016SGirish.Moodalbail@Sun.COM return (0);
14012016SGirish.Moodalbail@Sun.COM }
14112016SGirish.Moodalbail@Sun.COM }
14212016SGirish.Moodalbail@Sun.COM
14312016SGirish.Moodalbail@Sun.COM if ((new_tl = kmem_alloc(sizeof (tcp_listener_t), KM_NOSLEEP)) ==
14412016SGirish.Moodalbail@Sun.COM NULL) {
14512016SGirish.Moodalbail@Sun.COM mutex_exit(&tcps->tcps_listener_conf_lock);
14612016SGirish.Moodalbail@Sun.COM return (ENOMEM);
14712016SGirish.Moodalbail@Sun.COM }
14812016SGirish.Moodalbail@Sun.COM
14912016SGirish.Moodalbail@Sun.COM new_tl->tl_port = lport;
15012016SGirish.Moodalbail@Sun.COM new_tl->tl_ratio = ratio;
15112016SGirish.Moodalbail@Sun.COM list_insert_tail(&tcps->tcps_listener_conf, new_tl);
15212016SGirish.Moodalbail@Sun.COM mutex_exit(&tcps->tcps_listener_conf_lock);
15312016SGirish.Moodalbail@Sun.COM return (0);
15412016SGirish.Moodalbail@Sun.COM }
15512016SGirish.Moodalbail@Sun.COM
15612016SGirish.Moodalbail@Sun.COM /*
15712016SGirish.Moodalbail@Sun.COM * remove a listener limit configuration.
15812016SGirish.Moodalbail@Sun.COM */
15912016SGirish.Moodalbail@Sun.COM /* ARGSUSED */
16012016SGirish.Moodalbail@Sun.COM static int
tcp_listener_conf_del(void * cbarg,cred_t * cr,mod_prop_info_t * pinfo,const char * ifname,const void * pval,uint_t flags)16112016SGirish.Moodalbail@Sun.COM tcp_listener_conf_del(void *cbarg, cred_t *cr, mod_prop_info_t *pinfo,
16212016SGirish.Moodalbail@Sun.COM const char *ifname, const void* pval, uint_t flags)
16312016SGirish.Moodalbail@Sun.COM {
16412016SGirish.Moodalbail@Sun.COM tcp_listener_t *tl;
16512016SGirish.Moodalbail@Sun.COM long lport;
16612016SGirish.Moodalbail@Sun.COM tcp_stack_t *tcps = (tcp_stack_t *)cbarg;
16712016SGirish.Moodalbail@Sun.COM
16812016SGirish.Moodalbail@Sun.COM if (flags & MOD_PROP_DEFAULT)
16912016SGirish.Moodalbail@Sun.COM return (ENOTSUP);
17012016SGirish.Moodalbail@Sun.COM
17112016SGirish.Moodalbail@Sun.COM if (ddi_strtol(pval, NULL, 10, &lport) != 0 || lport <= 0 ||
17212016SGirish.Moodalbail@Sun.COM lport > USHRT_MAX) {
17312016SGirish.Moodalbail@Sun.COM return (EINVAL);
17412016SGirish.Moodalbail@Sun.COM }
17512016SGirish.Moodalbail@Sun.COM mutex_enter(&tcps->tcps_listener_conf_lock);
17612016SGirish.Moodalbail@Sun.COM for (tl = list_head(&tcps->tcps_listener_conf); tl != NULL;
17712016SGirish.Moodalbail@Sun.COM tl = list_next(&tcps->tcps_listener_conf, tl)) {
17812016SGirish.Moodalbail@Sun.COM if (tl->tl_port == lport) {
17912016SGirish.Moodalbail@Sun.COM list_remove(&tcps->tcps_listener_conf, tl);
18012016SGirish.Moodalbail@Sun.COM mutex_exit(&tcps->tcps_listener_conf_lock);
18112016SGirish.Moodalbail@Sun.COM kmem_free(tl, sizeof (tcp_listener_t));
18212016SGirish.Moodalbail@Sun.COM return (0);
18312016SGirish.Moodalbail@Sun.COM }
18412016SGirish.Moodalbail@Sun.COM }
18512016SGirish.Moodalbail@Sun.COM mutex_exit(&tcps->tcps_listener_conf_lock);
18612016SGirish.Moodalbail@Sun.COM return (ESRCH);
18712016SGirish.Moodalbail@Sun.COM }
18812016SGirish.Moodalbail@Sun.COM
18912016SGirish.Moodalbail@Sun.COM /*
19012016SGirish.Moodalbail@Sun.COM * All of these are alterable, within the min/max values given, at run time.
19112016SGirish.Moodalbail@Sun.COM *
192*13125SGirish.Moodalbail@oracle.COM * Note: All those tunables which do not start with "_" are Committed and
193*13125SGirish.Moodalbail@oracle.COM * therefore are public. See PSARC 2010/080.
19412016SGirish.Moodalbail@Sun.COM */
19512016SGirish.Moodalbail@Sun.COM mod_prop_info_t tcp_propinfo_tbl[] = {
19612016SGirish.Moodalbail@Sun.COM /* tunable - 0 */
197*13125SGirish.Moodalbail@oracle.COM { "_time_wait_interval", MOD_PROTO_TCP,
19812016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
19912016SGirish.Moodalbail@Sun.COM {1*SECONDS, 10*MINUTES, 1*MINUTES}, {1*MINUTES} },
20012016SGirish.Moodalbail@Sun.COM
201*13125SGirish.Moodalbail@oracle.COM { "_conn_req_max_q", MOD_PROTO_TCP,
20212016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
20312016SGirish.Moodalbail@Sun.COM {1, UINT32_MAX, 128}, {128} },
20412016SGirish.Moodalbail@Sun.COM
205*13125SGirish.Moodalbail@oracle.COM { "_conn_req_max_q0", MOD_PROTO_TCP,
20612016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
20712016SGirish.Moodalbail@Sun.COM {0, UINT32_MAX, 1024}, {1024} },
20812016SGirish.Moodalbail@Sun.COM
209*13125SGirish.Moodalbail@oracle.COM { "_conn_req_min", MOD_PROTO_TCP,
21012016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
21112016SGirish.Moodalbail@Sun.COM {1, 1024, 1}, {1} },
21212016SGirish.Moodalbail@Sun.COM
213*13125SGirish.Moodalbail@oracle.COM { "_conn_grace_period", MOD_PROTO_TCP,
21412016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
21512016SGirish.Moodalbail@Sun.COM {0*MS, 20*SECONDS, 0*MS}, {0*MS} },
21612016SGirish.Moodalbail@Sun.COM
217*13125SGirish.Moodalbail@oracle.COM { "_cwnd_max", MOD_PROTO_TCP,
21812016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
21912016SGirish.Moodalbail@Sun.COM {128, (1<<30), 1024*1024}, {1024*1024} },
22012016SGirish.Moodalbail@Sun.COM
221*13125SGirish.Moodalbail@oracle.COM { "_debug", MOD_PROTO_TCP,
22212016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
22312016SGirish.Moodalbail@Sun.COM {0, 10, 0}, {0} },
22412016SGirish.Moodalbail@Sun.COM
22512016SGirish.Moodalbail@Sun.COM { "smallest_nonpriv_port", MOD_PROTO_TCP,
22612016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
22712016SGirish.Moodalbail@Sun.COM {1024, (32*1024), 1024}, {1024} },
22812016SGirish.Moodalbail@Sun.COM
229*13125SGirish.Moodalbail@oracle.COM { "_ip_abort_cinterval", MOD_PROTO_TCP,
23012016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
23112016SGirish.Moodalbail@Sun.COM {1*SECONDS, UINT32_MAX, 3*MINUTES}, {3*MINUTES} },
23212016SGirish.Moodalbail@Sun.COM
233*13125SGirish.Moodalbail@oracle.COM { "_ip_abort_linterval", MOD_PROTO_TCP,
23412016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
23512016SGirish.Moodalbail@Sun.COM {1*SECONDS, UINT32_MAX, 3*MINUTES}, {3*MINUTES} },
23612016SGirish.Moodalbail@Sun.COM
23712016SGirish.Moodalbail@Sun.COM /* tunable - 10 */
238*13125SGirish.Moodalbail@oracle.COM { "_ip_abort_interval", MOD_PROTO_TCP,
23912016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
24012016SGirish.Moodalbail@Sun.COM {500*MS, UINT32_MAX, 5*MINUTES}, {5*MINUTES} },
24112016SGirish.Moodalbail@Sun.COM
242*13125SGirish.Moodalbail@oracle.COM { "_ip_notify_cinterval", MOD_PROTO_TCP,
24312016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
24412016SGirish.Moodalbail@Sun.COM {1*SECONDS, UINT32_MAX, 10*SECONDS},
24512016SGirish.Moodalbail@Sun.COM {10*SECONDS} },
24612016SGirish.Moodalbail@Sun.COM
247*13125SGirish.Moodalbail@oracle.COM { "_ip_notify_interval", MOD_PROTO_TCP,
24812016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
24912016SGirish.Moodalbail@Sun.COM {500*MS, UINT32_MAX, 10*SECONDS}, {10*SECONDS} },
25012016SGirish.Moodalbail@Sun.COM
251*13125SGirish.Moodalbail@oracle.COM { "_ipv4_ttl", MOD_PROTO_TCP,
25212016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
25312016SGirish.Moodalbail@Sun.COM {1, 255, 64}, {64} },
25412016SGirish.Moodalbail@Sun.COM
255*13125SGirish.Moodalbail@oracle.COM { "_keepalive_interval", MOD_PROTO_TCP,
25612016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
25712016SGirish.Moodalbail@Sun.COM {10*SECONDS, 10*DAYS, 2*HOURS}, {2*HOURS} },
25812016SGirish.Moodalbail@Sun.COM
259*13125SGirish.Moodalbail@oracle.COM { "_maxpsz_multiplier", MOD_PROTO_TCP,
26012016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
26112016SGirish.Moodalbail@Sun.COM {0, 100, 10}, {10} },
26212016SGirish.Moodalbail@Sun.COM
263*13125SGirish.Moodalbail@oracle.COM { "_mss_def_ipv4", MOD_PROTO_TCP,
26412016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
26512016SGirish.Moodalbail@Sun.COM {1, TCP_MSS_MAX_IPV4, 536}, {536} },
26612016SGirish.Moodalbail@Sun.COM
267*13125SGirish.Moodalbail@oracle.COM { "_mss_max_ipv4", MOD_PROTO_TCP,
26812016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
26912016SGirish.Moodalbail@Sun.COM {1, TCP_MSS_MAX_IPV4, TCP_MSS_MAX_IPV4},
27012016SGirish.Moodalbail@Sun.COM {TCP_MSS_MAX_IPV4} },
27112016SGirish.Moodalbail@Sun.COM
272*13125SGirish.Moodalbail@oracle.COM { "_mss_min", MOD_PROTO_TCP,
27312016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
27412016SGirish.Moodalbail@Sun.COM {1, TCP_MSS_MAX, 108}, {108} },
27512016SGirish.Moodalbail@Sun.COM
276*13125SGirish.Moodalbail@oracle.COM { "_naglim_def", MOD_PROTO_TCP,
27712016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
27812016SGirish.Moodalbail@Sun.COM {1, (64*1024)-1, (4*1024)-1}, {(4*1024)-1} },
27912016SGirish.Moodalbail@Sun.COM
28012016SGirish.Moodalbail@Sun.COM /* tunable - 20 */
281*13125SGirish.Moodalbail@oracle.COM { "_rexmit_interval_initial", MOD_PROTO_TCP,
28212016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
28312016SGirish.Moodalbail@Sun.COM {1*MS, 20*SECONDS, 1*SECONDS}, {1*SECONDS} },
28412016SGirish.Moodalbail@Sun.COM
285*13125SGirish.Moodalbail@oracle.COM { "_rexmit_interval_max", MOD_PROTO_TCP,
28612016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
28712016SGirish.Moodalbail@Sun.COM {1*MS, 2*HOURS, 60*SECONDS}, {60*SECONDS} },
28812016SGirish.Moodalbail@Sun.COM
289*13125SGirish.Moodalbail@oracle.COM { "_rexmit_interval_min", MOD_PROTO_TCP,
29012016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
29112016SGirish.Moodalbail@Sun.COM {1*MS, 2*HOURS, 400*MS}, {400*MS} },
29212016SGirish.Moodalbail@Sun.COM
293*13125SGirish.Moodalbail@oracle.COM { "_deferred_ack_interval", MOD_PROTO_TCP,
29412016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
29512016SGirish.Moodalbail@Sun.COM {1*MS, 1*MINUTES, 100*MS}, {100*MS} },
29612016SGirish.Moodalbail@Sun.COM
297*13125SGirish.Moodalbail@oracle.COM { "_snd_lowat_fraction", MOD_PROTO_TCP,
29812016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
29912016SGirish.Moodalbail@Sun.COM {0, 16, 0}, {0} },
30012016SGirish.Moodalbail@Sun.COM
301*13125SGirish.Moodalbail@oracle.COM { "_dupack_fast_retransmit", MOD_PROTO_TCP,
30212016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
30312016SGirish.Moodalbail@Sun.COM {1, 10000, 3}, {3} },
30412016SGirish.Moodalbail@Sun.COM
305*13125SGirish.Moodalbail@oracle.COM { "_ignore_path_mtu", MOD_PROTO_TCP,
30612016SGirish.Moodalbail@Sun.COM mod_set_boolean, mod_get_boolean,
30712016SGirish.Moodalbail@Sun.COM {B_FALSE}, {B_FALSE} },
30812016SGirish.Moodalbail@Sun.COM
30912016SGirish.Moodalbail@Sun.COM { "smallest_anon_port", MOD_PROTO_TCP,
31012016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
31112016SGirish.Moodalbail@Sun.COM {1024, ULP_MAX_PORT, 32*1024}, {32*1024} },
31212016SGirish.Moodalbail@Sun.COM
31312016SGirish.Moodalbail@Sun.COM { "largest_anon_port", MOD_PROTO_TCP,
31412016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
31512016SGirish.Moodalbail@Sun.COM {1024, ULP_MAX_PORT, ULP_MAX_PORT},
31612016SGirish.Moodalbail@Sun.COM {ULP_MAX_PORT} },
31712016SGirish.Moodalbail@Sun.COM
31812016SGirish.Moodalbail@Sun.COM { "send_maxbuf", MOD_PROTO_TCP,
31912016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
32012016SGirish.Moodalbail@Sun.COM {TCP_XMIT_LOWATER, (1<<30), TCP_XMIT_HIWATER},
32112016SGirish.Moodalbail@Sun.COM {TCP_XMIT_HIWATER} },
32212016SGirish.Moodalbail@Sun.COM
32312016SGirish.Moodalbail@Sun.COM /* tunable - 30 */
324*13125SGirish.Moodalbail@oracle.COM { "_xmit_lowat", MOD_PROTO_TCP,
32512016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
32612016SGirish.Moodalbail@Sun.COM {TCP_XMIT_LOWATER, (1<<30), TCP_XMIT_LOWATER},
32712016SGirish.Moodalbail@Sun.COM {TCP_XMIT_LOWATER} },
32812016SGirish.Moodalbail@Sun.COM
32912016SGirish.Moodalbail@Sun.COM { "recv_maxbuf", MOD_PROTO_TCP,
33012016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
33112016SGirish.Moodalbail@Sun.COM {TCP_RECV_LOWATER, (1<<30), TCP_RECV_HIWATER},
33212016SGirish.Moodalbail@Sun.COM {TCP_RECV_HIWATER} },
33312016SGirish.Moodalbail@Sun.COM
334*13125SGirish.Moodalbail@oracle.COM { "_recv_hiwat_minmss", MOD_PROTO_TCP,
33512016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
33612016SGirish.Moodalbail@Sun.COM {1, 65536, 4}, {4} },
33712016SGirish.Moodalbail@Sun.COM
338*13125SGirish.Moodalbail@oracle.COM { "_fin_wait_2_flush_interval", MOD_PROTO_TCP,
33912016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
34012544SKacheong.Poon@Sun.COM {1*SECONDS, 2*HOURS, 60*SECONDS},
34112544SKacheong.Poon@Sun.COM {60*SECONDS} },
34212016SGirish.Moodalbail@Sun.COM
343*13125SGirish.Moodalbail@oracle.COM { "_max_buf", MOD_PROTO_TCP,
34412016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
34512016SGirish.Moodalbail@Sun.COM {8192, (1<<30), 1024*1024}, {1024*1024} },
34612016SGirish.Moodalbail@Sun.COM
34712016SGirish.Moodalbail@Sun.COM /*
34812016SGirish.Moodalbail@Sun.COM * Question: What default value should I set for tcp_strong_iss?
34912016SGirish.Moodalbail@Sun.COM */
350*13125SGirish.Moodalbail@oracle.COM { "_strong_iss", MOD_PROTO_TCP,
35112016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
35212016SGirish.Moodalbail@Sun.COM {0, 2, 1}, {1} },
35312016SGirish.Moodalbail@Sun.COM
354*13125SGirish.Moodalbail@oracle.COM { "_rtt_updates", MOD_PROTO_TCP,
35512016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
35612016SGirish.Moodalbail@Sun.COM {0, 65536, 20}, {20} },
35712016SGirish.Moodalbail@Sun.COM
358*13125SGirish.Moodalbail@oracle.COM { "_wscale_always", MOD_PROTO_TCP,
35912016SGirish.Moodalbail@Sun.COM mod_set_boolean, mod_get_boolean,
36012016SGirish.Moodalbail@Sun.COM {B_TRUE}, {B_TRUE} },
36112016SGirish.Moodalbail@Sun.COM
362*13125SGirish.Moodalbail@oracle.COM { "_tstamp_always", MOD_PROTO_TCP,
36312016SGirish.Moodalbail@Sun.COM mod_set_boolean, mod_get_boolean,
36412016SGirish.Moodalbail@Sun.COM {B_FALSE}, {B_FALSE} },
36512016SGirish.Moodalbail@Sun.COM
366*13125SGirish.Moodalbail@oracle.COM { "_tstamp_if_wscale", MOD_PROTO_TCP,
36712016SGirish.Moodalbail@Sun.COM mod_set_boolean, mod_get_boolean,
36812016SGirish.Moodalbail@Sun.COM {B_TRUE}, {B_TRUE} },
36912016SGirish.Moodalbail@Sun.COM
37012016SGirish.Moodalbail@Sun.COM /* tunable - 40 */
371*13125SGirish.Moodalbail@oracle.COM { "_rexmit_interval_extra", MOD_PROTO_TCP,
37212016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
37312016SGirish.Moodalbail@Sun.COM {0*MS, 2*HOURS, 0*MS}, {0*MS} },
37412016SGirish.Moodalbail@Sun.COM
375*13125SGirish.Moodalbail@oracle.COM { "_deferred_acks_max", MOD_PROTO_TCP,
37612016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
37712016SGirish.Moodalbail@Sun.COM {0, 16, 2}, {2} },
37812016SGirish.Moodalbail@Sun.COM
379*13125SGirish.Moodalbail@oracle.COM { "_slow_start_after_idle", MOD_PROTO_TCP,
38012016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
38112016SGirish.Moodalbail@Sun.COM {1, 16384, 4}, {4} },
38212016SGirish.Moodalbail@Sun.COM
383*13125SGirish.Moodalbail@oracle.COM { "_slow_start_initial", MOD_PROTO_TCP,
38412016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
38512016SGirish.Moodalbail@Sun.COM {1, 4, 4}, {4} },
38612016SGirish.Moodalbail@Sun.COM
38712016SGirish.Moodalbail@Sun.COM { "sack", MOD_PROTO_TCP,
38812016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
38912016SGirish.Moodalbail@Sun.COM {0, 2, 2}, {2} },
39012016SGirish.Moodalbail@Sun.COM
391*13125SGirish.Moodalbail@oracle.COM { "_ipv6_hoplimit", MOD_PROTO_TCP,
39212016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
39312016SGirish.Moodalbail@Sun.COM {0, IPV6_MAX_HOPS, IPV6_DEFAULT_HOPS},
39412016SGirish.Moodalbail@Sun.COM {IPV6_DEFAULT_HOPS} },
39512016SGirish.Moodalbail@Sun.COM
396*13125SGirish.Moodalbail@oracle.COM { "_mss_def_ipv6", MOD_PROTO_TCP,
39712016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
39812016SGirish.Moodalbail@Sun.COM {1, TCP_MSS_MAX_IPV6, 1220}, {1220} },
39912016SGirish.Moodalbail@Sun.COM
400*13125SGirish.Moodalbail@oracle.COM { "_mss_max_ipv6", MOD_PROTO_TCP,
40112016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
40212016SGirish.Moodalbail@Sun.COM {1, TCP_MSS_MAX_IPV6, TCP_MSS_MAX_IPV6},
40312016SGirish.Moodalbail@Sun.COM {TCP_MSS_MAX_IPV6} },
40412016SGirish.Moodalbail@Sun.COM
405*13125SGirish.Moodalbail@oracle.COM { "_rev_src_routes", MOD_PROTO_TCP,
40612016SGirish.Moodalbail@Sun.COM mod_set_boolean, mod_get_boolean,
40712016SGirish.Moodalbail@Sun.COM {B_FALSE}, {B_FALSE} },
40812016SGirish.Moodalbail@Sun.COM
409*13125SGirish.Moodalbail@oracle.COM { "_local_dack_interval", MOD_PROTO_TCP,
41012016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
41112016SGirish.Moodalbail@Sun.COM {10*MS, 500*MS, 50*MS}, {50*MS} },
41212016SGirish.Moodalbail@Sun.COM
41312016SGirish.Moodalbail@Sun.COM /* tunable - 50 */
414*13125SGirish.Moodalbail@oracle.COM { "_local_dacks_max", MOD_PROTO_TCP,
41512016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
41612016SGirish.Moodalbail@Sun.COM {0, 16, 8}, {8} },
41712016SGirish.Moodalbail@Sun.COM
41812016SGirish.Moodalbail@Sun.COM { "ecn", MOD_PROTO_TCP,
41912016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
42012016SGirish.Moodalbail@Sun.COM {0, 2, 1}, {1} },
42112016SGirish.Moodalbail@Sun.COM
422*13125SGirish.Moodalbail@oracle.COM { "_rst_sent_rate_enabled", MOD_PROTO_TCP,
42312016SGirish.Moodalbail@Sun.COM mod_set_boolean, mod_get_boolean,
42412016SGirish.Moodalbail@Sun.COM {B_TRUE}, {B_TRUE} },
42512016SGirish.Moodalbail@Sun.COM
426*13125SGirish.Moodalbail@oracle.COM { "_rst_sent_rate", MOD_PROTO_TCP,
42712016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
42812016SGirish.Moodalbail@Sun.COM {0, UINT32_MAX, 40}, {40} },
42912016SGirish.Moodalbail@Sun.COM
430*13125SGirish.Moodalbail@oracle.COM { "_push_timer_interval", MOD_PROTO_TCP,
43112016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
43212016SGirish.Moodalbail@Sun.COM {0, 100*MS, 50*MS}, {50*MS} },
43312016SGirish.Moodalbail@Sun.COM
434*13125SGirish.Moodalbail@oracle.COM { "_use_smss_as_mss_opt", MOD_PROTO_TCP,
43512016SGirish.Moodalbail@Sun.COM mod_set_boolean, mod_get_boolean,
43612016SGirish.Moodalbail@Sun.COM {B_FALSE}, {B_FALSE} },
43712016SGirish.Moodalbail@Sun.COM
438*13125SGirish.Moodalbail@oracle.COM { "_keepalive_abort_interval", MOD_PROTO_TCP,
43912016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
44012016SGirish.Moodalbail@Sun.COM {0, UINT32_MAX, 8*MINUTES}, {8*MINUTES} },
44112016SGirish.Moodalbail@Sun.COM
44212016SGirish.Moodalbail@Sun.COM /*
44312016SGirish.Moodalbail@Sun.COM * tcp_wroff_xtra is the extra space in front of TCP/IP header for link
44412016SGirish.Moodalbail@Sun.COM * layer header. It has to be a multiple of 8.
44512016SGirish.Moodalbail@Sun.COM */
446*13125SGirish.Moodalbail@oracle.COM { "_wroff_xtra", MOD_PROTO_TCP,
44712016SGirish.Moodalbail@Sun.COM mod_set_aligned, mod_get_uint32,
44812016SGirish.Moodalbail@Sun.COM {0, 256, 32}, {32} },
44912016SGirish.Moodalbail@Sun.COM
450*13125SGirish.Moodalbail@oracle.COM { "_dev_flow_ctl", MOD_PROTO_TCP,
45112016SGirish.Moodalbail@Sun.COM mod_set_boolean, mod_get_boolean,
45212016SGirish.Moodalbail@Sun.COM {B_FALSE}, {B_FALSE} },
45312016SGirish.Moodalbail@Sun.COM
454*13125SGirish.Moodalbail@oracle.COM { "_reass_timeout", MOD_PROTO_TCP,
45512016SGirish.Moodalbail@Sun.COM mod_set_uint32, mod_get_uint32,
45612016SGirish.Moodalbail@Sun.COM {0, UINT32_MAX, 100*SECONDS}, {100*SECONDS} },
45712016SGirish.Moodalbail@Sun.COM
45812016SGirish.Moodalbail@Sun.COM /* tunable - 60 */
45912016SGirish.Moodalbail@Sun.COM { "extra_priv_ports", MOD_PROTO_TCP,
46012016SGirish.Moodalbail@Sun.COM mod_set_extra_privports, mod_get_extra_privports,
46112016SGirish.Moodalbail@Sun.COM {1, ULP_MAX_PORT, 0}, {0} },
46212016SGirish.Moodalbail@Sun.COM
463*13125SGirish.Moodalbail@oracle.COM { "_1948_phrase", MOD_PROTO_TCP,
46412016SGirish.Moodalbail@Sun.COM tcp_set_1948phrase, NULL, {0}, {0} },
46512016SGirish.Moodalbail@Sun.COM
466*13125SGirish.Moodalbail@oracle.COM { "_listener_limit_conf", MOD_PROTO_TCP,
46712016SGirish.Moodalbail@Sun.COM NULL, tcp_listener_conf_get, {0}, {0} },
46812016SGirish.Moodalbail@Sun.COM
469*13125SGirish.Moodalbail@oracle.COM { "_listener_limit_conf_add", MOD_PROTO_TCP,
47012016SGirish.Moodalbail@Sun.COM tcp_listener_conf_add, NULL, {0}, {0} },
47112016SGirish.Moodalbail@Sun.COM
472*13125SGirish.Moodalbail@oracle.COM { "_listener_limit_conf_del", MOD_PROTO_TCP,
47312016SGirish.Moodalbail@Sun.COM tcp_listener_conf_del, NULL, {0}, {0} },
47412016SGirish.Moodalbail@Sun.COM
47512016SGirish.Moodalbail@Sun.COM { "?", MOD_PROTO_TCP, NULL, mod_get_allprop, {0}, {0} },
47612016SGirish.Moodalbail@Sun.COM
47712016SGirish.Moodalbail@Sun.COM { NULL, 0, NULL, NULL, {0}, {0} }
47812016SGirish.Moodalbail@Sun.COM };
47912016SGirish.Moodalbail@Sun.COM
48012016SGirish.Moodalbail@Sun.COM int tcp_propinfo_count = A_CNT(tcp_propinfo_tbl);
481