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