1 /*
2  * Please do not edit this file.
3  * It was generated using rpcgen.
4  */
5 
6 #include "ypxfrd.h"
7 
8 #ifndef _KERNEL
9 #include <stdlib.h>
10 #endif /* !_KERNEL */
11 
12 /*
13  * CDDL HEADER START
14  *
15  * The contents of this file are subject to the terms of the
16  * Common Development and Distribution License, Version 1.0 only
17  * (the "License").  You may not use this file except in compliance
18  * with the License.
19  *
20  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
21  * or http://www.opensolaris.org/os/licensing.
22  * See the License for the specific language governing permissions
23  * and limitations under the License.
24  *
25  * When distributing Covered Code, include this CDDL HEADER in each
26  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
27  * If applicable, add the following below this CDDL HEADER, with the
28  * fields enclosed by brackets "[]" replaced with your own identifying
29  * information: Portions Copyright [yyyy] [name of copyright owner]
30  *
31  * CDDL HEADER END
32  *
33  * Copyright 1989 Sun Microsystems, Inc.  All rights reserved.
34  * Use is subject to license terms.
35  */
36 
37 #pragma ident	"%Z%%M%	%I%	%E% SMI"
38 
39 /*
40  * This is NOT source code!
41  * DO NOT EDIT THIS FILE!
42  */
43 
44 bool_t
45 xdr_answer(XDR *xdrs, answer *objp)
46 {
47 
48 	rpc_inline_t *buf;
49 
50 	if (!xdr_enum(xdrs, (enum_t *)objp))
51 		return (FALSE);
52 	return (TRUE);
53 }
54 
55 bool_t
56 xdr_pagblock(XDR *xdrs, pagblock objp)
57 {
58 
59 	rpc_inline_t *buf;
60 
61 	if (!xdr_opaque(xdrs, objp, PBLEN))
62 		return (FALSE);
63 	return (TRUE);
64 }
65 
66 bool_t
67 xdr_dirblock(XDR *xdrs, dirblock objp)
68 {
69 
70 	rpc_inline_t *buf;
71 
72 	if (!xdr_opaque(xdrs, objp, DBLEN))
73 		return (FALSE);
74 	return (TRUE);
75 }
76 
77 bool_t
78 xdr_pathname(XDR *xdrs, pathname *objp)
79 {
80 
81 	rpc_inline_t *buf;
82 
83 	if (!xdr_string(xdrs, objp, 1024))
84 		return (FALSE);
85 	return (TRUE);
86 }
87 
88 bool_t
89 xdr_hosereq(XDR *xdrs, hosereq *objp)
90 {
91 
92 	rpc_inline_t *buf;
93 
94 	if (!xdr_pathname(xdrs, &objp->map))
95 		return (FALSE);
96 	if (!xdr_pathname(xdrs, &objp->domain))
97 		return (FALSE);
98 	return (TRUE);
99 }
100 
101 bool_t
102 xdr_pagdat(XDR *xdrs, pagdat *objp)
103 {
104 
105 	rpc_inline_t *buf;
106 
107 	if (!xdr_int(xdrs, &objp->blkno))
108 		return (FALSE);
109 	if (!xdr_pagblock(xdrs, objp->blkdat))
110 		return (FALSE);
111 	return (TRUE);
112 }
113 
114 bool_t
115 xdr_dirdat(XDR *xdrs, dirdat *objp)
116 {
117 
118 	rpc_inline_t *buf;
119 
120 	if (!xdr_int(xdrs, &objp->blkno))
121 		return (FALSE);
122 	if (!xdr_dirblock(xdrs, objp->blkdat))
123 		return (FALSE);
124 	return (TRUE);
125 }
126 
127 bool_t
128 xdr_pag(XDR *xdrs, pag *objp)
129 {
130 
131 	rpc_inline_t *buf;
132 
133 	if (!xdr_answer(xdrs, &objp->status))
134 		return (FALSE);
135 	switch (objp->status) {
136 	case OK:
137 		if (!xdr_pagdat(xdrs, &objp->pag_u.ok))
138 			return (FALSE);
139 		break;
140 	}
141 	return (TRUE);
142 }
143 
144 bool_t
145 xdr_paglist(XDR *xdrs, paglist *objp)
146 {
147 
148 	rpc_inline_t *buf;
149 
150 	paglist *tmp_paglist;
151 	bool_t more_data = TRUE;
152 	bool_t first_objp = TRUE;
153 
154 
155 	if (xdrs->x_op == XDR_DECODE) {
156 
157 		while (more_data) {
158 
159 			void bzero();
160 
161 			if (!xdr_pag(xdrs, &objp->d))
162 				return (FALSE);
163 			if (!xdr_bool(xdrs, &more_data))
164 				return (FALSE);
165 
166 			if (!more_data) {
167 				objp->next = NULL;
168 				break;
169 			}
170 
171 			if (objp->next == NULL) {
172 				objp->next = (paglist *)
173 					mem_alloc(sizeof (paglist));
174 				if (objp->next == NULL)
175 					return (FALSE);
176 				bzero(objp->next, sizeof (paglist));
177 			}
178 			objp = objp->next;
179 		}
180 
181 	} else if (xdrs->x_op == XDR_ENCODE) {
182 
183 		while (more_data) {
184 			if (!xdr_pag(xdrs, &objp->d))
185 				return (FALSE);
186 			objp = objp->next;
187 			if (objp == NULL)
188 				more_data = FALSE;
189 			if (!xdr_bool(xdrs, &more_data))
190 				return (FALSE);
191 		}
192 
193 	} else {
194 
195 		while (more_data) {
196 			if (!xdr_pag(xdrs, &objp->d))
197 				return (FALSE);
198 			tmp_paglist = objp;
199 			objp = objp->next;
200 			if (objp == NULL)
201 				more_data = FALSE;
202 			if (!first_objp)
203 				mem_free(tmp_paglist, sizeof (paglist));
204 			else
205 				first_objp = FALSE;
206 		}
207 
208 	}
209 	return (TRUE);
210 }
211 
212 bool_t
213 xdr_dir(XDR *xdrs, dir *objp)
214 {
215 
216 	rpc_inline_t *buf;
217 
218 	if (!xdr_answer(xdrs, &objp->status))
219 		return (FALSE);
220 	switch (objp->status) {
221 	case OK:
222 		if (!xdr_dirdat(xdrs, &objp->dir_u.ok))
223 			return (FALSE);
224 		break;
225 	}
226 	return (TRUE);
227 }
228 
229 bool_t
230 xdr_dirlist(XDR *xdrs, dirlist *objp)
231 {
232 
233 	rpc_inline_t *buf;
234 
235 	dirlist *tmp_dirlist;
236 	bool_t more_data = TRUE;
237 	bool_t first_objp = TRUE;
238 
239 
240 	if (xdrs->x_op == XDR_DECODE) {
241 
242 		while (more_data) {
243 
244 			void bzero();
245 
246 			if (!xdr_dir(xdrs, &objp->d))
247 				return (FALSE);
248 			if (!xdr_bool(xdrs, &more_data))
249 				return (FALSE);
250 
251 			if (!more_data) {
252 				objp->next = NULL;
253 				break;
254 			}
255 
256 			if (objp->next == NULL) {
257 				objp->next = (dirlist *)
258 					mem_alloc(sizeof (dirlist));
259 				if (objp->next == NULL)
260 					return (FALSE);
261 				bzero(objp->next, sizeof (dirlist));
262 			}
263 			objp = objp->next;
264 		}
265 
266 	} else if (xdrs->x_op == XDR_ENCODE) {
267 
268 		while (more_data) {
269 			if (!xdr_dir(xdrs, &objp->d))
270 				return (FALSE);
271 			objp = objp->next;
272 			if (objp == NULL)
273 				more_data = FALSE;
274 			if (!xdr_bool(xdrs, &more_data))
275 				return (FALSE);
276 		}
277 
278 	} else {
279 
280 		while (more_data) {
281 			if (!xdr_dir(xdrs, &objp->d))
282 				return (FALSE);
283 			tmp_dirlist = objp;
284 			objp = objp->next;
285 			if (objp == NULL)
286 				more_data = FALSE;
287 			if (!first_objp)
288 				mem_free(tmp_dirlist, sizeof (dirlist));
289 			else
290 				first_objp = FALSE;
291 		}
292 
293 	}
294 	return (TRUE);
295 }
296 
297 bool_t
298 xdr_du(XDR *xdrs, du *objp)
299 {
300 
301 	rpc_inline_t *buf;
302 
303 	if (!xdr_paglist(xdrs, &objp->p))
304 		return (FALSE);
305 	if (!xdr_dirlist(xdrs, &objp->d))
306 		return (FALSE);
307 	return (TRUE);
308 }
309 
310 bool_t
311 xdr_dbmfyl(XDR *xdrs, dbmfyl *objp)
312 {
313 
314 	rpc_inline_t *buf;
315 
316 	if (!xdr_answer(xdrs, &objp->status))
317 		return (FALSE);
318 	switch (objp->status) {
319 	case OK:
320 		if (!xdr_du(xdrs, &objp->dbmfyl_u.ok))
321 			return (FALSE);
322 		break;
323 	}
324 	return (TRUE);
325 }
326