2 * Copyright (c) 1997-2014 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. Neither the name of the University nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * File: am-utils/amq/amq_clnt.c
42 #endif /* HAVE_CONFIG_H */
47 static struct timeval TIMEOUT = {ALLOWED_MOUNT_TIME, 0};
51 amqproc_null_1(voidp argp, CLIENT *clnt)
55 memset((char *) &res, 0, sizeof(res));
56 if (clnt_call(clnt, AMQPROC_NULL,
57 (XDRPROC_T_TYPE) xdr_void, argp,
58 (XDRPROC_T_TYPE) xdr_void, &res, TIMEOUT)
62 return ((voidp) &res);
67 amqproc_mnttree_1(amq_string *argp, CLIENT *clnt)
69 static amq_mount_tree_p res;
71 memset((char *) &res, 0, sizeof(res));
72 if (clnt_call(clnt, AMQPROC_MNTTREE,
73 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) argp,
74 (XDRPROC_T_TYPE) xdr_amq_mount_tree_p, (SVC_IN_ARG_TYPE) &res,
75 TIMEOUT) != RPC_SUCCESS) {
83 amqproc_umnt_1(amq_string *argp, CLIENT *clnt)
87 memset((char *) &res, 0, sizeof(res));
88 if (clnt_call(clnt, AMQPROC_UMNT,
89 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) argp,
90 (XDRPROC_T_TYPE) xdr_void, &res,
91 TIMEOUT) != RPC_SUCCESS) {
94 return ((voidp) &res);
99 amqproc_sync_umnt_1(amq_string *argp, CLIENT *clnt)
101 static amq_sync_umnt res;
104 memset((char *) &res, 0, sizeof(res));
105 if ((rv = clnt_call(clnt, AMQPROC_SYNC_UMNT,
106 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) argp,
107 (XDRPROC_T_TYPE) xdr_amq_sync_umnt, (SVC_IN_ARG_TYPE) &res,
108 TIMEOUT)) != RPC_SUCCESS) {
116 amqproc_stats_1(voidp argp, CLIENT *clnt)
118 static amq_mount_stats res;
120 memset((char *) &res, 0, sizeof(res));
121 if (clnt_call(clnt, AMQPROC_STATS,
122 (XDRPROC_T_TYPE) xdr_void, argp,
123 (XDRPROC_T_TYPE) xdr_amq_mount_stats,
124 (SVC_IN_ARG_TYPE) &res,
125 TIMEOUT) != RPC_SUCCESS) {
132 amq_mount_tree_list *
133 amqproc_export_1(voidp argp, CLIENT *clnt)
135 static amq_mount_tree_list res;
137 memset((char *) &res, 0, sizeof(res));
138 if (clnt_call(clnt, AMQPROC_EXPORT,
139 (XDRPROC_T_TYPE) xdr_void, argp,
140 (XDRPROC_T_TYPE) xdr_amq_mount_tree_list,
141 (SVC_IN_ARG_TYPE) &res, TIMEOUT) != RPC_SUCCESS) {
149 amqproc_setopt_1(amq_setopt *argp, CLIENT *clnt)
153 memset((char *) &res, 0, sizeof(res));
154 if (clnt_call(clnt, AMQPROC_SETOPT, (XDRPROC_T_TYPE) xdr_amq_setopt,
155 (SVC_IN_ARG_TYPE) argp, (XDRPROC_T_TYPE) xdr_int,
156 (SVC_IN_ARG_TYPE) &res, TIMEOUT) != RPC_SUCCESS) {
163 amq_mount_info_list *
164 amqproc_getmntfs_1(voidp argp, CLIENT *clnt)
166 static amq_mount_info_list res;
168 memset((char *) &res, 0, sizeof(res));
169 if (clnt_call(clnt, AMQPROC_GETMNTFS, (XDRPROC_T_TYPE) xdr_void, argp,
170 (XDRPROC_T_TYPE) xdr_amq_mount_info_list,
171 (SVC_IN_ARG_TYPE) &res, TIMEOUT) != RPC_SUCCESS) {
178 amqproc_getmapinfo_1(voidp argp, CLIENT *clnt)
180 static amq_map_info_list res;
182 memset((char *) &res, 0, sizeof(res));
183 if (clnt_call(clnt, AMQPROC_GETMAPINFO, (XDRPROC_T_TYPE) xdr_void, argp,
184 (XDRPROC_T_TYPE) xdr_amq_map_info_list,
185 (SVC_IN_ARG_TYPE) &res, TIMEOUT) != RPC_SUCCESS) {
193 amqproc_mount_1(voidp argp, CLIENT *clnt)
197 memset((char *) &res, 0, sizeof(res));
198 if (clnt_call(clnt, AMQPROC_MOUNT, (XDRPROC_T_TYPE) xdr_amq_string, argp,
199 (XDRPROC_T_TYPE) xdr_int, (SVC_IN_ARG_TYPE) &res,
200 TIMEOUT) != RPC_SUCCESS) {
208 amqproc_getvers_1(voidp argp, CLIENT *clnt)
210 static amq_string res;
212 memset((char *) &res, 0, sizeof(res));
213 if (clnt_call(clnt, AMQPROC_GETVERS, (XDRPROC_T_TYPE) xdr_void, argp,
214 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) &res,
215 TIMEOUT) != RPC_SUCCESS) {
223 amqproc_getpid_1(voidp argp, CLIENT *clnt)
227 memset((char *) &res, 0, sizeof(res));
228 if (clnt_call(clnt, AMQPROC_GETPID, (XDRPROC_T_TYPE) xdr_void, argp,
229 (XDRPROC_T_TYPE) xdr_int, (SVC_IN_ARG_TYPE) &res,
230 TIMEOUT) != RPC_SUCCESS) {
238 amqproc_pawd_1(amq_string *argp, CLIENT *clnt)
240 static amq_string res;
242 memset((char *) &res, 0, sizeof(res));
243 if (clnt_call(clnt, AMQPROC_PAWD,
244 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) argp,
245 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) &res,
246 TIMEOUT) != RPC_SUCCESS) {