r884: convert samba4 to use [u]int32_t instead of [u]int32
[samba.git] / source / ntvfs / ntvfs.h
1 /* 
2    Unix SMB/CIFS implementation.
3    NTVFS structures and defines
4    Copyright (C) Andrew Tridgell                        2003
5    
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10    
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15    
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 /* modules can use the following to determine if the interface has changed */
22 #define NTVFS_INTERFACE_VERSION 1
23
24
25
26 /* the ntvfs operations structure - contains function pointers to 
27    the backend implementations of each operation */
28 struct ntvfs_ops {
29         const char *name;
30         enum ntvfs_type type;
31         
32         /* initial setup */
33         NTSTATUS (*connect)(struct request_context *req, const char *sharename);
34         NTSTATUS (*disconnect)(struct tcon_context *conn);
35
36         /* path operations */
37         NTSTATUS (*unlink)(struct request_context *req, struct smb_unlink *unl);
38         NTSTATUS (*chkpath)(struct request_context *req, struct smb_chkpath *cp);
39         NTSTATUS (*qpathinfo)(struct request_context *req, union smb_fileinfo *st);
40         NTSTATUS (*setpathinfo)(struct request_context *req, union smb_setfileinfo *st);
41         NTSTATUS (*open)(struct request_context *req, union smb_open *oi);
42         NTSTATUS (*mkdir)(struct request_context *req, union smb_mkdir *md);
43         NTSTATUS (*rmdir)(struct request_context *req, struct smb_rmdir *rd);
44         NTSTATUS (*rename)(struct request_context *req, union smb_rename *ren);
45         NTSTATUS (*copy)(struct request_context *req, struct smb_copy *cp);
46
47         /* directory search */
48         NTSTATUS (*search_first)(struct request_context *req, union smb_search_first *io, void *private,
49                                  BOOL (*callback)(void *private, union smb_search_data *file));
50         NTSTATUS (*search_next)(struct request_context *req, union smb_search_next *io, void *private,
51                                  BOOL (*callback)(void *private, union smb_search_data *file));
52         NTSTATUS (*search_close)(struct request_context *req, union smb_search_close *io);
53
54         /* operations on open files */
55         NTSTATUS (*ioctl)(struct request_context *req, union smb_ioctl *io);
56         NTSTATUS (*read)(struct request_context *req, union smb_read *io);
57         NTSTATUS (*write)(struct request_context *req, union smb_write *io);
58         NTSTATUS (*seek)(struct request_context *req, struct smb_seek *io);
59         NTSTATUS (*flush)(struct request_context *req, struct smb_flush *flush);
60         NTSTATUS (*close)(struct request_context *req, union smb_close *io);
61         NTSTATUS (*exit)(struct request_context *req);
62         NTSTATUS (*lock)(struct request_context *req, union smb_lock *lck);
63         NTSTATUS (*setfileinfo)(struct request_context *req, union smb_setfileinfo *info);
64         NTSTATUS (*qfileinfo)(struct request_context *req, union smb_fileinfo *info);
65
66         /* filesystem operations */
67         NTSTATUS (*fsinfo)(struct request_context *req, union smb_fsinfo *fs);
68
69         /* printing specific operations */
70         NTSTATUS (*lpq)(struct request_context *req, union smb_lpq *lpq);
71
72         /* trans2 interface - only used by CIFS backend to prover complete passthru for testing */
73         NTSTATUS (*trans2)(struct request_context *req, struct smb_trans2 *trans2);
74
75         /* trans interface - used by IPC backend for pipes and RAP calls */
76         NTSTATUS (*trans)(struct request_context *req, struct smb_trans2 *trans);
77 };
78
79
80 /* this structure is used by backends to determine the size of some critical types */
81 struct ntvfs_critical_sizes {
82         int interface_version;
83         int sizeof_ntvfs_ops;
84         int sizeof_SMB_OFF_T;
85         int sizeof_tcon_context;
86         int sizeof_request_context;
87 };