2 * Copyright (c) 1997-2006 Erez Zadok
3 * Copyright (c) 1990 Jan-Simon Pendry
4 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
5 * Copyright (c) 1990 The Regents of the University of California.
8 * This code is derived from software contributed to Berkeley by
9 * Jan-Simon Pendry at Imperial College, London.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgment:
21 * This product includes software developed by the University of
22 * California, Berkeley and its contributors.
23 * 4. Neither the name of the University nor the names of its contributors
24 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * File: am-utils/amq/amq_clnt.c
46 #endif /* HAVE_CONFIG_H */
51 static struct timeval TIMEOUT = {ALLOWED_MOUNT_TIME, 0};
55 amqproc_null_1(voidp argp, CLIENT *clnt)
59 memset((char *) &res, 0, sizeof(res));
60 if (clnt_call(clnt, AMQPROC_NULL,
61 (XDRPROC_T_TYPE) xdr_void, argp,
62 (XDRPROC_T_TYPE) xdr_void, &res, TIMEOUT)
66 return ((voidp) &res);
71 amqproc_mnttree_1(amq_string *argp, CLIENT *clnt)
73 static amq_mount_tree_p res;
75 memset((char *) &res, 0, sizeof(res));
76 if (clnt_call(clnt, AMQPROC_MNTTREE,
77 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) argp,
78 (XDRPROC_T_TYPE) xdr_amq_mount_tree_p, (SVC_IN_ARG_TYPE) &res,
79 TIMEOUT) != RPC_SUCCESS) {
87 amqproc_umnt_1(amq_string *argp, CLIENT *clnt)
91 memset((char *) &res, 0, sizeof(res));
92 if (clnt_call(clnt, AMQPROC_UMNT,
93 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) argp,
94 (XDRPROC_T_TYPE) xdr_void, &res,
95 TIMEOUT) != RPC_SUCCESS) {
98 return ((voidp) &res);
103 amqproc_stats_1(voidp argp, CLIENT *clnt)
105 static amq_mount_stats res;
107 memset((char *) &res, 0, sizeof(res));
108 if (clnt_call(clnt, AMQPROC_STATS,
109 (XDRPROC_T_TYPE) xdr_void, argp,
110 (XDRPROC_T_TYPE) xdr_amq_mount_stats,
111 (SVC_IN_ARG_TYPE) &res,
112 TIMEOUT) != RPC_SUCCESS) {
119 amq_mount_tree_list *
120 amqproc_export_1(voidp argp, CLIENT *clnt)
122 static amq_mount_tree_list res;
124 memset((char *) &res, 0, sizeof(res));
125 if (clnt_call(clnt, AMQPROC_EXPORT,
126 (XDRPROC_T_TYPE) xdr_void, argp,
127 (XDRPROC_T_TYPE) xdr_amq_mount_tree_list,
128 (SVC_IN_ARG_TYPE) &res, TIMEOUT) != RPC_SUCCESS) {
136 amqproc_setopt_1(amq_setopt *argp, CLIENT *clnt)
140 memset((char *) &res, 0, sizeof(res));
141 if (clnt_call(clnt, AMQPROC_SETOPT, (XDRPROC_T_TYPE) xdr_amq_setopt,
142 (SVC_IN_ARG_TYPE) argp, (XDRPROC_T_TYPE) xdr_int,
143 (SVC_IN_ARG_TYPE) &res, TIMEOUT) != RPC_SUCCESS) {
150 amq_mount_info_list *
151 amqproc_getmntfs_1(voidp argp, CLIENT *clnt)
153 static amq_mount_info_list res;
155 memset((char *) &res, 0, sizeof(res));
156 if (clnt_call(clnt, AMQPROC_GETMNTFS, (XDRPROC_T_TYPE) xdr_void, argp,
157 (XDRPROC_T_TYPE) xdr_amq_mount_info_list,
158 (SVC_IN_ARG_TYPE) &res, TIMEOUT) != RPC_SUCCESS) {
166 amqproc_mount_1(voidp argp, CLIENT *clnt)
170 memset((char *) &res, 0, sizeof(res));
171 if (clnt_call(clnt, AMQPROC_MOUNT, (XDRPROC_T_TYPE) xdr_amq_string, argp,
172 (XDRPROC_T_TYPE) xdr_int, (SVC_IN_ARG_TYPE) &res,
173 TIMEOUT) != RPC_SUCCESS) {
181 amqproc_getvers_1(voidp argp, CLIENT *clnt)
183 static amq_string res;
185 memset((char *) &res, 0, sizeof(res));
186 if (clnt_call(clnt, AMQPROC_GETVERS, (XDRPROC_T_TYPE) xdr_void, argp,
187 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) &res,
188 TIMEOUT) != RPC_SUCCESS) {
196 amqproc_getpid_1(voidp argp, CLIENT *clnt)
200 memset((char *) &res, 0, sizeof(res));
201 if (clnt_call(clnt, AMQPROC_GETPID, (XDRPROC_T_TYPE) xdr_void, argp,
202 (XDRPROC_T_TYPE) xdr_int, (SVC_IN_ARG_TYPE) &res,
203 TIMEOUT) != RPC_SUCCESS) {
211 amqproc_pawd_1(amq_string *argp, CLIENT *clnt)
213 static amq_string res;
215 memset((char *) &res, 0, sizeof(res));
216 if (clnt_call(clnt, AMQPROC_PAWD,
217 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) argp,
218 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) &res,
219 TIMEOUT) != RPC_SUCCESS) {