summaryrefslogtreecommitdiffstats
path: root/isys/mount_xdr.c
blob: 542a7efb0be0ca121345a1f206422974261ef8d2 (plain)
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
/*
 * Please do not edit this file.
 * It was generated using rpcgen.
 */

#include "mount.h"

bool_t
xdr_fhandle(XDR *xdrs, fhandle objp)
{
	 if (!xdr_opaque(xdrs, objp, FHSIZE)) {
		 return (FALSE);
	 }
	return (TRUE);
}

bool_t
xdr_fhstatus(XDR *xdrs, fhstatus *objp)
{

	 if (!xdr_u_int(xdrs, &objp->fhs_status)) {
		 return (FALSE);
	 }
	switch (objp->fhs_status) {
	case 0:
		 if (!xdr_fhandle(xdrs, objp->fhstatus_u.fhs_fhandle)) {
			 return (FALSE);
		 }
		break;
	default:
		break;
	}
	return (TRUE);
}

bool_t
xdr_dirpath(XDR *xdrs, dirpath *objp)
{

	 if (!xdr_string(xdrs, objp, MNTPATHLEN)) {
		 return (FALSE);
	 }
	return (TRUE);
}

bool_t
xdr_name(XDR *xdrs, name *objp)
{

	 if (!xdr_string(xdrs, objp, MNTNAMLEN)) {
		 return (FALSE);
	 }
	return (TRUE);
}

bool_t
xdr_mountlist(XDR *xdrs, mountlist *objp)
{

	 if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct mountbody), (xdrproc_t)xdr_mountbody)) {
		 return (FALSE);
	 }
	return (TRUE);
}

bool_t
xdr_mountbody(XDR *xdrs, mountbody *objp)
{

	 if (!xdr_name(xdrs, &objp->ml_hostname)) {
		 return (FALSE);
	 }
	 if (!xdr_dirpath(xdrs, &objp->ml_directory)) {
		 return (FALSE);
	 }
	 if (!xdr_mountlist(xdrs, &objp->ml_next)) {
		 return (FALSE);
	 }
	return (TRUE);
}

bool_t
xdr_groups(XDR *xdrs, groups *objp)
{

	 if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct groupnode), (xdrproc_t)xdr_groupnode)) {
		 return (FALSE);
	 }
	return (TRUE);
}

bool_t
xdr_groupnode(XDR *xdrs, groupnode *objp)
{

	 if (!xdr_name(xdrs, &objp->gr_name)) {
		 return (FALSE);
	 }
	 if (!xdr_groups(xdrs, &objp->gr_next)) {
		 return (FALSE);
	 }
	return (TRUE);
}

bool_t
xdr_exports(XDR *xdrs, exports *objp)
{

	 if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct exportnode), (xdrproc_t)xdr_exportnode)) {
		 return (FALSE);
	 }
	return (TRUE);
}

bool_t
xdr_exportnode(XDR *xdrs, exportnode *objp)
{

	 if (!xdr_dirpath(xdrs, &objp->ex_dir)) {
		 return (FALSE);
	 }
	 if (!xdr_groups(xdrs, &objp->ex_groups)) {
		 return (FALSE);
	 }
	 if (!xdr_exports(xdrs, &objp->ex_next)) {
		 return (FALSE);
	 }
	return (TRUE);
}