tunables.h revision 5dd46ab5742d7db1cbb08dec7b64fa14930c02f7
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
f1e9465bc27e0b59eff81249c9c2e3fd268727a6Sowmini Varadhan * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
f1e9465bc27e0b59eff81249c9c2e3fd268727a6Sowmini Varadhan * Copyright (c) 1990 Mentat Inc.
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * The `mod_ioc_prop_s' datastructure is used as an IOCTL argument for
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * SIOCSETPROP and SIOCGETPROP ioctls. This datastructure identifies the
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * protocol (`mpr_proto') property (`mpr_name'), which needs to be modified
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * or retrieved (`mpr_valsize' and `mpr_val'). If the property applies to an
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * interface then `mpr_ifname' contains the name of the interface.
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail /* name of the interface (ill) for which property will be applied */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail char mpr_name[MAXPROPNAMELEN]; /* property name */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail/* permission flags for properties */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define MOD_PROP_PERM_RW (MOD_PROP_PERM_READ|MOD_PROP_PERM_WRITE)
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail/* mpr_flags values */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define MOD_PROP_ACTIVE 0x01 /* current value of the property */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define MOD_PROP_DEFAULT 0x02 /* default value of the property */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define MOD_PROP_POSSIBLE 0x04 /* possible values for the property */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define MOD_PROP_PERM 0x08 /* read/write permission for property */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define MOD_PROP_APPEND 0x10 /* append to multi-valued property */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define MOD_PROP_REMOVE 0x20 /* remove from multi-valued property */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail/* mpr_proto values */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define MOD_PROTO_IPV4 0x01 /* property is applicable to IPV4 */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define MOD_PROTO_IPV6 0x02 /* property is applicable to IPV6 */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define MOD_PROTO_RAWIP 0x04 /* property is applicable to ICMP */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define MOD_PROTO_TCP 0x08 /* property is applicable to TCP */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define MOD_PROTO_UDP 0x10 /* property is applicable to UDP */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define MOD_PROTO_SCTP 0x20 /* property is applicable to SCTP */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail/* property is applicable to both IPV[4|6] */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define MOD_PROTO_IP (MOD_PROTO_IPV4|MOD_PROTO_IPV6)
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbailtypedef struct mod_prop_info_s mod_prop_info_t;
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail/* set/get property callback functions */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbailtypedef int mod_prop_setf_t(void *, cred_t *, mod_prop_info_t *,
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail const char *, const void *, uint_t);
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbailtypedef int mod_prop_getf_t(void *, mod_prop_info_t *, const char *,
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * protocol property information
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail mod_prop_setf_t *mpi_setf; /* sets the property value */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail mod_prop_getf_t *mpi_getf; /* gets the property value */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * Holds the current value of the property. Whenever applicable
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * holds the min/max value too.
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * Holds the default value of the property, that is value of
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail * the property at boot time.
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail/* shortcuts to access current/default values */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define prop_min_uval u.mpi_uval.mod_propval_umin
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define prop_max_uval u.mpi_uval.mod_propval_umax
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#define prop_cur_uval u.mpi_uval.mod_propval_ucur
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail/* Largest TCP/UDP/SCTP port number */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail/* extra privilege ports for upper layer protocols, tcp, sctp and udp */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail/* generic function to set/get global module properties */
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbailextern mod_prop_setf_t mod_set_boolean, mod_set_uint32,
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbailextern mod_prop_getf_t mod_get_boolean, mod_get_uint32,
f1e9465bc27e0b59eff81249c9c2e3fd268727a6Sowmini Varadhanextern int mod_uint32_value(const void *, mod_prop_info_t *, uint_t,
f1e9465bc27e0b59eff81249c9c2e3fd268727a6Sowmini Varadhan unsigned long *);
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#endif /* _KERNEL */
f1e9465bc27e0b59eff81249c9c2e3fd268727a6Sowmini Varadhan * End-system model definitions that include the weak/strong end-system
f1e9465bc27e0b59eff81249c9c2e3fd268727a6Sowmini Varadhan * definitions in RFC 1122, Section 3.3.4.5. IP_WEAK_ES and IP_STRONG_ES
f1e9465bc27e0b59eff81249c9c2e3fd268727a6Sowmini Varadhan * conform to the corresponding RFC 1122 definitions. The IP_SRC_PRI_ES
f1e9465bc27e0b59eff81249c9c2e3fd268727a6Sowmini Varadhan * hostmodel is similar to IP_WEAK_ES with one additional enhancement: for
f1e9465bc27e0b59eff81249c9c2e3fd268727a6Sowmini Varadhan * a packet with source S2, destination D2, the route selection algorithm
f1e9465bc27e0b59eff81249c9c2e3fd268727a6Sowmini Varadhan * will first attempt to find a route for the destination that goes out
f1e9465bc27e0b59eff81249c9c2e3fd268727a6Sowmini Varadhan * through an interface where S2 is configured and marked UP. If such
f1e9465bc27e0b59eff81249c9c2e3fd268727a6Sowmini Varadhan * a route cannot be found, then the best-matching route for D2 will be
f1e9465bc27e0b59eff81249c9c2e3fd268727a6Sowmini Varadhan * selected, ignoring any mismatches between S2 and the interface addresses
f1e9465bc27e0b59eff81249c9c2e3fd268727a6Sowmini Varadhan * on the outgoing interface implied by the route.
f1e9465bc27e0b59eff81249c9c2e3fd268727a6Sowmini Varadhantypedef enum {
6e91bba0d6c6bdabbba62cefae583715a4a58e2aGirish Moodalbail#endif /* _INET_TUNABLES_H */