2004-09-29 17:17:09 +04:00
/*
Unix SMB / CIFS implementation .
NTVFS interface functions
Copyright ( C ) Stefan ( metze ) Metzmacher 2004
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-10 06:07:03 +04:00
the Free Software Foundation ; either version 3 of the License , or
2004-09-29 17:17:09 +04:00
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
2007-07-10 06:07:03 +04:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2004-09-29 17:17:09 +04:00
*/
# include "includes.h"
2005-12-28 01:51:30 +03:00
# include "ntvfs/ntvfs.h"
2010-04-26 15:40:15 +04:00
# include "lib/tsocket/tsocket.h"
2004-09-29 17:17:09 +04:00
/* connect/disconnect */
2009-05-14 11:58:50 +04:00
NTSTATUS ntvfs_connect ( struct ntvfs_request * req , union smb_tcon * tcon )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > connect_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > connect_fn ( ntvfs , req , tcon ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_disconnect ( struct ntvfs_context * ntvfs_ctx )
2004-09-29 17:17:09 +04:00
{
2005-08-05 01:00:38 +04:00
struct ntvfs_module_context * ntvfs ;
2006-03-10 17:31:17 +03:00
if ( ntvfs_ctx = = NULL ) {
2005-08-05 01:00:38 +04:00
return NT_STATUS_INVALID_CONNECTION ;
}
2006-03-10 17:31:17 +03:00
ntvfs = ntvfs_ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > disconnect_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > disconnect_fn ( ntvfs ) ;
2006-03-10 17:31:17 +03:00
}
/* async setup - called by a backend that wants to setup any state for
a async request */
2009-02-02 10:29:13 +03:00
NTSTATUS ntvfs_async_setup ( struct ntvfs_request * req , void * private_data )
2006-03-10 17:31:17 +03:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > async_setup_fn ) {
2006-03-10 17:31:17 +03:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > async_setup_fn ( ntvfs , req , private_data ) ;
2006-03-10 17:31:17 +03:00
}
/* filesystem operations */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_fsinfo ( struct ntvfs_request * req , union smb_fsinfo * fs )
2006-03-10 17:31:17 +03:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > fsinfo_fn ) {
2006-03-10 17:31:17 +03:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > fsinfo_fn ( ntvfs , req , fs ) ;
2004-09-29 17:17:09 +04:00
}
/* path operations */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_unlink ( struct ntvfs_request * req , union smb_unlink * unl )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > unlink_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > unlink_fn ( ntvfs , req , unl ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_chkpath ( struct ntvfs_request * req , union smb_chkpath * cp )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > chkpath_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > chkpath_fn ( ntvfs , req , cp ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_qpathinfo ( struct ntvfs_request * req , union smb_fileinfo * st )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > qpathinfo_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > qpathinfo_fn ( ntvfs , req , st ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_setpathinfo ( struct ntvfs_request * req , union smb_setfileinfo * st )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > setpathinfo_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > setpathinfo_fn ( ntvfs , req , st ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_open ( struct ntvfs_request * req , union smb_open * oi )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > open_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > open_fn ( ntvfs , req , oi ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_mkdir ( struct ntvfs_request * req , union smb_mkdir * md )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > mkdir_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > mkdir_fn ( ntvfs , req , md ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_rmdir ( struct ntvfs_request * req , struct smb_rmdir * rd )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > rmdir_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > rmdir_fn ( ntvfs , req , rd ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_rename ( struct ntvfs_request * req , union smb_rename * ren )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > rename_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > rename_fn ( ntvfs , req , ren ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_copy ( struct ntvfs_request * req , struct smb_copy * cp )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > copy_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > copy_fn ( ntvfs , req , cp ) ;
2004-09-29 17:17:09 +04:00
}
/* directory search */
2009-02-02 10:29:13 +03:00
NTSTATUS ntvfs_search_first ( struct ntvfs_request * req , union smb_search_first * io , void * private_data ,
bool ntvfs_callback ( void * private_data , const union smb_search_data * file ) )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > search_first_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > search_first_fn ( ntvfs , req , io , private_data , ntvfs_callback ) ;
2004-09-29 17:17:09 +04:00
}
2009-02-02 10:29:13 +03:00
NTSTATUS ntvfs_search_next ( struct ntvfs_request * req , union smb_search_next * io , void * private_data ,
bool ntvfs_callback ( void * private_data , const union smb_search_data * file ) )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > search_next_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > search_next_fn ( ntvfs , req , io , private_data , ntvfs_callback ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_search_close ( struct ntvfs_request * req , union smb_search_close * io )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > search_close_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > search_close_fn ( ntvfs , req , io ) ;
2004-09-29 17:17:09 +04:00
}
/* operations on open files */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_ioctl ( struct ntvfs_request * req , union smb_ioctl * io )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > ioctl_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > ioctl_fn ( ntvfs , req , io ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_read ( struct ntvfs_request * req , union smb_read * io )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > read_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > read_fn ( ntvfs , req , io ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_write ( struct ntvfs_request * req , union smb_write * io )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > write_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > write_fn ( ntvfs , req , io ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_seek ( struct ntvfs_request * req , union smb_seek * io )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > seek_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > seek_fn ( ntvfs , req , io ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_flush ( struct ntvfs_request * req ,
2006-03-10 23:49:20 +03:00
union smb_flush * flush )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > flush_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > flush_fn ( ntvfs , req , flush ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_lock ( struct ntvfs_request * req , union smb_lock * lck )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > lock_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > lock_fn ( ntvfs , req , lck ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_qfileinfo ( struct ntvfs_request * req , union smb_fileinfo * info )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > qfileinfo_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > qfileinfo_fn ( ntvfs , req , info ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_setfileinfo ( struct ntvfs_request * req , union smb_setfileinfo * info )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > setfileinfo_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > setfileinfo_fn ( ntvfs , req , info ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_close ( struct ntvfs_request * req , union smb_close * io )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > close_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > close_fn ( ntvfs , req , io ) ;
2004-09-29 17:17:09 +04:00
}
2006-03-10 17:31:17 +03:00
/* trans interface - used by IPC backend for pipes and RAP calls */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_trans ( struct ntvfs_request * req , struct smb_trans2 * trans )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > trans_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > trans_fn ( ntvfs , req , trans ) ;
2004-09-29 17:17:09 +04:00
}
/* trans2 interface - only used by CIFS backend to prover complete passthru for testing */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_trans2 ( struct ntvfs_request * req , struct smb_trans2 * trans2 )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > trans2_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > trans2_fn ( ntvfs , req , trans2 ) ;
2004-09-29 17:17:09 +04:00
}
2006-03-10 17:31:17 +03:00
/* printing specific operations */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_lpq ( struct ntvfs_request * req , union smb_lpq * lpq )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > lpq_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > lpq_fn ( ntvfs , req , lpq ) ;
2004-09-29 17:17:09 +04:00
}
/* logoff - called when a vuid is closed */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_logoff ( struct ntvfs_request * req )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > logoff_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > logoff_fn ( ntvfs , req ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_exit ( struct ntvfs_request * req )
2004-10-18 17:27:22 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > exit_fn ) {
2004-10-18 17:27:22 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > exit_fn ( ntvfs , req ) ;
2004-10-18 17:27:22 +04:00
}
2004-11-04 14:28:38 +03:00
/*
2006-03-10 17:31:17 +03:00
change notify request
2004-11-04 14:28:38 +03:00
*/
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_notify ( struct ntvfs_request * req , union smb_notify * info )
2004-11-04 14:28:38 +03:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > notify_fn ) {
2004-11-04 14:28:38 +03:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > notify_fn ( ntvfs , req , info ) ;
2004-11-04 14:28:38 +03:00
}
2006-03-08 06:54:24 +03:00
/*
2006-03-10 17:31:17 +03:00
cancel an outstanding async request
2006-03-08 06:54:24 +03:00
*/
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_cancel ( struct ntvfs_request * req )
2006-03-08 06:54:24 +03:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > ops - > cancel_fn ) {
2006-03-08 06:54:24 +03:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > ops - > cancel_fn ( ntvfs , req ) ;
2006-03-08 06:54:24 +03:00
}
2004-09-29 17:17:09 +04:00
/* initial setup */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_connect ( struct ntvfs_module_context * ntvfs ,
2009-05-14 11:58:50 +04:00
struct ntvfs_request * req ,
union smb_tcon * tcon )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > connect_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > connect_fn ( ntvfs - > next , req , tcon ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_disconnect ( struct ntvfs_module_context * ntvfs )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > disconnect_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > disconnect_fn ( ntvfs - > next ) ;
2006-03-10 17:31:17 +03:00
}
/* async_setup - called when setting up for a async request */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_async_setup ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
2009-02-02 10:29:13 +03:00
void * private_data )
2006-03-10 17:31:17 +03:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > async_setup_fn ) {
2006-03-10 17:31:17 +03:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > async_setup_fn ( ntvfs - > next , req , private_data ) ;
2006-03-10 17:31:17 +03:00
}
/* filesystem operations */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_fsinfo ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_fsinfo * fs )
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > fsinfo_fn ) {
2006-03-10 17:31:17 +03:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > fsinfo_fn ( ntvfs - > next , req , fs ) ;
2004-09-29 17:17:09 +04:00
}
/* path operations */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_unlink ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
2006-03-10 23:49:20 +03:00
union smb_unlink * unl )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > unlink_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > unlink_fn ( ntvfs - > next , req , unl ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_chkpath ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
2006-03-10 23:49:20 +03:00
union smb_chkpath * cp )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > chkpath_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > chkpath_fn ( ntvfs - > next , req , cp ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_qpathinfo ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_fileinfo * st )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > qpathinfo_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > qpathinfo_fn ( ntvfs - > next , req , st ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_setpathinfo ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_setfileinfo * st )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > setpathinfo_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > setpathinfo_fn ( ntvfs - > next , req , st ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_mkdir ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_mkdir * md )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > mkdir_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > mkdir_fn ( ntvfs - > next , req , md ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_rmdir ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
struct smb_rmdir * rd )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > rmdir_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > rmdir_fn ( ntvfs - > next , req , rd ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_rename ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_rename * ren )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > rename_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > rename_fn ( ntvfs - > next , req , ren ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_copy ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
struct smb_copy * cp )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > copy_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > copy_fn ( ntvfs - > next , req , cp ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_open ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_open * oi )
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > open_fn ) {
2006-03-10 17:31:17 +03:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > open_fn ( ntvfs - > next , req , oi ) ;
2006-03-10 17:31:17 +03:00
}
2004-09-29 17:17:09 +04:00
/* directory search */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_search_first ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
2009-02-02 10:29:13 +03:00
union smb_search_first * io , void * private_data ,
bool ( * callback ) ( void * private_data , const union smb_search_data * file ) )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > search_first_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > search_first_fn ( ntvfs - > next , req , io , private_data , callback ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_search_next ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
2009-02-02 10:29:13 +03:00
union smb_search_next * io , void * private_data ,
bool ( * callback ) ( void * private_data , const union smb_search_data * file ) )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > search_next_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > search_next_fn ( ntvfs - > next , req , io , private_data , callback ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_search_close ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_search_close * io )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > search_close_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > search_close_fn ( ntvfs - > next , req , io ) ;
2004-09-29 17:17:09 +04:00
}
/* operations on open files */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_ioctl ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_ioctl * io )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > ioctl_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > ioctl_fn ( ntvfs - > next , req , io ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_read ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_read * io )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > read_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > read_fn ( ntvfs - > next , req , io ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_write ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_write * io )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > write_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > write_fn ( ntvfs - > next , req , io ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_seek ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
2006-03-10 23:49:20 +03:00
union smb_seek * io )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > seek_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > seek_fn ( ntvfs - > next , req , io ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_flush ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
2006-03-10 23:49:20 +03:00
union smb_flush * flush )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > flush_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > flush_fn ( ntvfs - > next , req , flush ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_lock ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_lock * lck )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > lock_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > lock_fn ( ntvfs - > next , req , lck ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_qfileinfo ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_fileinfo * info )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > qfileinfo_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > qfileinfo_fn ( ntvfs - > next , req , info ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_setfileinfo ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_setfileinfo * info )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > setfileinfo_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > setfileinfo_fn ( ntvfs - > next , req , info ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_close ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_close * io )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > close_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > close_fn ( ntvfs - > next , req , io ) ;
2004-09-29 17:17:09 +04:00
}
2006-03-10 17:31:17 +03:00
/* trans interface - used by IPC backend for pipes and RAP calls */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_trans ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
struct smb_trans2 * trans )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > trans_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > trans_fn ( ntvfs - > next , req , trans ) ;
2004-09-29 17:17:09 +04:00
}
/* trans2 interface - only used by CIFS backend to prover complete passthru for testing */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_trans2 ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
struct smb_trans2 * trans2 )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > trans2_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > trans2_fn ( ntvfs - > next , req , trans2 ) ;
2004-09-29 17:17:09 +04:00
}
2006-03-10 17:31:17 +03:00
/*
change notify request
*/
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_notify ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
2006-07-12 18:25:50 +04:00
union smb_notify * info )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > notify_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > notify_fn ( ntvfs - > next , req , info ) ;
2004-09-29 17:17:09 +04:00
}
2006-03-10 17:31:17 +03:00
/* cancel - called to cancel an outstanding async request */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_cancel ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req )
2004-09-29 17:17:09 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > cancel_fn ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > cancel_fn ( ntvfs - > next , req ) ;
2004-09-29 17:17:09 +04:00
}
2004-10-18 17:27:22 +04:00
2006-03-10 17:31:17 +03:00
/* printing specific operations */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_lpq ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_lpq * lpq )
2004-10-18 17:27:22 +04:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > lpq_fn ) {
2004-10-18 17:27:22 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > lpq_fn ( ntvfs - > next , req , lpq ) ;
2004-10-18 17:27:22 +04:00
}
2004-11-04 14:28:38 +03:00
2006-03-10 17:31:17 +03:00
/* logoff - called when a vuid is closed */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_logoff ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req )
2004-11-04 14:28:38 +03:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > logoff_fn ) {
2004-11-04 14:28:38 +03:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > logoff_fn ( ntvfs - > next , req ) ;
2004-11-04 14:28:38 +03:00
}
2006-03-08 14:13:13 +03:00
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_exit ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req )
2006-03-08 14:13:13 +03:00
{
2012-06-13 11:11:42 +04:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > exit_fn ) {
2006-03-08 14:13:13 +03:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2012-06-13 11:11:42 +04:00
return ntvfs - > next - > ops - > exit_fn ( ntvfs - > next , req ) ;
2006-03-08 14:13:13 +03:00
}
2006-03-15 20:28:46 +03:00
2010-04-26 15:40:15 +04:00
/* client connection callback */
NTSTATUS ntvfs_set_addresses ( struct ntvfs_context * ntvfs ,
const struct tsocket_address * local_address ,
const struct tsocket_address * remote_address )
{
ntvfs - > client . local_address = tsocket_address_copy ( local_address , ntvfs ) ;
NT_STATUS_HAVE_NO_MEMORY ( ntvfs - > client . local_address ) ;
ntvfs - > client . remote_address = tsocket_address_copy ( remote_address , ntvfs ) ;
NT_STATUS_HAVE_NO_MEMORY ( ntvfs - > client . remote_address ) ;
return NT_STATUS_OK ;
}
const struct tsocket_address * ntvfs_get_local_address ( struct ntvfs_module_context * ntvfs )
{
return ntvfs - > ctx - > client . local_address ;
}
const struct tsocket_address * ntvfs_get_remote_address ( struct ntvfs_module_context * ntvfs )
{
return ntvfs - > ctx - > client . remote_address ;
}
2006-03-16 21:54:19 +03:00
/* oplock helpers */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_set_oplock_handler ( struct ntvfs_context * ntvfs ,
2006-05-20 12:15:22 +04:00
NTSTATUS ( * handler ) ( void * private_data , struct ntvfs_handle * handle , uint8_t level ) ,
2006-03-15 20:28:46 +03:00
void * private_data )
{
ntvfs - > oplock . handler = handler ;
ntvfs - > oplock . private_data = private_data ;
return NT_STATUS_OK ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_send_oplock_break ( struct ntvfs_module_context * ntvfs ,
2006-05-20 12:15:22 +04:00
struct ntvfs_handle * handle , uint8_t level )
2006-03-15 20:28:46 +03:00
{
if ( ! ntvfs - > ctx - > oplock . handler ) {
return NT_STATUS_OK ;
}
2006-05-20 12:15:22 +04:00
return ntvfs - > ctx - > oplock . handler ( ntvfs - > ctx - > oplock . private_data , handle , level ) ;
2006-03-15 20:28:46 +03:00
}
2006-03-16 21:54:19 +03:00