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_clnt.c
48 #endif /* HAVE_CONFIG_H */
53 static struct timeval TIMEOUT
= {ALLOWED_MOUNT_TIME
, 0};
57 amqproc_null_1(voidp argp
, CLIENT
*clnt
)
61 memset((char *) &res
, 0, sizeof(res
));
62 if (clnt_call(clnt
, AMQPROC_NULL
,
63 (XDRPROC_T_TYPE
) xdr_void
, argp
,
64 (XDRPROC_T_TYPE
) xdr_void
, &res
, TIMEOUT
)
68 return ((voidp
) &res
);
73 amqproc_mnttree_1(amq_string
*argp
, CLIENT
*clnt
)
75 static amq_mount_tree_p res
;
77 memset((char *) &res
, 0, sizeof(res
));
78 if (clnt_call(clnt
, AMQPROC_MNTTREE
,
79 (XDRPROC_T_TYPE
) xdr_amq_string
, (SVC_IN_ARG_TYPE
) argp
,
80 (XDRPROC_T_TYPE
) xdr_amq_mount_tree_p
, (SVC_IN_ARG_TYPE
) &res
,
81 TIMEOUT
) != RPC_SUCCESS
) {
89 amqproc_umnt_1(amq_string
*argp
, CLIENT
*clnt
)
93 memset((char *) &res
, 0, sizeof(res
));
94 if (clnt_call(clnt
, AMQPROC_UMNT
,
95 (XDRPROC_T_TYPE
) xdr_amq_string
, (SVC_IN_ARG_TYPE
) argp
,
96 (XDRPROC_T_TYPE
) xdr_void
, &res
,
97 TIMEOUT
) != RPC_SUCCESS
) {
100 return ((voidp
) &res
);
105 amqproc_sync_umnt_1(amq_string
*argp
, CLIENT
*clnt
)
107 static amq_sync_umnt res
;
110 memset((char *) &res
, 0, sizeof(res
));
111 if ((rv
= clnt_call(clnt
, AMQPROC_SYNC_UMNT
,
112 (XDRPROC_T_TYPE
) xdr_amq_string
, (SVC_IN_ARG_TYPE
) argp
,
113 (XDRPROC_T_TYPE
) xdr_amq_sync_umnt
, &res
,
114 TIMEOUT
)) != RPC_SUCCESS
) {
122 amqproc_stats_1(voidp argp
, CLIENT
*clnt
)
124 static amq_mount_stats res
;
126 memset((char *) &res
, 0, sizeof(res
));
127 if (clnt_call(clnt
, AMQPROC_STATS
,
128 (XDRPROC_T_TYPE
) xdr_void
, argp
,
129 (XDRPROC_T_TYPE
) xdr_amq_mount_stats
,
130 (SVC_IN_ARG_TYPE
) &res
,
131 TIMEOUT
) != RPC_SUCCESS
) {
138 amq_mount_tree_list
*
139 amqproc_export_1(voidp argp
, CLIENT
*clnt
)
141 static amq_mount_tree_list res
;
143 memset((char *) &res
, 0, sizeof(res
));
144 if (clnt_call(clnt
, AMQPROC_EXPORT
,
145 (XDRPROC_T_TYPE
) xdr_void
, argp
,
146 (XDRPROC_T_TYPE
) xdr_amq_mount_tree_list
,
147 (SVC_IN_ARG_TYPE
) &res
, TIMEOUT
) != RPC_SUCCESS
) {
155 amqproc_setopt_1(amq_setopt
*argp
, CLIENT
*clnt
)
159 memset((char *) &res
, 0, sizeof(res
));
160 if (clnt_call(clnt
, AMQPROC_SETOPT
, (XDRPROC_T_TYPE
) xdr_amq_setopt
,
161 (SVC_IN_ARG_TYPE
) argp
, (XDRPROC_T_TYPE
) xdr_int
,
162 (SVC_IN_ARG_TYPE
) &res
, TIMEOUT
) != RPC_SUCCESS
) {
169 amq_mount_info_list
*
170 amqproc_getmntfs_1(voidp argp
, CLIENT
*clnt
)
172 static amq_mount_info_list res
;
174 memset((char *) &res
, 0, sizeof(res
));
175 if (clnt_call(clnt
, AMQPROC_GETMNTFS
, (XDRPROC_T_TYPE
) xdr_void
, argp
,
176 (XDRPROC_T_TYPE
) xdr_amq_mount_info_list
,
177 (SVC_IN_ARG_TYPE
) &res
, TIMEOUT
) != RPC_SUCCESS
) {
185 amqproc_mount_1(voidp argp
, CLIENT
*clnt
)
189 memset((char *) &res
, 0, sizeof(res
));
190 if (clnt_call(clnt
, AMQPROC_MOUNT
, (XDRPROC_T_TYPE
) xdr_amq_string
, argp
,
191 (XDRPROC_T_TYPE
) xdr_int
, (SVC_IN_ARG_TYPE
) &res
,
192 TIMEOUT
) != RPC_SUCCESS
) {
200 amqproc_getvers_1(voidp argp
, CLIENT
*clnt
)
202 static amq_string res
;
204 memset((char *) &res
, 0, sizeof(res
));
205 if (clnt_call(clnt
, AMQPROC_GETVERS
, (XDRPROC_T_TYPE
) xdr_void
, argp
,
206 (XDRPROC_T_TYPE
) xdr_amq_string
, (SVC_IN_ARG_TYPE
) &res
,
207 TIMEOUT
) != RPC_SUCCESS
) {
215 amqproc_getpid_1(voidp argp
, CLIENT
*clnt
)
219 memset((char *) &res
, 0, sizeof(res
));
220 if (clnt_call(clnt
, AMQPROC_GETPID
, (XDRPROC_T_TYPE
) xdr_void
, argp
,
221 (XDRPROC_T_TYPE
) xdr_int
, (SVC_IN_ARG_TYPE
) &res
,
222 TIMEOUT
) != RPC_SUCCESS
) {
230 amqproc_pawd_1(amq_string
*argp
, CLIENT
*clnt
)
232 static amq_string res
;
234 memset((char *) &res
, 0, sizeof(res
));
235 if (clnt_call(clnt
, AMQPROC_PAWD
,
236 (XDRPROC_T_TYPE
) xdr_amq_string
, (SVC_IN_ARG_TYPE
) argp
,
237 (XDRPROC_T_TYPE
) xdr_amq_string
, (SVC_IN_ARG_TYPE
) &res
,
238 TIMEOUT
) != RPC_SUCCESS
) {