xref: /reactos/base/services/nfsd/nfs41_compound.h (revision 8a978a17)
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_DAEMON_COMPOUND_H__
23 #define __NFS41_DAEMON_COMPOUND_H__
24 
25 #include "nfs41.h"
26 
27 
28 /* COMPOUND */
29 typedef struct __nfs_argop4 {
30     uint32_t                op;
31     void                    *arg;
32 } nfs_argop4;
33 
34 typedef struct __nfs41_compound_args {
35     uint32_t                tag_len;
36     unsigned char           tag[NFS4_OPAQUE_LIMIT];
37     uint32_t                minorversion;
38     uint32_t                argarray_count;
39     nfs_argop4              *argarray; /* <> */
40 } nfs41_compound_args;
41 
42 typedef struct __nfs_resop4 {
43     uint32_t                op;
44     void                    *res;
45 } nfs_resop4;
46 
47 typedef struct __nfs41_compound_res {
48     uint32_t                status;
49     uint32_t                tag_len;
50     unsigned char           tag[NFS4_OPAQUE_LIMIT];
51     uint32_t                resarray_count;
52     nfs_resop4              *resarray; /* <> */
53 } nfs41_compound_res;
54 
55 typedef struct __nfs41_compound {
56     nfs41_compound_args     args;
57     nfs41_compound_res      res;
58 } nfs41_compound;
59 
60 
61 int compound_error(int status);
62 
63 void compound_init(
64     nfs41_compound *compound,
65     nfs_argop4 *argops,
66     nfs_resop4 *resops,
67     const char *tag);
68 
69 void compound_add_op(
70     nfs41_compound *compound,
71     uint32_t opnum,
72     void *arg,
73     void *res);
74 
75 int compound_encode_send_decode(
76     nfs41_session *session,
77     nfs41_compound *compound,
78     bool_t try_recovery);
79 
80 #endif /* __NFS41_DAEMON_COMPOUND_H__ */
81