xref: /openbsd/usr.sbin/amd/rpcx/amq_clnt.c (revision 78b63d65)
1 /*
2  * Copyright (c) 1990 Jan-Simon Pendry
3  * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
4  * Copyright (c) 1990, 1993
5  *	The Regents of the University of California.  All rights reserved.
6  *
7  * This code is derived from software contributed to Berkeley by
8  * Jan-Simon Pendry at Imperial College, London.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  * 3. All advertising materials mentioning features or use of this software
19  *    must display the following acknowledgement:
20  *	This product includes software developed by the University of
21  *	California, Berkeley and its contributors.
22  * 4. Neither the name of the University nor the names of its contributors
23  *    may be used to endorse or promote products derived from this software
24  *    without specific prior written permission.
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36  * SUCH DAMAGE.
37  *
38  *	from: @(#)amq_clnt.c	8.1 (Berkeley) 6/6/93
39  *	$Id: amq_clnt.c,v 1.1.1.1 1995/10/18 08:47:22 deraadt Exp $
40  *
41  */
42 
43 #include "am.h"
44 #include "amq.h"
45 
46 static struct timeval TIMEOUT = { ALLOWED_MOUNT_TIME, 0 };
47 
48 voidp
49 amqproc_null_1(argp, clnt)
50 	voidp argp;
51 	CLIENT *clnt;
52 {
53 	static char res;
54 
55 	bzero((char *)&res, sizeof(res));
56 	if (clnt_call(clnt, AMQPROC_NULL, xdr_void, argp, xdr_void, &res, TIMEOUT) != RPC_SUCCESS) {
57 		return (NULL);
58 	}
59 	return ((voidp)&res);
60 }
61 
62 
63 amq_mount_tree_p *
64 amqproc_mnttree_1(argp, clnt)
65 	amq_string *argp;
66 	CLIENT *clnt;
67 {
68 	static amq_mount_tree_p res;
69 
70 	bzero((char *)&res, sizeof(res));
71 	if (clnt_call(clnt, AMQPROC_MNTTREE, xdr_amq_string, argp, xdr_amq_mount_tree_p, &res, TIMEOUT) != RPC_SUCCESS) {
72 		return (NULL);
73 	}
74 	return (&res);
75 }
76 
77 
78 voidp
79 amqproc_umnt_1(argp, clnt)
80 	amq_string *argp;
81 	CLIENT *clnt;
82 {
83 	static char res;
84 
85 	bzero((char *)&res, sizeof(res));
86 	if (clnt_call(clnt, AMQPROC_UMNT, xdr_amq_string, argp, xdr_void, &res, TIMEOUT) != RPC_SUCCESS) {
87 		return (NULL);
88 	}
89 	return ((voidp)&res);
90 }
91 
92 
93 amq_mount_stats *
94 amqproc_stats_1(argp, clnt)
95 	voidp argp;
96 	CLIENT *clnt;
97 {
98 	static amq_mount_stats res;
99 
100 	bzero((char *)&res, sizeof(res));
101 	if (clnt_call(clnt, AMQPROC_STATS, xdr_void, argp, xdr_amq_mount_stats, &res, TIMEOUT) != RPC_SUCCESS) {
102 		return (NULL);
103 	}
104 	return (&res);
105 }
106 
107 
108 amq_mount_tree_list *
109 amqproc_export_1(argp, clnt)
110 	voidp argp;
111 	CLIENT *clnt;
112 {
113 	static amq_mount_tree_list res;
114 
115 	bzero((char *)&res, sizeof(res));
116 	if (clnt_call(clnt, AMQPROC_EXPORT, xdr_void, argp, xdr_amq_mount_tree_list, &res, TIMEOUT) != RPC_SUCCESS) {
117 		return (NULL);
118 	}
119 	return (&res);
120 }
121 
122 int *
123 amqproc_setopt_1(argp, clnt)
124 	amq_setopt *argp;
125 	CLIENT *clnt;
126 {
127 	static int res;
128 
129 	bzero((char *)&res, sizeof(res));
130 	if (clnt_call(clnt, AMQPROC_SETOPT, xdr_amq_setopt, argp, xdr_int, &res, TIMEOUT) != RPC_SUCCESS) {
131 		return (NULL);
132 	}
133 	return (&res);
134 }
135 
136 
137 amq_mount_info_list *
138 amqproc_getmntfs_1(argp, clnt)
139 	voidp argp;
140 	CLIENT *clnt;
141 {
142 	static amq_mount_info_list res;
143 
144 	bzero((char *)&res, sizeof(res));
145 	if (clnt_call(clnt, AMQPROC_GETMNTFS, xdr_void, argp, xdr_amq_mount_info_list, &res, TIMEOUT) != RPC_SUCCESS) {
146 		return (NULL);
147 	}
148 	return (&res);
149 }
150 
151 
152 int *
153 amqproc_mount_1(argp, clnt)
154 	voidp argp;
155 	CLIENT *clnt;
156 {
157 	static int res;
158 
159 	bzero((char *)&res, sizeof(res));
160 	if (clnt_call(clnt, AMQPROC_MOUNT, xdr_amq_string, argp, xdr_int, &res, TIMEOUT) != RPC_SUCCESS) {
161 		return (NULL);
162 	}
163 	return (&res);
164 }
165 
166 
167 amq_string *
168 amqproc_getvers_1(argp, clnt)
169 	voidp argp;
170 	CLIENT *clnt;
171 {
172 	static amq_string res;
173 
174 	bzero((char *)&res, sizeof(res));
175 	if (clnt_call(clnt, AMQPROC_GETVERS, xdr_void, argp, xdr_amq_string, &res, TIMEOUT) != RPC_SUCCESS) {
176 		return (NULL);
177 	}
178 	return (&res);
179 }
180 
181