79
80 if ((err = mod_uint32_value(pval, pinfo, flags, &new_value)) != 0)
81 return (err);
82 /* mod_uint32_value() + pinfo guarantees we're in UDP port range. */
83 if (new_value < us->us_smallest_anon_port)
84 return (ERANGE);
85 pinfo->prop_cur_uval = (uint32_t)new_value;
86 return (0);
87 }
88
89 /*
90 * All of these are alterable, within the min/max values given, at run time.
91 *
92 * Note: All those tunables which do not start with "_" are Committed and
93 * therefore are public. See PSARC 2010/080.
94 */
95 mod_prop_info_t udp_propinfo_tbl[] = {
96 /* tunable - 0 */
97 { "_wroff_extra", MOD_PROTO_UDP,
98 mod_set_uint32, mod_get_uint32,
99 {0, 256, 32}, {32} },
100
101 { "_ipv4_ttl", MOD_PROTO_UDP,
102 mod_set_uint32, mod_get_uint32,
103 {1, 255, 255}, {255} },
104
105 { "_ipv6_hoplimit", MOD_PROTO_UDP,
106 mod_set_uint32, mod_get_uint32,
107 {0, IPV6_MAX_HOPS, IPV6_DEFAULT_HOPS}, {IPV6_DEFAULT_HOPS} },
108
109 { "smallest_nonpriv_port", MOD_PROTO_UDP,
110 mod_set_uint32, mod_get_uint32,
111 {1024, (32 * 1024), 1024}, {1024} },
112
113 { "_do_checksum", MOD_PROTO_UDP,
114 mod_set_boolean, mod_get_boolean,
115 {B_TRUE}, {B_TRUE} },
116
117 { "smallest_anon_port", MOD_PROTO_UDP,
118 udp_smallest_anon_set, mod_get_uint32,
119 {1024, ULP_MAX_PORT, (32 * 1024)}, {(32 * 1024)} },
120
121 { "largest_anon_port", MOD_PROTO_UDP,
122 udp_largest_anon_set, mod_get_uint32,
123 {1024, ULP_MAX_PORT, ULP_MAX_PORT}, {ULP_MAX_PORT} },
124
125 { "send_buf", MOD_PROTO_UDP,
126 udp_set_buf_prop, udp_get_buf_prop,
127 {UDP_XMIT_LOWATER, ULP_MAX_BUF, UDP_XMIT_HIWATER},
128 {UDP_XMIT_HIWATER} },
129
130 { "_xmit_lowat", MOD_PROTO_UDP,
131 mod_set_uint32, mod_get_uint32,
132 {0, ULP_MAX_BUF, UDP_XMIT_LOWATER},
133 {UDP_XMIT_LOWATER} },
134
135 { "recv_buf", MOD_PROTO_UDP,
136 udp_set_buf_prop, udp_get_buf_prop,
137 {UDP_RECV_LOWATER, ULP_MAX_BUF, UDP_RECV_HIWATER},
138 {UDP_RECV_HIWATER} },
139
140 /* tunable - 10 */
141 { "max_buf", MOD_PROTO_UDP,
142 mod_set_uint32, mod_get_uint32,
143 {65536, ULP_MAX_BUF, 2*1024*1024}, {2*1024*1024} },
144
145 { "_pmtu_discovery", MOD_PROTO_UDP,
146 mod_set_boolean, mod_get_boolean,
147 {B_FALSE}, {B_FALSE} },
148
149 { "_sendto_ignerr", MOD_PROTO_UDP,
150 mod_set_boolean, mod_get_boolean,
151 {B_FALSE}, {B_FALSE} },
152
153 { "extra_priv_ports", MOD_PROTO_UDP,
154 mod_set_extra_privports, mod_get_extra_privports,
155 {1, ULP_MAX_PORT, 0}, {0} },
156
157 { "?", MOD_PROTO_UDP, NULL, mod_get_allprop, {0}, {0} },
158
159 { NULL, 0, NULL, NULL, {0}, {0} }
160 };
161
162 int udp_propinfo_count = A_CNT(udp_propinfo_tbl);
|
79
80 if ((err = mod_uint32_value(pval, pinfo, flags, &new_value)) != 0)
81 return (err);
82 /* mod_uint32_value() + pinfo guarantees we're in UDP port range. */
83 if (new_value < us->us_smallest_anon_port)
84 return (ERANGE);
85 pinfo->prop_cur_uval = (uint32_t)new_value;
86 return (0);
87 }
88
89 /*
90 * All of these are alterable, within the min/max values given, at run time.
91 *
92 * Note: All those tunables which do not start with "_" are Committed and
93 * therefore are public. See PSARC 2010/080.
94 */
95 mod_prop_info_t udp_propinfo_tbl[] = {
96 /* tunable - 0 */
97 { "_wroff_extra", MOD_PROTO_UDP,
98 mod_set_uint32, mod_get_uint32,
99 {{0, 256, 32}}, {32} },
100
101 { "_ipv4_ttl", MOD_PROTO_UDP,
102 mod_set_uint32, mod_get_uint32,
103 {{1, 255, 255}}, {255} },
104
105 { "_ipv6_hoplimit", MOD_PROTO_UDP,
106 mod_set_uint32, mod_get_uint32,
107 {{0, IPV6_MAX_HOPS, IPV6_DEFAULT_HOPS}}, {IPV6_DEFAULT_HOPS} },
108
109 { "smallest_nonpriv_port", MOD_PROTO_UDP,
110 mod_set_uint32, mod_get_uint32,
111 {{1024, (32 * 1024), 1024}}, {1024} },
112
113 { "_do_checksum", MOD_PROTO_UDP,
114 mod_set_boolean, mod_get_boolean,
115 {.mpi_bval = B_TRUE}, {B_TRUE} },
116
117 { "smallest_anon_port", MOD_PROTO_UDP,
118 udp_smallest_anon_set, mod_get_uint32,
119 {{1024, ULP_MAX_PORT, (32 * 1024)}}, {(32 * 1024)} },
120
121 { "largest_anon_port", MOD_PROTO_UDP,
122 udp_largest_anon_set, mod_get_uint32,
123 {{1024, ULP_MAX_PORT, ULP_MAX_PORT}}, {ULP_MAX_PORT} },
124
125 { "send_buf", MOD_PROTO_UDP,
126 udp_set_buf_prop, udp_get_buf_prop,
127 {{UDP_XMIT_LOWATER, ULP_MAX_BUF, UDP_XMIT_HIWATER}},
128 {UDP_XMIT_HIWATER} },
129
130 { "_xmit_lowat", MOD_PROTO_UDP,
131 mod_set_uint32, mod_get_uint32,
132 {{0, ULP_MAX_BUF, UDP_XMIT_LOWATER}},
133 {UDP_XMIT_LOWATER} },
134
135 { "recv_buf", MOD_PROTO_UDP,
136 udp_set_buf_prop, udp_get_buf_prop,
137 {{UDP_RECV_LOWATER, ULP_MAX_BUF, UDP_RECV_HIWATER}},
138 {UDP_RECV_HIWATER} },
139
140 /* tunable - 10 */
141 { "max_buf", MOD_PROTO_UDP,
142 mod_set_uint32, mod_get_uint32,
143 {{65536, ULP_MAX_BUF, 2*1024*1024}}, {2*1024*1024} },
144
145 { "_pmtu_discovery", MOD_PROTO_UDP,
146 mod_set_boolean, mod_get_boolean,
147 {.mpi_bval = B_FALSE}, {B_FALSE} },
148
149 { "_sendto_ignerr", MOD_PROTO_UDP,
150 mod_set_boolean, mod_get_boolean,
151 {.mpi_bval = B_FALSE}, {B_FALSE} },
152
153 { "extra_priv_ports", MOD_PROTO_UDP,
154 mod_set_extra_privports, mod_get_extra_privports,
155 {{1, ULP_MAX_PORT, 0}}, {0} },
156
157 { "?", MOD_PROTO_UDP, NULL, mod_get_allprop, {{0,0,0}}, {0} },
158
159 { NULL, 0, NULL, NULL, {{0,0,0}}, {0} }
160 };
161
162 int udp_propinfo_count = A_CNT(udp_propinfo_tbl);
|