sctp_param.c revision f4b3ec61df05330d25f55a36b975b4d7519fdeb1
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <inet/ipclassifier.h>
#include "sctp_impl.h"
#include "sctp_addr.h"
#define MS 1L
/* Max size IP datagram is 64k - 1 */
sizeof (sctp_hdr_t)))
sizeof (sctp_hdr_t)))
/* Max of the above */
#define SCTP_MSS_MAX SCTP_MSS_MAX_IPV4
/* Largest SCTP port number */
/*
* Extra privileged ports. In host byte order.
* Protected by sctp_epriv_port_lock.
*/
#define SCTP_NUM_EPRIV_PORTS 64
/*
* layer header. It has to be a multiple of 4.
* Also there has to be enough space to stash in information passed between
* IP and SCTP.
*/
256, 32, "sctp_wroff_xtra" };
/*
* Note that the default value of "sctp_time_wait_interval" is four minutes,
* per the SCTP spec.
*/
/* BEGIN CSTYLED */
/*min max value name */
{ 0, 128, 8, "sctp_max_init_retr"},
{ 1, 128, 10, "sctp_pa_max_retr"},
{ 1, 128, 5, "sctp_pp_max_retr" },
{ 128, (1<<30), 1024*1024, "sctp_cwnd_max" },
{ 0, 10, 0, "sctp_debug" },
{ 1024, (32*1024), 1024, "sctp_smallest_nonpriv_port"},
{ 1, 255, 64, "sctp_ipv4_ttl"},
{ 68, 65535, 1500, "sctp_initial_mtu" },
{ 0, 16, 0, "sctp_snd_lowat_fraction" },
{ 0, 1, 0, "sctp_ignore_path_mtu" },
{ 8192, (1<<30), 1024*1024, "sctp_max_buf"},
{ 0, 65536, 20, "sctp_rtt_updates"},
{ 2, 8, 4, "sctp_maxburst" },
{ 0, 1, 0, "sctp_addip_enabled" },
{ 1, 65536, 4, "sctp_recv_hiwat_minmss" },
{ 1, 16, 4, "sctp_slow_start_initial"},
{ 1, 16384, 4, "sctp_slow_start_after_idle"},
{ 0, 1, 1, "sctp_prsctp_enabled"},
{ 1, 10000, 3, "sctp_fast_rxt_thresh"},
{ 1, 16, 2, "sctp_deferred_acks_max"},
};
/* END CSTYLED */
/* Get callback routine passed to nd_load by sctp_param_register */
/* ARGSUSED */
static int
{
return (0);
}
/* Set callback routine passed to nd_load by sctp_param_register */
/* ARGSUSED */
static int
{
long new_value;
return (EINVAL);
}
return (0);
}
/* ndd set routine for sctp_wroff_xtra. */
/* ARGSUSED */
static int
{
long new_value;
return (EINVAL);
}
/*
* Need to make sure new_value is a multiple of 8. If it is not,
* round it up.
*/
if (new_value & 0x7) {
}
return (0);
}
/*
* Note: No locks are held when inspecting sctp_g_*epriv_ports
* but instead the code relies on:
* - the fact that the address of the array and its size never changes
* - the atomic assignment of the elements of the array
*/
/* ARGSUSED */
static int
{
int i;
for (i = 0; i < sctps->sctps_g_num_epriv_ports; i++) {
if (sctps->sctps_g_epriv_ports[i] != 0)
sctps->sctps_g_epriv_ports[i]);
}
return (0);
}
/*
* Hold a lock while changing sctp_g_epriv_ports to prevent multiple
* threads from changing it at the same time.
*/
/* ARGSUSED */
static int
{
long new_value;
int i;
/*
* Fail the request if the new value does not lie within the
* port number limits.
*/
return (EINVAL);
}
/* Check if the value is already in the list */
for (i = 0; i < sctps->sctps_g_num_epriv_ports; i++) {
return (EEXIST);
}
}
/* Find an empty slot */
for (i = 0; i < sctps->sctps_g_num_epriv_ports; i++) {
if (sctps->sctps_g_epriv_ports[i] == 0)
break;
}
if (i == sctps->sctps_g_num_epriv_ports) {
return (EOVERFLOW);
}
/* Set the new value */
return (0);
}
/*
* Hold a lock while changing sctp_g_epriv_ports to prevent multiple
* threads from changing it at the same time.
*/
/* ARGSUSED */
static int
{
long new_value;
int i;
/*
* Fail the request if the new value does not lie within the
* port number limits.
*/
return (EINVAL);
}
/* Check that the value is already in the list */
for (i = 0; i < sctps->sctps_g_num_epriv_ports; i++) {
break;
}
if (i == sctps->sctps_g_num_epriv_ports) {
return (ESRCH);
}
/* Clear the value */
sctps->sctps_g_epriv_ports[i] = 0;
return (0);
}
/*
* Walk through the param array specified registering each element with the
* named dispatch handler.
*/
{
return (B_TRUE);
}
return (B_FALSE);
}
}
}
KM_SLEEP);
sizeof (sctpparam_t));
return (B_FALSE);
}
return (B_FALSE);
}
return (B_FALSE);
}
return (B_FALSE);
}
return (B_TRUE);
}
{
}
int
{
}
void
{
}