SANEI 1.3.1.72-4c77c
sanei_net.h
1/* sane - Scanner Access Now Easy.
2 Copyright (C) 1997-1999 David Mosberger-Tang and Andreas Beck
3 This file is part of the SANE package.
4
5 This file is in the public domain. You may use and modify it as
6 you see fit, as long as this copyright message is included and
7 that there is an indication as to what modifications have been
8 made (if any).
9
10 SANE is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE.
13
14 This file declares SANE application interface. See the SANE
15 standard for a detailed explanation of the interface. */
16
17#ifndef sanei_net_h
18#define sanei_net_h
19
20#include <sane/sane.h>
21#include <sane/sanei_wire.h>
22
23#define SANEI_NET_PROTOCOL_VERSION 3
24
25typedef enum
26 {
27 SANE_NET_LITTLE_ENDIAN = 0x1234,
28 SANE_NET_BIG_ENDIAN = 0x4321
29 }
30SANE_Net_Byte_Order;
31
32typedef enum
33 {
34 SANE_NET_INIT = 0,
35 SANE_NET_GET_DEVICES,
36 SANE_NET_OPEN,
37 SANE_NET_CLOSE,
38 SANE_NET_GET_OPTION_DESCRIPTORS,
39 SANE_NET_CONTROL_OPTION,
40 SANE_NET_GET_PARAMETERS,
41 SANE_NET_START,
42 SANE_NET_CANCEL,
43 SANE_NET_AUTHORIZE,
44 SANE_NET_EXIT
45 }
46SANE_Net_Procedure_Number;
47
48typedef struct
49 {
50 SANE_Word version_code;
51 SANE_String username;
52 }
53SANE_Init_Req;
54
55typedef struct
56 {
57 SANE_Status status;
58 SANE_Word version_code;
59 }
60SANE_Init_Reply;
61
62typedef struct
63 {
64 SANE_Status status;
65 SANE_Device **device_list;
66 }
67SANE_Get_Devices_Reply;
68
69typedef struct
70 {
71 SANE_Status status;
72 SANE_Word handle;
73 SANE_String resource_to_authorize;
74 }
75SANE_Open_Reply;
76
77typedef struct
78 {
79 SANE_Word num_options;
80 SANE_Option_Descriptor **desc;
81 }
82SANE_Option_Descriptor_Array;
83
84typedef struct
85 {
86 SANE_Word handle;
87 SANE_Word option;
88 SANE_Word action;
89 SANE_Word value_type;
90 SANE_Word value_size;
91 void *value;
92 }
93SANE_Control_Option_Req;
94
95typedef struct
96 {
97 SANE_Status status;
98 SANE_Word info;
99 SANE_Word value_type;
100 SANE_Word value_size;
101 void *value;
102 SANE_String resource_to_authorize;
103 }
104SANE_Control_Option_Reply;
105
106typedef struct
107 {
108 SANE_Status status;
109 SANE_Parameters params;
110 }
111SANE_Get_Parameters_Reply;
112
113typedef struct
114 {
115 SANE_Status status;
116 SANE_Word port;
117 SANE_Word byte_order;
118 SANE_String resource_to_authorize;
119 }
120SANE_Start_Reply;
121
122typedef struct
123 {
124 SANE_String resource;
125 SANE_String username;
126 SANE_String password;
127 }
128SANE_Authorization_Req;
129
130extern void sanei_w_init_req (Wire *w, SANE_Init_Req *req);
131extern void sanei_w_init_reply (Wire *w, SANE_Init_Reply *reply);
132extern void sanei_w_get_devices_reply (Wire *w, SANE_Get_Devices_Reply *reply);
133extern void sanei_w_open_reply (Wire *w, SANE_Open_Reply *reply);
134extern void sanei_w_option_descriptor_array (Wire *w,
135 SANE_Option_Descriptor_Array *opt);
136extern void sanei_w_control_option_req (Wire *w, SANE_Control_Option_Req *req);
137extern void sanei_w_control_option_reply (Wire *w,
138 SANE_Control_Option_Reply *reply);
139extern void sanei_w_get_parameters_reply (Wire *w,
140 SANE_Get_Parameters_Reply *reply);
141extern void sanei_w_start_reply (Wire *w, SANE_Start_Reply *reply);
142extern void sanei_w_authorization_req (Wire *w, SANE_Authorization_Req *req);
143
144#endif /* sanei_net_h */