1 /* NFSv4.1 client for Windows
2  * Copyright � 2012 The Regents of the University of Michigan
3  *
4  * Olga Kornievskaia <aglo@umich.edu>
5  * Casey Bodley <cbodley@umich.edu>
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by
9  * the Free Software Foundation; either version 2.1 of the License, or (at
10  * your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * without any warranty; without even the implied warranty of merchantability
14  * or fitness for a particular purpose.  See the GNU Lesser General Public
15  * License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20  */
21 
22 #ifndef _NFS41_DRIVER_
23 #define _NFS41_DRIVER_
24 
25 #define NFS41_DEVICE_NAME L"\\Device\\nfs41_driver"
26 #define NFS41_SHADOW_DEVICE_NAME L"\\??\\nfs41_driver"
27 #define NFS41_USER_DEVICE_NAME L"\\\\.\\nfs41_driver"
28 #define NFS41_USER_DEVICE_NAME_A "\\\\.\\nfs41_driver"
29 #define NFS41_PROVIDER_NAME_A "NFS41 Network"
30 #define NFS41_PROVIDER_NAME_U L"NFS41 Network"
31 
32 #define NFS41_PIPE_NAME L"\\Device\\nfs41_pipe"
33 #define NFS41_SHADOW_PIPE_NAME L"\\??\\nfs41_pipe"
34 #define NFS41_USER_PIPE_NAME L"\\\\.\\nfs41_pipe"
35 
36 #define NFS41_SHARED_MEMORY_NAME L"\\BaseNamedObjects\\nfs41_shared_memory"
37 #define NFS41_USER_SHARED_MEMORY_NAME "Global\\nfs41_shared_memory"
38 
39 // See "Defining I/O Control Codes" in WDK docs
40 #define _RDR_CTL_CODE(code, method) \
41     CTL_CODE(FILE_DEVICE_NETWORK_REDIRECTOR, 0x800 | (code), method, FILE_ANY_ACCESS)
42 
43 #define IOCTL_NFS41_START       _RDR_CTL_CODE(0, METHOD_BUFFERED)
44 #define IOCTL_NFS41_STOP        _RDR_CTL_CODE(1, METHOD_NEITHER)
45 #define IOCTL_NFS41_GETSTATE    _RDR_CTL_CODE(3, METHOD_NEITHER)
46 #define IOCTL_NFS41_ADDCONN     _RDR_CTL_CODE(4, METHOD_BUFFERED)
47 #define IOCTL_NFS41_DELCONN     _RDR_CTL_CODE(5, METHOD_BUFFERED)
48 #define IOCTL_NFS41_READ        _RDR_CTL_CODE(6, METHOD_BUFFERED)
49 #define IOCTL_NFS41_WRITE       _RDR_CTL_CODE(7, METHOD_BUFFERED)
50 #define IOCTL_NFS41_INVALCACHE  _RDR_CTL_CODE(8, METHOD_BUFFERED)
51 
52 typedef enum _nfs41_opcodes {
53     NFS41_MOUNT,
54     NFS41_UNMOUNT,
55     NFS41_OPEN,
56     NFS41_CLOSE,
57     NFS41_READ,
58     NFS41_WRITE,
59     NFS41_LOCK,
60     NFS41_UNLOCK,
61     NFS41_DIR_QUERY,
62     NFS41_FILE_QUERY,
63     NFS41_FILE_SET,
64     NFS41_EA_GET,
65     NFS41_EA_SET,
66     NFS41_SYMLINK,
67     NFS41_VOLUME_QUERY,
68     NFS41_ACL_QUERY,
69     NFS41_ACL_SET,
70     NFS41_SHUTDOWN,
71     INVALID_OPCODE
72 } nfs41_opcodes;
73 
74 enum rpcsec_flavors {
75     RPCSEC_AUTH_SYS,
76     RPCSEC_AUTHGSS_KRB5,
77     RPCSEC_AUTHGSS_KRB5I,
78     RPCSEC_AUTHGSS_KRB5P
79 };
80 
81 typedef enum _nfs41_init_driver_state {
82    NFS41_INIT_DRIVER_STARTABLE,
83    NFS41_INIT_DRIVER_START_IN_PROGRESS,
84    NFS41_INIT_DRIVER_STARTED
85 } nfs41_init_driver_state;
86 
87 typedef enum _nfs41_start_driver_state {
88    NFS41_START_DRIVER_STARTABLE,
89    NFS41_START_DRIVER_START_IN_PROGRESS,
90    NFS41_START_DRIVER_STARTED,
91    NFS41_START_DRIVER_STOPPED
92 } nfs41_start_driver_state;
93 #endif
94