1 /* NFSv4.1 client for Windows
2 * Copyright © 2012 The Regents of the University of Michigan
4 * Olga Kornievskaia <aglo@umich.edu>
5 * Casey Bodley <cbodley@umich.edu>
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.
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.
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
22 #ifndef __NFS41_DAEMON_UPCALL_H__
23 #define __NFS41_DAEMON_UPCALL_H__
25 #include "nfs41_ops.h"
26 #include "from_kernel.h"
28 #define NFSD_VERSION_MISMATCH 116
30 /* structures for upcall arguments */
31 typedef struct __mount_upcall_args
{
38 FILE_FS_ATTRIBUTE_INFORMATION FsAttrs
;
41 typedef struct __open_upcall_args
{
42 nfs41_abs_path symlink
;
43 FILE_BASIC_INFO basic_info
;
44 FILE_STANDARD_INFO std_info
;
56 PFILE_FULL_EA_INFORMATION ea
;
58 BOOLEAN symlink_embedded
;
61 typedef struct __close_upcall_args
{
68 typedef struct __readwrite_upcall_args
{
69 unsigned char *buffer
;
74 } readwrite_upcall_args
;
76 typedef struct __lock_upcall_args
{
84 typedef struct __unlock_upcall_args
{
90 typedef struct __getattr_upcall_args
{
91 FILE_BASIC_INFO basic_info
;
92 FILE_STANDARD_INFO std_info
;
93 FILE_ATTRIBUTE_TAG_INFO tag_info
;
94 FILE_INTERNAL_INFORMATION intr_info
;
95 FILE_NETWORK_OPEN_INFORMATION network_info
;
100 } getattr_upcall_args
;
102 typedef struct __setattr_upcall_args
{
105 nfs41_open_state
*state
;
110 } setattr_upcall_args
;
112 typedef struct __getexattr_upcall_args
{
117 unsigned char *ealist
;
122 } getexattr_upcall_args
;
125 typedef struct __setexattr_upcall_args
{
131 } setexattr_upcall_args
;
133 typedef struct __readdir_upcall_args
{
136 nfs41_open_state
*state
;
144 } readdir_upcall_args
;
146 typedef struct __symlink_upcall_args
{
147 nfs41_abs_path target_get
;
151 } symlink_upcall_args
;
153 typedef struct __volume_upcall_args
{
154 FS_INFORMATION_CLASS query
;
157 FILE_FS_SIZE_INFORMATION size
;
158 FILE_FS_FULL_SIZE_INFORMATION fullsize
;
159 FILE_FS_ATTRIBUTE_INFORMATION attribute
;
161 } volume_upcall_args
;
163 typedef struct __getacl_upcall_args
{
164 SECURITY_INFORMATION query
;
165 PSECURITY_DESCRIPTOR sec_desc
;
167 } getacl_upcall_args
;
169 typedef struct __setacl_upcall_args
{
170 SECURITY_INFORMATION query
;
171 PSECURITY_DESCRIPTOR sec_desc
;
173 } setacl_upcall_args
;
175 typedef union __upcall_args
{
176 mount_upcall_args mount
;
177 open_upcall_args open
;
178 close_upcall_args close
;
179 readwrite_upcall_args rw
;
180 lock_upcall_args lock
;
181 unlock_upcall_args unlock
;
182 getattr_upcall_args getattr
;
183 getexattr_upcall_args getexattr
;
184 setattr_upcall_args setattr
;
185 setexattr_upcall_args setexattr
;
186 readdir_upcall_args readdir
;
187 symlink_upcall_args symlink
;
188 volume_upcall_args volume
;
189 getacl_upcall_args getacl
;
190 setacl_upcall_args setacl
;
193 typedef struct __nfs41_upcall
{
203 /* store referenced pointers with the upcall for
204 * automatic dereferencing on upcall_cleanup();
205 * see upcall_root_ref() and upcall_open_state_ref() */
206 nfs41_root
*root_ref
;
207 nfs41_open_state
*state_ref
;
211 /* upcall operation interface */
212 typedef int (*upcall_parse_proc
)(unsigned char*, uint32_t, nfs41_upcall
*);
213 typedef int (*upcall_handle_proc
)(nfs41_upcall
*);
214 typedef int (*upcall_marshall_proc
)(unsigned char*, uint32_t*, nfs41_upcall
*);
215 typedef void (*upcall_cancel_proc
)(nfs41_upcall
*);
216 typedef void (*upcall_cleanup_proc
)(nfs41_upcall
*);
218 typedef struct __nfs41_upcall_op
{
219 upcall_parse_proc parse
;
220 upcall_handle_proc handle
;
221 upcall_marshall_proc marshall
;
222 upcall_cancel_proc cancel
;
223 upcall_cleanup_proc cleanup
;
229 IN
unsigned char *buffer
,
231 OUT nfs41_upcall
*upcall
);
234 IN nfs41_upcall
*upcall
);
236 void upcall_marshall(
237 IN nfs41_upcall
*upcall
,
238 OUT
unsigned char *buffer
,
240 OUT
uint32_t *length_out
);
243 IN nfs41_upcall
*upcall
);
246 IN nfs41_upcall
*upcall
);
248 #endif /* !__NFS41_DAEMON_UPCALL_H__ */