00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef sanei_net_h
00018 #define sanei_net_h
00019
00020 #include <sane/sane.h>
00021 #include <sane/sanei_wire.h>
00022
00023 #define SANEI_NET_PROTOCOL_VERSION 3
00024
00025 typedef enum
00026 {
00027 SANE_NET_LITTLE_ENDIAN = 0x1234,
00028 SANE_NET_BIG_ENDIAN = 0x4321
00029 }
00030 SANE_Net_Byte_Order;
00031
00032 typedef enum
00033 {
00034 SANE_NET_INIT = 0,
00035 SANE_NET_GET_DEVICES,
00036 SANE_NET_OPEN,
00037 SANE_NET_CLOSE,
00038 SANE_NET_GET_OPTION_DESCRIPTORS,
00039 SANE_NET_CONTROL_OPTION,
00040 SANE_NET_GET_PARAMETERS,
00041 SANE_NET_START,
00042 SANE_NET_CANCEL,
00043 SANE_NET_AUTHORIZE,
00044 SANE_NET_EXIT
00045 }
00046 SANE_Net_Procedure_Number;
00047
00048 typedef struct
00049 {
00050 SANE_Word version_code;
00051 SANE_String username;
00052 }
00053 SANE_Init_Req;
00054
00055 typedef struct
00056 {
00057 SANE_Status status;
00058 SANE_Word version_code;
00059 }
00060 SANE_Init_Reply;
00061
00062 typedef struct
00063 {
00064 SANE_Status status;
00065 SANE_Device **device_list;
00066 }
00067 SANE_Get_Devices_Reply;
00068
00069 typedef struct
00070 {
00071 SANE_Status status;
00072 SANE_Word handle;
00073 SANE_String resource_to_authorize;
00074 }
00075 SANE_Open_Reply;
00076
00077 typedef struct
00078 {
00079 SANE_Word num_options;
00080 SANE_Option_Descriptor **desc;
00081 }
00082 SANE_Option_Descriptor_Array;
00083
00084 typedef struct
00085 {
00086 SANE_Word handle;
00087 SANE_Word option;
00088 SANE_Word action;
00089 SANE_Word value_type;
00090 SANE_Word value_size;
00091 void *value;
00092 }
00093 SANE_Control_Option_Req;
00094
00095 typedef struct
00096 {
00097 SANE_Status status;
00098 SANE_Word info;
00099 SANE_Word value_type;
00100 SANE_Word value_size;
00101 void *value;
00102 SANE_String resource_to_authorize;
00103 }
00104 SANE_Control_Option_Reply;
00105
00106 typedef struct
00107 {
00108 SANE_Status status;
00109 SANE_Parameters params;
00110 }
00111 SANE_Get_Parameters_Reply;
00112
00113 typedef struct
00114 {
00115 SANE_Status status;
00116 SANE_Word port;
00117 SANE_Word byte_order;
00118 SANE_String resource_to_authorize;
00119 }
00120 SANE_Start_Reply;
00121
00122 typedef struct
00123 {
00124 SANE_String resource;
00125 SANE_String username;
00126 SANE_String password;
00127 }
00128 SANE_Authorization_Req;
00129
00130 extern void sanei_w_init_req (Wire *w, SANE_Init_Req *req);
00131 extern void sanei_w_init_reply (Wire *w, SANE_Init_Reply *reply);
00132 extern void sanei_w_get_devices_reply (Wire *w, SANE_Get_Devices_Reply *reply);
00133 extern void sanei_w_open_reply (Wire *w, SANE_Open_Reply *reply);
00134 extern void sanei_w_option_descriptor_array (Wire *w,
00135 SANE_Option_Descriptor_Array *opt);
00136 extern void sanei_w_control_option_req (Wire *w, SANE_Control_Option_Req *req);
00137 extern void sanei_w_control_option_reply (Wire *w,
00138 SANE_Control_Option_Reply *reply);
00139 extern void sanei_w_get_parameters_reply (Wire *w,
00140 SANE_Get_Parameters_Reply *reply);
00141 extern void sanei_w_start_reply (Wire *w, SANE_Start_Reply *reply);
00142 extern void sanei_w_authorization_req (Wire *w, SANE_Authorization_Req *req);
00143
00144 #endif