xref: /illumos-gate/usr/src/uts/common/inet/udp/udp_tunables.c (revision e77c795bcbe51aebd7579fe13cbf2a6d56eca47f)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
23  */
24 /* Copyright (c) 1990 Mentat Inc. */
25 
26 #include <inet/ip.h>
27 #include <inet/ip6.h>
28 #include <inet/udp_impl.h>
29 #include <sys/sunddi.h>
30 
31 /*
32  * All of these are alterable, within the min/max values given, at run time.
33  *
34  * Note: All those tunables which do not start with "_" are Committed and
35  * therefore are public. See PSARC 2010/080.
36  */
37 mod_prop_info_t udp_propinfo_tbl[] = {
38 	/* tunable - 0 */
39 	{ "_wroff_extra", MOD_PROTO_UDP,
40 	    mod_set_uint32, mod_get_uint32,
41 	    {0, 256, 32}, {32} },
42 
43 	{ "_ipv4_ttl", MOD_PROTO_UDP,
44 	    mod_set_uint32, mod_get_uint32,
45 	    {1, 255, 255}, {255} },
46 
47 	{ "_ipv6_hoplimit", MOD_PROTO_UDP,
48 	    mod_set_uint32, mod_get_uint32,
49 	    {0, IPV6_MAX_HOPS, IPV6_DEFAULT_HOPS}, {IPV6_DEFAULT_HOPS} },
50 
51 	{ "smallest_nonpriv_port", MOD_PROTO_UDP,
52 	    mod_set_uint32, mod_get_uint32,
53 	    {1024, (32 * 1024), 1024}, {1024} },
54 
55 	{ "_do_checksum", MOD_PROTO_UDP,
56 	    mod_set_boolean, mod_get_boolean,
57 	    {B_TRUE}, {B_TRUE} },
58 
59 	{ "smallest_anon_port", MOD_PROTO_UDP,
60 	    mod_set_uint32, mod_get_uint32,
61 	    {1024, ULP_MAX_PORT, (32 * 1024)}, {(32 * 1024)} },
62 
63 	{ "largest_anon_port", MOD_PROTO_UDP,
64 	    mod_set_uint32, mod_get_uint32,
65 	    {1024, ULP_MAX_PORT, ULP_MAX_PORT}, {ULP_MAX_PORT} },
66 
67 	{ "send_maxbuf", MOD_PROTO_UDP,
68 	    mod_set_uint32, mod_get_uint32,
69 	    {UDP_XMIT_LOWATER, (1<<30), UDP_XMIT_HIWATER},
70 	    {UDP_XMIT_HIWATER} },
71 
72 	{ "_xmit_lowat", MOD_PROTO_UDP,
73 	    mod_set_uint32, mod_get_uint32,
74 	    {0, (1<<30), UDP_XMIT_LOWATER},
75 	    {UDP_XMIT_LOWATER} },
76 
77 	{ "recv_maxbuf", MOD_PROTO_UDP,
78 	    mod_set_uint32, mod_get_uint32,
79 	    {UDP_RECV_LOWATER, (1<<30), UDP_RECV_HIWATER},
80 	    {UDP_RECV_HIWATER} },
81 
82 	/* tunable - 10 */
83 	{ "_max_buf", MOD_PROTO_UDP,
84 	    mod_set_uint32, mod_get_uint32,
85 	    {65536, (1<<30), 2*1024*1024}, {2*1024*1024} },
86 
87 	{ "_pmtu_discovery", MOD_PROTO_UDP,
88 	    mod_set_boolean, mod_get_boolean,
89 	    {B_FALSE}, {B_FALSE} },
90 
91 	{ "_sendto_ignerr", MOD_PROTO_UDP,
92 	    mod_set_boolean, mod_get_boolean,
93 	    {B_FALSE}, {B_FALSE} },
94 
95 	{ "extra_priv_ports", MOD_PROTO_UDP,
96 	    mod_set_extra_privports, mod_get_extra_privports,
97 	    {1, ULP_MAX_PORT, 0}, {0} },
98 
99 	{ "?", MOD_PROTO_UDP, NULL, mod_get_allprop, {0}, {0} },
100 
101 	{ NULL, 0, NULL, NULL, {0}, {0} }
102 };
103 
104 int udp_propinfo_count = A_CNT(udp_propinfo_tbl);
105