ntvfs: pass down the client capabilities into the ntvfs layer
[jelmer/samba4-debian.git] / source / ntvfs / ntvfs.h
index c346c0b9e9a0934cf224f6ecce5c7466e7575390..7a2edc7e2c2b5570bf3616b3e2120618d2d1141b 100644 (file)
@@ -6,7 +6,7 @@
    
    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
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -15,8 +15,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #ifndef _NTVFS_H_
@@ -33,9 +32,11 @@ struct ntvfs_module_context;
 struct ntvfs_request;
 
 /* each backend has to be one one of the following 3 basic types. In
- * earlier versions of Samba backends needed to handle all types, now
- * we implement them separately. */
-enum ntvfs_type {NTVFS_DISK, NTVFS_PRINT, NTVFS_IPC};
+   earlier versions of Samba backends needed to handle all types, now
+   we implement them separately.
+   The values 1..3 match the SMB2 SMB2_SHARE_TYPE_* values
+ */
+enum ntvfs_type {NTVFS_DISK=1, NTVFS_IPC=2, NTVFS_PRINT=3};
 
 /* the ntvfs operations structure - contains function pointers to 
    the backend implementations of each operation */
@@ -92,11 +93,11 @@ struct ntvfs_ops {
        NTSTATUS (*search_first)(struct ntvfs_module_context *ntvfs,
                                 struct ntvfs_request *req,
                                 union smb_search_first *io, void *private,
-                                BOOL (*callback)(void *private, const union smb_search_data *file));
+                                bool (*callback)(void *private, const union smb_search_data *file));
        NTSTATUS (*search_next)(struct ntvfs_module_context *ntvfs,
                                struct ntvfs_request *req,
                                union smb_search_next *io, void *private,
-                               BOOL (*callback)(void *private, const union smb_search_data *file));
+                               bool (*callback)(void *private, const union smb_search_data *file));
        NTSTATUS (*search_close)(struct ntvfs_module_context *ntvfs,
                                 struct ntvfs_request *req,
                                 union smb_search_close *io);
@@ -180,6 +181,14 @@ struct ntvfs_context {
 
        enum protocol_types protocol;
 
+       /*
+        * client capabilities
+        * this field doesn't use protocol specific
+        * values!
+        */
+#define NTVFS_CLIENT_CAP_LEVEL_II_OPLOCKS      0x0000000000000001LLU
+       uint64_t client_caps;
+
        /* 
         * linked list of module contexts
         */
@@ -188,6 +197,7 @@ struct ntvfs_context {
        struct share_config *config;
 
        struct server_id server_id;
+       struct loadparm_context *lp_ctx;
        struct event_context *event_ctx;
        struct messaging_context *msg_ctx;
 
@@ -255,6 +265,14 @@ struct ntvfs_request {
        /* the smb pid is needed for locking contexts */
        uint16_t smbpid;
 
+       /*
+        * client capabilities
+        * this field doesn't use protocol specific
+        * values!
+        * see NTVFS_CLIENT_CAP_*
+        */
+       uint64_t client_caps;
+
        /* some statictics for the management tools */
        struct {
                /* the system time when the request arrived */