smbd_door_ops.c revision c8ec8eea9849cac239663c46be8a7f5d2ba7ca00
/*
* 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 "@(#)smbd_door_ops.c 1.6 08/07/16 SMI"
/*
* SMBd door operations
*/
#include <stdlib.h>
#include <synch.h>
#include <strings.h>
#include <smbsrv/smb_common_door.h>
#include <smbsrv/smb_token.h>
#include <smbsrv/mlsvc_util.h>
#include <smbsrv/libmlsvc.h>
#include "smbd.h"
static int smb_set_downcall_desc(int desc);
static int smb_get_downcall_desc(void);
/* SMB daemon's door operation table */
{
};
/*ARGSUSED*/
static char *
{
char *buf;
*rbufsize = 0;
return (NULL);
}
*rbufsize = 0;
return (NULL);
}
*err = SMB_DR_OP_SUCCESS;
return (buf);
}
/*ARGSUSED*/
static char *
{
char *buf;
*rbufsize = 0;
return (NULL);
}
*rbufsize = 0;
return (NULL);
}
*err = SMB_DR_OP_SUCCESS;
return (buf);
}
/*
* smb_downcall_desc
*
* This downcall descriptor will be initialized when the SMB Kmod
* makes a upcall for the SMBD_DOOR_SET_DOWNCALL_DESC.
* This descriptor should be passed as the 1st argument to the
* door_call() whenever the SMBD is making a downcall to SMB Kmod.
*/
static int smb_downcall_desc = -1;
static mutex_t smb_downcall_mutex;
/*
* Get and set the smb downcall descriptor.
*/
static int
{
(void) mutex_lock(&smb_downcall_mutex);
(void) mutex_unlock(&smb_downcall_mutex);
return (0);
}
/*
* smb_get_downcall_desc
*
* Returns the downcall descriptor.
*/
static int
smb_get_downcall_desc(void)
{
int rc;
(void) mutex_lock(&smb_downcall_mutex);
(void) mutex_unlock(&smb_downcall_mutex);
return (rc);
}
/*
* smb_dr_is_valid_opcode
*
* Validates the given door opcode.
*/
int
{
if (opcode < 0 ||
return (-1);
else
return (0);
}
/*
* Obtains an access token on successful user authentication.
*/
/*ARGSUSED*/
static char *
{
char *buf;
*rbufsize = 0;
*err = 0;
return (NULL);
}
if (!token) {
return (NULL);
}
}
return (buf);
}
/*
* smb_dop_set_dwncall_desc
*
* Set the downcall descriptor.
*/
/*ARGSUSED*/
static char *
{
*rbufsize = 0;
*err = 0;
if (n_desc != 1 ||
} else {
/* install get downcall descriptor callback */
}
*rbufsize = 0;
}
return (buf);
}
/*
* smb_dr_op_users
*
* This function will obtain information on the connected users
* starting at the given offset by making a door down-call. The
* information will then be returned to the user-space door client.
*
* At most 50 users (i.e. SMB_DR_MAX_USER) will be returned via this
* function. The user-space door client might need to make multiple
* calls to retrieve information on all connected users.
*/
/*ARGSUSED*/
char *
{
int cnt = 0;
*err = SMB_DR_OP_SUCCESS;
*rbufsize = 0;
return (NULL);
}
if (!ulist) {
return (NULL);
}
if (cnt < 0) {
return (NULL);
}
*rbufsize = 0;
}
return (rbuf);
}
/*ARGSUSED*/
static char *
{
char strsid[SMB_SID_STRSZ];
char strres[SMB_SID_STRSZ];
*err = SMB_DR_OP_SUCCESS;
*rbufsize = 0;
/* Decode */
return (NULL);
}
*strres = '\0';
if (status == NT_STATUS_SUCCESS) {
/* pack the SID and its type in a string */
}
/* Encode the result and return */
*rbufsize = 0;
}
return (rbuf);
}
/*ARGSUSED*/
static char *
{
char *strsid;
*err = SMB_DR_OP_SUCCESS;
*rbufsize = 0;
/* Decode */
return (NULL);
}
if (status != NT_STATUS_SUCCESS)
/* Encode the result and return */
*rbufsize = 0;
}
if (status == NT_STATUS_SUCCESS)
return (rbuf);
}
/*ARGSUSED*/
static char *
{
*err = SMB_DR_OP_SUCCESS;
*rbufsize = 0;
!= 0) {
return (NULL);
}
*rbufsize = 0;
}
return (rbuf);
}
/*ARGSUSED*/
static char *
{
*err = SMB_DR_OP_SUCCESS;
*rbufsize = 0;
if (ret_ntdomain_info == NULL) {
return (NULL);
}
*rbufsize = 0;
}
return (rbuf);
}