6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * CDDL HEADER START
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * The contents of this file are subject to the terms of the
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * Common Development and Distribution License (the "License").
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * You may not use this file except in compliance with the License.
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * or http://www.opensolaris.org/os/licensing.
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * See the License for the specific language governing permissions
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * and limitations under the License.
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * When distributing Covered Code, include this CDDL HEADER in each
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * If applicable, add the following below this CDDL HEADER, with the
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * fields enclosed by brackets "[]" replaced with your own identifying
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * information: Portions Copyright [yyyy] [name of copyright owner]
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * CDDL HEADER END
8887b57dc579de11464fc6c74163d2595ce073afGirish Moodalbail * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
7256a34efe9df75b638b9e812912ef7c5c68e208Dan McDonald * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roy * Copyright (c) 2013 by Delphix. All rights reserved.
8887b57dc579de11464fc6c74163d2595ce073afGirish Moodalbail/* Copyright (c) 1990 Mentat Inc. */
299625c6492013aa7bd163862f0d181854f69b3cSebastien Royudp_set_buf_prop(netstack_t *stack, cred_t *cr, mod_prop_info_t *pinfo,
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roy const char *ifname, const void *pval, uint_t flags)
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roy return (mod_set_buf_prop(stack->netstack_udp->us_propinfo_tbl, stack,
299625c6492013aa7bd163862f0d181854f69b3cSebastien Royudp_get_buf_prop(netstack_t *stack, mod_prop_info_t *pinfo, const char *ifname,
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roy return (mod_get_buf_prop(stack->netstack_udp->us_propinfo_tbl, stack,
7256a34efe9df75b638b9e812912ef7c5c68e208Dan McDonald * Special checkers for smallest/largest anonymous port so they don't
7256a34efe9df75b638b9e812912ef7c5c68e208Dan McDonald * ever happen to be (largest < smallest).
7256a34efe9df75b638b9e812912ef7c5c68e208Dan McDonald/* ARGSUSED */
299625c6492013aa7bd163862f0d181854f69b3cSebastien Royudp_smallest_anon_set(netstack_t *stack, cred_t *cr, mod_prop_info_t *pinfo,
7256a34efe9df75b638b9e812912ef7c5c68e208Dan McDonald const char *ifname, const void *pval, uint_t flags)
7256a34efe9df75b638b9e812912ef7c5c68e208Dan McDonald if ((err = mod_uint32_value(pval, pinfo, flags, &new_value)) != 0)
7256a34efe9df75b638b9e812912ef7c5c68e208Dan McDonald /* mod_uint32_value() + pinfo guarantees we're in UDP port range. */
7256a34efe9df75b638b9e812912ef7c5c68e208Dan McDonald/* ARGSUSED */
299625c6492013aa7bd163862f0d181854f69b3cSebastien Royudp_largest_anon_set(netstack_t *stack, cred_t *cr, mod_prop_info_t *pinfo,
7256a34efe9df75b638b9e812912ef7c5c68e208Dan McDonald const char *ifname, const void *pval, uint_t flags)
7256a34efe9df75b638b9e812912ef7c5c68e208Dan McDonald if ((err = mod_uint32_value(pval, pinfo, flags, &new_value)) != 0)
7256a34efe9df75b638b9e812912ef7c5c68e208Dan McDonald /* mod_uint32_value() + pinfo guarantees we're in UDP port range. */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * All of these are alterable, within the min/max values given, at run time.
8887b57dc579de11464fc6c74163d2595ce073afGirish Moodalbail * Note: All those tunables which do not start with "_" are Committed and
8887b57dc579de11464fc6c74163d2595ce073afGirish Moodalbail * therefore are public. See PSARC 2010/080.
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail /* tunable - 0 */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail {0, IPV6_MAX_HOPS, IPV6_DEFAULT_HOPS}, {IPV6_DEFAULT_HOPS} },
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail {1024, ULP_MAX_PORT, (32 * 1024)}, {(32 * 1024)} },
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail {1024, ULP_MAX_PORT, ULP_MAX_PORT}, {ULP_MAX_PORT} },
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roy {UDP_XMIT_LOWATER, ULP_MAX_BUF, UDP_XMIT_HIWATER},
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roy {UDP_RECV_LOWATER, ULP_MAX_BUF, UDP_RECV_HIWATER},
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail /* tunable - 10 */
299625c6492013aa7bd163862f0d181854f69b3cSebastien Roy {65536, ULP_MAX_BUF, 2*1024*1024}, {2*1024*1024} },
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail mod_set_extra_privports, mod_get_extra_privports,
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail { "?", MOD_PROTO_UDP, NULL, mod_get_allprop, {0}, {0} },