1 | /* |
---|
2 | * Please do not edit this file. |
---|
3 | * It was generated using rpcgen. |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _NFS_PROT_H_RPCGEN |
---|
7 | #define _NFS_PROT_H_RPCGEN |
---|
8 | |
---|
9 | #include <rpc/rpc.h> |
---|
10 | |
---|
11 | |
---|
12 | #ifdef __cplusplus |
---|
13 | extern "C" { |
---|
14 | #endif |
---|
15 | |
---|
16 | #define NFS_PORT 2049 |
---|
17 | #define NFS_MAXDATA 8192 |
---|
18 | #define NFS_MAXPATHLEN 1024 |
---|
19 | #define NFS_MAXNAMLEN 255 |
---|
20 | #define NFS_FHSIZE 32 |
---|
21 | #define NFS_COOKIESIZE 4 |
---|
22 | #define NFS_FIFO_DEV -1 |
---|
23 | #define NFSMODE_FMT 0170000 |
---|
24 | #define NFSMODE_DIR 0040000 |
---|
25 | #define NFSMODE_CHR 0020000 |
---|
26 | #define NFSMODE_BLK 0060000 |
---|
27 | #define NFSMODE_REG 0100000 |
---|
28 | #define NFSMODE_LNK 0120000 |
---|
29 | #define NFSMODE_SOCK 0140000 |
---|
30 | #define NFSMODE_FIFO 0010000 |
---|
31 | |
---|
32 | enum nfsstat { |
---|
33 | NFS_OK = 0, |
---|
34 | NFSERR_PERM = 1, |
---|
35 | NFSERR_NOENT = 2, |
---|
36 | NFSERR_IO = 5, |
---|
37 | NFSERR_NXIO = 6, |
---|
38 | NFSERR_ACCES = 13, |
---|
39 | NFSERR_EXIST = 17, |
---|
40 | NFSERR_NODEV = 19, |
---|
41 | NFSERR_NOTDIR = 20, |
---|
42 | NFSERR_ISDIR = 21, |
---|
43 | NFSERR_FBIG = 27, |
---|
44 | NFSERR_NOSPC = 28, |
---|
45 | NFSERR_ROFS = 30, |
---|
46 | NFSERR_NAMETOOLONG = 63, |
---|
47 | NFSERR_NOTEMPTY = 66, |
---|
48 | NFSERR_DQUOT = 69, |
---|
49 | NFSERR_STALE = 70, |
---|
50 | NFSERR_WFLUSH = 99, |
---|
51 | }; |
---|
52 | typedef enum nfsstat nfsstat; |
---|
53 | |
---|
54 | enum ftype { |
---|
55 | NFNON = 0, |
---|
56 | NFREG = 1, |
---|
57 | NFDIR = 2, |
---|
58 | NFBLK = 3, |
---|
59 | NFCHR = 4, |
---|
60 | NFLNK = 5, |
---|
61 | NFSOCK = 6, |
---|
62 | NFBAD = 7, |
---|
63 | NFFIFO = 8, |
---|
64 | }; |
---|
65 | typedef enum ftype ftype; |
---|
66 | |
---|
67 | struct nfs_fh { |
---|
68 | char data[NFS_FHSIZE]; |
---|
69 | }; |
---|
70 | typedef struct nfs_fh nfs_fh; |
---|
71 | |
---|
72 | struct nfstime { |
---|
73 | u_int seconds; |
---|
74 | u_int useconds; |
---|
75 | }; |
---|
76 | typedef struct nfstime nfstime; |
---|
77 | |
---|
78 | struct fattr { |
---|
79 | ftype type; |
---|
80 | u_int mode; |
---|
81 | u_int nlink; |
---|
82 | u_int uid; |
---|
83 | u_int gid; |
---|
84 | u_int size; |
---|
85 | u_int blocksize; |
---|
86 | u_int rdev; |
---|
87 | u_int blocks; |
---|
88 | u_int fsid; |
---|
89 | u_int fileid; |
---|
90 | nfstime atime; |
---|
91 | nfstime mtime; |
---|
92 | nfstime ctime; |
---|
93 | }; |
---|
94 | typedef struct fattr fattr; |
---|
95 | |
---|
96 | struct sattr { |
---|
97 | u_int mode; |
---|
98 | u_int uid; |
---|
99 | u_int gid; |
---|
100 | u_int size; |
---|
101 | nfstime atime; |
---|
102 | nfstime mtime; |
---|
103 | }; |
---|
104 | typedef struct sattr sattr; |
---|
105 | |
---|
106 | typedef char *filename; |
---|
107 | |
---|
108 | typedef char *nfspath; |
---|
109 | |
---|
110 | struct attrstat { |
---|
111 | nfsstat status; |
---|
112 | union { |
---|
113 | fattr attributes; |
---|
114 | } attrstat_u; |
---|
115 | }; |
---|
116 | typedef struct attrstat attrstat; |
---|
117 | |
---|
118 | struct sattrargs { |
---|
119 | nfs_fh file; |
---|
120 | sattr attributes; |
---|
121 | }; |
---|
122 | typedef struct sattrargs sattrargs; |
---|
123 | |
---|
124 | struct diropargs { |
---|
125 | nfs_fh dir; |
---|
126 | filename name; |
---|
127 | }; |
---|
128 | typedef struct diropargs diropargs; |
---|
129 | |
---|
130 | struct diropokres { |
---|
131 | nfs_fh file; |
---|
132 | fattr attributes; |
---|
133 | }; |
---|
134 | typedef struct diropokres diropokres; |
---|
135 | |
---|
136 | struct diropres { |
---|
137 | nfsstat status; |
---|
138 | union { |
---|
139 | diropokres diropres; |
---|
140 | } diropres_u; |
---|
141 | }; |
---|
142 | typedef struct diropres diropres; |
---|
143 | |
---|
144 | struct readlinkres { |
---|
145 | nfsstat status; |
---|
146 | union { |
---|
147 | nfspath data; |
---|
148 | } readlinkres_u; |
---|
149 | }; |
---|
150 | typedef struct readlinkres readlinkres; |
---|
151 | |
---|
152 | struct readargs { |
---|
153 | nfs_fh file; |
---|
154 | u_int offset; |
---|
155 | u_int count; |
---|
156 | u_int totalcount; |
---|
157 | }; |
---|
158 | typedef struct readargs readargs; |
---|
159 | |
---|
160 | struct readokres { |
---|
161 | fattr attributes; |
---|
162 | struct { |
---|
163 | u_int data_len; |
---|
164 | char *data_val; |
---|
165 | } data; |
---|
166 | }; |
---|
167 | typedef struct readokres readokres; |
---|
168 | |
---|
169 | struct readres { |
---|
170 | nfsstat status; |
---|
171 | union { |
---|
172 | readokres reply; |
---|
173 | } readres_u; |
---|
174 | }; |
---|
175 | typedef struct readres readres; |
---|
176 | |
---|
177 | struct writeargs { |
---|
178 | nfs_fh file; |
---|
179 | u_int beginoffset; |
---|
180 | u_int offset; |
---|
181 | u_int totalcount; |
---|
182 | struct { |
---|
183 | u_int data_len; |
---|
184 | char *data_val; |
---|
185 | } data; |
---|
186 | }; |
---|
187 | typedef struct writeargs writeargs; |
---|
188 | |
---|
189 | struct createargs { |
---|
190 | diropargs where; |
---|
191 | sattr attributes; |
---|
192 | }; |
---|
193 | typedef struct createargs createargs; |
---|
194 | |
---|
195 | struct renameargs { |
---|
196 | diropargs from; |
---|
197 | diropargs to; |
---|
198 | }; |
---|
199 | typedef struct renameargs renameargs; |
---|
200 | |
---|
201 | struct linkargs { |
---|
202 | nfs_fh from; |
---|
203 | diropargs to; |
---|
204 | }; |
---|
205 | typedef struct linkargs linkargs; |
---|
206 | |
---|
207 | struct symlinkargs { |
---|
208 | diropargs from; |
---|
209 | nfspath to; |
---|
210 | sattr attributes; |
---|
211 | }; |
---|
212 | typedef struct symlinkargs symlinkargs; |
---|
213 | |
---|
214 | struct nfscookie { |
---|
215 | char data[NFS_COOKIESIZE]; |
---|
216 | }; |
---|
217 | typedef struct nfscookie nfscookie; |
---|
218 | |
---|
219 | struct readdirargs { |
---|
220 | nfs_fh dir; |
---|
221 | nfscookie cookie; |
---|
222 | u_int count; |
---|
223 | }; |
---|
224 | typedef struct readdirargs readdirargs; |
---|
225 | |
---|
226 | struct entry { |
---|
227 | u_int fileid; |
---|
228 | filename name; |
---|
229 | nfscookie cookie; |
---|
230 | struct entry *nextentry; |
---|
231 | }; |
---|
232 | typedef struct entry entry; |
---|
233 | |
---|
234 | struct dirlist { |
---|
235 | entry *entries; |
---|
236 | bool_t eof; |
---|
237 | }; |
---|
238 | typedef struct dirlist dirlist; |
---|
239 | |
---|
240 | struct readdirres { |
---|
241 | nfsstat status; |
---|
242 | union { |
---|
243 | dirlist reply; |
---|
244 | } readdirres_u; |
---|
245 | }; |
---|
246 | typedef struct readdirres readdirres; |
---|
247 | |
---|
248 | struct statfsokres { |
---|
249 | u_int tsize; |
---|
250 | u_int bsize; |
---|
251 | u_int blocks; |
---|
252 | u_int bfree; |
---|
253 | u_int bavail; |
---|
254 | }; |
---|
255 | typedef struct statfsokres statfsokres; |
---|
256 | |
---|
257 | struct statfsres { |
---|
258 | nfsstat status; |
---|
259 | union { |
---|
260 | statfsokres reply; |
---|
261 | } statfsres_u; |
---|
262 | }; |
---|
263 | typedef struct statfsres statfsres; |
---|
264 | |
---|
265 | #define NFS_PROGRAM 100003 |
---|
266 | #define NFS_VERSION 2 |
---|
267 | |
---|
268 | #if defined(__STDC__) || defined(__cplusplus) |
---|
269 | #define NFSPROC_NULL 0 |
---|
270 | extern void * nfsproc_null_2(void *, CLIENT *); |
---|
271 | extern void * nfsproc_null_2_svc(void *, struct svc_req *); |
---|
272 | #define NFSPROC_GETATTR 1 |
---|
273 | extern attrstat * nfsproc_getattr_2(nfs_fh *, CLIENT *); |
---|
274 | extern attrstat * nfsproc_getattr_2_svc(nfs_fh *, struct svc_req *); |
---|
275 | #define NFSPROC_SETATTR 2 |
---|
276 | extern attrstat * nfsproc_setattr_2(sattrargs *, CLIENT *); |
---|
277 | extern attrstat * nfsproc_setattr_2_svc(sattrargs *, struct svc_req *); |
---|
278 | #define NFSPROC_ROOT 3 |
---|
279 | extern void * nfsproc_root_2(void *, CLIENT *); |
---|
280 | extern void * nfsproc_root_2_svc(void *, struct svc_req *); |
---|
281 | #define NFSPROC_LOOKUP 4 |
---|
282 | extern diropres * nfsproc_lookup_2(diropargs *, CLIENT *); |
---|
283 | extern diropres * nfsproc_lookup_2_svc(diropargs *, struct svc_req *); |
---|
284 | #define NFSPROC_READLINK 5 |
---|
285 | extern readlinkres * nfsproc_readlink_2(nfs_fh *, CLIENT *); |
---|
286 | extern readlinkres * nfsproc_readlink_2_svc(nfs_fh *, struct svc_req *); |
---|
287 | #define NFSPROC_READ 6 |
---|
288 | extern readres * nfsproc_read_2(readargs *, CLIENT *); |
---|
289 | extern readres * nfsproc_read_2_svc(readargs *, struct svc_req *); |
---|
290 | #define NFSPROC_WRITECACHE 7 |
---|
291 | extern void * nfsproc_writecache_2(void *, CLIENT *); |
---|
292 | extern void * nfsproc_writecache_2_svc(void *, struct svc_req *); |
---|
293 | #define NFSPROC_WRITE 8 |
---|
294 | extern attrstat * nfsproc_write_2(writeargs *, CLIENT *); |
---|
295 | extern attrstat * nfsproc_write_2_svc(writeargs *, struct svc_req *); |
---|
296 | #define NFSPROC_CREATE 9 |
---|
297 | extern diropres * nfsproc_create_2(createargs *, CLIENT *); |
---|
298 | extern diropres * nfsproc_create_2_svc(createargs *, struct svc_req *); |
---|
299 | #define NFSPROC_REMOVE 10 |
---|
300 | extern nfsstat * nfsproc_remove_2(diropargs *, CLIENT *); |
---|
301 | extern nfsstat * nfsproc_remove_2_svc(diropargs *, struct svc_req *); |
---|
302 | #define NFSPROC_RENAME 11 |
---|
303 | extern nfsstat * nfsproc_rename_2(renameargs *, CLIENT *); |
---|
304 | extern nfsstat * nfsproc_rename_2_svc(renameargs *, struct svc_req *); |
---|
305 | #define NFSPROC_LINK 12 |
---|
306 | extern nfsstat * nfsproc_link_2(linkargs *, CLIENT *); |
---|
307 | extern nfsstat * nfsproc_link_2_svc(linkargs *, struct svc_req *); |
---|
308 | #define NFSPROC_SYMLINK 13 |
---|
309 | extern nfsstat * nfsproc_symlink_2(symlinkargs *, CLIENT *); |
---|
310 | extern nfsstat * nfsproc_symlink_2_svc(symlinkargs *, struct svc_req *); |
---|
311 | #define NFSPROC_MKDIR 14 |
---|
312 | extern diropres * nfsproc_mkdir_2(createargs *, CLIENT *); |
---|
313 | extern diropres * nfsproc_mkdir_2_svc(createargs *, struct svc_req *); |
---|
314 | #define NFSPROC_RMDIR 15 |
---|
315 | extern nfsstat * nfsproc_rmdir_2(diropargs *, CLIENT *); |
---|
316 | extern nfsstat * nfsproc_rmdir_2_svc(diropargs *, struct svc_req *); |
---|
317 | #define NFSPROC_READDIR 16 |
---|
318 | extern readdirres * nfsproc_readdir_2(readdirargs *, CLIENT *); |
---|
319 | extern readdirres * nfsproc_readdir_2_svc(readdirargs *, struct svc_req *); |
---|
320 | #define NFSPROC_STATFS 17 |
---|
321 | extern statfsres * nfsproc_statfs_2(nfs_fh *, CLIENT *); |
---|
322 | extern statfsres * nfsproc_statfs_2_svc(nfs_fh *, struct svc_req *); |
---|
323 | extern int nfs_program_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t); |
---|
324 | |
---|
325 | #else /* K&R C */ |
---|
326 | #define NFSPROC_NULL 0 |
---|
327 | extern void * nfsproc_null_2(); |
---|
328 | extern void * nfsproc_null_2_svc(); |
---|
329 | #define NFSPROC_GETATTR 1 |
---|
330 | extern attrstat * nfsproc_getattr_2(); |
---|
331 | extern attrstat * nfsproc_getattr_2_svc(); |
---|
332 | #define NFSPROC_SETATTR 2 |
---|
333 | extern attrstat * nfsproc_setattr_2(); |
---|
334 | extern attrstat * nfsproc_setattr_2_svc(); |
---|
335 | #define NFSPROC_ROOT 3 |
---|
336 | extern void * nfsproc_root_2(); |
---|
337 | extern void * nfsproc_root_2_svc(); |
---|
338 | #define NFSPROC_LOOKUP 4 |
---|
339 | extern diropres * nfsproc_lookup_2(); |
---|
340 | extern diropres * nfsproc_lookup_2_svc(); |
---|
341 | #define NFSPROC_READLINK 5 |
---|
342 | extern readlinkres * nfsproc_readlink_2(); |
---|
343 | extern readlinkres * nfsproc_readlink_2_svc(); |
---|
344 | #define NFSPROC_READ 6 |
---|
345 | extern readres * nfsproc_read_2(); |
---|
346 | extern readres * nfsproc_read_2_svc(); |
---|
347 | #define NFSPROC_WRITECACHE 7 |
---|
348 | extern void * nfsproc_writecache_2(); |
---|
349 | extern void * nfsproc_writecache_2_svc(); |
---|
350 | #define NFSPROC_WRITE 8 |
---|
351 | extern attrstat * nfsproc_write_2(); |
---|
352 | extern attrstat * nfsproc_write_2_svc(); |
---|
353 | #define NFSPROC_CREATE 9 |
---|
354 | extern diropres * nfsproc_create_2(); |
---|
355 | extern diropres * nfsproc_create_2_svc(); |
---|
356 | #define NFSPROC_REMOVE 10 |
---|
357 | extern nfsstat * nfsproc_remove_2(); |
---|
358 | extern nfsstat * nfsproc_remove_2_svc(); |
---|
359 | #define NFSPROC_RENAME 11 |
---|
360 | extern nfsstat * nfsproc_rename_2(); |
---|
361 | extern nfsstat * nfsproc_rename_2_svc(); |
---|
362 | #define NFSPROC_LINK 12 |
---|
363 | extern nfsstat * nfsproc_link_2(); |
---|
364 | extern nfsstat * nfsproc_link_2_svc(); |
---|
365 | #define NFSPROC_SYMLINK 13 |
---|
366 | extern nfsstat * nfsproc_symlink_2(); |
---|
367 | extern nfsstat * nfsproc_symlink_2_svc(); |
---|
368 | #define NFSPROC_MKDIR 14 |
---|
369 | extern diropres * nfsproc_mkdir_2(); |
---|
370 | extern diropres * nfsproc_mkdir_2_svc(); |
---|
371 | #define NFSPROC_RMDIR 15 |
---|
372 | extern nfsstat * nfsproc_rmdir_2(); |
---|
373 | extern nfsstat * nfsproc_rmdir_2_svc(); |
---|
374 | #define NFSPROC_READDIR 16 |
---|
375 | extern readdirres * nfsproc_readdir_2(); |
---|
376 | extern readdirres * nfsproc_readdir_2_svc(); |
---|
377 | #define NFSPROC_STATFS 17 |
---|
378 | extern statfsres * nfsproc_statfs_2(); |
---|
379 | extern statfsres * nfsproc_statfs_2_svc(); |
---|
380 | extern int nfs_program_2_freeresult (); |
---|
381 | #endif /* K&R C */ |
---|
382 | |
---|
383 | /* the xdr functions */ |
---|
384 | |
---|
385 | #if defined(__STDC__) || defined(__cplusplus) |
---|
386 | extern bool_t xdr_nfsstat (XDR *, nfsstat*); |
---|
387 | extern bool_t xdr_ftype (XDR *, ftype*); |
---|
388 | extern bool_t xdr_nfs_fh (XDR *, nfs_fh*); |
---|
389 | extern bool_t xdr_nfstime (XDR *, nfstime*); |
---|
390 | extern bool_t xdr_fattr (XDR *, fattr*); |
---|
391 | extern bool_t xdr_sattr (XDR *, sattr*); |
---|
392 | extern bool_t xdr_filename (XDR *, filename*); |
---|
393 | extern bool_t xdr_nfspath (XDR *, nfspath*); |
---|
394 | extern bool_t xdr_attrstat (XDR *, attrstat*); |
---|
395 | extern bool_t xdr_sattrargs (XDR *, sattrargs*); |
---|
396 | extern bool_t xdr_diropargs (XDR *, diropargs*); |
---|
397 | extern bool_t xdr_diropokres (XDR *, diropokres*); |
---|
398 | extern bool_t xdr_diropres (XDR *, diropres*); |
---|
399 | extern bool_t xdr_readlinkres (XDR *, readlinkres*); |
---|
400 | extern bool_t xdr_readargs (XDR *, readargs*); |
---|
401 | extern bool_t xdr_readokres (XDR *, readokres*); |
---|
402 | extern bool_t xdr_readres (XDR *, readres*); |
---|
403 | extern bool_t xdr_writeargs (XDR *, writeargs*); |
---|
404 | extern bool_t xdr_createargs (XDR *, createargs*); |
---|
405 | extern bool_t xdr_renameargs (XDR *, renameargs*); |
---|
406 | extern bool_t xdr_linkargs (XDR *, linkargs*); |
---|
407 | extern bool_t xdr_symlinkargs (XDR *, symlinkargs*); |
---|
408 | extern bool_t xdr_nfscookie (XDR *, nfscookie*); |
---|
409 | extern bool_t xdr_readdirargs (XDR *, readdirargs*); |
---|
410 | extern bool_t xdr_entry (XDR *, entry*); |
---|
411 | extern bool_t xdr_dirlist (XDR *, dirlist*); |
---|
412 | extern bool_t xdr_readdirres (XDR *, readdirres*); |
---|
413 | extern bool_t xdr_statfsokres (XDR *, statfsokres*); |
---|
414 | extern bool_t xdr_statfsres (XDR *, statfsres*); |
---|
415 | |
---|
416 | #else /* K&R C */ |
---|
417 | extern bool_t xdr_nfsstat (); |
---|
418 | extern bool_t xdr_ftype (); |
---|
419 | extern bool_t xdr_nfs_fh (); |
---|
420 | extern bool_t xdr_nfstime (); |
---|
421 | extern bool_t xdr_fattr (); |
---|
422 | extern bool_t xdr_sattr (); |
---|
423 | extern bool_t xdr_filename (); |
---|
424 | extern bool_t xdr_nfspath (); |
---|
425 | extern bool_t xdr_attrstat (); |
---|
426 | extern bool_t xdr_sattrargs (); |
---|
427 | extern bool_t xdr_diropargs (); |
---|
428 | extern bool_t xdr_diropokres (); |
---|
429 | extern bool_t xdr_diropres (); |
---|
430 | extern bool_t xdr_readlinkres (); |
---|
431 | extern bool_t xdr_readargs (); |
---|
432 | extern bool_t xdr_readokres (); |
---|
433 | extern bool_t xdr_readres (); |
---|
434 | extern bool_t xdr_writeargs (); |
---|
435 | extern bool_t xdr_createargs (); |
---|
436 | extern bool_t xdr_renameargs (); |
---|
437 | extern bool_t xdr_linkargs (); |
---|
438 | extern bool_t xdr_symlinkargs (); |
---|
439 | extern bool_t xdr_nfscookie (); |
---|
440 | extern bool_t xdr_readdirargs (); |
---|
441 | extern bool_t xdr_entry (); |
---|
442 | extern bool_t xdr_dirlist (); |
---|
443 | extern bool_t xdr_readdirres (); |
---|
444 | extern bool_t xdr_statfsokres (); |
---|
445 | extern bool_t xdr_statfsres (); |
---|
446 | |
---|
447 | #endif /* K&R C */ |
---|
448 | |
---|
449 | #ifdef __cplusplus |
---|
450 | } |
---|
451 | #endif |
---|
452 | |
---|
453 | #endif /* !_NFS_PROT_H_RPCGEN */ |
---|