xref: /original-bsd/usr.sbin/amd/rpcx/amq_clnt.c (revision 93ab02a6)
1 /*
2  * Copyright (c) 1990 Jan-Simon Pendry
3  * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
4  * Copyright (c) 1990 The Regents of the University of California.
5  * 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  * %sccs.include.redist.c%
11  *
12  *	@(#)amq_clnt.c	5.3 (Berkeley) 05/12/91
13  *
14  * $Id: amq_clnt.c,v 5.2.1.3 91/05/07 22:18:52 jsp Alpha $
15  *
16  */
17 
18 #include "am.h"
19 #include "amq.h"
20 
21 static struct timeval TIMEOUT = { ALLOWED_MOUNT_TIME, 0 };
22 
23 voidp
24 amqproc_null_1(argp, clnt)
25 	voidp argp;
26 	CLIENT *clnt;
27 {
28 	static char res;
29 
30 	bzero((char *)&res, sizeof(res));
31 	if (clnt_call(clnt, AMQPROC_NULL, xdr_void, argp, xdr_void, &res, TIMEOUT) != RPC_SUCCESS) {
32 		return (NULL);
33 	}
34 	return ((voidp)&res);
35 }
36 
37 
38 amq_mount_tree_p *
39 amqproc_mnttree_1(argp, clnt)
40 	amq_string *argp;
41 	CLIENT *clnt;
42 {
43 	static amq_mount_tree_p res;
44 
45 	bzero((char *)&res, sizeof(res));
46 	if (clnt_call(clnt, AMQPROC_MNTTREE, xdr_amq_string, argp, xdr_amq_mount_tree_p, &res, TIMEOUT) != RPC_SUCCESS) {
47 		return (NULL);
48 	}
49 	return (&res);
50 }
51 
52 
53 voidp
54 amqproc_umnt_1(argp, clnt)
55 	amq_string *argp;
56 	CLIENT *clnt;
57 {
58 	static char res;
59 
60 	bzero((char *)&res, sizeof(res));
61 	if (clnt_call(clnt, AMQPROC_UMNT, xdr_amq_string, argp, xdr_void, &res, TIMEOUT) != RPC_SUCCESS) {
62 		return (NULL);
63 	}
64 	return ((voidp)&res);
65 }
66 
67 
68 amq_mount_stats *
69 amqproc_stats_1(argp, clnt)
70 	voidp argp;
71 	CLIENT *clnt;
72 {
73 	static amq_mount_stats res;
74 
75 	bzero((char *)&res, sizeof(res));
76 	if (clnt_call(clnt, AMQPROC_STATS, xdr_void, argp, xdr_amq_mount_stats, &res, TIMEOUT) != RPC_SUCCESS) {
77 		return (NULL);
78 	}
79 	return (&res);
80 }
81 
82 
83 amq_mount_tree_list *
84 amqproc_export_1(argp, clnt)
85 	voidp argp;
86 	CLIENT *clnt;
87 {
88 	static amq_mount_tree_list res;
89 
90 	bzero((char *)&res, sizeof(res));
91 	if (clnt_call(clnt, AMQPROC_EXPORT, xdr_void, argp, xdr_amq_mount_tree_list, &res, TIMEOUT) != RPC_SUCCESS) {
92 		return (NULL);
93 	}
94 	return (&res);
95 }
96 
97 int *
98 amqproc_setopt_1(argp, clnt)
99 	amq_setopt *argp;
100 	CLIENT *clnt;
101 {
102 	static int res;
103 
104 	bzero((char *)&res, sizeof(res));
105 	if (clnt_call(clnt, AMQPROC_SETOPT, xdr_amq_setopt, argp, xdr_int, &res, TIMEOUT) != RPC_SUCCESS) {
106 		return (NULL);
107 	}
108 	return (&res);
109 }
110 
111 
112 amq_mount_info_list *
113 amqproc_getmntfs_1(argp, clnt)
114 	voidp argp;
115 	CLIENT *clnt;
116 {
117 	static amq_mount_info_list res;
118 
119 	bzero((char *)&res, sizeof(res));
120 	if (clnt_call(clnt, AMQPROC_GETMNTFS, xdr_void, argp, xdr_amq_mount_info_list, &res, TIMEOUT) != RPC_SUCCESS) {
121 		return (NULL);
122 	}
123 	return (&res);
124 }
125 
126 
127 int *
128 amqproc_mount_1(argp, clnt)
129 	voidp argp;
130 	CLIENT *clnt;
131 {
132 	static int res;
133 
134 	bzero((char *)&res, sizeof(res));
135 	if (clnt_call(clnt, AMQPROC_MOUNT, xdr_amq_string, argp, xdr_int, &res, TIMEOUT) != RPC_SUCCESS) {
136 		return (NULL);
137 	}
138 	return (&res);
139 }
140 
141 
142 amq_string *
143 amqproc_getvers_1(argp, clnt)
144 	voidp argp;
145 	CLIENT *clnt;
146 {
147 	static amq_string res;
148 
149 	bzero((char *)&res, sizeof(res));
150 	if (clnt_call(clnt, AMQPROC_GETVERS, xdr_void, argp, xdr_amq_string, &res, TIMEOUT) != RPC_SUCCESS) {
151 		return (NULL);
152 	}
153 	return (&res);
154 }
155 
156