-
Notifications
You must be signed in to change notification settings - Fork 0
/
fuse_rpc.h
596 lines (535 loc) · 15.1 KB
/
fuse_rpc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
/*
* Please do not edit this file.
* It was generated using rpcgen.
*/
#ifndef _FUSE_RPC_H_RPCGEN
#define _FUSE_RPC_H_RPCGEN
#include <rpc/rpc.h>
#include <pthread.h>
#ifdef __cplusplus
extern "C" {
#endif
#define MAX_SIZE 4096
struct identity {
int is_master;
int is_degraded;
};
typedef struct identity identity;
struct init_arg {
identity server_info;
char *ip;
char *rootdir;
};
typedef struct init_arg init_arg;
struct init_ret {
int ret;
};
typedef struct init_ret init_ret;
struct getattr_arg {
char *ip;
char *path;
};
typedef struct getattr_arg getattr_arg;
struct getattr_ret {
int st_dev;
int st_ino;
int st_mode;
int st_nlink;
int st_uid;
int st_gid;
int st_rdev;
u_long st_size;
u_long st_blksize;
u_long st_blocks;
long st_acc_time;
long st_mod_time;
long st_chg_time;
int ret;
};
typedef struct getattr_ret getattr_ret;
struct access_arg {
char *ip;
char *path;
int mask;
};
typedef struct access_arg access_arg;
struct access_ret {
int ret;
};
typedef struct access_ret access_ret;
struct mkdir_arg {
char *ip;
identity server_info;
char *path;
int mode;
};
typedef struct mkdir_arg mkdir_arg;
struct mkdir_ret {
int ret;
};
typedef struct mkdir_ret mkdir_ret;
struct rmdir_arg {
char *ip;
identity server_info;
char *path;
};
typedef struct rmdir_arg rmdir_arg;
struct rmdir_ret {
int ret;
};
typedef struct rmdir_ret rmdir_ret;
struct opendir_arg {
char *ip;
char *path;
};
typedef struct opendir_arg opendir_arg;
struct opendir_ret {
int fd;
int ret;
};
typedef struct opendir_ret opendir_ret;
struct readdir_arg {
int fd;
};
typedef struct readdir_arg readdir_arg;
struct readdir_ret {
int count;
char entries[MAX_SIZE];
int ret;
};
typedef struct readdir_ret readdir_ret;
struct releasedir_arg {
int fd;
};
typedef struct releasedir_arg releasedir_arg;
struct releasedir_ret {
int ret;
};
typedef struct releasedir_ret releasedir_ret;
struct rename_arg {
char *ip;
identity server_info;
char *path;
char *newpath;
};
typedef struct rename_arg rename_arg;
struct rename_ret {
int ret;
};
typedef struct rename_ret rename_ret;
struct symlink_arg {
char *ip;
identity server_info;
char *path;
char *link;
};
typedef struct symlink_arg symlink_arg;
struct symlink_ret {
int ret;
};
typedef struct symlink_ret symlink_ret;
struct link_arg {
char *ip;
identity server_info;
char *path;
char *newpath;
};
typedef struct link_arg link_arg;
struct link_ret {
int ret;
};
typedef struct link_ret link_ret;
struct readlink_arg {
char *ip;
char *path;
u_int size;
};
typedef struct readlink_arg readlink_arg;
struct readlink_ret {
char buffer[MAX_SIZE];
int len;
int ret;
};
typedef struct readlink_ret readlink_ret;
struct mknod_arg {
char *ip;
identity server_info;
char *path;
int mode;
int dev;
};
typedef struct mknod_arg mknod_arg;
struct mknod_ret {
int ret;
};
typedef struct mknod_ret mknod_ret;
struct utime_arg {
char *ip;
identity server_info;
char *path;
long actime;
long modtime;
};
typedef struct utime_arg utime_arg;
struct utime_ret {
int ret;
};
typedef struct utime_ret utime_ret;
struct truncate_arg {
char *ip;
identity server_info;
char *path;
int newsize;
};
typedef struct truncate_arg truncate_arg;
struct truncate_ret {
int ret;
};
typedef struct truncate_ret truncate_ret;
struct chmod_arg {
char *ip;
identity server_info;
char *path;
int mode;
};
typedef struct chmod_arg chmod_arg;
struct chmod_ret {
int ret;
};
typedef struct chmod_ret chmod_ret;
struct chown_arg {
char *ip;
identity server_info;
char *path;
u_int uid;
u_int gid;
};
typedef struct chown_arg chown_arg;
struct chown_ret {
int ret;
};
typedef struct chown_ret chown_ret;
struct unlink_arg {
char *ip;
identity server_info;
char *path;
};
typedef struct unlink_arg unlink_arg;
struct unlink_ret {
int ret;
};
typedef struct unlink_ret unlink_ret;
struct open_arg {
char *ip;
char *path;
int flags;
};
typedef struct open_arg open_arg;
struct open_ret {
int fd;
int ret;
};
typedef struct open_ret open_ret;
struct release_arg {
char *ip;
int fd;
};
typedef struct release_arg release_arg;
struct release_ret {
int ret;
};
typedef struct release_ret release_ret;
struct read_arg {
char *ip;
int fd;
u_int size;
u_int offset;
};
typedef struct read_arg read_arg;
struct read_ret {
char buffer[MAX_SIZE];
int len;
int ret;
};
typedef struct read_ret read_ret;
struct write_arg {
char *ip;
identity server_info;
int fd;
char *path;
u_int size;
u_int offset;
char buffer[MAX_SIZE];
};
typedef struct write_arg write_arg;
struct write_ret {
int len;
int ret;
};
typedef struct write_ret write_ret;
struct statfs_arg {
char *path;
};
typedef struct statfs_arg statfs_arg;
struct statfs_ret {
u_long f_bsize;
u_long f_frsize;
u_long f_blocks;
u_long f_bfree;
u_long f_bavail;
u_long f_files;
u_long f_ffree;
u_long f_favail;
u_long f_fsid;
u_long f_flag;
u_long f_namemax;
int ret;
};
typedef struct statfs_ret statfs_ret;
#define COMPUTE 456123789
#define COMPUTE_VERS 6
#if defined(__STDC__) || defined(__cplusplus)
#define INIT_ROOTDIR 0
extern enum clnt_stat init_rootdir_6(init_arg *, init_ret *, CLIENT *);
extern bool_t init_rootdir_6_svc(init_arg *, init_ret *, struct svc_req *);
#define BB_GETATTR 1
extern enum clnt_stat bb_getattr_6(getattr_arg *, getattr_ret *, CLIENT *);
extern bool_t bb_getattr_6_svc(getattr_arg *, getattr_ret *, struct svc_req *);
#define BB_ACCESS 2
extern enum clnt_stat bb_access_6(access_arg *, access_ret *, CLIENT *);
extern bool_t bb_access_6_svc(access_arg *, access_ret *, struct svc_req *);
#define BB_MKDIR 3
extern enum clnt_stat bb_mkdir_6(mkdir_arg *, mkdir_ret *, CLIENT *);
extern bool_t bb_mkdir_6_svc(mkdir_arg *, mkdir_ret *, struct svc_req *);
#define BB_RMDIR 4
extern enum clnt_stat bb_rmdir_6(rmdir_arg *, rmdir_ret *, CLIENT *);
extern bool_t bb_rmdir_6_svc(rmdir_arg *, rmdir_ret *, struct svc_req *);
#define BB_OPENDIR 5
extern enum clnt_stat bb_opendir_6(opendir_arg *, opendir_ret *, CLIENT *);
extern bool_t bb_opendir_6_svc(opendir_arg *, opendir_ret *, struct svc_req *);
#define BB_READDIR 6
extern enum clnt_stat bb_readdir_6(readdir_arg *, readdir_ret *, CLIENT *);
extern bool_t bb_readdir_6_svc(readdir_arg *, readdir_ret *, struct svc_req *);
#define BB_RELEASEDIR 7
extern enum clnt_stat bb_releasedir_6(releasedir_arg *, releasedir_ret *, CLIENT *);
extern bool_t bb_releasedir_6_svc(releasedir_arg *, releasedir_ret *, struct svc_req *);
#define BB_RENAME 8
extern enum clnt_stat bb_rename_6(rename_arg *, rename_ret *, CLIENT *);
extern bool_t bb_rename_6_svc(rename_arg *, rename_ret *, struct svc_req *);
#define BB_SYMLINK 9
extern enum clnt_stat bb_symlink_6(symlink_arg *, symlink_ret *, CLIENT *);
extern bool_t bb_symlink_6_svc(symlink_arg *, symlink_ret *, struct svc_req *);
#define BB_LINK 10
extern enum clnt_stat bb_link_6(link_arg *, link_ret *, CLIENT *);
extern bool_t bb_link_6_svc(link_arg *, link_ret *, struct svc_req *);
#define BB_READLINK 11
extern enum clnt_stat bb_readlink_6(readlink_arg *, readlink_ret *, CLIENT *);
extern bool_t bb_readlink_6_svc(readlink_arg *, readlink_ret *, struct svc_req *);
#define BB_MKNOD 12
extern enum clnt_stat bb_mknod_6(mknod_arg *, mknod_ret *, CLIENT *);
extern bool_t bb_mknod_6_svc(mknod_arg *, mknod_ret *, struct svc_req *);
#define BB_TRUNCATE 13
extern enum clnt_stat bb_truncate_6(truncate_arg *, truncate_ret *, CLIENT *);
extern bool_t bb_truncate_6_svc(truncate_arg *, truncate_ret *, struct svc_req *);
#define BB_UNLINK 14
extern enum clnt_stat bb_unlink_6(unlink_arg *, unlink_ret *, CLIENT *);
extern bool_t bb_unlink_6_svc(unlink_arg *, unlink_ret *, struct svc_req *);
#define BB_UTIME 15
extern enum clnt_stat bb_utime_6(utime_arg *, utime_ret *, CLIENT *);
extern bool_t bb_utime_6_svc(utime_arg *, utime_ret *, struct svc_req *);
#define BB_CHMOD 16
extern enum clnt_stat bb_chmod_6(chmod_arg *, chmod_ret *, CLIENT *);
extern bool_t bb_chmod_6_svc(chmod_arg *, chmod_ret *, struct svc_req *);
#define BB_CHOWN 17
extern enum clnt_stat bb_chown_6(chown_arg *, chown_ret *, CLIENT *);
extern bool_t bb_chown_6_svc(chown_arg *, chown_ret *, struct svc_req *);
#define BB_OPEN 18
extern enum clnt_stat bb_open_6(open_arg *, open_ret *, CLIENT *);
extern bool_t bb_open_6_svc(open_arg *, open_ret *, struct svc_req *);
#define BB_RELEASE 19
extern enum clnt_stat bb_release_6(release_arg *, release_ret *, CLIENT *);
extern bool_t bb_release_6_svc(release_arg *, release_ret *, struct svc_req *);
#define BB_READ 20
extern enum clnt_stat bb_read_6(read_arg *, read_ret *, CLIENT *);
extern bool_t bb_read_6_svc(read_arg *, read_ret *, struct svc_req *);
#define BB_WRITE 21
extern enum clnt_stat bb_write_6(write_arg *, write_ret *, CLIENT *);
extern bool_t bb_write_6_svc(write_arg *, write_ret *, struct svc_req *);
#define BB_STATFS 22
extern enum clnt_stat bb_statfs_6(statfs_arg *, statfs_ret *, CLIENT *);
extern bool_t bb_statfs_6_svc(statfs_arg *, statfs_ret *, struct svc_req *);
extern int compute_6_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
#else /* K&R C */
#define INIT_ROOTDIR 0
extern enum clnt_stat init_rootdir_6();
extern bool_t init_rootdir_6_svc();
#define BB_GETATTR 1
extern enum clnt_stat bb_getattr_6();
extern bool_t bb_getattr_6_svc();
#define BB_ACCESS 2
extern enum clnt_stat bb_access_6();
extern bool_t bb_access_6_svc();
#define BB_MKDIR 3
extern enum clnt_stat bb_mkdir_6();
extern bool_t bb_mkdir_6_svc();
#define BB_RMDIR 4
extern enum clnt_stat bb_rmdir_6();
extern bool_t bb_rmdir_6_svc();
#define BB_OPENDIR 5
extern enum clnt_stat bb_opendir_6();
extern bool_t bb_opendir_6_svc();
#define BB_READDIR 6
extern enum clnt_stat bb_readdir_6();
extern bool_t bb_readdir_6_svc();
#define BB_RELEASEDIR 7
extern enum clnt_stat bb_releasedir_6();
extern bool_t bb_releasedir_6_svc();
#define BB_RENAME 8
extern enum clnt_stat bb_rename_6();
extern bool_t bb_rename_6_svc();
#define BB_SYMLINK 9
extern enum clnt_stat bb_symlink_6();
extern bool_t bb_symlink_6_svc();
#define BB_LINK 10
extern enum clnt_stat bb_link_6();
extern bool_t bb_link_6_svc();
#define BB_READLINK 11
extern enum clnt_stat bb_readlink_6();
extern bool_t bb_readlink_6_svc();
#define BB_MKNOD 12
extern enum clnt_stat bb_mknod_6();
extern bool_t bb_mknod_6_svc();
#define BB_TRUNCATE 13
extern enum clnt_stat bb_truncate_6();
extern bool_t bb_truncate_6_svc();
#define BB_UNLINK 14
extern enum clnt_stat bb_unlink_6();
extern bool_t bb_unlink_6_svc();
#define BB_UTIME 15
extern enum clnt_stat bb_utime_6();
extern bool_t bb_utime_6_svc();
#define BB_CHMOD 16
extern enum clnt_stat bb_chmod_6();
extern bool_t bb_chmod_6_svc();
#define BB_CHOWN 17
extern enum clnt_stat bb_chown_6();
extern bool_t bb_chown_6_svc();
#define BB_OPEN 18
extern enum clnt_stat bb_open_6();
extern bool_t bb_open_6_svc();
#define BB_RELEASE 19
extern enum clnt_stat bb_release_6();
extern bool_t bb_release_6_svc();
#define BB_READ 20
extern enum clnt_stat bb_read_6();
extern bool_t bb_read_6_svc();
#define BB_WRITE 21
extern enum clnt_stat bb_write_6();
extern bool_t bb_write_6_svc();
#define BB_STATFS 22
extern enum clnt_stat bb_statfs_6();
extern bool_t bb_statfs_6_svc();
extern int compute_6_freeresult ();
#endif /* K&R C */
/* the xdr functions */
#if defined(__STDC__) || defined(__cplusplus)
extern bool_t xdr_identity (XDR *, identity*);
extern bool_t xdr_init_arg (XDR *, init_arg*);
extern bool_t xdr_init_ret (XDR *, init_ret*);
extern bool_t xdr_getattr_arg (XDR *, getattr_arg*);
extern bool_t xdr_getattr_ret (XDR *, getattr_ret*);
extern bool_t xdr_access_arg (XDR *, access_arg*);
extern bool_t xdr_access_ret (XDR *, access_ret*);
extern bool_t xdr_mkdir_arg (XDR *, mkdir_arg*);
extern bool_t xdr_mkdir_ret (XDR *, mkdir_ret*);
extern bool_t xdr_rmdir_arg (XDR *, rmdir_arg*);
extern bool_t xdr_rmdir_ret (XDR *, rmdir_ret*);
extern bool_t xdr_opendir_arg (XDR *, opendir_arg*);
extern bool_t xdr_opendir_ret (XDR *, opendir_ret*);
extern bool_t xdr_readdir_arg (XDR *, readdir_arg*);
extern bool_t xdr_readdir_ret (XDR *, readdir_ret*);
extern bool_t xdr_releasedir_arg (XDR *, releasedir_arg*);
extern bool_t xdr_releasedir_ret (XDR *, releasedir_ret*);
extern bool_t xdr_rename_arg (XDR *, rename_arg*);
extern bool_t xdr_rename_ret (XDR *, rename_ret*);
extern bool_t xdr_symlink_arg (XDR *, symlink_arg*);
extern bool_t xdr_symlink_ret (XDR *, symlink_ret*);
extern bool_t xdr_link_arg (XDR *, link_arg*);
extern bool_t xdr_link_ret (XDR *, link_ret*);
extern bool_t xdr_readlink_arg (XDR *, readlink_arg*);
extern bool_t xdr_readlink_ret (XDR *, readlink_ret*);
extern bool_t xdr_mknod_arg (XDR *, mknod_arg*);
extern bool_t xdr_mknod_ret (XDR *, mknod_ret*);
extern bool_t xdr_utime_arg (XDR *, utime_arg*);
extern bool_t xdr_utime_ret (XDR *, utime_ret*);
extern bool_t xdr_truncate_arg (XDR *, truncate_arg*);
extern bool_t xdr_truncate_ret (XDR *, truncate_ret*);
extern bool_t xdr_chmod_arg (XDR *, chmod_arg*);
extern bool_t xdr_chmod_ret (XDR *, chmod_ret*);
extern bool_t xdr_chown_arg (XDR *, chown_arg*);
extern bool_t xdr_chown_ret (XDR *, chown_ret*);
extern bool_t xdr_unlink_arg (XDR *, unlink_arg*);
extern bool_t xdr_unlink_ret (XDR *, unlink_ret*);
extern bool_t xdr_open_arg (XDR *, open_arg*);
extern bool_t xdr_open_ret (XDR *, open_ret*);
extern bool_t xdr_release_arg (XDR *, release_arg*);
extern bool_t xdr_release_ret (XDR *, release_ret*);
extern bool_t xdr_read_arg (XDR *, read_arg*);
extern bool_t xdr_read_ret (XDR *, read_ret*);
extern bool_t xdr_write_arg (XDR *, write_arg*);
extern bool_t xdr_write_ret (XDR *, write_ret*);
extern bool_t xdr_statfs_arg (XDR *, statfs_arg*);
extern bool_t xdr_statfs_ret (XDR *, statfs_ret*);
#else /* K&R C */
extern bool_t xdr_identity ();
extern bool_t xdr_init_arg ();
extern bool_t xdr_init_ret ();
extern bool_t xdr_getattr_arg ();
extern bool_t xdr_getattr_ret ();
extern bool_t xdr_access_arg ();
extern bool_t xdr_access_ret ();
extern bool_t xdr_mkdir_arg ();
extern bool_t xdr_mkdir_ret ();
extern bool_t xdr_rmdir_arg ();
extern bool_t xdr_rmdir_ret ();
extern bool_t xdr_opendir_arg ();
extern bool_t xdr_opendir_ret ();
extern bool_t xdr_readdir_arg ();
extern bool_t xdr_readdir_ret ();
extern bool_t xdr_releasedir_arg ();
extern bool_t xdr_releasedir_ret ();
extern bool_t xdr_rename_arg ();
extern bool_t xdr_rename_ret ();
extern bool_t xdr_symlink_arg ();
extern bool_t xdr_symlink_ret ();
extern bool_t xdr_link_arg ();
extern bool_t xdr_link_ret ();
extern bool_t xdr_readlink_arg ();
extern bool_t xdr_readlink_ret ();
extern bool_t xdr_mknod_arg ();
extern bool_t xdr_mknod_ret ();
extern bool_t xdr_utime_arg ();
extern bool_t xdr_utime_ret ();
extern bool_t xdr_truncate_arg ();
extern bool_t xdr_truncate_ret ();
extern bool_t xdr_chmod_arg ();
extern bool_t xdr_chmod_ret ();
extern bool_t xdr_chown_arg ();
extern bool_t xdr_chown_ret ();
extern bool_t xdr_unlink_arg ();
extern bool_t xdr_unlink_ret ();
extern bool_t xdr_open_arg ();
extern bool_t xdr_open_ret ();
extern bool_t xdr_release_arg ();
extern bool_t xdr_release_ret ();
extern bool_t xdr_read_arg ();
extern bool_t xdr_read_ret ();
extern bool_t xdr_write_arg ();
extern bool_t xdr_write_ret ();
extern bool_t xdr_statfs_arg ();
extern bool_t xdr_statfs_ret ();
#endif /* K&R C */
#ifdef __cplusplus
}
#endif
#endif /* !_FUSE_RPC_H_RPCGEN */