2 /* $Id: nfs4m_subs.h,v 1.36 2003/11/05 14:59:01 rees Exp $ */
6 * the regents of the university of michigan
9 * permission is granted to use, copy, create derivative works and redistribute
10 * this software and such derivative works for any purpose, so long as the name
11 * of the university of michigan is not used in any advertising or publicity
12 * pertaining to the use or distribution of this software without specific,
13 * written prior authorization. if the above copyright notice or any other
14 * identification of the university of michigan is included in any copy of any
15 * portion of this software, then the disclaimer below must also be included.
17 * this software is provided as is, without representation from the university
18 * of michigan as to its fitness for any purpose, and without warranty by the
19 * university of michigan of any kind, either express or implied, including
20 * without limitation the implied warranties of merchantability and fitness for
21 * a particular purpose. the regents of the university of michigan shall not be
22 * liable for any damages, including special, indirect, incidental, or
23 * consequential damages, with respect to any claim arising out of or in
24 * connection with the use of the software, even if it has been or is hereafter
25 * advised of the possibility of such damages.
28 #ifndef _NFS4CLIENT_NFSM4_SUBS_H
29 #define _NFS4CLIENT_NFSM4_SUBS_H
31 void nfsm_v4init(void);
33 void nfsm_buildf_xx(struct mbuf **mb, caddr_t *bpos, char *fmt, ...);
34 int nfsm_dissectf_xx(struct mbuf **md, caddr_t *dpos, char *fmt, ...);
36 int nfsm_v4build_compound_xx(struct nfs4_compound *, char *,
37 struct mbuf **, caddr_t *);
38 int nfsm_v4build_putfh_xx(struct nfs4_compound *, struct vnode *,
39 struct mbuf **, caddr_t *);
40 int nfsm_v4build_putfh_nv_xx(struct nfs4_compound *, struct nfs4_oparg_getfh *,
41 struct mbuf **, caddr_t *);
42 int nfsm_v4build_getattr_xx(struct nfs4_compound *, struct nfs4_oparg_getattr *,
43 struct mbuf **, caddr_t *);
44 int nfsm_v4build_finalize_xx(struct nfs4_compound *, struct mbuf **, caddr_t *);
45 int nfsm_v4build_getfh_xx(struct nfs4_compound *, struct nfs4_oparg_getfh *,
46 struct mbuf **, caddr_t *);
47 int nfsm_v4build_lookup_xx(struct nfs4_compound *, struct nfs4_oparg_lookup *,
48 struct mbuf **, caddr_t *);
49 int nfsm_v4build_setclientid_xx(struct nfs4_compound *,
50 struct nfs4_oparg_setclientid *, struct mbuf **, caddr_t *);
51 int nfsm_v4build_setclientid_confirm_xx(struct nfs4_compound *,
52 struct nfs4_oparg_setclientid *, struct mbuf **, caddr_t *);
53 int nfsm_v4build_close_xx(struct nfs4_compound *, struct nfs4_fctx *,
54 struct mbuf **, caddr_t *);
55 int nfsm_v4build_access_xx(struct nfs4_compound *, struct nfs4_oparg_access *,
56 struct mbuf **, caddr_t *);
57 int nfsm_v4build_open_xx(struct nfs4_compound *, struct nfs4_oparg_open *,
58 struct mbuf **, caddr_t *);
59 int nfsm_v4build_open_confirm_xx(struct nfs4_compound *, struct nfs4_oparg_open *,
60 struct mbuf **, caddr_t *);
61 int nfsm_v4build_read_xx(struct nfs4_compound *, struct nfs4_oparg_read *,
62 struct mbuf **, caddr_t *);
63 int nfsm_v4build_write_xx(struct nfs4_compound *, struct nfs4_oparg_write *,
64 struct mbuf **, caddr_t *);
65 int nfsm_v4build_commit_xx(struct nfs4_compound *, struct nfs4_oparg_commit *,
66 struct mbuf **, caddr_t *);
67 int nfsm_v4build_readdir_xx(struct nfs4_compound *, struct nfs4_oparg_readdir *,
68 struct mbuf **, caddr_t *);
69 int nfsm_v4build_renew_xx(struct nfs4_compound *, uint64_t,
70 struct mbuf **, caddr_t *);
71 int nfsm_v4build_setattr_xx(struct nfs4_compound *, struct vattr *,
72 struct nfs4_fctx *, struct mbuf **, caddr_t *);
73 int nfsm_v4build_create_xx(struct nfs4_compound *, struct nfs4_oparg_create *,
74 struct mbuf **, caddr_t *);
75 int nfsm_v4build_rename_xx(struct nfs4_compound *, struct nfs4_oparg_rename *,
76 struct mbuf **, caddr_t *);
77 int nfsm_v4build_link_xx(struct nfs4_compound *, struct nfs4_oparg_link *,
78 struct mbuf **, caddr_t *);
79 int nfsm_v4build_remove_xx(struct nfs4_compound *, const char *, u_int,
80 struct mbuf **, caddr_t *);
82 int nfsm_v4dissect_compound_xx(struct nfs4_compound *, struct mbuf **, caddr_t *);
83 int nfsm_v4dissect_getattr_xx(struct nfs4_compound *, struct nfs4_oparg_getattr *,
84 struct mbuf **, caddr_t *);
85 int nfsm_v4dissect_getfh_xx(struct nfs4_compound *, struct nfs4_oparg_getfh *,
86 struct mbuf **, caddr_t *);
87 int nfsm_v4dissect_setclientid_xx(struct nfs4_compound *,
88 struct nfs4_oparg_setclientid *, struct mbuf **, caddr_t *);
89 int nfsm_v4dissect_close_xx(struct nfs4_compound *, struct nfs4_fctx *,
90 struct mbuf **, caddr_t *);
91 int nfsm_v4dissect_access_xx(struct nfs4_compound *, struct nfs4_oparg_access *,
92 struct mbuf **, caddr_t *);
93 int nfsm_v4dissect_open_xx(struct nfs4_compound *, struct nfs4_oparg_open *,
94 struct mbuf **, caddr_t *);
95 int nfsm_v4dissect_open_confirm_xx(struct nfs4_compound *, struct nfs4_oparg_open *,
96 struct mbuf **, caddr_t *);
97 int nfsm_v4dissect_read_xx(struct nfs4_compound *, struct nfs4_oparg_read *,
98 struct mbuf **, caddr_t *);
99 int nfsm_v4dissect_write_xx(struct nfs4_compound *, struct nfs4_oparg_write *,
100 struct mbuf **, caddr_t *);
101 int nfsm_v4dissect_commit_xx(struct nfs4_compound *, struct nfs4_oparg_commit *,
102 struct mbuf **, caddr_t *);
103 int nfsm_v4dissect_setattr_xx(struct nfs4_compound *, struct mbuf **, caddr_t *);
104 int nfsm_v4dissect_create_xx(struct nfs4_compound *, struct nfs4_oparg_create *,
105 struct mbuf **, caddr_t *);
106 int nfsm_v4dissect_readlink_xx(struct nfs4_compound *, struct uio *,
107 struct mbuf **, caddr_t *);
109 int nfsm_v4dissect_attrs_xx(struct nfsv4_fattr *, struct mbuf **, caddr_t *);
111 int nfsm_v4build_simple_xx(struct nfs4_compound *, uint32_t,
112 struct mbuf **, caddr_t *);
113 int nfsm_v4dissect_simple_xx(struct nfs4_compound *, uint32_t,
114 uint32_t, struct mbuf **, caddr_t *);
116 #define nfsm_v4build_putrootfh_xx(cp, mb, bpos) \
117 nfsm_v4build_simple_xx((cp), NFSV4OP_PUTROOTFH, (mb), (bpos))
119 #define nfsm_v4build_lookupp_xx(cp, mb, bpos) \
120 nfsm_v4build_simple_xx((cp), NFSV4OP_LOOKUPP, (mb), (bpos))
122 #define nfsm_v4build_savefh_xx(cp, mb, bpos) \
123 nfsm_v4build_simple_xx((cp), NFSV4OP_SAVEFH, (mb), (bpos))
125 #define nfsm_v4build_readlink_xx(cp, mb, bpos) \
126 nfsm_v4build_simple_xx((cp), NFSV4OP_READLINK, (mb), (bpos))
129 #define nfsm_v4dissect_putrootfh_xx(cp, mb, bpos) \
130 nfsm_v4dissect_simple_xx((cp), NFSV4OP_PUTROOTFH, 0, (mb), (bpos))
132 #define nfsm_v4dissect_lookup_xx(cp, mb, bpos) \
133 nfsm_v4dissect_simple_xx((cp), NFSV4OP_LOOKUP, 0, (mb), (bpos))
135 #define nfsm_v4dissect_lookupp_xx(cp, mb, bpos) \
136 nfsm_v4dissect_simple_xx((cp), NFSV4OP_LOOKUPP, 0, (mb), (bpos))
138 #define nfsm_v4dissect_putfh_xx(cp, mb, bpos) \
139 nfsm_v4dissect_simple_xx((cp), NFSV4OP_PUTFH, 0, (mb), (bpos))
141 #define nfsm_v4dissect_renew_xx(cp, mb, bpos) \
142 nfsm_v4dissect_simple_xx((cp), NFSV4OP_RENEW, 0, (mb), (bpos))
144 #define nfsm_v4dissect_setclientid_confirm_xx(cp, mb, bpos) \
145 nfsm_v4dissect_simple_xx((cp), NFSV4OP_SETCLIENTID_CONFIRM, 0, (mb), (bpos))
147 #define nfsm_v4dissect_rename_xx(cp, mb, bpos) \
148 nfsm_v4dissect_simple_xx((cp), NFSV4OP_RENAME, 0, (mb), (bpos))
150 #define nfsm_v4dissect_link_xx(cp, mb, bpos) \
151 nfsm_v4dissect_simple_xx((cp), NFSV4OP_LINK, 0, (mb), (bpos))
153 #define nfsm_v4dissect_savefh_xx(cp, mb, bpos) \
154 nfsm_v4dissect_simple_xx((cp), NFSV4OP_SAVEFH, 0, (mb), (bpos))
156 #define nfsm_v4dissect_remove_xx(cp, mb, bpos) \
157 nfsm_v4dissect_simple_xx((cp), NFSV4OP_REMOVE, 0, (mb), (bpos))
159 #define nfsm_v4build_compound(cp, tag) do { \
161 t1 = nfsm_v4build_compound_xx((cp), (tag), &mb, &bpos); \
162 nfsm_bcheck(t1, mreq); \
165 #define nfsm_v4build_finalize(cp) do { \
167 t1 = nfsm_v4build_finalize_xx((cp), &mb, &bpos); \
168 nfsm_bcheck(t1, mreq); \
171 #define nfsm_v4build_putfh(cp, vp) do { \
173 t1 = nfsm_v4build_putfh_xx((cp), (vp), &mb, &bpos); \
174 nfsm_bcheck(t1, mreq); \
177 #define nfsm_v4build_putfh_nv(cp, gfh) do { \
179 t1 = nfsm_v4build_putfh_nv_xx((cp), (gfh), &mb, &bpos); \
180 nfsm_bcheck(t1, mreq); \
183 #define nfsm_v4build_putrootfh(cp) do { \
185 t1 = nfsm_v4build_putrootfh_xx((cp), &mb, &bpos); \
186 nfsm_bcheck(t1, mreq); \
189 #define nfsm_v4build_getattr(cp, ga) do { \
191 t1 = nfsm_v4build_getattr_xx((cp), (ga), &mb, &bpos); \
192 nfsm_bcheck(t1, mreq); \
195 #define nfsm_v4build_setattr(cp, vap, fcp) do { \
197 t1 = nfsm_v4build_setattr_xx((cp), (vap), (fcp), &mb, &bpos); \
198 nfsm_bcheck(t1, mreq); \
201 #define nfsm_v4build_lookup(cp, l) do { \
203 t1 = nfsm_v4build_lookup_xx((cp), (l), &mb, &bpos); \
204 nfsm_bcheck(t1, mreq); \
207 #define nfsm_v4build_lookupp(cp) do { \
209 t1 = nfsm_v4build_lookupp_xx((cp), &mb, &bpos); \
210 nfsm_bcheck(t1, mreq); \
213 #define nfsm_v4build_getfh(cp, gfh) do { \
215 t1 = nfsm_v4build_getfh_xx((cp), (gfh), &mb, &bpos); \
216 nfsm_bcheck(t1, mreq); \
219 #define nfsm_v4build_close(cp, fcp) do { \
221 t1 = nfsm_v4build_close_xx((cp), (fcp), &mb, &bpos); \
222 nfsm_bcheck(t1, mreq); \
225 #define nfsm_v4build_access(cp, acc) do { \
227 t1 = nfsm_v4build_access_xx((cp), (acc), &mb, &bpos); \
228 nfsm_bcheck(t1, mreq); \
231 #define nfsm_v4build_open(cp, o) do { \
233 t1 = nfsm_v4build_open_xx((cp), (o), &mb, &bpos); \
234 nfsm_bcheck(t1, mreq); \
237 #define nfsm_v4build_open_confirm(cp, o) do { \
239 t1 = nfsm_v4build_open_confirm_xx((cp), (o), &mb, &bpos); \
240 nfsm_bcheck(t1, mreq); \
243 #define nfsm_v4build_read(cp, r) do { \
245 t1 = nfsm_v4build_read_xx((cp), (r), &mb, &bpos); \
246 nfsm_bcheck(t1, mreq); \
249 #define nfsm_v4build_write(cp, w) do { \
251 t1 = nfsm_v4build_write_xx((cp), (w), &mb, &bpos); \
252 nfsm_bcheck(t1, mreq); \
255 #define nfsm_v4build_commit(cp, c) do { \
257 t1 = nfsm_v4build_commit_xx((cp), (c), &mb, &bpos); \
258 nfsm_bcheck(t1, mreq); \
261 #define nfsm_v4build_readdir(cp, r) do { \
263 t1 = nfsm_v4build_readdir_xx((cp), (r), &mb, &bpos); \
264 nfsm_bcheck(t1, mreq); \
267 #define nfsm_v4build_renew(cp, cid) do { \
269 t1 = nfsm_v4build_renew_xx((cp), (cid), &mb, &bpos); \
270 nfsm_bcheck(t1, mreq); \
273 #define nfsm_v4build_setclientid(cp, cid) do { \
275 t1 = nfsm_v4build_setclientid_xx((cp), (cid), &mb, &bpos); \
276 nfsm_bcheck(t1, mreq); \
279 #define nfsm_v4build_setclientid_confirm(cp, cid) do { \
281 t1 = nfsm_v4build_setclientid_confirm_xx((cp), (cid), &mb, &bpos); \
282 nfsm_bcheck(t1, mreq); \
285 #define nfsm_v4build_create(cp, c) do { \
287 t1 = nfsm_v4build_create_xx((cp), (c), &mb, &bpos); \
288 nfsm_bcheck(t1, mreq); \
291 #define nfsm_v4build_rename(cp, r) do { \
293 t1 = nfsm_v4build_rename_xx((cp), (r), &mb, &bpos); \
294 nfsm_bcheck(t1, mreq); \
297 #define nfsm_v4build_link(cp, r) do { \
299 t1 = nfsm_v4build_link_xx((cp), (r), &mb, &bpos); \
300 nfsm_bcheck(t1, mreq); \
303 #define nfsm_v4build_savefh(cp) do { \
305 t1 = nfsm_v4build_savefh_xx((cp), &mb, &bpos); \
306 nfsm_bcheck(t1, mreq); \
309 #define nfsm_v4build_readlink(cp) do { \
311 t1 = nfsm_v4build_readlink_xx((cp), &mb, &bpos); \
312 nfsm_bcheck(t1, mreq); \
315 #define nfsm_v4build_remove(cp, name, namelen) do { \
317 t1 = nfsm_v4build_remove_xx((cp), (name), (namelen), &mb, &bpos); \
318 nfsm_bcheck(t1, mreq); \
323 #define nfsm_v4dissect_compound(cp) \
326 t1 = nfsm_v4dissect_compound_xx((cp), &md, &dpos); \
327 nfsm_dcheck(t1, mrep); \
330 #define nfsm_v4dissect_putfh(cp) \
333 t1 = nfsm_v4dissect_putfh_xx((cp), &md, &dpos); \
334 nfsm_dcheck(t1, mrep); \
337 #define nfsm_v4dissect_putrootfh(cp) \
340 t1 = nfsm_v4dissect_putrootfh_xx((cp), &md, &dpos); \
341 nfsm_dcheck(t1, mrep); \
344 #define nfsm_v4dissect_getattr(cp, ga) \
347 t1 = nfsm_v4dissect_getattr_xx((cp), (ga), &md, &dpos); \
348 nfsm_dcheck(t1, mrep); \
351 #define nfsm_v4dissect_setattr(cp) \
354 t1 = nfsm_v4dissect_setattr_xx((cp), &md, &dpos); \
355 nfsm_dcheck(t1, mrep); \
358 #define nfsm_v4dissect_lookup(cp) \
361 t1 = nfsm_v4dissect_lookup_xx((cp), &md, &dpos); \
362 nfsm_dcheck(t1, mrep); \
365 #define nfsm_v4dissect_lookupp(cp) \
368 t1 = nfsm_v4dissect_lookupp_xx((cp), &md, &dpos); \
369 nfsm_dcheck(t1, mrep); \
372 #define nfsm_v4dissect_getfh(cp, gfh) \
375 t1 = nfsm_v4dissect_getfh_xx((cp), (gfh), &md, &dpos); \
376 nfsm_dcheck(t1, mrep); \
379 #define nfsm_v4dissect_setclientid(cp, sci) \
382 t1 = nfsm_v4dissect_setclientid_xx((cp), (sci), &md, &dpos); \
383 nfsm_dcheck(t1, mrep); \
386 #define nfsm_v4dissect_setclientid_confirm(cp) \
389 t1 = nfsm_v4dissect_setclientid_confirm_xx((cp), &md, &dpos); \
390 nfsm_dcheck(t1, mrep); \
393 #define nfsm_v4dissect_close(cp, fcp) \
396 t1 = nfsm_v4dissect_close_xx((cp), (fcp), &md, &dpos); \
397 nfsm_dcheck(t1, mrep); \
400 #define nfsm_v4dissect_access(cp, acc) \
403 t1 = nfsm_v4dissect_access_xx((cp), (acc), &md, &dpos); \
404 nfsm_dcheck(t1, mrep); \
407 #define nfsm_v4dissect_open(cp, openp) \
410 t1 = nfsm_v4dissect_open_xx((cp), (openp), &md, &dpos); \
411 nfsm_dcheck(t1, mrep); \
414 #define nfsm_v4dissect_open_confirm(cp, openp) \
417 t1 = nfsm_v4dissect_open_confirm_xx((cp), (openp), &md, &dpos); \
418 nfsm_dcheck(t1, mrep); \
421 #define nfsm_v4dissect_read(cp, r) \
424 t1 = nfsm_v4dissect_read_xx((cp), (r), &md, &dpos); \
425 nfsm_dcheck(t1, mrep); \
428 #define nfsm_v4dissect_write(cp, w) \
431 t1 = nfsm_v4dissect_write_xx((cp), (w), &md, &dpos); \
432 nfsm_dcheck(t1, mrep); \
435 #define nfsm_v4dissect_commit(cp, c) \
438 t1 = nfsm_v4dissect_commit_xx((cp), (c), &md, &dpos); \
439 nfsm_dcheck(t1, mrep); \
442 #define nfsm_v4dissect_attrs(fattr) \
445 t1 = nfsm_v4dissect_attrs_xx((fattr), &md, &dpos); \
446 nfsm_dcheck(t1, mrep); \
449 #define nfsm_v4dissect_renew(cp) \
452 t1 = nfsm_v4dissect_renew_xx((cp), &md, &dpos); \
453 nfsm_dcheck(t1, mrep); \
456 #define nfsm_v4dissect_create(cp, c) \
459 t1 = nfsm_v4dissect_create_xx((cp), (c), &md, &dpos); \
460 nfsm_dcheck(t1, mrep); \
463 #define nfsm_v4dissect_rename(cp) \
466 t1 = nfsm_v4dissect_rename_xx((cp), &md, &dpos); \
467 nfsm_dcheck(t1, mrep); \
470 #define nfsm_v4dissect_link(cp) \
473 t1 = nfsm_v4dissect_link_xx((cp), &md, &dpos); \
474 nfsm_dcheck(t1, mrep); \
477 #define nfsm_v4dissect_savefh(cp) \
480 t1 = nfsm_v4dissect_savefh_xx((cp), &md, &dpos); \
481 nfsm_dcheck(t1, mrep); \
484 #define nfsm_v4dissect_readlink(cp, uiop) \
487 t1 = nfsm_v4dissect_readlink_xx((cp), (uiop), &md, &dpos); \
488 nfsm_dcheck(t1, mrep); \
491 #define nfsm_v4dissect_remove(cp) \
494 t1 = nfsm_v4dissect_remove_xx((cp), &md, &dpos); \
495 nfsm_dcheck(t1, mrep); \
498 #endif /* _NFS4CLIENT_NFSM4_SUBS_H */