-
Notifications
You must be signed in to change notification settings - Fork 0
/
fuse_rpc_client.c
181 lines (173 loc) · 4.77 KB
/
fuse_rpc_client.c
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
/*
* This is sample code generated by rpcgen.
* These are only templates and you can use them
* as a guideline for developing your own functions.
*/
#include "fuse_rpc.h"
void
compute_6(char *host)
{
CLIENT *clnt;
enum clnt_stat retval_1;
getattr_ret result_1;
getattr_arg bb_getattr_6_arg;
enum clnt_stat retval_2;
access_ret result_2;
access_arg bb_access_6_arg;
enum clnt_stat retval_3;
mkdir_ret result_3;
mkdir_arg bb_mkdir_6_arg;
enum clnt_stat retval_4;
rmdir_ret result_4;
rmdir_arg bb_rmdir_6_arg;
enum clnt_stat retval_5;
opendir_ret result_5;
opendir_arg bb_opendir_6_arg;
enum clnt_stat retval_6;
readdir_ret result_6;
readdir_arg bb_readdir_6_arg;
enum clnt_stat retval_7;
releasedir_ret result_7;
releasedir_arg bb_releasedir_6_arg;
enum clnt_stat retval_8;
rename_ret result_8;
rename_arg bb_rename_6_arg;
enum clnt_stat retval_9;
symlink_ret result_9;
symlink_arg bb_symlink_6_arg;
enum clnt_stat retval_10;
readlink_ret result_10;
readlink_arg bb_readlink_6_arg;
enum clnt_stat retval_11;
mknod_ret result_11;
mknod_arg bb_mknod_6_arg;
enum clnt_stat retval_12;
truncate_ret result_12;
truncate_arg bb_truncate_6_arg;
enum clnt_stat retval_13;
unlink_ret result_13;
unlink_arg bb_unlink_6_arg;
enum clnt_stat retval_14;
utime_ret result_14;
utime_arg bb_utime_6_arg;
enum clnt_stat retval_15;
chmod_ret result_15;
chmod_arg bb_chmod_6_arg;
enum clnt_stat retval_16;
chown_ret result_16;
chown_arg bb_chown_6_arg;
enum clnt_stat retval_17;
open_ret result_17;
open_arg bb_open_6_arg;
enum clnt_stat retval_18;
release_ret result_18;
release_arg bb_release_6_arg;
enum clnt_stat retval_19;
read_ret result_19;
read_arg bb_read_6_arg;
enum clnt_stat retval_20;
write_ret result_20;
write_arg bb_write_6_arg;
#ifndef DEBUG
clnt = clnt_create (host, COMPUTE, COMPUTE_VERS, "udp");
if (clnt == NULL) {
clnt_pcreateerror (host);
exit (1);
}
#endif /* DEBUG */
retval_1 = bb_getattr_6(&bb_getattr_6_arg, &result_1, clnt);
if (retval_1 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_2 = bb_access_6(&bb_access_6_arg, &result_2, clnt);
if (retval_2 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_3 = bb_mkdir_6(&bb_mkdir_6_arg, &result_3, clnt);
if (retval_3 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_4 = bb_rmdir_6(&bb_rmdir_6_arg, &result_4, clnt);
if (retval_4 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_5 = bb_opendir_6(&bb_opendir_6_arg, &result_5, clnt);
if (retval_5 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_6 = bb_readdir_6(&bb_readdir_6_arg, &result_6, clnt);
if (retval_6 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_7 = bb_releasedir_6(&bb_releasedir_6_arg, &result_7, clnt);
if (retval_7 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_8 = bb_rename_6(&bb_rename_6_arg, &result_8, clnt);
if (retval_8 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_9 = bb_symlink_6(&bb_symlink_6_arg, &result_9, clnt);
if (retval_9 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_10 = bb_readlink_6(&bb_readlink_6_arg, &result_10, clnt);
if (retval_10 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_11 = bb_mknod_6(&bb_mknod_6_arg, &result_11, clnt);
if (retval_11 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_12 = bb_truncate_6(&bb_truncate_6_arg, &result_12, clnt);
if (retval_12 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_13 = bb_unlink_6(&bb_unlink_6_arg, &result_13, clnt);
if (retval_13 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_14 = bb_utime_6(&bb_utime_6_arg, &result_14, clnt);
if (retval_14 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_15 = bb_chmod_6(&bb_chmod_6_arg, &result_15, clnt);
if (retval_15 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_16 = bb_chown_6(&bb_chown_6_arg, &result_16, clnt);
if (retval_16 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_17 = bb_open_6(&bb_open_6_arg, &result_17, clnt);
if (retval_17 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_18 = bb_release_6(&bb_release_6_arg, &result_18, clnt);
if (retval_18 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_19 = bb_read_6(&bb_read_6_arg, &result_19, clnt);
if (retval_19 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
retval_20 = bb_write_6(&bb_write_6_arg, &result_20, clnt);
if (retval_20 != RPC_SUCCESS) {
clnt_perror (clnt, "call failed");
}
#ifndef DEBUG
clnt_destroy (clnt);
#endif /* DEBUG */
}
int
main (int argc, char *argv[])
{
char *host;
if (argc < 2) {
printf ("usage: %s server_host\n", argv[0]);
exit (1);
}
host = argv[1];
compute_6 (host);
exit (0);
}