dma: move sender into queue
[dragonfly.git] / contrib / amd / amq / amq_clnt.c
blob1251c879fccfb9e1e6980f65d9f2e45c9dc24d07
1 /*
2 * Copyright (c) 1997-1999 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.
6 * All rights reserved.
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
13 * are met:
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
37 * SUCH DAMAGE.
39 * %W% (Berkeley) %G%
41 * $Id: amq_clnt.c,v 1.2 1999/01/10 21:53:59 ezk Exp $
45 #ifdef HAVE_CONFIG_H
46 # include <config.h>
47 #endif /* HAVE_CONFIG_H */
48 #include <am_defs.h>
49 #include <amq.h>
52 static struct timeval TIMEOUT = {ALLOWED_MOUNT_TIME, 0};
55 voidp
56 amqproc_null_1(voidp argp, CLIENT *clnt)
58 static char res;
60 memset((char *) &res, 0, sizeof(res));
61 if (clnt_call(clnt, AMQPROC_NULL,
62 (XDRPROC_T_TYPE) xdr_void, argp,
63 (XDRPROC_T_TYPE) xdr_void, &res, TIMEOUT)
64 != RPC_SUCCESS) {
65 return (NULL);
67 return ((voidp) &res);
71 amq_mount_tree_p *
72 amqproc_mnttree_1(amq_string *argp, CLIENT *clnt)
74 static amq_mount_tree_p res;
76 memset((char *) &res, 0, sizeof(res));
77 if (clnt_call(clnt, AMQPROC_MNTTREE,
78 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) argp,
79 (XDRPROC_T_TYPE) xdr_amq_mount_tree_p, (SVC_IN_ARG_TYPE) & res,
80 TIMEOUT) != RPC_SUCCESS) {
81 return (NULL);
83 return (&res);
87 voidp
88 amqproc_umnt_1(amq_string *argp, CLIENT *clnt)
90 static char res;
92 memset((char *) &res, 0, sizeof(res));
93 if (clnt_call(clnt, AMQPROC_UMNT,
94 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) argp,
95 (XDRPROC_T_TYPE) xdr_void, &res,
96 TIMEOUT) != RPC_SUCCESS) {
97 return (NULL);
99 return ((voidp) &res);
103 amq_mount_stats *
104 amqproc_stats_1(voidp argp, CLIENT *clnt)
106 static amq_mount_stats res;
108 memset((char *) &res, 0, sizeof(res));
109 if (clnt_call(clnt, AMQPROC_STATS,
110 (XDRPROC_T_TYPE) xdr_void, argp,
111 (XDRPROC_T_TYPE) xdr_amq_mount_stats,
112 (SVC_IN_ARG_TYPE) & res,
113 TIMEOUT) != RPC_SUCCESS) {
114 return (NULL);
116 return (&res);
120 amq_mount_tree_list *
121 amqproc_export_1(voidp argp, CLIENT *clnt)
123 static amq_mount_tree_list res;
125 memset((char *) &res, 0, sizeof(res));
126 if (clnt_call(clnt, AMQPROC_EXPORT,
127 (XDRPROC_T_TYPE) xdr_void, argp,
128 (XDRPROC_T_TYPE) xdr_amq_mount_tree_list,
129 (SVC_IN_ARG_TYPE) & res, TIMEOUT) != RPC_SUCCESS) {
130 return (NULL);
132 return (&res);
136 int *
137 amqproc_setopt_1(amq_setopt *argp, CLIENT *clnt)
139 static int res;
141 memset((char *) &res, 0, sizeof(res));
142 if (clnt_call(clnt, AMQPROC_SETOPT, (XDRPROC_T_TYPE) xdr_amq_setopt,
143 (SVC_IN_ARG_TYPE) argp, (XDRPROC_T_TYPE) xdr_int,
144 (SVC_IN_ARG_TYPE) & res, TIMEOUT) != RPC_SUCCESS) {
145 return (NULL);
147 return (&res);
151 amq_mount_info_list *
152 amqproc_getmntfs_1(voidp argp, CLIENT *clnt)
154 static amq_mount_info_list res;
156 memset((char *) &res, 0, sizeof(res));
157 if (clnt_call(clnt, AMQPROC_GETMNTFS, (XDRPROC_T_TYPE) xdr_void, argp,
158 (XDRPROC_T_TYPE) xdr_amq_mount_info_list,
159 (SVC_IN_ARG_TYPE) & res, TIMEOUT) != RPC_SUCCESS) {
160 return (NULL);
162 return (&res);
166 int *
167 amqproc_mount_1(voidp argp, CLIENT *clnt)
169 static int res;
171 memset((char *) &res, 0, sizeof(res));
172 if (clnt_call(clnt, AMQPROC_MOUNT, (XDRPROC_T_TYPE) xdr_amq_string, argp,
173 (XDRPROC_T_TYPE) xdr_int, (SVC_IN_ARG_TYPE) & res,
174 TIMEOUT) != RPC_SUCCESS) {
175 return (NULL);
177 return (&res);
181 amq_string *
182 amqproc_getvers_1(voidp argp, CLIENT *clnt)
184 static amq_string res;
186 memset((char *) &res, 0, sizeof(res));
187 if (clnt_call(clnt, AMQPROC_GETVERS, (XDRPROC_T_TYPE) xdr_void, argp,
188 (XDRPROC_T_TYPE) xdr_amq_string, (SVC_IN_ARG_TYPE) & res,
189 TIMEOUT) != RPC_SUCCESS) {
190 return (NULL);
192 return (&res);
196 int *
197 amqproc_getpid_1(voidp argp, CLIENT *clnt)
199 static int res;
201 memset((char *) &res, 0, sizeof(res));
202 if (clnt_call(clnt, AMQPROC_GETPID, (XDRPROC_T_TYPE) xdr_void, argp,
203 (XDRPROC_T_TYPE) xdr_int, (SVC_IN_ARG_TYPE) & res,
204 TIMEOUT) != RPC_SUCCESS) {
205 return (NULL);
207 return (&res);