/*
* 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 2013 Nexenta Systems, Inc. All rights reserved.
*/
#include <smbsrv/smb_kproto.h>
#include <smbsrv/smb_ioctl.h>
/*
* *****************************************************************************
* ****************************** Global Variables *****************************
* *****************************************************************************
*
*/
/*
* Maximum buffer size for NT: configurable based on the client environment.
* IR104720 Experiments with Windows 2000 indicate that we achieve better
* SmbWriteX performance with a buffer size of 64KB instead of the 37KB used
* with Windows NT4.0. Previous experiments with NT4.0 resulted in directory
* listing problems so this buffer size is configurable based on the end-user
* environment. When in doubt use 37KB.
*
* smb_raw_mode: read_raw and write_raw supported (1) or NOT supported (0).
*/
int smb_sign_debug = 0;
int smb_raw_mode = 0;
#ifdef DEBUG
#else
0;
#endif
/*
* Maximum number of simultaneous authentication, share mapping, pipe open
* requests to be processed.
*/
/*
* Number of milliseconds that a request will be stalled if it comes in after
* the maximum number of inflight operations are being proccessed.
*/
int smb_threshold_debug = 0;
/*
* Thread priorities used in smbsrv. Our threads spend most of their time
* blocked on various conditions. However, if the system gets heavy load,
* the scheduler has to choose an order to run these. We want the order:
* (a) timers, (b) notifications, (c) workers, (d) receivers (and etc.)
* where notifications are oplock and change notify work. Aside from this
* relative ordering, smbsrv threads should run with a priority close to
* that of normal user-space threads (thus minclsyspri below), just like
* NFS and other "file service" kinds of processing.
*/
/*
* These are the (open,close,ioctl) entry points into this
* (fake) "driver". They are declared in smb_ioctl.h
*/
static int g_init_done = 0;
int fksmbsrv_vfs_init(void);
int
fksmbsrv_drv_open(void)
{
int rc;
if (g_init_done == 0) {
if ((rc = fksmbsrv_vfs_init()) != 0) {
return (rc);
}
if ((rc = smb_server_g_init()) != 0) {
return (rc);
}
g_init_done = 1;
}
rc = smb_server_create();
return (rc);
}
int
fksmbsrv_drv_close(void)
{
int rc;
rc = smb_server_delete();
if (g_init_done != 0) {
g_init_done = 0;
}
return (rc);
}
/*
* This is the primary entry point into this library, called by
* fksmbd (user-level debug version of smbsrv).
*/
int
{
int rc = 0;
switch (cmd) {
case SMB_IOC_CONFIG:
break;
case SMB_IOC_START:
break;
case SMB_IOC_STOP:
rc = smb_server_stop();
break;
case SMB_IOC_EVENT:
break;
case SMB_IOC_GMTOFF:
break;
case SMB_IOC_SHARE:
break;
case SMB_IOC_UNSHARE:
break;
case SMB_IOC_SHAREINFO:
break;
case SMB_IOC_NUMOPEN:
break;
case SMB_IOC_SVCENUM:
break;
case SMB_IOC_SESSION_CLOSE:
break;
case SMB_IOC_FILE_CLOSE:
break;
case SMB_IOC_SPOOLDOC:
break;
default:
break;
}
return (rc);
}
/*
* This function intentionally does nothing. It's used only to
* force libfksmbsrv to load when fksmbd starts so one can set
* breakpoints etc. without debugger "force load" tricks.
*/
void
fksmbsrv_drv_load(void)
{
}