Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / bsd / am-utils / dist / amq / amq_clnt.c
blobc633d613a4936ecea4f17928dd7ffdc62c916214
1 /* $NetBSD$ */
3 /*
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.
8 * All rights reserved.
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
15 * are met:
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
39 * SUCH DAMAGE.
42 * File: am-utils/amq/amq_clnt.c
46 #ifdef HAVE_CONFIG_H
47 # include <config.h>
48 #endif /* HAVE_CONFIG_H */
49 #include <am_defs.h>
50 #include <amq.h>
53 static struct timeval TIMEOUT = {ALLOWED_MOUNT_TIME, 0};
56 voidp
57 amqproc_null_1(voidp argp, CLIENT *clnt)
59 static char res;
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)
65 != RPC_SUCCESS) {
66 return (NULL);
68 return ((voidp) &res);
72 amq_mount_tree_p *
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) {
82 return (NULL);
84 return (&res);
88 voidp
89 amqproc_umnt_1(amq_string *argp, CLIENT *clnt)
91 static char res;
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) {
98 return (NULL);
100 return ((voidp) &res);
104 amq_sync_umnt *
105 amqproc_sync_umnt_1(amq_string *argp, CLIENT *clnt)
107 static amq_sync_umnt res;
108 enum clnt_stat rv;
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) {
115 return (NULL);
117 return &res;
121 amq_mount_stats *
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) {
132 return (NULL);
134 return (&res);
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) {
148 return (NULL);
150 return (&res);
154 int *
155 amqproc_setopt_1(amq_setopt *argp, CLIENT *clnt)
157 static int res;
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) {
163 return (NULL);
165 return (&res);
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) {
178 return (NULL);
180 return (&res);
184 int *
185 amqproc_mount_1(voidp argp, CLIENT *clnt)
187 static int res;
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) {
193 return (NULL);
195 return (&res);
199 amq_string *
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) {
208 return (NULL);
210 return (&res);
214 int *
215 amqproc_getpid_1(voidp argp, CLIENT *clnt)
217 static int res;
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) {
223 return (NULL);
225 return (&res);
229 amq_string *
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) {
239 return (NULL);
241 return (&res);