vxi11 0.1.2 → 0.1.3

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.
@@ -0,0 +1,343 @@
1
+ /*
2
+ * Please do not edit this file.
3
+ * It was generated using rpcgen.
4
+ */
5
+
6
+ #ifndef _VXI11_H_RPCGEN
7
+ #define _VXI11_H_RPCGEN
8
+
9
+ #include <rpc/rpc.h>
10
+
11
+ #include <pthread.h>
12
+
13
+ #ifdef __cplusplus
14
+ extern "C" {
15
+ #endif
16
+
17
+
18
+ typedef long Device_Link;
19
+
20
+ enum Device_AddrFamily {
21
+ DEVICE_TCP = 0,
22
+ DEVICE_UDP = 1,
23
+ };
24
+ typedef enum Device_AddrFamily Device_AddrFamily;
25
+
26
+ typedef long Device_Flags;
27
+
28
+ typedef long Device_ErrorCode;
29
+
30
+ struct Device_Error {
31
+ Device_ErrorCode error;
32
+ };
33
+ typedef struct Device_Error Device_Error;
34
+
35
+ struct Create_LinkParms {
36
+ long clientId;
37
+ bool_t lockDevice;
38
+ u_long lock_timeout;
39
+ char *device;
40
+ };
41
+ typedef struct Create_LinkParms Create_LinkParms;
42
+
43
+ struct Create_LinkResp {
44
+ Device_ErrorCode error;
45
+ Device_Link lid;
46
+ u_short abortPort;
47
+ u_long maxRecvSize;
48
+ };
49
+ typedef struct Create_LinkResp Create_LinkResp;
50
+
51
+ struct Device_WriteParms {
52
+ Device_Link lid;
53
+ u_long io_timeout;
54
+ u_long lock_timeout;
55
+ Device_Flags flags;
56
+ struct {
57
+ u_int data_len;
58
+ char *data_val;
59
+ } data;
60
+ };
61
+ typedef struct Device_WriteParms Device_WriteParms;
62
+
63
+ struct Device_WriteResp {
64
+ Device_ErrorCode error;
65
+ u_long size;
66
+ };
67
+ typedef struct Device_WriteResp Device_WriteResp;
68
+
69
+ struct Device_ReadParms {
70
+ Device_Link lid;
71
+ u_long requestSize;
72
+ u_long io_timeout;
73
+ u_long lock_timeout;
74
+ Device_Flags flags;
75
+ char termChar;
76
+ };
77
+ typedef struct Device_ReadParms Device_ReadParms;
78
+
79
+ struct Device_ReadResp {
80
+ Device_ErrorCode error;
81
+ long reason;
82
+ struct {
83
+ u_int data_len;
84
+ char *data_val;
85
+ } data;
86
+ };
87
+ typedef struct Device_ReadResp Device_ReadResp;
88
+
89
+ struct Device_ReadStbResp {
90
+ Device_ErrorCode error;
91
+ u_char stb;
92
+ };
93
+ typedef struct Device_ReadStbResp Device_ReadStbResp;
94
+
95
+ struct Device_GenericParms {
96
+ Device_Link lid;
97
+ Device_Flags flags;
98
+ u_long lock_timeout;
99
+ u_long io_timeout;
100
+ };
101
+ typedef struct Device_GenericParms Device_GenericParms;
102
+
103
+ struct Device_RemoteFunc {
104
+ u_long hostAddr;
105
+ u_long hostPort;
106
+ u_long progNum;
107
+ u_long progVers;
108
+ Device_AddrFamily progFamily;
109
+ };
110
+ typedef struct Device_RemoteFunc Device_RemoteFunc;
111
+
112
+ struct Device_EnableSrqParms {
113
+ Device_Link lid;
114
+ bool_t enable;
115
+ struct {
116
+ u_int handle_len;
117
+ char *handle_val;
118
+ } handle;
119
+ };
120
+ typedef struct Device_EnableSrqParms Device_EnableSrqParms;
121
+
122
+ struct Device_LockParms {
123
+ Device_Link lid;
124
+ Device_Flags flags;
125
+ u_long lock_timeout;
126
+ };
127
+ typedef struct Device_LockParms Device_LockParms;
128
+
129
+ struct Device_DocmdParms {
130
+ Device_Link lid;
131
+ Device_Flags flags;
132
+ u_long io_timeout;
133
+ u_long lock_timeout;
134
+ long cmd;
135
+ bool_t network_order;
136
+ long datasize;
137
+ struct {
138
+ u_int data_in_len;
139
+ char *data_in_val;
140
+ } data_in;
141
+ };
142
+ typedef struct Device_DocmdParms Device_DocmdParms;
143
+
144
+ struct Device_DocmdResp {
145
+ Device_ErrorCode error;
146
+ struct {
147
+ u_int data_out_len;
148
+ char *data_out_val;
149
+ } data_out;
150
+ };
151
+ typedef struct Device_DocmdResp Device_DocmdResp;
152
+
153
+ struct Device_SrqParms {
154
+ struct {
155
+ u_int handle_len;
156
+ char *handle_val;
157
+ } handle;
158
+ };
159
+ typedef struct Device_SrqParms Device_SrqParms;
160
+
161
+ #define DEVICE_ASYNC 0x0607B0
162
+ #define DEVICE_ASYNC_VERSION 1
163
+
164
+ #if defined(__STDC__) || defined(__cplusplus)
165
+ #define device_abort 1
166
+ extern enum clnt_stat device_abort_1(Device_Link *, Device_Error *, CLIENT *);
167
+ extern bool_t device_abort_1_svc(Device_Link *, Device_Error *, struct svc_req *);
168
+ extern int device_async_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
169
+
170
+ #else /* K&R C */
171
+ #define device_abort 1
172
+ extern enum clnt_stat device_abort_1();
173
+ extern bool_t device_abort_1_svc();
174
+ extern int device_async_1_freeresult ();
175
+ #endif /* K&R C */
176
+
177
+ #define DEVICE_CORE 0x0607AF
178
+ #define DEVICE_CORE_VERSION 1
179
+
180
+ #if defined(__STDC__) || defined(__cplusplus)
181
+ #define create_link 10
182
+ extern enum clnt_stat create_link_1(Create_LinkParms *, Create_LinkResp *, CLIENT *);
183
+ extern bool_t create_link_1_svc(Create_LinkParms *, Create_LinkResp *, struct svc_req *);
184
+ #define device_write 11
185
+ extern enum clnt_stat device_write_1(Device_WriteParms *, Device_WriteResp *, CLIENT *);
186
+ extern bool_t device_write_1_svc(Device_WriteParms *, Device_WriteResp *, struct svc_req *);
187
+ #define device_read 12
188
+ extern enum clnt_stat device_read_1(Device_ReadParms *, Device_ReadResp *, CLIENT *);
189
+ extern bool_t device_read_1_svc(Device_ReadParms *, Device_ReadResp *, struct svc_req *);
190
+ #define device_readstb 13
191
+ extern enum clnt_stat device_readstb_1(Device_GenericParms *, Device_ReadStbResp *, CLIENT *);
192
+ extern bool_t device_readstb_1_svc(Device_GenericParms *, Device_ReadStbResp *, struct svc_req *);
193
+ #define device_trigger 14
194
+ extern enum clnt_stat device_trigger_1(Device_GenericParms *, Device_Error *, CLIENT *);
195
+ extern bool_t device_trigger_1_svc(Device_GenericParms *, Device_Error *, struct svc_req *);
196
+ #define device_clear 15
197
+ extern enum clnt_stat device_clear_1(Device_GenericParms *, Device_Error *, CLIENT *);
198
+ extern bool_t device_clear_1_svc(Device_GenericParms *, Device_Error *, struct svc_req *);
199
+ #define device_remote 16
200
+ extern enum clnt_stat device_remote_1(Device_GenericParms *, Device_Error *, CLIENT *);
201
+ extern bool_t device_remote_1_svc(Device_GenericParms *, Device_Error *, struct svc_req *);
202
+ #define device_local 17
203
+ extern enum clnt_stat device_local_1(Device_GenericParms *, Device_Error *, CLIENT *);
204
+ extern bool_t device_local_1_svc(Device_GenericParms *, Device_Error *, struct svc_req *);
205
+ #define device_lock 18
206
+ extern enum clnt_stat device_lock_1(Device_LockParms *, Device_Error *, CLIENT *);
207
+ extern bool_t device_lock_1_svc(Device_LockParms *, Device_Error *, struct svc_req *);
208
+ #define device_unlock 19
209
+ extern enum clnt_stat device_unlock_1(Device_Link *, Device_Error *, CLIENT *);
210
+ extern bool_t device_unlock_1_svc(Device_Link *, Device_Error *, struct svc_req *);
211
+ #define device_enable_srq 20
212
+ extern enum clnt_stat device_enable_srq_1(Device_EnableSrqParms *, Device_Error *, CLIENT *);
213
+ extern bool_t device_enable_srq_1_svc(Device_EnableSrqParms *, Device_Error *, struct svc_req *);
214
+ #define device_docmd 22
215
+ extern enum clnt_stat device_docmd_1(Device_DocmdParms *, Device_DocmdResp *, CLIENT *);
216
+ extern bool_t device_docmd_1_svc(Device_DocmdParms *, Device_DocmdResp *, struct svc_req *);
217
+ #define destroy_link 23
218
+ extern enum clnt_stat destroy_link_1(Device_Link *, Device_Error *, CLIENT *);
219
+ extern bool_t destroy_link_1_svc(Device_Link *, Device_Error *, struct svc_req *);
220
+ #define create_intr_chan 25
221
+ extern enum clnt_stat create_intr_chan_1(Device_RemoteFunc *, Device_Error *, CLIENT *);
222
+ extern bool_t create_intr_chan_1_svc(Device_RemoteFunc *, Device_Error *, struct svc_req *);
223
+ #define destroy_intr_chan 26
224
+ extern enum clnt_stat destroy_intr_chan_1(void *, Device_Error *, CLIENT *);
225
+ extern bool_t destroy_intr_chan_1_svc(void *, Device_Error *, struct svc_req *);
226
+ extern int device_core_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
227
+
228
+ #else /* K&R C */
229
+ #define create_link 10
230
+ extern enum clnt_stat create_link_1();
231
+ extern bool_t create_link_1_svc();
232
+ #define device_write 11
233
+ extern enum clnt_stat device_write_1();
234
+ extern bool_t device_write_1_svc();
235
+ #define device_read 12
236
+ extern enum clnt_stat device_read_1();
237
+ extern bool_t device_read_1_svc();
238
+ #define device_readstb 13
239
+ extern enum clnt_stat device_readstb_1();
240
+ extern bool_t device_readstb_1_svc();
241
+ #define device_trigger 14
242
+ extern enum clnt_stat device_trigger_1();
243
+ extern bool_t device_trigger_1_svc();
244
+ #define device_clear 15
245
+ extern enum clnt_stat device_clear_1();
246
+ extern bool_t device_clear_1_svc();
247
+ #define device_remote 16
248
+ extern enum clnt_stat device_remote_1();
249
+ extern bool_t device_remote_1_svc();
250
+ #define device_local 17
251
+ extern enum clnt_stat device_local_1();
252
+ extern bool_t device_local_1_svc();
253
+ #define device_lock 18
254
+ extern enum clnt_stat device_lock_1();
255
+ extern bool_t device_lock_1_svc();
256
+ #define device_unlock 19
257
+ extern enum clnt_stat device_unlock_1();
258
+ extern bool_t device_unlock_1_svc();
259
+ #define device_enable_srq 20
260
+ extern enum clnt_stat device_enable_srq_1();
261
+ extern bool_t device_enable_srq_1_svc();
262
+ #define device_docmd 22
263
+ extern enum clnt_stat device_docmd_1();
264
+ extern bool_t device_docmd_1_svc();
265
+ #define destroy_link 23
266
+ extern enum clnt_stat destroy_link_1();
267
+ extern bool_t destroy_link_1_svc();
268
+ #define create_intr_chan 25
269
+ extern enum clnt_stat create_intr_chan_1();
270
+ extern bool_t create_intr_chan_1_svc();
271
+ #define destroy_intr_chan 26
272
+ extern enum clnt_stat destroy_intr_chan_1();
273
+ extern bool_t destroy_intr_chan_1_svc();
274
+ extern int device_core_1_freeresult ();
275
+ #endif /* K&R C */
276
+
277
+ #define DEVICE_INTR 0x0607B1
278
+ #define DEVICE_INTR_VERSION 1
279
+
280
+ #if defined(__STDC__) || defined(__cplusplus)
281
+ #define device_intr_srq 30
282
+ extern enum clnt_stat device_intr_srq_1(Device_SrqParms *, void *, CLIENT *);
283
+ extern bool_t device_intr_srq_1_svc(Device_SrqParms *, void *, struct svc_req *);
284
+ extern int device_intr_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
285
+
286
+ #else /* K&R C */
287
+ #define device_intr_srq 30
288
+ extern enum clnt_stat device_intr_srq_1();
289
+ extern bool_t device_intr_srq_1_svc();
290
+ extern int device_intr_1_freeresult ();
291
+ #endif /* K&R C */
292
+
293
+ /* the xdr functions */
294
+
295
+ #if defined(__STDC__) || defined(__cplusplus)
296
+ extern bool_t xdr_Device_Link (XDR *, Device_Link*);
297
+ extern bool_t xdr_Device_AddrFamily (XDR *, Device_AddrFamily*);
298
+ extern bool_t xdr_Device_Flags (XDR *, Device_Flags*);
299
+ extern bool_t xdr_Device_ErrorCode (XDR *, Device_ErrorCode*);
300
+ extern bool_t xdr_Device_Error (XDR *, Device_Error*);
301
+ extern bool_t xdr_Create_LinkParms (XDR *, Create_LinkParms*);
302
+ extern bool_t xdr_Create_LinkResp (XDR *, Create_LinkResp*);
303
+ extern bool_t xdr_Device_WriteParms (XDR *, Device_WriteParms*);
304
+ extern bool_t xdr_Device_WriteResp (XDR *, Device_WriteResp*);
305
+ extern bool_t xdr_Device_ReadParms (XDR *, Device_ReadParms*);
306
+ extern bool_t xdr_Device_ReadResp (XDR *, Device_ReadResp*);
307
+ extern bool_t xdr_Device_ReadStbResp (XDR *, Device_ReadStbResp*);
308
+ extern bool_t xdr_Device_GenericParms (XDR *, Device_GenericParms*);
309
+ extern bool_t xdr_Device_RemoteFunc (XDR *, Device_RemoteFunc*);
310
+ extern bool_t xdr_Device_EnableSrqParms (XDR *, Device_EnableSrqParms*);
311
+ extern bool_t xdr_Device_LockParms (XDR *, Device_LockParms*);
312
+ extern bool_t xdr_Device_DocmdParms (XDR *, Device_DocmdParms*);
313
+ extern bool_t xdr_Device_DocmdResp (XDR *, Device_DocmdResp*);
314
+ extern bool_t xdr_Device_SrqParms (XDR *, Device_SrqParms*);
315
+
316
+ #else /* K&R C */
317
+ extern bool_t xdr_Device_Link ();
318
+ extern bool_t xdr_Device_AddrFamily ();
319
+ extern bool_t xdr_Device_Flags ();
320
+ extern bool_t xdr_Device_ErrorCode ();
321
+ extern bool_t xdr_Device_Error ();
322
+ extern bool_t xdr_Create_LinkParms ();
323
+ extern bool_t xdr_Create_LinkResp ();
324
+ extern bool_t xdr_Device_WriteParms ();
325
+ extern bool_t xdr_Device_WriteResp ();
326
+ extern bool_t xdr_Device_ReadParms ();
327
+ extern bool_t xdr_Device_ReadResp ();
328
+ extern bool_t xdr_Device_ReadStbResp ();
329
+ extern bool_t xdr_Device_GenericParms ();
330
+ extern bool_t xdr_Device_RemoteFunc ();
331
+ extern bool_t xdr_Device_EnableSrqParms ();
332
+ extern bool_t xdr_Device_LockParms ();
333
+ extern bool_t xdr_Device_DocmdParms ();
334
+ extern bool_t xdr_Device_DocmdResp ();
335
+ extern bool_t xdr_Device_SrqParms ();
336
+
337
+ #endif /* K&R C */
338
+
339
+ #ifdef __cplusplus
340
+ }
341
+ #endif
342
+
343
+ #endif /* !_VXI11_H_RPCGEN */
@@ -0,0 +1,87 @@
1
+ /* vxi11_user.h
2
+ * Copyright (C) 2006 Steve D. Sharples
3
+ *
4
+ * User library for opening, closing, sending to and receiving from
5
+ * a device enabled with the VXI11 RPC ethernet protocol. Uses the files
6
+ * generated by rpcgen vxi11.x.
7
+ *
8
+ * This program is free software; you can redistribute it and/or
9
+ * modify it under the terms of the GNU General Public License
10
+ * as published by the Free Software Foundation; either version 2
11
+ * of the License, or (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program; if not, write to the Free Software
20
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
+ *
22
+ * The author's email address is steve.sharples@nottingham.ac.uk
23
+ */
24
+
25
+ #ifndef __VXI11_USER__
26
+ #define __VXI11_USER__
27
+ #include <stdio.h>
28
+ #include <stdlib.h>
29
+ #include <string.h>
30
+
31
+ #include <rpc/rpc.h>
32
+ #include "vxi11.h"
33
+
34
+ #define VXI11_DEFAULT_TIMEOUT 10000 /* in ms */
35
+ #define VXI11_READ_TIMEOUT 2000 /* in ms */
36
+ #define VXI11_CLIENT CLIENT
37
+ #define VXI11_LINK Create_LinkResp
38
+ #define VXI11_MAX_CLIENTS 256 /* maximum no of unique IP addresses/clients */
39
+ #define VXI11_NULL_READ_RESP 50 /* vxi11_receive() return value if a query
40
+ * times out ON THE INSTRUMENT (and so we have
41
+ * to resend the query again) */
42
+ #define VXI11_NULL_WRITE_RESP 51 /* vxi11_send() return value if a sent command
43
+ * times out ON THE INSTURMENT. */
44
+
45
+ struct CLINK {
46
+ VXI11_CLIENT *client;
47
+ VXI11_LINK *link;
48
+ } ;
49
+ typedef struct CLINK CLINK;
50
+
51
+ /* The four main functions: open, close, send, receieve (plus a couple of wrappers) */
52
+ /* In fact all 6 of these are wrappers to the original functions listed at the
53
+ * bottom, that use separate CLIENT and VXI11_LINK structures. It was easier to
54
+ * write wrappers for these functions than to re-write the original functions
55
+ * themselves. These are the 4 (or 6 if you like) key user functions that you
56
+ * should probably be using. They all use the CLINK structure. */
57
+ int vxi11_open(const char *ip, CLINK *clink);
58
+ int vxi11_open_device(const char *ip, CLINK *clink, char *device);
59
+ int vxi11_close_device(const char *ip, CLINK *clink);
60
+ int vxi11_send(CLINK *clink, const char *cmd);
61
+ int vxi11_send_data(CLINK *clink, const char *cmd, unsigned long len);
62
+ long vxi11_receive(CLINK *clink, char *buffer, unsigned long len);
63
+ long vxi11_receive_timeout(CLINK *clink, char *buffer, unsigned long len, unsigned long timeout);
64
+
65
+ /* Utility functions, that use send() and receive(). Use these too. */
66
+ int vxi11_send_data_block(CLINK *clink, const char *cmd, char *buffer, unsigned long len);
67
+ long vxi11_receive_data_block(CLINK *clink, char *buffer, unsigned long len, unsigned long timeout);
68
+ long vxi11_send_and_receive(CLINK *clink, const char *cmd, char *buf, unsigned long buf_len, unsigned long timeout);
69
+ long vxi11_obtain_long_value_timeout(CLINK *clink, const char *cmd, unsigned long timeout);
70
+ double vxi11_obtain_double_value_timeout(CLINK *clink, const char *cmd, unsigned long timeout);
71
+ long vxi11_obtain_long_value(CLINK *clink, const char *cmd);
72
+ double vxi11_obtain_double_value(CLINK *link, const char *cmd);
73
+
74
+ /* When I first wrote this library I used separate client and links. I've
75
+ * retained the original functions and just written clink wrappers for them
76
+ * (see above) as it's perhaps a little clearer this way. Probably not worth
77
+ * delving this deep in use, but it's where the real nitty gritty is. */
78
+ int vxi11_open_device_client(const char *ip, CLIENT **client, VXI11_LINK **link, char *device);
79
+ int vxi11_open_link_client(const char *ip, CLIENT **client, VXI11_LINK **link, char *device);
80
+ int vxi11_close_device_client(const char *ip, CLIENT *client, VXI11_LINK *link);
81
+ int vxi11_close_link_client(const char *ip, CLIENT *client, VXI11_LINK *link);
82
+ int vxi11_send_client(CLIENT *client, VXI11_LINK *link, const char *cmd);
83
+ int vxi11_send_data_client(CLIENT *client, VXI11_LINK *link, const char *cmd, unsigned long len);
84
+ long vxi11_receive_client(CLIENT *client, VXI11_LINK *link, char *buffer, unsigned long len);
85
+ long vxi11_receive_timeout_client(CLIENT *client, VXI11_LINK *link, char *buffer, unsigned long len, unsigned long timeout);
86
+
87
+ #endif
@@ -0,0 +1,465 @@
1
+ /*
2
+ * Please do not edit this file.
3
+ * It was generated using rpcgen.
4
+ */
5
+
6
+ #include "vxi11.h"
7
+
8
+ bool_t
9
+ xdr_Device_Link(xdrs, objp)
10
+ XDR *xdrs;
11
+ Device_Link *objp;
12
+ {
13
+
14
+ if (!xdr_long(xdrs, objp))
15
+ return (FALSE);
16
+ return (TRUE);
17
+ }
18
+
19
+ bool_t
20
+ xdr_Device_AddrFamily(xdrs, objp)
21
+ XDR *xdrs;
22
+ Device_AddrFamily *objp;
23
+ {
24
+
25
+ if (!xdr_enum(xdrs, (enum_t *)objp))
26
+ return (FALSE);
27
+ return (TRUE);
28
+ }
29
+
30
+ bool_t
31
+ xdr_Device_Flags(xdrs, objp)
32
+ XDR *xdrs;
33
+ Device_Flags *objp;
34
+ {
35
+
36
+ if (!xdr_long(xdrs, objp))
37
+ return (FALSE);
38
+ return (TRUE);
39
+ }
40
+
41
+ bool_t
42
+ xdr_Device_ErrorCode(xdrs, objp)
43
+ XDR *xdrs;
44
+ Device_ErrorCode *objp;
45
+ {
46
+
47
+ if (!xdr_long(xdrs, objp))
48
+ return (FALSE);
49
+ return (TRUE);
50
+ }
51
+
52
+ bool_t
53
+ xdr_Device_Error(xdrs, objp)
54
+ XDR *xdrs;
55
+ Device_Error *objp;
56
+ {
57
+
58
+ if (!xdr_Device_ErrorCode(xdrs, &objp->error))
59
+ return (FALSE);
60
+ return (TRUE);
61
+ }
62
+
63
+ bool_t
64
+ xdr_Create_LinkParms(xdrs, objp)
65
+ XDR *xdrs;
66
+ Create_LinkParms *objp;
67
+ {
68
+ int32_t *buf;
69
+
70
+ if (xdrs->x_op == XDR_ENCODE) {
71
+ buf = (int32_t *)XDR_INLINE(xdrs, 3 * BYTES_PER_XDR_UNIT);
72
+ if (buf == NULL) {
73
+ if (!xdr_long(xdrs, &objp->clientId))
74
+ return (FALSE);
75
+ if (!xdr_bool(xdrs, &objp->lockDevice))
76
+ return (FALSE);
77
+ if (!xdr_u_long(xdrs, &objp->lock_timeout))
78
+ return (FALSE);
79
+ } else {
80
+ IXDR_PUT_LONG(buf, objp->clientId);
81
+ IXDR_PUT_BOOL(buf, objp->lockDevice);
82
+ IXDR_PUT_U_LONG(buf, objp->lock_timeout);
83
+ }
84
+ if (!xdr_string(xdrs, &objp->device, ~0))
85
+ return (FALSE);
86
+ } else if (xdrs->x_op == XDR_DECODE) {
87
+ buf = (int32_t *)XDR_INLINE(xdrs, 3 * BYTES_PER_XDR_UNIT);
88
+ if (buf == NULL) {
89
+ if (!xdr_long(xdrs, &objp->clientId))
90
+ return (FALSE);
91
+ if (!xdr_bool(xdrs, &objp->lockDevice))
92
+ return (FALSE);
93
+ if (!xdr_u_long(xdrs, &objp->lock_timeout))
94
+ return (FALSE);
95
+ } else {
96
+ objp->clientId = IXDR_GET_LONG(buf);
97
+ objp->lockDevice = IXDR_GET_BOOL(buf);
98
+ objp->lock_timeout = IXDR_GET_U_LONG(buf);
99
+ }
100
+ if (!xdr_string(xdrs, &objp->device, ~0))
101
+ return (FALSE);
102
+ } else {
103
+ if (!xdr_long(xdrs, &objp->clientId))
104
+ return (FALSE);
105
+ if (!xdr_bool(xdrs, &objp->lockDevice))
106
+ return (FALSE);
107
+ if (!xdr_u_long(xdrs, &objp->lock_timeout))
108
+ return (FALSE);
109
+ if (!xdr_string(xdrs, &objp->device, ~0))
110
+ return (FALSE);
111
+ }
112
+ return (TRUE);
113
+ }
114
+
115
+ bool_t
116
+ xdr_Create_LinkResp(xdrs, objp)
117
+ XDR *xdrs;
118
+ Create_LinkResp *objp;
119
+ {
120
+
121
+ if (!xdr_Device_ErrorCode(xdrs, &objp->error))
122
+ return (FALSE);
123
+ if (!xdr_Device_Link(xdrs, &objp->lid))
124
+ return (FALSE);
125
+ if (!xdr_u_short(xdrs, &objp->abortPort))
126
+ return (FALSE);
127
+ if (!xdr_u_long(xdrs, &objp->maxRecvSize))
128
+ return (FALSE);
129
+ return (TRUE);
130
+ }
131
+
132
+ bool_t
133
+ xdr_Device_WriteParms(xdrs, objp)
134
+ XDR *xdrs;
135
+ Device_WriteParms *objp;
136
+ {
137
+
138
+ if (!xdr_Device_Link(xdrs, &objp->lid))
139
+ return (FALSE);
140
+ if (!xdr_u_long(xdrs, &objp->io_timeout))
141
+ return (FALSE);
142
+ if (!xdr_u_long(xdrs, &objp->lock_timeout))
143
+ return (FALSE);
144
+ if (!xdr_Device_Flags(xdrs, &objp->flags))
145
+ return (FALSE);
146
+ if (!xdr_bytes(xdrs, (char **)&objp->data.data_val, (u_int *)&objp->data.data_len, ~0))
147
+ return (FALSE);
148
+ return (TRUE);
149
+ }
150
+
151
+ bool_t
152
+ xdr_Device_WriteResp(xdrs, objp)
153
+ XDR *xdrs;
154
+ Device_WriteResp *objp;
155
+ {
156
+
157
+ if (!xdr_Device_ErrorCode(xdrs, &objp->error))
158
+ return (FALSE);
159
+ if (!xdr_u_long(xdrs, &objp->size))
160
+ return (FALSE);
161
+ return (TRUE);
162
+ }
163
+
164
+ bool_t
165
+ xdr_Device_ReadParms(xdrs, objp)
166
+ XDR *xdrs;
167
+ Device_ReadParms *objp;
168
+ {
169
+ int32_t *buf;
170
+
171
+ if (xdrs->x_op == XDR_ENCODE) {
172
+ if (!xdr_Device_Link(xdrs, &objp->lid))
173
+ return (FALSE);
174
+ buf = (int32_t *)XDR_INLINE(xdrs, 3 * BYTES_PER_XDR_UNIT);
175
+ if (buf == NULL) {
176
+ if (!xdr_u_long(xdrs, &objp->requestSize))
177
+ return (FALSE);
178
+ if (!xdr_u_long(xdrs, &objp->io_timeout))
179
+ return (FALSE);
180
+ if (!xdr_u_long(xdrs, &objp->lock_timeout))
181
+ return (FALSE);
182
+ } else {
183
+ IXDR_PUT_U_LONG(buf, objp->requestSize);
184
+ IXDR_PUT_U_LONG(buf, objp->io_timeout);
185
+ IXDR_PUT_U_LONG(buf, objp->lock_timeout);
186
+ }
187
+ if (!xdr_Device_Flags(xdrs, &objp->flags))
188
+ return (FALSE);
189
+ if (!xdr_char(xdrs, &objp->termChar))
190
+ return (FALSE);
191
+ } else if (xdrs->x_op == XDR_DECODE) {
192
+ if (!xdr_Device_Link(xdrs, &objp->lid))
193
+ return (FALSE);
194
+ buf = (int32_t *)XDR_INLINE(xdrs, 3 * BYTES_PER_XDR_UNIT);
195
+ if (buf == NULL) {
196
+ if (!xdr_u_long(xdrs, &objp->requestSize))
197
+ return (FALSE);
198
+ if (!xdr_u_long(xdrs, &objp->io_timeout))
199
+ return (FALSE);
200
+ if (!xdr_u_long(xdrs, &objp->lock_timeout))
201
+ return (FALSE);
202
+ } else {
203
+ objp->requestSize = IXDR_GET_U_LONG(buf);
204
+ objp->io_timeout = IXDR_GET_U_LONG(buf);
205
+ objp->lock_timeout = IXDR_GET_U_LONG(buf);
206
+ }
207
+ if (!xdr_Device_Flags(xdrs, &objp->flags))
208
+ return (FALSE);
209
+ if (!xdr_char(xdrs, &objp->termChar))
210
+ return (FALSE);
211
+ } else {
212
+ if (!xdr_Device_Link(xdrs, &objp->lid))
213
+ return (FALSE);
214
+ if (!xdr_u_long(xdrs, &objp->requestSize))
215
+ return (FALSE);
216
+ if (!xdr_u_long(xdrs, &objp->io_timeout))
217
+ return (FALSE);
218
+ if (!xdr_u_long(xdrs, &objp->lock_timeout))
219
+ return (FALSE);
220
+ if (!xdr_Device_Flags(xdrs, &objp->flags))
221
+ return (FALSE);
222
+ if (!xdr_char(xdrs, &objp->termChar))
223
+ return (FALSE);
224
+ }
225
+ return (TRUE);
226
+ }
227
+
228
+ bool_t
229
+ xdr_Device_ReadResp(xdrs, objp)
230
+ XDR *xdrs;
231
+ Device_ReadResp *objp;
232
+ {
233
+
234
+ if (!xdr_Device_ErrorCode(xdrs, &objp->error))
235
+ return (FALSE);
236
+ if (!xdr_long(xdrs, &objp->reason))
237
+ return (FALSE);
238
+ if (!xdr_bytes(xdrs, (char **)&objp->data.data_val, (u_int *)&objp->data.data_len, ~0))
239
+ return (FALSE);
240
+ return (TRUE);
241
+ }
242
+
243
+ bool_t
244
+ xdr_Device_ReadStbResp(xdrs, objp)
245
+ XDR *xdrs;
246
+ Device_ReadStbResp *objp;
247
+ {
248
+
249
+ if (!xdr_Device_ErrorCode(xdrs, &objp->error))
250
+ return (FALSE);
251
+ if (!xdr_u_char(xdrs, &objp->stb))
252
+ return (FALSE);
253
+ return (TRUE);
254
+ }
255
+
256
+ bool_t
257
+ xdr_Device_GenericParms(xdrs, objp)
258
+ XDR *xdrs;
259
+ Device_GenericParms *objp;
260
+ {
261
+
262
+ if (!xdr_Device_Link(xdrs, &objp->lid))
263
+ return (FALSE);
264
+ if (!xdr_Device_Flags(xdrs, &objp->flags))
265
+ return (FALSE);
266
+ if (!xdr_u_long(xdrs, &objp->lock_timeout))
267
+ return (FALSE);
268
+ if (!xdr_u_long(xdrs, &objp->io_timeout))
269
+ return (FALSE);
270
+ return (TRUE);
271
+ }
272
+
273
+ bool_t
274
+ xdr_Device_RemoteFunc(xdrs, objp)
275
+ XDR *xdrs;
276
+ Device_RemoteFunc *objp;
277
+ {
278
+ int32_t *buf;
279
+
280
+ if (xdrs->x_op == XDR_ENCODE) {
281
+ buf = (int32_t *)XDR_INLINE(xdrs, 4 * BYTES_PER_XDR_UNIT);
282
+ if (buf == NULL) {
283
+ if (!xdr_u_long(xdrs, &objp->hostAddr))
284
+ return (FALSE);
285
+ if (!xdr_u_long(xdrs, &objp->hostPort))
286
+ return (FALSE);
287
+ if (!xdr_u_long(xdrs, &objp->progNum))
288
+ return (FALSE);
289
+ if (!xdr_u_long(xdrs, &objp->progVers))
290
+ return (FALSE);
291
+ } else {
292
+ IXDR_PUT_U_LONG(buf, objp->hostAddr);
293
+ IXDR_PUT_U_LONG(buf, objp->hostPort);
294
+ IXDR_PUT_U_LONG(buf, objp->progNum);
295
+ IXDR_PUT_U_LONG(buf, objp->progVers);
296
+ }
297
+ if (!xdr_Device_AddrFamily(xdrs, &objp->progFamily))
298
+ return (FALSE);
299
+ } else if (xdrs->x_op == XDR_DECODE) {
300
+ buf = (int32_t *)XDR_INLINE(xdrs, 4 * BYTES_PER_XDR_UNIT);
301
+ if (buf == NULL) {
302
+ if (!xdr_u_long(xdrs, &objp->hostAddr))
303
+ return (FALSE);
304
+ if (!xdr_u_long(xdrs, &objp->hostPort))
305
+ return (FALSE);
306
+ if (!xdr_u_long(xdrs, &objp->progNum))
307
+ return (FALSE);
308
+ if (!xdr_u_long(xdrs, &objp->progVers))
309
+ return (FALSE);
310
+ } else {
311
+ objp->hostAddr = IXDR_GET_U_LONG(buf);
312
+ objp->hostPort = IXDR_GET_U_LONG(buf);
313
+ objp->progNum = IXDR_GET_U_LONG(buf);
314
+ objp->progVers = IXDR_GET_U_LONG(buf);
315
+ }
316
+ if (!xdr_Device_AddrFamily(xdrs, &objp->progFamily))
317
+ return (FALSE);
318
+ } else {
319
+ if (!xdr_u_long(xdrs, &objp->hostAddr))
320
+ return (FALSE);
321
+ if (!xdr_u_long(xdrs, &objp->hostPort))
322
+ return (FALSE);
323
+ if (!xdr_u_long(xdrs, &objp->progNum))
324
+ return (FALSE);
325
+ if (!xdr_u_long(xdrs, &objp->progVers))
326
+ return (FALSE);
327
+ if (!xdr_Device_AddrFamily(xdrs, &objp->progFamily))
328
+ return (FALSE);
329
+ }
330
+ return (TRUE);
331
+ }
332
+
333
+ bool_t
334
+ xdr_Device_EnableSrqParms(xdrs, objp)
335
+ XDR *xdrs;
336
+ Device_EnableSrqParms *objp;
337
+ {
338
+
339
+ if (!xdr_Device_Link(xdrs, &objp->lid))
340
+ return (FALSE);
341
+ if (!xdr_bool(xdrs, &objp->enable))
342
+ return (FALSE);
343
+ if (!xdr_bytes(xdrs, (char **)&objp->handle.handle_val, (u_int *)&objp->handle.handle_len, 40))
344
+ return (FALSE);
345
+ return (TRUE);
346
+ }
347
+
348
+ bool_t
349
+ xdr_Device_LockParms(xdrs, objp)
350
+ XDR *xdrs;
351
+ Device_LockParms *objp;
352
+ {
353
+
354
+ if (!xdr_Device_Link(xdrs, &objp->lid))
355
+ return (FALSE);
356
+ if (!xdr_Device_Flags(xdrs, &objp->flags))
357
+ return (FALSE);
358
+ if (!xdr_u_long(xdrs, &objp->lock_timeout))
359
+ return (FALSE);
360
+ return (TRUE);
361
+ }
362
+
363
+ bool_t
364
+ xdr_Device_DocmdParms(xdrs, objp)
365
+ XDR *xdrs;
366
+ Device_DocmdParms *objp;
367
+ {
368
+ int32_t *buf;
369
+
370
+ if (xdrs->x_op == XDR_ENCODE) {
371
+ if (!xdr_Device_Link(xdrs, &objp->lid))
372
+ return (FALSE);
373
+ if (!xdr_Device_Flags(xdrs, &objp->flags))
374
+ return (FALSE);
375
+ buf = (int32_t *)XDR_INLINE(xdrs, 5 * BYTES_PER_XDR_UNIT);
376
+ if (buf == NULL) {
377
+ if (!xdr_u_long(xdrs, &objp->io_timeout))
378
+ return (FALSE);
379
+ if (!xdr_u_long(xdrs, &objp->lock_timeout))
380
+ return (FALSE);
381
+ if (!xdr_long(xdrs, &objp->cmd))
382
+ return (FALSE);
383
+ if (!xdr_bool(xdrs, &objp->network_order))
384
+ return (FALSE);
385
+ if (!xdr_long(xdrs, &objp->datasize))
386
+ return (FALSE);
387
+ } else {
388
+ IXDR_PUT_U_LONG(buf, objp->io_timeout);
389
+ IXDR_PUT_U_LONG(buf, objp->lock_timeout);
390
+ IXDR_PUT_LONG(buf, objp->cmd);
391
+ IXDR_PUT_BOOL(buf, objp->network_order);
392
+ IXDR_PUT_LONG(buf, objp->datasize);
393
+ }
394
+ if (!xdr_bytes(xdrs, (char **)&objp->data_in.data_in_val, (u_int *)&objp->data_in.data_in_len, ~0))
395
+ return (FALSE);
396
+ } else if (xdrs->x_op == XDR_DECODE) {
397
+ if (!xdr_Device_Link(xdrs, &objp->lid))
398
+ return (FALSE);
399
+ if (!xdr_Device_Flags(xdrs, &objp->flags))
400
+ return (FALSE);
401
+ buf = (int32_t *)XDR_INLINE(xdrs, 5 * BYTES_PER_XDR_UNIT);
402
+ if (buf == NULL) {
403
+ if (!xdr_u_long(xdrs, &objp->io_timeout))
404
+ return (FALSE);
405
+ if (!xdr_u_long(xdrs, &objp->lock_timeout))
406
+ return (FALSE);
407
+ if (!xdr_long(xdrs, &objp->cmd))
408
+ return (FALSE);
409
+ if (!xdr_bool(xdrs, &objp->network_order))
410
+ return (FALSE);
411
+ if (!xdr_long(xdrs, &objp->datasize))
412
+ return (FALSE);
413
+ } else {
414
+ objp->io_timeout = IXDR_GET_U_LONG(buf);
415
+ objp->lock_timeout = IXDR_GET_U_LONG(buf);
416
+ objp->cmd = IXDR_GET_LONG(buf);
417
+ objp->network_order = IXDR_GET_BOOL(buf);
418
+ objp->datasize = IXDR_GET_LONG(buf);
419
+ }
420
+ if (!xdr_bytes(xdrs, (char **)&objp->data_in.data_in_val, (u_int *)&objp->data_in.data_in_len, ~0))
421
+ return (FALSE);
422
+ } else {
423
+ if (!xdr_Device_Link(xdrs, &objp->lid))
424
+ return (FALSE);
425
+ if (!xdr_Device_Flags(xdrs, &objp->flags))
426
+ return (FALSE);
427
+ if (!xdr_u_long(xdrs, &objp->io_timeout))
428
+ return (FALSE);
429
+ if (!xdr_u_long(xdrs, &objp->lock_timeout))
430
+ return (FALSE);
431
+ if (!xdr_long(xdrs, &objp->cmd))
432
+ return (FALSE);
433
+ if (!xdr_bool(xdrs, &objp->network_order))
434
+ return (FALSE);
435
+ if (!xdr_long(xdrs, &objp->datasize))
436
+ return (FALSE);
437
+ if (!xdr_bytes(xdrs, (char **)&objp->data_in.data_in_val, (u_int *)&objp->data_in.data_in_len, ~0))
438
+ return (FALSE);
439
+ }
440
+ return (TRUE);
441
+ }
442
+
443
+ bool_t
444
+ xdr_Device_DocmdResp(xdrs, objp)
445
+ XDR *xdrs;
446
+ Device_DocmdResp *objp;
447
+ {
448
+
449
+ if (!xdr_Device_ErrorCode(xdrs, &objp->error))
450
+ return (FALSE);
451
+ if (!xdr_bytes(xdrs, (char **)&objp->data_out.data_out_val, (u_int *)&objp->data_out.data_out_len, ~0))
452
+ return (FALSE);
453
+ return (TRUE);
454
+ }
455
+
456
+ bool_t
457
+ xdr_Device_SrqParms(xdrs, objp)
458
+ XDR *xdrs;
459
+ Device_SrqParms *objp;
460
+ {
461
+
462
+ if (!xdr_bytes(xdrs, (char **)&objp->handle.handle_val, (u_int *)&objp->handle.handle_len, ~0))
463
+ return (FALSE);
464
+ return (TRUE);
465
+ }