GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: usr.sbin/amd/amd/../rpcx/nfs_prot_xdr.c Lines: 0 191 0.0 %
Date: 2017-11-13 Branches: 0 168 0.0 %

Line Branch Exec Source
1
/*
2
 * Please do not edit this file.
3
 * It was generated using rpcgen.
4
 */
5
6
#include "nfs_prot.h"
7
8
bool_t
9
xdr_nfs_fh(XDR *xdrs, nfs_fh *objp)
10
{
11
12
13
	if (!xdr_opaque(xdrs, objp->data, NFS_FHSIZE))
14
		return (FALSE);
15
	return (TRUE);
16
}
17
18
bool_t
19
xdr_nfstime(XDR *xdrs, nfstime *objp)
20
{
21
22
23
	if (!xdr_u_int(xdrs, &objp->seconds))
24
		return (FALSE);
25
	if (!xdr_u_int(xdrs, &objp->useconds))
26
		return (FALSE);
27
	return (TRUE);
28
}
29
30
bool_t
31
xdr_fattr(XDR *xdrs, fattr *objp)
32
{
33
34
35
	if (!xdr_int(xdrs, &objp->type))
36
		return (FALSE);
37
	if (!xdr_u_int(xdrs, &objp->mode))
38
		return (FALSE);
39
	if (!xdr_u_int(xdrs, &objp->nlink))
40
		return (FALSE);
41
	if (!xdr_u_int(xdrs, &objp->uid))
42
		return (FALSE);
43
	if (!xdr_u_int(xdrs, &objp->gid))
44
		return (FALSE);
45
	if (!xdr_u_int(xdrs, &objp->size))
46
		return (FALSE);
47
	if (!xdr_u_int(xdrs, &objp->blocksize))
48
		return (FALSE);
49
	if (!xdr_u_int(xdrs, &objp->rdev))
50
		return (FALSE);
51
	if (!xdr_u_int(xdrs, &objp->blocks))
52
		return (FALSE);
53
	if (!xdr_u_int(xdrs, &objp->fsid))
54
		return (FALSE);
55
	if (!xdr_u_int(xdrs, &objp->fileid))
56
		return (FALSE);
57
	if (!xdr_nfstime(xdrs, &objp->atime))
58
		return (FALSE);
59
	if (!xdr_nfstime(xdrs, &objp->mtime))
60
		return (FALSE);
61
	if (!xdr_nfstime(xdrs, &objp->ctime))
62
		return (FALSE);
63
	return (TRUE);
64
}
65
66
bool_t
67
xdr_sattr(XDR *xdrs, sattr *objp)
68
{
69
70
71
	if (!xdr_u_int(xdrs, &objp->mode))
72
		return (FALSE);
73
	if (!xdr_u_int(xdrs, &objp->uid))
74
		return (FALSE);
75
	if (!xdr_u_int(xdrs, &objp->gid))
76
		return (FALSE);
77
	if (!xdr_u_int(xdrs, &objp->size))
78
		return (FALSE);
79
	if (!xdr_nfstime(xdrs, &objp->atime))
80
		return (FALSE);
81
	if (!xdr_nfstime(xdrs, &objp->mtime))
82
		return (FALSE);
83
	return (TRUE);
84
}
85
86
bool_t
87
xdr_filename(XDR *xdrs, filename *objp)
88
{
89
90
	if (!xdr_string(xdrs, objp, NFS_MAXNAMLEN))
91
		return (FALSE);
92
	return (TRUE);
93
}
94
95
bool_t
96
xdr_nfspath(XDR *xdrs, nfspath *objp)
97
{
98
99
	if (!xdr_string(xdrs, objp, NFS_MAXPATHLEN))
100
		return (FALSE);
101
	return (TRUE);
102
}
103
104
bool_t
105
xdr_attrstat(XDR *xdrs, attrstat *objp)
106
{
107
108
	if (!xdr_int(xdrs, &objp->status))
109
		return (FALSE);
110
	switch (objp->status) {
111
	case NFS_OK:
112
		if (!xdr_fattr(xdrs, &objp->attrstat_u.attributes))
113
			return (FALSE);
114
		break;
115
	default:
116
		break;
117
	}
118
	return (TRUE);
119
}
120
121
bool_t
122
xdr_sattrargs(XDR *xdrs, sattrargs *objp)
123
{
124
125
126
	if (!xdr_nfs_fh(xdrs, &objp->file))
127
		return (FALSE);
128
	if (!xdr_sattr(xdrs, &objp->attributes))
129
		return (FALSE);
130
	return (TRUE);
131
}
132
133
bool_t
134
xdr_diropargs(XDR *xdrs, diropargs *objp)
135
{
136
137
138
	if (!xdr_nfs_fh(xdrs, &objp->dir))
139
		return (FALSE);
140
	if (!xdr_filename(xdrs, &objp->name))
141
		return (FALSE);
142
	return (TRUE);
143
}
144
145
bool_t
146
xdr_diropokres(XDR *xdrs, diropokres *objp)
147
{
148
149
150
	if (!xdr_nfs_fh(xdrs, &objp->file))
151
		return (FALSE);
152
	if (!xdr_fattr(xdrs, &objp->attributes))
153
		return (FALSE);
154
	return (TRUE);
155
}
156
157
bool_t
158
xdr_diropres(XDR *xdrs, diropres *objp)
159
{
160
161
	if (!xdr_int(xdrs, &objp->status))
162
		return (FALSE);
163
	switch (objp->status) {
164
	case NFS_OK:
165
		if (!xdr_diropokres(xdrs, &objp->diropres_u.diropres))
166
			return (FALSE);
167
		break;
168
	default:
169
		break;
170
	}
171
	return (TRUE);
172
}
173
174
bool_t
175
xdr_readlinkres(XDR *xdrs, readlinkres *objp)
176
{
177
178
	if (!xdr_int(xdrs, &objp->status))
179
		return (FALSE);
180
	switch (objp->status) {
181
	case NFS_OK:
182
		if (!xdr_nfspath(xdrs, &objp->readlinkres_u.data))
183
			return (FALSE);
184
		break;
185
	default:
186
		break;
187
	}
188
	return (TRUE);
189
}
190
191
bool_t
192
xdr_readargs(XDR *xdrs, readargs *objp)
193
{
194
195
196
	if (!xdr_nfs_fh(xdrs, &objp->file))
197
		return (FALSE);
198
	if (!xdr_u_int(xdrs, &objp->offset))
199
		return (FALSE);
200
	if (!xdr_u_int(xdrs, &objp->count))
201
		return (FALSE);
202
	if (!xdr_u_int(xdrs, &objp->totalcount))
203
		return (FALSE);
204
	return (TRUE);
205
}
206
207
bool_t
208
xdr_readokres(XDR *xdrs, readokres *objp)
209
{
210
211
212
	if (!xdr_fattr(xdrs, &objp->attributes))
213
		return (FALSE);
214
	if (!xdr_bytes(xdrs, (char **)&objp->data.data_val,
215
	    (u_int *)&objp->data.data_len,
216
	    NFS_MAXDATA))
217
		return (FALSE);
218
	return (TRUE);
219
}
220
221
bool_t
222
xdr_readres(XDR *xdrs, readres *objp)
223
{
224
225
	if (!xdr_int(xdrs, &objp->status))
226
		return (FALSE);
227
	switch (objp->status) {
228
	case NFS_OK:
229
		if (!xdr_readokres(xdrs, &objp->readres_u.reply))
230
			return (FALSE);
231
		break;
232
	default:
233
		break;
234
	}
235
	return (TRUE);
236
}
237
238
bool_t
239
xdr_writeargs(XDR *xdrs, writeargs *objp)
240
{
241
242
243
	if (!xdr_nfs_fh(xdrs, &objp->file))
244
		return (FALSE);
245
	if (!xdr_u_int(xdrs, &objp->beginoffset))
246
		return (FALSE);
247
	if (!xdr_u_int(xdrs, &objp->offset))
248
		return (FALSE);
249
	if (!xdr_u_int(xdrs, &objp->totalcount))
250
		return (FALSE);
251
	if (!xdr_bytes(xdrs, (char **)&objp->data.data_val,
252
	    (u_int *)&objp->data.data_len,
253
	    NFS_MAXDATA))
254
		return (FALSE);
255
	return (TRUE);
256
}
257
258
bool_t
259
xdr_createargs(XDR *xdrs, createargs *objp)
260
{
261
262
263
	if (!xdr_diropargs(xdrs, &objp->where))
264
		return (FALSE);
265
	if (!xdr_sattr(xdrs, &objp->attributes))
266
		return (FALSE);
267
	return (TRUE);
268
}
269
270
bool_t
271
xdr_renameargs(XDR *xdrs, renameargs *objp)
272
{
273
274
275
	if (!xdr_diropargs(xdrs, &objp->from))
276
		return (FALSE);
277
	if (!xdr_diropargs(xdrs, &objp->to))
278
		return (FALSE);
279
	return (TRUE);
280
}
281
282
bool_t
283
xdr_linkargs(XDR *xdrs, linkargs *objp)
284
{
285
286
287
	if (!xdr_nfs_fh(xdrs, &objp->from))
288
		return (FALSE);
289
	if (!xdr_diropargs(xdrs, &objp->to))
290
		return (FALSE);
291
	return (TRUE);
292
}
293
294
bool_t
295
xdr_symlinkargs(XDR *xdrs, symlinkargs *objp)
296
{
297
298
299
	if (!xdr_diropargs(xdrs, &objp->from))
300
		return (FALSE);
301
	if (!xdr_nfspath(xdrs, &objp->to))
302
		return (FALSE);
303
	if (!xdr_sattr(xdrs, &objp->attributes))
304
		return (FALSE);
305
	return (TRUE);
306
}
307
308
bool_t
309
xdr_nfscookie(XDR *xdrs, nfscookie objp)
310
{
311
312
	if (!xdr_opaque(xdrs, objp, NFS_COOKIESIZE))
313
		return (FALSE);
314
	return (TRUE);
315
}
316
317
bool_t
318
xdr_readdirargs(XDR *xdrs, readdirargs *objp)
319
{
320
321
322
	if (!xdr_nfs_fh(xdrs, &objp->dir))
323
		return (FALSE);
324
	if (!xdr_nfscookie(xdrs, objp->cookie))
325
		return (FALSE);
326
	if (!xdr_u_int(xdrs, &objp->count))
327
		return (FALSE);
328
	return (TRUE);
329
}
330
331
bool_t
332
xdr_entry(XDR *xdrs, entry *objp)
333
{
334
335
336
	if (!xdr_u_int(xdrs, &objp->fileid))
337
		return (FALSE);
338
	if (!xdr_filename(xdrs, &objp->name))
339
		return (FALSE);
340
	if (!xdr_nfscookie(xdrs, objp->cookie))
341
		return (FALSE);
342
	if (!xdr_pointer(xdrs, (char **)&objp->nextentry, sizeof(entry), (xdrproc_t)xdr_entry))
343
		return (FALSE);
344
	return (TRUE);
345
}
346
347
bool_t
348
xdr_dirlist(XDR *xdrs, dirlist *objp)
349
{
350
351
352
	if (!xdr_pointer(xdrs, (char **)&objp->entries, sizeof(entry), (xdrproc_t)xdr_entry))
353
		return (FALSE);
354
	if (!xdr_bool(xdrs, &objp->eof))
355
		return (FALSE);
356
	return (TRUE);
357
}
358
359
bool_t
360
xdr_readdirres(XDR *xdrs, readdirres *objp)
361
{
362
363
	if (!xdr_int(xdrs, &objp->status))
364
		return (FALSE);
365
	switch (objp->status) {
366
	case NFS_OK:
367
		if (!xdr_dirlist(xdrs, &objp->readdirres_u.reply))
368
			return (FALSE);
369
		break;
370
	default:
371
		break;
372
	}
373
	return (TRUE);
374
}
375
376
bool_t
377
xdr_statfsokres(XDR *xdrs, statfsokres *objp)
378
{
379
380
381
	if (!xdr_u_int(xdrs, &objp->tsize))
382
		return (FALSE);
383
	if (!xdr_u_int(xdrs, &objp->bsize))
384
		return (FALSE);
385
	if (!xdr_u_int(xdrs, &objp->blocks))
386
		return (FALSE);
387
	if (!xdr_u_int(xdrs, &objp->bfree))
388
		return (FALSE);
389
	if (!xdr_u_int(xdrs, &objp->bavail))
390
		return (FALSE);
391
	return (TRUE);
392
}
393
394
bool_t
395
xdr_statfsres(XDR *xdrs, statfsres *objp)
396
{
397
398
	if (!xdr_int(xdrs, &objp->status))
399
		return (FALSE);
400
	switch (objp->status) {
401
	case NFS_OK:
402
		if (!xdr_statfsokres(xdrs, &objp->statfsres_u.reply))
403
			return (FALSE);
404
		break;
405
	default:
406
		break;
407
	}
408
	return (TRUE);
409
}