/*
* 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 (c) 1990 Mentat Inc.
*/
#include <inet/proto_set.h>
};
/* ARGSUSED */
int
{
/* no default value processed by protocol specific code currently */
return (-1);
}
/*
* This routine retrieves the current status of socket options.
* It returns the size of the option retrieved.
*/
int
{
switch (level) {
case SOL_SOCKET:
switch (name) {
case SO_TYPE:
*i1 = SOCK_DGRAM;
break; /* goto sizeof (int) option return */
case SO_SNDBUF:
break; /* goto sizeof (int) option return */
case SO_RCVBUF:
break; /* goto sizeof (int) option return */
default:
return (-1);
}
break;
default:
return (-1);
}
return (sizeof (int));
}
/* This routine sets socket options. */
/* ARGSUSED */
int
{
switch (optset_context) {
case SETFN_OPTCOM_CHECKONLY:
/*
* Note: Implies T_CHECK semantics for T_OPTCOM_REQ
* inlen != 0 implies value supplied and
* we have to "pretend" to set it.
* inlen == 0 implies that there is no
* value part in T_CHECK request and just validation
* done elsewhere should be enough, we just return here.
*/
if (inlen == 0) {
*outlenp = 0;
return (0);
}
break;
case SETFN_OPTCOM_NEGOTIATE:
break;
default:
/*
* We should never get here
*/
*outlenp = 0;
return (EINVAL);
}
/*
* For fixed length options, no sanity check
* of passed in length is done. It is assumed *_optcom_req()
* routines do the right thing.
*/
switch (level) {
case SOL_SOCKET:
switch (name) {
case SO_SNDBUF:
if (*i1 > rds_max_buf) {
*outlenp = 0;
return (ENOBUFS);
}
if (!checkonly) {
}
break;
case SO_RCVBUF:
if (*i1 > rds_max_buf) {
*outlenp = 0;
return (ENOBUFS);
}
if (!checkonly) {
}
break;
default:
*outlenp = 0;
return (EINVAL);
}
break;
default:
*outlenp = 0;
return (EINVAL);
}
/*
* Common case of OK return with outval same as inval.
*/
}
return (0);
}
};
/*
* Initialize option database object for RDS
*
* This object represents database of options to search passed to
* {sock,tpi}optcom_req() interface routine to take care of option
* management and associated methods.
*/
rds_opt_default, /* RDS default value function pointer */
rds_opt_get, /* RDS get function pointer */
rds_opt_set, /* RDS set function pointer */
RDS_OPT_ARR_CNT, /* RDS option database count of entries */
rds_opt_arr, /* RDS option database */
RDS_VALID_LEVELS_CNT, /* RDS valid level count of entries */
rds_valid_levels_arr /* RDS valid level array */
};