2 * Copyright (c) 1998,1999,2000
3 * Traakan, Inc., Los Altos, CA
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice unmodified, this list of conditions, and the following
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 #include "ndmprotocol.h"
42 #ifndef NDMOS_OPTION_NO_NDMP2
45 #define xdr_ndmp2_connect_close_request xdr_void
46 #define xdr_ndmp2_connect_close_reply xdr_void
47 #define xdr_ndmp2_config_get_host_info_request xdr_void
48 #define xdr_ndmp2_config_get_mover_type_request xdr_void
49 #define xdr_ndmp2_scsi_close_request xdr_void
50 #define xdr_ndmp2_scsi_get_state_request xdr_void
51 #define xdr_ndmp2_scsi_reset_device_request xdr_void
52 #define xdr_ndmp2_scsi_reset_bus_request xdr_void
53 #define xdr_ndmp2_tape_close_request xdr_void
54 #define xdr_ndmp2_tape_get_state_request xdr_void
55 #define xdr_ndmp2_data_get_state_request xdr_void
57 #define xdr_ndmp2_data_abort_request xdr_void
58 #define xdr_ndmp2_data_get_env_request xdr_void
59 #define xdr_ndmp2_data_stop_request xdr_void
60 #define xdr_ndmp2_notify_data_halted_reply 0
61 #define xdr_ndmp2_notify_connected_reply 0
62 #define xdr_ndmp2_notify_mover_halted_reply 0
63 #define xdr_ndmp2_notify_mover_paused_reply 0
64 #define xdr_ndmp2_notify_data_read_reply 0
65 #define xdr_ndmp2_log_log_reply 0
66 #define xdr_ndmp2_log_debug_reply 0
67 #define xdr_ndmp2_log_file_reply 0
68 #define xdr_ndmp2_fh_add_unix_path_reply 0
69 #define xdr_ndmp2_fh_add_unix_dir_reply 0
70 #define xdr_ndmp2_fh_add_unix_node_reply 0
71 #define xdr_ndmp2_mover_get_state_request xdr_void
72 #define xdr_ndmp2_mover_continue_request xdr_void
73 #define xdr_ndmp2_mover_abort_request xdr_void
74 #define xdr_ndmp2_mover_stop_request xdr_void
75 #define xdr_ndmp2_mover_close_request xdr_void
80 struct ndmp_xdr_message_table ndmp2_xdr_message_table[] = {
82 xdr_ndmp2_connect_open_request,
83 xdr_ndmp2_connect_open_reply,
85 { NDMP2_CONNECT_CLIENT_AUTH,
86 xdr_ndmp2_connect_client_auth_request,
87 xdr_ndmp2_connect_client_auth_reply,
89 { NDMP2_CONNECT_CLOSE,
90 xdr_ndmp2_connect_close_request,
91 xdr_ndmp2_connect_close_reply,
93 { NDMP2_CONNECT_SERVER_AUTH,
94 xdr_ndmp2_connect_server_auth_request,
95 xdr_ndmp2_connect_server_auth_reply,
97 { NDMP2_CONFIG_GET_HOST_INFO,
98 xdr_ndmp2_config_get_host_info_request,
99 xdr_ndmp2_config_get_host_info_reply,
101 { NDMP2_CONFIG_GET_BUTYPE_ATTR,
102 xdr_ndmp2_config_get_butype_attr_request,
103 xdr_ndmp2_config_get_butype_attr_reply,
105 { NDMP2_CONFIG_GET_MOVER_TYPE,
106 xdr_ndmp2_config_get_mover_type_request,
107 xdr_ndmp2_config_get_mover_type_reply,
109 { NDMP2_CONFIG_GET_AUTH_ATTR,
110 xdr_ndmp2_config_get_auth_attr_request,
111 xdr_ndmp2_config_get_auth_attr_reply,
114 xdr_ndmp2_scsi_open_request,
115 xdr_ndmp2_scsi_open_reply,
118 xdr_ndmp2_scsi_close_request,
119 xdr_ndmp2_scsi_close_reply,
121 { NDMP2_SCSI_GET_STATE,
122 xdr_ndmp2_scsi_get_state_request,
123 xdr_ndmp2_scsi_get_state_reply,
125 { NDMP2_SCSI_SET_TARGET,
126 xdr_ndmp2_scsi_set_target_request,
127 xdr_ndmp2_scsi_set_target_reply,
129 { NDMP2_SCSI_RESET_DEVICE,
130 xdr_ndmp2_scsi_reset_device_request,
131 xdr_ndmp2_scsi_reset_device_reply,
133 { NDMP2_SCSI_RESET_BUS,
134 xdr_ndmp2_scsi_reset_bus_request,
135 xdr_ndmp2_scsi_reset_bus_reply,
137 { NDMP2_SCSI_EXECUTE_CDB,
138 xdr_ndmp2_scsi_execute_cdb_request,
139 xdr_ndmp2_scsi_execute_cdb_reply,
142 xdr_ndmp2_tape_open_request,
143 xdr_ndmp2_tape_open_reply,
146 xdr_ndmp2_tape_close_request,
147 xdr_ndmp2_tape_close_reply,
149 { NDMP2_TAPE_GET_STATE,
150 xdr_ndmp2_tape_get_state_request,
151 xdr_ndmp2_tape_get_state_reply,
154 xdr_ndmp2_tape_mtio_request,
155 xdr_ndmp2_tape_mtio_reply,
158 xdr_ndmp2_tape_write_request,
159 xdr_ndmp2_tape_write_reply,
162 xdr_ndmp2_tape_read_request,
163 xdr_ndmp2_tape_read_reply,
165 { NDMP2_TAPE_EXECUTE_CDB,
166 xdr_ndmp2_tape_execute_cdb_request,
167 xdr_ndmp2_tape_execute_cdb_reply,
169 { NDMP2_DATA_GET_STATE,
170 xdr_ndmp2_data_get_state_request,
171 xdr_ndmp2_data_get_state_reply,
173 { NDMP2_DATA_START_BACKUP,
174 xdr_ndmp2_data_start_backup_request,
175 xdr_ndmp2_data_start_backup_reply,
177 { NDMP2_DATA_START_RECOVER,
178 xdr_ndmp2_data_start_recover_request,
179 xdr_ndmp2_data_start_recover_reply,
182 xdr_ndmp2_data_abort_request,
183 xdr_ndmp2_data_abort_reply,
185 { NDMP2_DATA_GET_ENV,
186 xdr_ndmp2_data_get_env_request,
187 xdr_ndmp2_data_get_env_reply,
190 xdr_ndmp2_data_stop_request,
191 xdr_ndmp2_data_stop_reply,
193 { NDMP2_DATA_START_RECOVER_FILEHIST,
194 xdr_ndmp2_data_start_recover_filehist_request,
195 xdr_ndmp2_data_start_recover_filehist_reply,
197 { NDMP2_NOTIFY_DATA_HALTED,
198 xdr_ndmp2_notify_data_halted_request,
199 xdr_ndmp2_notify_data_halted_reply,
201 { NDMP2_NOTIFY_CONNECTED,
202 xdr_ndmp2_notify_connected_request,
203 xdr_ndmp2_notify_connected_reply,
205 { NDMP2_NOTIFY_MOVER_HALTED,
206 xdr_ndmp2_notify_mover_halted_request,
207 xdr_ndmp2_notify_mover_halted_reply,
209 { NDMP2_NOTIFY_MOVER_PAUSED,
210 xdr_ndmp2_notify_mover_paused_request,
211 xdr_ndmp2_notify_mover_paused_reply,
213 { NDMP2_NOTIFY_DATA_READ,
214 xdr_ndmp2_notify_data_read_request,
215 xdr_ndmp2_notify_data_read_reply,
218 xdr_ndmp2_log_log_request,
219 xdr_ndmp2_log_log_reply,
222 xdr_ndmp2_log_debug_request,
223 xdr_ndmp2_log_debug_reply,
226 xdr_ndmp2_log_file_request,
227 xdr_ndmp2_log_file_reply,
229 { NDMP2_FH_ADD_UNIX_PATH,
230 xdr_ndmp2_fh_add_unix_path_request,
231 xdr_ndmp2_fh_add_unix_path_reply,
233 { NDMP2_FH_ADD_UNIX_DIR,
234 xdr_ndmp2_fh_add_unix_dir_request,
235 xdr_ndmp2_fh_add_unix_dir_reply,
237 { NDMP2_FH_ADD_UNIX_NODE,
238 xdr_ndmp2_fh_add_unix_node_request,
239 xdr_ndmp2_fh_add_unix_node_reply,
241 { NDMP2_MOVER_GET_STATE,
242 xdr_ndmp2_mover_get_state_request,
243 xdr_ndmp2_mover_get_state_reply,
245 { NDMP2_MOVER_LISTEN,
246 xdr_ndmp2_mover_listen_request,
247 xdr_ndmp2_mover_listen_reply,
249 { NDMP2_MOVER_CONTINUE,
250 xdr_ndmp2_mover_continue_request,
251 xdr_ndmp2_mover_continue_reply,
254 xdr_ndmp2_mover_abort_request,
255 xdr_ndmp2_mover_abort_reply,
258 xdr_ndmp2_mover_stop_request,
259 xdr_ndmp2_mover_stop_reply,
261 { NDMP2_MOVER_SET_WINDOW,
262 xdr_ndmp2_mover_set_window_request,
263 xdr_ndmp2_mover_set_window_reply,
266 xdr_ndmp2_mover_read_request,
267 xdr_ndmp2_mover_read_reply,
270 xdr_ndmp2_mover_close_request,
271 xdr_ndmp2_mover_close_reply,
273 { NDMP2_MOVER_SET_RECORD_SIZE,
274 xdr_ndmp2_mover_set_record_size_request,
275 xdr_ndmp2_mover_set_record_size_reply,
283 * XDR unsigned long integers
284 * same as xdr_long - open coded to save a proc call!
287 xdr_ndmp2_u_quad(xdrs, objp)
293 switch (xdrs->x_op) {
295 if (XDR_GETLONG(xdrs, (long*)&hi)
296 && XDR_GETLONG(xdrs, (long*)&lo)) {
297 *objp = ((unsigned long long)hi << 32) | (lo & 0xffffffff);
305 return XDR_PUTLONG(xdrs, (long*)&hi)
306 && XDR_PUTLONG(xdrs, (long*)&lo);
315 #endif /* !NDMOS_OPTION_NO_NDMP2 */