vxi11 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/ext/vxi11/clnt_find_services.c +322 -0
- data/ext/vxi11/extconf.rb +5 -0
- data/ext/vxi11/vxi11_clnt.c +234 -0
- data/ext/vxi11/vxi11_user.cc +639 -0
- data/ext/vxi11/vxi11_xdr.c +465 -0
- data/lib/vxi11.rb +8 -0
- metadata +78 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e3bc860034b8caa8482d52f3ffb2a56b8c664e56
|
4
|
+
data.tar.gz: 5e4a1ccb9593b13d24493ca67e73de274d8e6847
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c64e49fb613f43e5c5bf56443eb4da0eec218d3c95460d0e1066e1b8f572076ec776eaae306241a071adf92da0082dfe91c9154a0ebf456f13b6120afb44f0be
|
7
|
+
data.tar.gz: 95927ab88465a16ac8ea802e37c50a1f54574191bbbdc49af1600645d8bafdc1eb131e9f1cb8fdd90f094e872c1d7ca43c6f0f322e36859c20af987cfd08eb18
|
@@ -0,0 +1,322 @@
|
|
1
|
+
/*
|
2
|
+
* This code contains modifications to clnt_broadcast available in the
|
3
|
+
* rpc.subproj/pmap_rmt.c. A summary of modifications:
|
4
|
+
*
|
5
|
+
* 1. Allow blocking time to be set by the user, the previous hard-coded
|
6
|
+
* times were not general enough.
|
7
|
+
* 2. Calls PORTMAP_GETPORT to determine if there's a service that satisfies
|
8
|
+
* the input specifications
|
9
|
+
* 3. The clnt_broadcast has been renamed to clnt_find_services.
|
10
|
+
*
|
11
|
+
* M. Marino November 2011
|
12
|
+
*
|
13
|
+
*/
|
14
|
+
/*
|
15
|
+
* Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
|
16
|
+
*
|
17
|
+
* @APPLE_LICENSE_HEADER_START@
|
18
|
+
*
|
19
|
+
* Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
|
20
|
+
* Reserved. This file contains Original Code and/or Modifications of
|
21
|
+
* Original Code as defined in and that are subject to the Apple Public
|
22
|
+
* Source License Version 1.1 (the "License"). You may not use this file
|
23
|
+
* except in compliance with the License. Please obtain a copy of the
|
24
|
+
* License at http://www.apple.com/publicsource and read it before using
|
25
|
+
* this file.
|
26
|
+
*
|
27
|
+
* The Original Code and all software distributed under the License are
|
28
|
+
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
29
|
+
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
30
|
+
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
31
|
+
* FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
|
32
|
+
* License for the specific language governing rights and limitations
|
33
|
+
* under the License.
|
34
|
+
*
|
35
|
+
* @APPLE_LICENSE_HEADER_END@
|
36
|
+
*/
|
37
|
+
/*
|
38
|
+
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
39
|
+
* unrestricted use provided that this legend is included on all tape
|
40
|
+
* media and as a part of the software program in whole or part. Users
|
41
|
+
* may copy or modify Sun RPC without charge, but are not authorized
|
42
|
+
* to license or distribute it to anyone else except as part of a product or
|
43
|
+
* program developed by the user.
|
44
|
+
*
|
45
|
+
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
46
|
+
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
47
|
+
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
48
|
+
*
|
49
|
+
* Sun RPC is provided with no support and without any obligation on the
|
50
|
+
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
51
|
+
* modification or enhancement.
|
52
|
+
*
|
53
|
+
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
54
|
+
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
55
|
+
* OR ANY PART THEREOF.
|
56
|
+
*
|
57
|
+
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
58
|
+
* or profits or other special, indirect and consequential damages, even if
|
59
|
+
* Sun has been advised of the possibility of such damages.
|
60
|
+
*
|
61
|
+
* Sun Microsystems, Inc.
|
62
|
+
* 2550 Garcia Avenue
|
63
|
+
* Mountain View, California 94043
|
64
|
+
*/
|
65
|
+
|
66
|
+
#include "clnt_find_services.h"
|
67
|
+
#include <rpc/xdr.h>
|
68
|
+
#include <arpa/inet.h>
|
69
|
+
#include <rpc/pmap_rmt.h>
|
70
|
+
#include <rpc/pmap_prot.h>
|
71
|
+
#include <unistd.h>
|
72
|
+
#include <sys/socket.h>
|
73
|
+
#include <sys/fcntl.h>
|
74
|
+
#include <stdio.h>
|
75
|
+
#include <string.h>
|
76
|
+
#include <errno.h>
|
77
|
+
#include <net/if.h>
|
78
|
+
#include <sys/ioctl.h>
|
79
|
+
#define MAX_BROADCAST_SIZE 1400
|
80
|
+
|
81
|
+
int
|
82
|
+
getbroadcastnets(struct in_addr *addrs, int sock, char *buf)
|
83
|
+
{
|
84
|
+
struct ifconf ifc;
|
85
|
+
struct ifreq ifreq, *ifr;
|
86
|
+
struct sockaddr_in *sin;
|
87
|
+
char *cp, *cplim;
|
88
|
+
int i = 0;
|
89
|
+
|
90
|
+
ifc.ifc_len = UDPMSGSIZE;
|
91
|
+
ifc.ifc_buf = buf;
|
92
|
+
if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) {
|
93
|
+
perror("broadcast: ioctl (get interface configuration)");
|
94
|
+
return (0);
|
95
|
+
}
|
96
|
+
#if defined __APPLE__ /* This should really be BSD */
|
97
|
+
#define max(a, b) (a > b ? a : b)
|
98
|
+
#define size(p) max((p).sa_len, sizeof(p))
|
99
|
+
#endif
|
100
|
+
cplim = buf + ifc.ifc_len; /*skip over if's with big ifr_addr's */
|
101
|
+
for (cp = buf; cp < cplim;
|
102
|
+
#if defined __APPLE__ /* This should really be BSD */
|
103
|
+
cp += sizeof (ifr->ifr_name) + size(ifr->ifr_addr)) {
|
104
|
+
#else
|
105
|
+
cp += sizeof (*ifr)) {
|
106
|
+
#endif
|
107
|
+
ifr = (struct ifreq *)cp;
|
108
|
+
if (ifr->ifr_addr.sa_family != AF_INET)
|
109
|
+
continue;
|
110
|
+
ifreq = *ifr;
|
111
|
+
if (ioctl(sock, SIOCGIFFLAGS, (char *)&ifreq) < 0) {
|
112
|
+
perror("broadcast: ioctl (get interface flags)");
|
113
|
+
continue;
|
114
|
+
}
|
115
|
+
if ((ifreq.ifr_flags & IFF_BROADCAST) &&
|
116
|
+
(ifreq.ifr_flags & IFF_UP)) {
|
117
|
+
sin = (struct sockaddr_in *)&ifr->ifr_addr;
|
118
|
+
#ifdef SIOCGIFBRDADDR /* 4.3BSD */
|
119
|
+
if (ioctl(sock, SIOCGIFBRDADDR, (char *)&ifreq) < 0) {
|
120
|
+
addrs[i++] =
|
121
|
+
inet_makeaddr(inet_netof(sin->sin_addr),
|
122
|
+
INADDR_ANY);
|
123
|
+
} else {
|
124
|
+
addrs[i++] = ((struct sockaddr_in*)
|
125
|
+
&ifreq.ifr_addr)->sin_addr;
|
126
|
+
}
|
127
|
+
#else /* 4.2 BSD */
|
128
|
+
addrs[i++] = inet_makeaddr(inet_netof(sin->sin_addr),
|
129
|
+
INADDR_ANY);
|
130
|
+
#endif
|
131
|
+
}
|
132
|
+
}
|
133
|
+
return (i);
|
134
|
+
}
|
135
|
+
|
136
|
+
|
137
|
+
enum clnt_stat
|
138
|
+
#if (defined __LP64__) && (defined __APPLE__) /* 64-bit APPLE machines */
|
139
|
+
clnt_find_services(uint32_t prog, uint32_t vers, uint32_t proc,
|
140
|
+
#else
|
141
|
+
clnt_find_services(u_long prog, u_long vers, u_long proc,
|
142
|
+
#endif
|
143
|
+
struct timeval *t, resultfoundproc_t found_callback)
|
144
|
+
{
|
145
|
+
enum clnt_stat stat;
|
146
|
+
XDR xdr_stream;
|
147
|
+
register XDR *xdrs = &xdr_stream;
|
148
|
+
int outlen, inlen, nets;
|
149
|
+
unsigned int fromlen;
|
150
|
+
register int sock;
|
151
|
+
int on = 1;
|
152
|
+
fd_set mask;
|
153
|
+
fd_set readfds;
|
154
|
+
register int i;
|
155
|
+
bool_t done = FALSE;
|
156
|
+
uint32_t xid;
|
157
|
+
#if (defined __LP64__) && (defined __APPLE__)
|
158
|
+
unsigned int port;
|
159
|
+
#else
|
160
|
+
unsigned long port;
|
161
|
+
#endif
|
162
|
+
|
163
|
+
struct in_addr addrs[20];
|
164
|
+
struct sockaddr_in baddr, raddr; /* broadcast and response addresses */
|
165
|
+
struct rmtcallargs a;
|
166
|
+
struct rmtcallres r;
|
167
|
+
struct rpc_msg msg;
|
168
|
+
char outbuf[MAX_BROADCAST_SIZE], inbuf[UDPMSGSIZE];
|
169
|
+
int rfd;
|
170
|
+
|
171
|
+
stat = RPC_SUCCESS;
|
172
|
+
|
173
|
+
/*
|
174
|
+
* initialization: create a socket, a broadcast address, and
|
175
|
+
* preserialize the arguments into a send buffer.
|
176
|
+
*/
|
177
|
+
if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
|
178
|
+
perror("Cannot create socket for broadcast rpc");
|
179
|
+
stat = RPC_CANTSEND;
|
180
|
+
goto done_broad;
|
181
|
+
}
|
182
|
+
#ifdef SO_BROADCAST
|
183
|
+
if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &on, sizeof (on)) < 0) {
|
184
|
+
perror("Cannot set socket option SO_BROADCAST");
|
185
|
+
stat = RPC_CANTSEND;
|
186
|
+
goto done_broad;
|
187
|
+
}
|
188
|
+
#endif /* def SO_BROADCAST */
|
189
|
+
FD_ZERO(&mask);
|
190
|
+
FD_SET(sock, &mask);
|
191
|
+
nets = getbroadcastnets(addrs, sock, inbuf);
|
192
|
+
memset((char *)&baddr, 0, sizeof (baddr));
|
193
|
+
baddr.sin_family = AF_INET;
|
194
|
+
baddr.sin_port = htons(PMAPPORT);
|
195
|
+
baddr.sin_addr.s_addr = htonl(INADDR_ANY);
|
196
|
+
/* baddr.sin_addr.S_un.S_addr = htonl(INADDR_ANY); */
|
197
|
+
|
198
|
+
rfd = open("/dev/random", O_RDONLY, 0);
|
199
|
+
if ((rfd < 0) || (read(rfd, &xid, sizeof(xid)) != sizeof(xid)))
|
200
|
+
{
|
201
|
+
gettimeofday(t, (struct timezone *)0);
|
202
|
+
xid = getpid() ^ t->tv_sec ^ t->tv_usec;
|
203
|
+
}
|
204
|
+
if (rfd > 0) close(rfd);
|
205
|
+
|
206
|
+
msg.rm_xid = xid;
|
207
|
+
msg.rm_direction = CALL;
|
208
|
+
msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
|
209
|
+
msg.rm_call.cb_prog = PMAPPROG;
|
210
|
+
msg.rm_call.cb_vers = PMAPVERS;
|
211
|
+
msg.rm_call.cb_proc = PMAPPROC_GETPORT;
|
212
|
+
msg.rm_call.cb_cred = _null_auth;
|
213
|
+
msg.rm_call.cb_verf = _null_auth;
|
214
|
+
a.prog = prog;
|
215
|
+
a.vers = vers;
|
216
|
+
a.proc = proc;
|
217
|
+
a.xdr_args = (xdrproc_t)xdr_void;
|
218
|
+
a.args_ptr = NULL;
|
219
|
+
a.arglen = 0;
|
220
|
+
r.port_ptr = &port;
|
221
|
+
r.xdr_results = (xdrproc_t)xdr_void;
|
222
|
+
r.results_ptr = NULL;
|
223
|
+
r.resultslen = 0;
|
224
|
+
xdrmem_create(xdrs, outbuf, MAX_BROADCAST_SIZE, XDR_ENCODE);
|
225
|
+
if ((! xdr_callmsg(xdrs, &msg)) || (! xdr_rmtcall_args(xdrs, &a))) {
|
226
|
+
stat = RPC_CANTENCODEARGS;
|
227
|
+
goto done_broad;
|
228
|
+
}
|
229
|
+
outlen = (int)xdr_getpos(xdrs);
|
230
|
+
xdr_destroy(xdrs);
|
231
|
+
/*
|
232
|
+
* Basic loop: broadcast a packet and wait a while for response(s).
|
233
|
+
* The response timeout grows larger per iteration.
|
234
|
+
*/
|
235
|
+
for (i = 0; i < nets; i++) {
|
236
|
+
baddr.sin_addr = addrs[i];
|
237
|
+
if (sendto(sock, outbuf, outlen, 0,
|
238
|
+
(struct sockaddr *)&baddr,
|
239
|
+
sizeof (struct sockaddr)) != outlen) {
|
240
|
+
perror("Cannot send broadcast packet");
|
241
|
+
stat = RPC_CANTSEND;
|
242
|
+
goto done_broad;
|
243
|
+
}
|
244
|
+
}
|
245
|
+
if (found_callback == NULL ) {
|
246
|
+
stat = RPC_SUCCESS;
|
247
|
+
goto done_broad;
|
248
|
+
}
|
249
|
+
recv_again:
|
250
|
+
msg.acpted_rply.ar_verf = _null_auth;
|
251
|
+
msg.acpted_rply.ar_results.where = (caddr_t)&r;
|
252
|
+
msg.acpted_rply.ar_results.proc = (xdrproc_t)xdr_void;
|
253
|
+
port = 0;
|
254
|
+
readfds = mask;
|
255
|
+
switch (select(sock+1, &readfds, NULL, NULL, t)) {
|
256
|
+
|
257
|
+
case 0: /* timed out */
|
258
|
+
stat = RPC_TIMEDOUT;
|
259
|
+
goto done_broad;
|
260
|
+
|
261
|
+
case -1: /* some kind of error */
|
262
|
+
if (errno == EINTR)
|
263
|
+
goto recv_again;
|
264
|
+
perror("Broadcast select problem");
|
265
|
+
stat = RPC_CANTRECV;
|
266
|
+
goto done_broad;
|
267
|
+
|
268
|
+
} /* end of select results switch */
|
269
|
+
try_again:
|
270
|
+
fromlen = sizeof(struct sockaddr);
|
271
|
+
inlen = recvfrom(sock, inbuf, UDPMSGSIZE, 0, (struct sockaddr *)&raddr, &fromlen);
|
272
|
+
if (inlen < 0) {
|
273
|
+
if (errno == EINTR)
|
274
|
+
goto try_again;
|
275
|
+
fprintf(stderr,"Cannot receive reply to broadcast: %s",strerror(errno));
|
276
|
+
stat = RPC_CANTRECV;
|
277
|
+
goto done_broad;
|
278
|
+
}
|
279
|
+
#if (defined __LP64__) && (defined __APPLE__)
|
280
|
+
if (inlen < (int)sizeof(uint32_t))
|
281
|
+
goto recv_again;
|
282
|
+
#else
|
283
|
+
if (inlen < (int)sizeof(u_long))
|
284
|
+
goto recv_again;
|
285
|
+
#endif
|
286
|
+
/*
|
287
|
+
* see if reply transaction id matches sent id.
|
288
|
+
* If so, decode the results.
|
289
|
+
*/
|
290
|
+
xdrmem_create(xdrs, inbuf, (u_int)inlen, XDR_DECODE);
|
291
|
+
if (xdr_replymsg(xdrs, &msg) &&
|
292
|
+
xdr_u_long(xdrs, &port) &&
|
293
|
+
port != 0) {
|
294
|
+
if ((msg.rm_xid == xid) &&
|
295
|
+
(msg.rm_reply.rp_stat == MSG_ACCEPTED) &&
|
296
|
+
(msg.acpted_rply.ar_stat == SUCCESS)) {
|
297
|
+
raddr.sin_port = htons((u_short)port);
|
298
|
+
done = found_callback(&raddr);
|
299
|
+
}
|
300
|
+
/* otherwise, we just ignore the errors ... */
|
301
|
+
} else {
|
302
|
+
#ifdef notdef
|
303
|
+
/* some kind of deserialization problem ... */
|
304
|
+
if (msg.rm_xid == xid)
|
305
|
+
fprintf(stderr, "Broadcast deserialization problem");
|
306
|
+
/* otherwise, just random garbage */
|
307
|
+
#endif
|
308
|
+
}
|
309
|
+
xdrs->x_op = XDR_FREE;
|
310
|
+
msg.acpted_rply.ar_results.proc = (xdrproc_t)xdr_void;
|
311
|
+
(void)xdr_replymsg(xdrs, &msg);
|
312
|
+
xdr_destroy(xdrs);
|
313
|
+
if (done) {
|
314
|
+
stat = RPC_SUCCESS;
|
315
|
+
goto done_broad;
|
316
|
+
} else {
|
317
|
+
goto recv_again;
|
318
|
+
}
|
319
|
+
done_broad:
|
320
|
+
(void)close(sock);
|
321
|
+
return (stat);
|
322
|
+
}
|
@@ -0,0 +1,234 @@
|
|
1
|
+
/*
|
2
|
+
* Please do not edit this file.
|
3
|
+
* It was generated using rpcgen.
|
4
|
+
*/
|
5
|
+
|
6
|
+
#include "vxi11.h"
|
7
|
+
#include <string.h>
|
8
|
+
#undef clnt_call
|
9
|
+
#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
|
10
|
+
((*(rh)->cl_ops->cl_call)(rh, proc, (xdrproc_t)xargs, argsp, (xdrproc_t)xres, resp, secs))
|
11
|
+
|
12
|
+
/* Default timeout can be changed using clnt_control() */
|
13
|
+
static struct timeval TIMEOUT = { 25, 0 };
|
14
|
+
|
15
|
+
Device_Error *
|
16
|
+
device_abort_1(argp, clnt)
|
17
|
+
Device_Link *argp;
|
18
|
+
CLIENT *clnt;
|
19
|
+
{
|
20
|
+
static Device_Error clnt_res;
|
21
|
+
|
22
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
23
|
+
if (clnt_call(clnt, device_abort, xdr_Device_Link, argp, xdr_Device_Error, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
24
|
+
return (NULL);
|
25
|
+
return (&clnt_res);
|
26
|
+
}
|
27
|
+
|
28
|
+
Create_LinkResp *
|
29
|
+
create_link_1(argp, clnt)
|
30
|
+
Create_LinkParms *argp;
|
31
|
+
CLIENT *clnt;
|
32
|
+
{
|
33
|
+
static Create_LinkResp clnt_res;
|
34
|
+
|
35
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
36
|
+
if (clnt_call(clnt, create_link, xdr_Create_LinkParms, argp, xdr_Create_LinkResp, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
37
|
+
return (NULL);
|
38
|
+
return (&clnt_res);
|
39
|
+
}
|
40
|
+
|
41
|
+
Device_WriteResp *
|
42
|
+
device_write_1(argp, clnt)
|
43
|
+
Device_WriteParms *argp;
|
44
|
+
CLIENT *clnt;
|
45
|
+
{
|
46
|
+
static Device_WriteResp clnt_res;
|
47
|
+
|
48
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
49
|
+
if (clnt_call(clnt, device_write, xdr_Device_WriteParms, argp, xdr_Device_WriteResp, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
50
|
+
return (NULL);
|
51
|
+
return (&clnt_res);
|
52
|
+
}
|
53
|
+
|
54
|
+
Device_ReadResp *
|
55
|
+
device_read_1(argp, clnt)
|
56
|
+
Device_ReadParms *argp;
|
57
|
+
CLIENT *clnt;
|
58
|
+
{
|
59
|
+
static Device_ReadResp clnt_res;
|
60
|
+
|
61
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
62
|
+
if (clnt_call(clnt, device_read, xdr_Device_ReadParms, argp, xdr_Device_ReadResp, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
63
|
+
return (NULL);
|
64
|
+
return (&clnt_res);
|
65
|
+
}
|
66
|
+
|
67
|
+
Device_ReadStbResp *
|
68
|
+
device_readstb_1(argp, clnt)
|
69
|
+
Device_GenericParms *argp;
|
70
|
+
CLIENT *clnt;
|
71
|
+
{
|
72
|
+
static Device_ReadStbResp clnt_res;
|
73
|
+
|
74
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
75
|
+
if (clnt_call(clnt, device_readstb, xdr_Device_GenericParms, argp, xdr_Device_ReadStbResp, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
76
|
+
return (NULL);
|
77
|
+
return (&clnt_res);
|
78
|
+
}
|
79
|
+
|
80
|
+
Device_Error *
|
81
|
+
device_trigger_1(argp, clnt)
|
82
|
+
Device_GenericParms *argp;
|
83
|
+
CLIENT *clnt;
|
84
|
+
{
|
85
|
+
static Device_Error clnt_res;
|
86
|
+
|
87
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
88
|
+
if (clnt_call(clnt, device_trigger, xdr_Device_GenericParms, argp, xdr_Device_Error, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
89
|
+
return (NULL);
|
90
|
+
return (&clnt_res);
|
91
|
+
}
|
92
|
+
|
93
|
+
Device_Error *
|
94
|
+
device_clear_1(argp, clnt)
|
95
|
+
Device_GenericParms *argp;
|
96
|
+
CLIENT *clnt;
|
97
|
+
{
|
98
|
+
static Device_Error clnt_res;
|
99
|
+
|
100
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
101
|
+
if (clnt_call(clnt, device_clear, xdr_Device_GenericParms, argp, xdr_Device_Error, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
102
|
+
return (NULL);
|
103
|
+
return (&clnt_res);
|
104
|
+
}
|
105
|
+
|
106
|
+
Device_Error *
|
107
|
+
device_remote_1(argp, clnt)
|
108
|
+
Device_GenericParms *argp;
|
109
|
+
CLIENT *clnt;
|
110
|
+
{
|
111
|
+
static Device_Error clnt_res;
|
112
|
+
|
113
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
114
|
+
if (clnt_call(clnt, device_remote, xdr_Device_GenericParms, argp, xdr_Device_Error, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
115
|
+
return (NULL);
|
116
|
+
return (&clnt_res);
|
117
|
+
}
|
118
|
+
|
119
|
+
Device_Error *
|
120
|
+
device_local_1(argp, clnt)
|
121
|
+
Device_GenericParms *argp;
|
122
|
+
CLIENT *clnt;
|
123
|
+
{
|
124
|
+
static Device_Error clnt_res;
|
125
|
+
|
126
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
127
|
+
if (clnt_call(clnt, device_local, xdr_Device_GenericParms, argp, xdr_Device_Error, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
128
|
+
return (NULL);
|
129
|
+
return (&clnt_res);
|
130
|
+
}
|
131
|
+
|
132
|
+
Device_Error *
|
133
|
+
device_lock_1(argp, clnt)
|
134
|
+
Device_LockParms *argp;
|
135
|
+
CLIENT *clnt;
|
136
|
+
{
|
137
|
+
static Device_Error clnt_res;
|
138
|
+
|
139
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
140
|
+
if (clnt_call(clnt, device_lock, xdr_Device_LockParms, argp, xdr_Device_Error, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
141
|
+
return (NULL);
|
142
|
+
return (&clnt_res);
|
143
|
+
}
|
144
|
+
|
145
|
+
Device_Error *
|
146
|
+
device_unlock_1(argp, clnt)
|
147
|
+
Device_Link *argp;
|
148
|
+
CLIENT *clnt;
|
149
|
+
{
|
150
|
+
static Device_Error clnt_res;
|
151
|
+
|
152
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
153
|
+
if (clnt_call(clnt, device_unlock, xdr_Device_Link, argp, xdr_Device_Error, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
154
|
+
return (NULL);
|
155
|
+
return (&clnt_res);
|
156
|
+
}
|
157
|
+
|
158
|
+
Device_Error *
|
159
|
+
device_enable_srq_1(argp, clnt)
|
160
|
+
Device_EnableSrqParms *argp;
|
161
|
+
CLIENT *clnt;
|
162
|
+
{
|
163
|
+
static Device_Error clnt_res;
|
164
|
+
|
165
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
166
|
+
if (clnt_call(clnt, device_enable_srq, xdr_Device_EnableSrqParms, argp, xdr_Device_Error, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
167
|
+
return (NULL);
|
168
|
+
return (&clnt_res);
|
169
|
+
}
|
170
|
+
|
171
|
+
Device_DocmdResp *
|
172
|
+
device_docmd_1(argp, clnt)
|
173
|
+
Device_DocmdParms *argp;
|
174
|
+
CLIENT *clnt;
|
175
|
+
{
|
176
|
+
static Device_DocmdResp clnt_res;
|
177
|
+
|
178
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
179
|
+
if (clnt_call(clnt, device_docmd, xdr_Device_DocmdParms, argp, xdr_Device_DocmdResp, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
180
|
+
return (NULL);
|
181
|
+
return (&clnt_res);
|
182
|
+
}
|
183
|
+
|
184
|
+
Device_Error *
|
185
|
+
destroy_link_1(argp, clnt)
|
186
|
+
Device_Link *argp;
|
187
|
+
CLIENT *clnt;
|
188
|
+
{
|
189
|
+
static Device_Error clnt_res;
|
190
|
+
|
191
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
192
|
+
if (clnt_call(clnt, destroy_link, xdr_Device_Link, argp, xdr_Device_Error, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
193
|
+
return (NULL);
|
194
|
+
return (&clnt_res);
|
195
|
+
}
|
196
|
+
|
197
|
+
Device_Error *
|
198
|
+
create_intr_chan_1(argp, clnt)
|
199
|
+
Device_RemoteFunc *argp;
|
200
|
+
CLIENT *clnt;
|
201
|
+
{
|
202
|
+
static Device_Error clnt_res;
|
203
|
+
|
204
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
205
|
+
if (clnt_call(clnt, create_intr_chan, xdr_Device_RemoteFunc, argp, xdr_Device_Error, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
206
|
+
return (NULL);
|
207
|
+
return (&clnt_res);
|
208
|
+
}
|
209
|
+
|
210
|
+
Device_Error *
|
211
|
+
destroy_intr_chan_1(argp, clnt)
|
212
|
+
void *argp;
|
213
|
+
CLIENT *clnt;
|
214
|
+
{
|
215
|
+
static Device_Error clnt_res;
|
216
|
+
|
217
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
218
|
+
if (clnt_call(clnt, destroy_intr_chan, xdr_void, argp, xdr_Device_Error, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
219
|
+
return (NULL);
|
220
|
+
return (&clnt_res);
|
221
|
+
}
|
222
|
+
|
223
|
+
void *
|
224
|
+
device_intr_srq_1(argp, clnt)
|
225
|
+
Device_SrqParms *argp;
|
226
|
+
CLIENT *clnt;
|
227
|
+
{
|
228
|
+
static char clnt_res;
|
229
|
+
|
230
|
+
memset((char *)&clnt_res, 0, sizeof(clnt_res));
|
231
|
+
if (clnt_call(clnt, device_intr_srq, xdr_Device_SrqParms, argp, xdr_void, &clnt_res, TIMEOUT) != RPC_SUCCESS)
|
232
|
+
return (NULL);
|
233
|
+
return ((void *)&clnt_res);
|
234
|
+
}
|