]> git.ipfire.org Git - thirdparty/util-linux.git/blob - mount/nfsmount_xdr.c
Imported from util-linux-2.9i tarball.
[thirdparty/util-linux.git] / mount / nfsmount_xdr.c
1 /*
2 * Please do not edit this file.
3 * It was generated using rpcgen.
4 */
5
6 #include <rpc/types.h>
7 #include <rpc/xdr.h>
8
9 #include "nfsmount.h"
10 /*
11 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
12 * unrestricted use provided that this legend is included on all tape
13 * media and as a part of the software program in whole or part. Users
14 * may copy or modify Sun RPC without charge, but are not authorized
15 * to license or distribute it to anyone else except as part of a product or
16 * program developed by the user or with the express written consent of
17 * Sun Microsystems, Inc.
18 *
19 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
20 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
21 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
22 *
23 * Sun RPC is provided with no support and without any obligation on the
24 * part of Sun Microsystems, Inc. to assist in its use, correction,
25 * modification or enhancement.
26 *
27 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
28 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
29 * OR ANY PART THEREOF.
30 *
31 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
32 * or profits or other special, indirect and consequential damages, even if
33 * Sun has been advised of the possibility of such damages.
34 *
35 * Sun Microsystems, Inc.
36 * 2550 Garcia Avenue
37 * Mountain View, California 94043
38 */
39 /*
40 * Copyright (c) 1985, 1990 by Sun Microsystems, Inc.
41 */
42
43 /* from @(#)mount.x 1.3 91/03/11 TIRPC 1.0 */
44
45 bool_t
46 xdr_fhandle(XDR *xdrs, fhandle objp)
47 {
48
49 register long *buf;
50
51 if (!xdr_opaque(xdrs, objp, FHSIZE)) {
52 return (FALSE);
53 }
54 return (TRUE);
55 }
56
57 bool_t
58 xdr_fhstatus(XDR *xdrs, fhstatus *objp)
59 {
60
61 register long *buf;
62
63 if (!xdr_u_int(xdrs, &objp->fhs_status)) {
64 return (FALSE);
65 }
66 switch (objp->fhs_status) {
67 case 0:
68 if (!xdr_fhandle(xdrs, objp->fhstatus_u.fhs_fhandle)) {
69 return (FALSE);
70 }
71 break;
72 default:
73 break;
74 }
75 return (TRUE);
76 }
77
78 bool_t
79 xdr_dirpath(XDR *xdrs, dirpath *objp)
80 {
81
82 register long *buf;
83
84 if (!xdr_string(xdrs, objp, MNTPATHLEN)) {
85 return (FALSE);
86 }
87 return (TRUE);
88 }
89
90 bool_t
91 xdr_name(XDR *xdrs, name *objp)
92 {
93
94 register long *buf;
95
96 if (!xdr_string(xdrs, objp, MNTNAMLEN)) {
97 return (FALSE);
98 }
99 return (TRUE);
100 }
101
102 bool_t
103 xdr_mountlist(XDR *xdrs, mountlist *objp)
104 {
105
106 register long *buf;
107
108 if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct mountbody), (xdrproc_t)xdr_mountbody)) {
109 return (FALSE);
110 }
111 return (TRUE);
112 }
113
114 bool_t
115 xdr_mountbody(XDR *xdrs, mountbody *objp)
116 {
117
118 register long *buf;
119
120 if (!xdr_name(xdrs, &objp->ml_hostname)) {
121 return (FALSE);
122 }
123 if (!xdr_dirpath(xdrs, &objp->ml_directory)) {
124 return (FALSE);
125 }
126 if (!xdr_mountlist(xdrs, &objp->ml_next)) {
127 return (FALSE);
128 }
129 return (TRUE);
130 }
131
132 bool_t
133 xdr_groups(XDR *xdrs, groups *objp)
134 {
135
136 register long *buf;
137
138 if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct groupnode), (xdrproc_t)xdr_groupnode)) {
139 return (FALSE);
140 }
141 return (TRUE);
142 }
143
144 bool_t
145 xdr_groupnode(XDR *xdrs, groupnode *objp)
146 {
147
148 register long *buf;
149
150 if (!xdr_name(xdrs, &objp->gr_name)) {
151 return (FALSE);
152 }
153 if (!xdr_groups(xdrs, &objp->gr_next)) {
154 return (FALSE);
155 }
156 return (TRUE);
157 }
158
159 bool_t
160 xdr_exports(XDR *xdrs, exports *objp)
161 {
162
163 register long *buf;
164
165 if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct exportnode), (xdrproc_t)xdr_exportnode)) {
166 return (FALSE);
167 }
168 return (TRUE);
169 }
170
171 bool_t
172 xdr_exportnode(XDR *xdrs, exportnode *objp)
173 {
174
175 register long *buf;
176
177 if (!xdr_dirpath(xdrs, &objp->ex_dir)) {
178 return (FALSE);
179 }
180 if (!xdr_groups(xdrs, &objp->ex_groups)) {
181 return (FALSE);
182 }
183 if (!xdr_exports(xdrs, &objp->ex_next)) {
184 return (FALSE);
185 }
186 return (TRUE);
187 }
188
189 bool_t
190 xdr_ppathcnf(XDR *xdrs, ppathcnf *objp)
191 {
192
193 register long *buf;
194
195 int i;
196
197 if (xdrs->x_op == XDR_ENCODE) {
198 buf = XDR_INLINE(xdrs,6 * BYTES_PER_XDR_UNIT);
199 if (buf == NULL) {
200 if (!xdr_int(xdrs, &objp->pc_link_max)) {
201 return (FALSE);
202 }
203 if (!xdr_short(xdrs, &objp->pc_max_canon)) {
204 return (FALSE);
205 }
206 if (!xdr_short(xdrs, &objp->pc_max_input)) {
207 return (FALSE);
208 }
209 if (!xdr_short(xdrs, &objp->pc_name_max)) {
210 return (FALSE);
211 }
212 if (!xdr_short(xdrs, &objp->pc_path_max)) {
213 return (FALSE);
214 }
215 if (!xdr_short(xdrs, &objp->pc_pipe_buf)) {
216 return (FALSE);
217 }
218
219 }
220 else {
221 IXDR_PUT_LONG(buf,objp->pc_link_max);
222 IXDR_PUT_SHORT(buf,objp->pc_max_canon);
223 IXDR_PUT_SHORT(buf,objp->pc_max_input);
224 IXDR_PUT_SHORT(buf,objp->pc_name_max);
225 IXDR_PUT_SHORT(buf,objp->pc_path_max);
226 IXDR_PUT_SHORT(buf,objp->pc_pipe_buf);
227 }
228 if (!xdr_u_char(xdrs, &objp->pc_vdisable)) {
229 return (FALSE);
230 }
231 if (!xdr_char(xdrs, &objp->pc_xxx)) {
232 return (FALSE);
233 }
234 buf = XDR_INLINE(xdrs, 2 * BYTES_PER_XDR_UNIT);
235 if (buf == NULL) {
236 if (!xdr_vector(xdrs, (char *)objp->pc_mask, 2, sizeof(short), (xdrproc_t)xdr_short)) {
237 return (FALSE);
238 }
239
240 }
241 else {
242 { register short *genp;
243 for ( i = 0,genp=objp->pc_mask;
244 i < 2; i++){
245 IXDR_PUT_SHORT(buf,*genp++);
246 }
247 };
248 }
249
250 return (TRUE);
251 } else if (xdrs->x_op == XDR_DECODE) {
252 buf = XDR_INLINE(xdrs,6 * BYTES_PER_XDR_UNIT);
253 if (buf == NULL) {
254 if (!xdr_int(xdrs, &objp->pc_link_max)) {
255 return (FALSE);
256 }
257 if (!xdr_short(xdrs, &objp->pc_max_canon)) {
258 return (FALSE);
259 }
260 if (!xdr_short(xdrs, &objp->pc_max_input)) {
261 return (FALSE);
262 }
263 if (!xdr_short(xdrs, &objp->pc_name_max)) {
264 return (FALSE);
265 }
266 if (!xdr_short(xdrs, &objp->pc_path_max)) {
267 return (FALSE);
268 }
269 if (!xdr_short(xdrs, &objp->pc_pipe_buf)) {
270 return (FALSE);
271 }
272
273 }
274 else {
275 objp->pc_link_max = IXDR_GET_LONG(buf);
276 objp->pc_max_canon = IXDR_GET_SHORT(buf);
277 objp->pc_max_input = IXDR_GET_SHORT(buf);
278 objp->pc_name_max = IXDR_GET_SHORT(buf);
279 objp->pc_path_max = IXDR_GET_SHORT(buf);
280 objp->pc_pipe_buf = IXDR_GET_SHORT(buf);
281 }
282 if (!xdr_u_char(xdrs, &objp->pc_vdisable)) {
283 return (FALSE);
284 }
285 if (!xdr_char(xdrs, &objp->pc_xxx)) {
286 return (FALSE);
287 }
288 buf = XDR_INLINE(xdrs, 2 * BYTES_PER_XDR_UNIT);
289 if (buf == NULL) {
290 if (!xdr_vector(xdrs, (char *)objp->pc_mask, 2, sizeof(short), (xdrproc_t)xdr_short)) {
291 return (FALSE);
292 }
293
294 }
295 else {
296 { register short *genp;
297 for ( i = 0,genp=objp->pc_mask;
298 i < 2; i++){
299 *genp++ = IXDR_GET_SHORT(buf);
300 }
301 };
302 }
303 return(TRUE);
304 }
305
306 if (!xdr_int(xdrs, &objp->pc_link_max)) {
307 return (FALSE);
308 }
309 if (!xdr_short(xdrs, &objp->pc_max_canon)) {
310 return (FALSE);
311 }
312 if (!xdr_short(xdrs, &objp->pc_max_input)) {
313 return (FALSE);
314 }
315 if (!xdr_short(xdrs, &objp->pc_name_max)) {
316 return (FALSE);
317 }
318 if (!xdr_short(xdrs, &objp->pc_path_max)) {
319 return (FALSE);
320 }
321 if (!xdr_short(xdrs, &objp->pc_pipe_buf)) {
322 return (FALSE);
323 }
324 if (!xdr_u_char(xdrs, &objp->pc_vdisable)) {
325 return (FALSE);
326 }
327 if (!xdr_char(xdrs, &objp->pc_xxx)) {
328 return (FALSE);
329 }
330 if (!xdr_vector(xdrs, (char *)objp->pc_mask, 2, sizeof(short), (xdrproc_t)xdr_short)) {
331 return (FALSE);
332 }
333 return (TRUE);
334 }