sctp_ioc.c revision bd670b35a010421b6e1a5536c34453a827007c81
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#define _SUN_TPI_VERSION 2
#include <inet/ipclassifier.h>
#include "sctp_impl.h"
/*
* sctp_wput_ioctl is called by sctp_wput to handle all
* M_IOCTL messages.
*/
void
{
ip0dbg(("sctp_wput_ioctl: null conn\n"));
return;
}
case ND_SET:
/* sctp_nd_getset() -> nd_getset() does the checking. */
case ND_GET:
if (!sctp_nd_getset(q, mp)) {
break;
}
return;
default:
break;
}
}
/*
*/
static int sctp_str_close(queue_t *);
static struct module_info sctp_mod_info = {
};
};
};
};
static int
{
return (0);
}
/*ARGSUSED2*/
static int
{
netstack_t *ns;
/* If the stream is already open, return immediately. */
return (0);
/* If this is not a driver open, fail. */
return (EINVAL);
/*
* For exclusive stacks we set the zoneid to zero
* to make IP operate as if in the global zone.
*/
else
/*
* We are opening as a device. This is an IP client stream, and we
* allocate an conn_t as the instance data.
*/
/*
* ipcl_conn_create did a netstack_hold. Undo the hold that was
* done by netstack_find_by_cred()
*/
/* conn_allzones can not be set this early, hence no IPCL_ZONEID */
if ((ip_minor_arena_la != NULL) &&
} else {
/*
* Minor numbers in the large arena are exhausted.
* Try to allocate from the small arena.
*/
== 0) {
/* CONN_DEC_REF takes care of netstack_rele() */
return (EBUSY);
}
}
/*
* connp->conn_cred is crfree()ed in ipcl_conn_destroy()
*/
/* Cache things in ixa without an extra refhold */
if (is_system_labeled())
/*
* Make the conn globally visible to walkers
*/
qprocson(q);
return (0);
}
/*
* The SCTP write put procedure which is used only to handle ioctls.
*/
void
{
case M_IOCTL:
sctp_wput_ioctl(q, mp);
break;
case M_DATA:
/* Should be handled in sctp_output() */
ASSERT(0);
break;
case M_PROTO:
case M_PCPROTO:
/*
* There is no "standard" way on how to respond
* to T_CAPABILITY_REQ if a module does not
* understand it. And the current TI mod
* has problems handling an error ack. So we
* catch the request here and reply with a response
* which the TI mod knows how to respond to.
*/
switch (type) {
case T_CAPABILITY_REQ:
break;
default:
TNOTSUPPORT, 0)) != NULL) {
return;
}
}
}
/* FALLTHRU */
default:
return;
}
}