4 * Copyright (c) 1997-2009 Erez Zadok
5 * Copyright (c) 1990 Jan-Simon Pendry
6 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
7 * Copyright (c) 1990 The Regents of the University of California.
10 * This code is derived from software contributed to Berkeley by
11 * Jan-Simon Pendry at Imperial College, London.
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. All advertising materials mentioning features or use of this software
22 * must display the following acknowledgment:
23 * This product includes software developed by the University of
24 * California, Berkeley and its contributors.
25 * 4. Neither the name of the University nor the names of its contributors
26 * may be used to endorse or promote products derived from this software
27 * without specific prior written permission.
29 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
30 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
33 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 * File: am-utils/amq/amq_xdr.c
48 #endif /* HAVE_CONFIG_H */
54 xdr_time_type(XDR
*xdrs
, time_type
*objp
)
56 if (!xdr_long(xdrs
, (long *) objp
)) {
64 xdr_amq_mount_tree(XDR
*xdrs
, amq_mount_tree
*objp
)
67 if (!xdr_amq_string(xdrs
, &objp
->mt_mountinfo
)) {
71 if (!xdr_amq_string(xdrs
, &objp
->mt_directory
)) {
75 if (!xdr_amq_string(xdrs
, &objp
->mt_mountpoint
)) {
79 if (!xdr_amq_string(xdrs
, &objp
->mt_type
)) {
83 if (!xdr_time_type(xdrs
, &objp
->mt_mounttime
)) {
87 if (!xdr_u_short(xdrs
, &objp
->mt_mountuid
)) {
91 if (!xdr_int(xdrs
, &objp
->mt_getattr
)) {
95 if (!xdr_int(xdrs
, &objp
->mt_lookup
)) {
99 if (!xdr_int(xdrs
, &objp
->mt_readdir
)) {
103 if (!xdr_int(xdrs
, &objp
->mt_readlink
)) {
107 if (!xdr_int(xdrs
, &objp
->mt_statfs
)) {
111 if (!xdr_pointer(xdrs
,
112 (char **) ((voidp
) &objp
->mt_next
),
113 sizeof(amq_mount_tree
),
114 (XDRPROC_T_TYPE
) xdr_amq_mount_tree
)) {
118 if (!xdr_pointer(xdrs
,
119 (char **) ((voidp
) &objp
->mt_child
),
120 sizeof(amq_mount_tree
),
121 (XDRPROC_T_TYPE
) xdr_amq_mount_tree
)) {
130 xdr_amq_mount_tree_p(XDR
*xdrs
, amq_mount_tree_p
*objp
)
132 if (!xdr_pointer(xdrs
,
134 sizeof(amq_mount_tree
),
135 (XDRPROC_T_TYPE
) xdr_amq_mount_tree
)) {
143 xdr_amq_mount_info(XDR
*xdrs
, amq_mount_info
*objp
)
146 if (!xdr_amq_string(xdrs
, &objp
->mi_type
)) {
150 if (!xdr_amq_string(xdrs
, &objp
->mi_mountpt
)) {
154 if (!xdr_amq_string(xdrs
, &objp
->mi_mountinfo
)) {
158 if (!xdr_amq_string(xdrs
, &objp
->mi_fserver
)) {
162 if (!xdr_int(xdrs
, &objp
->mi_error
)) {
166 if (!xdr_int(xdrs
, &objp
->mi_refc
)) {
170 if (!xdr_int(xdrs
, &objp
->mi_up
)) {
179 xdr_amq_mount_info_list(XDR
*xdrs
, amq_mount_info_list
*objp
)
182 (char **) ((voidp
) &objp
->amq_mount_info_list_val
),
183 (u_int
*) &objp
->amq_mount_info_list_len
,
185 sizeof(amq_mount_info
),
186 (XDRPROC_T_TYPE
) xdr_amq_mount_info
)) {
194 xdr_amq_mount_tree_list(XDR
*xdrs
, amq_mount_tree_list
*objp
)
197 (char **) ((voidp
) &objp
->amq_mount_tree_list_val
),
198 (u_int
*) &objp
->amq_mount_tree_list_len
,
200 sizeof(amq_mount_tree_p
),
201 (XDRPROC_T_TYPE
) xdr_amq_mount_tree_p
)) {
209 xdr_amq_mount_stats(XDR
*xdrs
, amq_mount_stats
*objp
)
212 if (!xdr_int(xdrs
, &objp
->as_drops
)) {
216 if (!xdr_int(xdrs
, &objp
->as_stale
)) {
220 if (!xdr_int(xdrs
, &objp
->as_mok
)) {
224 if (!xdr_int(xdrs
, &objp
->as_merr
)) {
228 if (!xdr_int(xdrs
, &objp
->as_uerr
)) {
237 xdr_amq_opt(XDR
*xdrs
, amq_opt
*objp
)
239 if (!xdr_enum(xdrs
, (enum_t
*) objp
)) {
247 xdr_amq_setopt(XDR
*xdrs
, amq_setopt
*objp
)
250 if (!xdr_amq_opt(xdrs
, &objp
->as_opt
)) {
254 if (!xdr_amq_string(xdrs
, &objp
->as_str
)) {
263 xdr_pri_free(XDRPROC_T_TYPE xdr_args
, caddr_t args_ptr
)
268 return ((*xdr_args
) (&xdr
, (caddr_t
*) args_ptr
));