smbd_opipe_doorsvc.c revision 3db3f65c6274eb042354801a308c8e9bc4994553
/*
* 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <strings.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <door.h>
#include <errno.h>
#include <syslog.h>
#include <pthread.h>
#include <smbsrv/libmlrpc.h>
#include <smbsrv/mlsvc_util.h>
static int smbd_opipe_fd = -1;
/*
* Create the smbd opipe door service.
* Returns the door descriptor on success. Otherwise returns -1.
*/
int
smbd_opipe_dsrv_start(void)
{
(void) pthread_mutex_lock(&smbd_opipe_mutex);
if (smbd_opipe_fd != -1) {
(void) pthread_mutex_unlock(&smbd_opipe_mutex);
return (-1);
}
errno = 0;
smbd_opipe_fd = -1;
}
(void) pthread_mutex_unlock(&smbd_opipe_mutex);
return (smbd_opipe_fd);
}
/*
* Stop the smbd opipe door service.
*/
void
smbd_opipe_dsrv_stop(void)
{
(void) pthread_mutex_lock(&smbd_opipe_mutex);
if (smbd_opipe_fd != -1) {
(void) door_revoke(smbd_opipe_fd);
smbd_opipe_fd = -1;
}
(void) pthread_mutex_unlock(&smbd_opipe_mutex);
}
/*
* Process smbd opipe requests.
*/
/*ARGSUSED*/
static void
{
char buf[SMB_OPIPE_DOOR_BUFSIZE];
}
case SMB_OPIPE_OPEN:
hdr.oh_datalen = 0;
break;
case SMB_OPIPE_CLOSE:
hdr.oh_datalen = 0;
break;
case SMB_OPIPE_READ:
break;
case SMB_OPIPE_WRITE:
hdr.oh_datalen = 0;
break;
default:
break;
}
}