socksdpvnops.c revision 8793b36b40d14ad0a0fecc97738dc118a928f46c
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/vfs_opreg.h>
#include <sys/sysmacros.h>
#include <sys/socketvar.h>
#include "socksdp.h"
/*
* SDP sockfs vnode operations
*/
caller_context_t *);
struct cred *, caller_context_t *);
caller_context_t *);
caller_context_t *);
caller_context_t *);
static int socksdpv_poll(struct vnode *, short, int, short *,
struct pollhead **, caller_context_t *);
const fs_operation_def_t socksdp_vnodeops_template[] = {
};
struct vnodeops *socksdp_vnodeops;
/*ARGSUSED3*/
static int
{
struct sdp_sonode *ss;
if (flag & SO_ACCEPTOR) {
return (0);
}
/*
* Active open.
*/
/*
* When the necessary hardware is not available, the sdp_create stub
* will evaluate to nomod_zero, which leaves 'error' untouched. Hence
* the EPROTONOSUPPORT above. A successful call to sdp_create clears
* the error.
*/
return (error);
}
return (error);
}
/*ARGSUSED*/
static int
{
int sendsig = 0;
int error = 0;
struct sdp_sonode *ss;
if (count > 1) {
return (0);
}
/*
* Need to set flags as there might be ops in progress on
* this socket.
*
* If socket already disconnected/disconnecting,
* don't send signal (again).
*/
sendsig |= SDPSIG_READ;
sendsig |= SDPSIG_WRITE;
soisdisconnected(so, 0);
/*
* Initiate connection shutdown.
*/
if (sendsig != 0)
}
return (error);
}
/*ARGSUSED2*/
static int
{
return (EOPNOTSUPP);
}
lmsg.msg_namelen = 0;
lmsg.msg_controllen = 0;
}
/*
* Send data, see sosdp_sendmsg()
*/
/*ARGSUSED2*/
static int
{
int error;
int flags = 0;
return (EPIPE);
}
if (error != 0) {
return (error);
}
}
flags |= MSG_DONTWAIT;
return (ENOTCONN);
}
if (count == 0) {
return (0);
}
return (error);
}
/*ARGSUSED4*/
static int
{
struct sdp_sonode *ss;
/* handle socket specific ioctls */
switch (cmd) {
case FIONBIO:
return (EFAULT);
}
if (value != 0) {
} else {
}
return (0);
case FIOASYNC:
return (EFAULT);
}
if (value) {
/* Turn on SIGIO */
} else {
/* Turn off SIGIO */
}
return (0);
case SIOCSPGRP:
case FIOSETOWN:
return (EFAULT);
}
return (error);
case SIOCGPGRP:
case FIOGETOWN:
return (EFAULT);
return (0);
case SIOCATMARK:
intval = 0;
return (EFAULT);
return (0);
case SIOCSENABLESDP: {
/*
* System wide enable SDP
*/
return (EFAULT);
return (EFAULT);
return (0);
}
/* from strioctl */
case FIONREAD:
/*
* Return number of bytes of data in all data messages
* in queue in "arg".
* For stream socket, amount of available data.
*/
intval = 0;
} else {
}
return (EFAULT);
return (0);
default:
return (EINVAL);
}
}
/*
* Allow any flags. Record FNDELAY and FNONBLOCK so that they can be inherited
* from listener to acceptor.
*/
/* ARGSUSED */
static int
{
else
else
return (0);
}
/*ARGSUSED*/
static void
{
/*
* If no one has reclaimed the vnode, remove from the
* cache now.
*/
/*
* Drop the temporary hold by vn_rele now
*/
return;
}
/* We are the sole owner of so now */
}
sosdp_free(so);
}
/*
* Check socktpi_poll() on why so_lock is not held in this function.
*/
/*ARGSUSED5*/
static int
{
struct sdp_sonode *ss;
short origevents = events;
int so_state;
/*
* Not connected yet - turn off write side events
*/
}
/*
* Check for errors
*/
return (0);
}
*reventsp = 0;
/*
* Don't mark socket as writable until TX queued data is
* below watermark.
*/
}
} else {
*reventsp = 0;
goto done;
}
}
}
done:
}
return (0);
}