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"
43 struct ndmp_xdr_message_table ndmp9_xdr_message_table[] = {
45 xdr_ndmp9_connect_open_request,
46 xdr_ndmp9_connect_open_reply,
48 { NDMP9_CONNECT_CLIENT_AUTH,
49 xdr_ndmp9_connect_client_auth_request,
50 xdr_ndmp9_connect_client_auth_reply,
52 { NDMP9_CONNECT_CLOSE,
53 xdr_ndmp9_connect_close_request,
54 xdr_ndmp9_connect_close_reply,
56 { NDMP9_CONNECT_SERVER_AUTH,
57 xdr_ndmp9_connect_server_auth_request,
58 xdr_ndmp9_connect_server_auth_reply,
60 { NDMP9_CONFIG_GET_HOST_INFO,
61 xdr_ndmp9_config_get_host_info_request,
62 xdr_ndmp9_config_get_host_info_reply,
64 { NDMP9_CONFIG_GET_CONNECTION_TYPE,
65 xdr_ndmp9_config_get_connection_type_request,
66 xdr_ndmp9_config_get_connection_type_reply,
68 { NDMP9_CONFIG_GET_AUTH_ATTR,
69 xdr_ndmp9_config_get_auth_attr_request,
70 xdr_ndmp9_config_get_auth_attr_reply,
72 { NDMP9_CONFIG_GET_BUTYPE_INFO,
73 xdr_ndmp9_config_get_butype_info_request,
74 xdr_ndmp9_config_get_butype_info_reply,
76 { NDMP9_CONFIG_GET_FS_INFO,
77 xdr_ndmp9_config_get_fs_info_request,
78 xdr_ndmp9_config_get_fs_info_reply,
80 { NDMP9_CONFIG_GET_TAPE_INFO,
81 xdr_ndmp9_config_get_tape_info_request,
82 xdr_ndmp9_config_get_tape_info_reply,
84 { NDMP9_CONFIG_GET_SCSI_INFO,
85 xdr_ndmp9_config_get_scsi_info_request,
86 xdr_ndmp9_config_get_scsi_info_reply,
88 { NDMP9_CONFIG_GET_SERVER_INFO,
89 xdr_ndmp9_config_get_server_info_request,
90 xdr_ndmp9_config_get_server_info_reply,
93 xdr_ndmp9_scsi_open_request,
94 xdr_ndmp9_scsi_open_reply,
97 xdr_ndmp9_scsi_close_request,
98 xdr_ndmp9_scsi_close_reply,
100 { NDMP9_SCSI_GET_STATE,
101 xdr_ndmp9_scsi_get_state_request,
102 xdr_ndmp9_scsi_get_state_reply,
104 { NDMP9_SCSI_RESET_DEVICE,
105 xdr_ndmp9_scsi_reset_device_request,
106 xdr_ndmp9_scsi_reset_device_reply,
108 { NDMP9_SCSI_EXECUTE_CDB,
109 xdr_ndmp9_scsi_execute_cdb_request,
110 xdr_ndmp9_scsi_execute_cdb_reply,
113 xdr_ndmp9_tape_open_request,
114 xdr_ndmp9_tape_open_reply,
117 xdr_ndmp9_tape_close_request,
118 xdr_ndmp9_tape_close_reply,
120 { NDMP9_TAPE_GET_STATE,
121 xdr_ndmp9_tape_get_state_request,
122 xdr_ndmp9_tape_get_state_reply,
125 xdr_ndmp9_tape_mtio_request,
126 xdr_ndmp9_tape_mtio_reply,
129 xdr_ndmp9_tape_write_request,
130 xdr_ndmp9_tape_write_reply,
133 xdr_ndmp9_tape_read_request,
134 xdr_ndmp9_tape_read_reply,
136 { NDMP9_TAPE_EXECUTE_CDB,
137 xdr_ndmp9_tape_execute_cdb_request,
138 xdr_ndmp9_tape_execute_cdb_reply,
140 { NDMP9_DATA_GET_STATE,
141 xdr_ndmp9_data_get_state_request,
142 xdr_ndmp9_data_get_state_reply,
144 { NDMP9_DATA_START_BACKUP,
145 xdr_ndmp9_data_start_backup_request,
146 xdr_ndmp9_data_start_backup_reply,
148 { NDMP9_DATA_START_RECOVER,
149 xdr_ndmp9_data_start_recover_request,
150 xdr_ndmp9_data_start_recover_reply,
152 { NDMP9_DATA_START_RECOVER_FILEHIST,
153 xdr_ndmp9_data_start_recover_filehist_request,
154 xdr_ndmp9_data_start_recover_filehist_reply,
157 xdr_ndmp9_data_abort_request,
158 xdr_ndmp9_data_abort_reply,
160 { NDMP9_DATA_GET_ENV,
161 xdr_ndmp9_data_get_env_request,
162 xdr_ndmp9_data_get_env_reply,
165 xdr_ndmp9_data_stop_request,
166 xdr_ndmp9_data_stop_reply,
169 xdr_ndmp9_data_listen_request,
170 xdr_ndmp9_data_listen_reply,
172 { NDMP9_DATA_CONNECT,
173 xdr_ndmp9_data_connect_request,
174 xdr_ndmp9_data_connect_reply,
176 { NDMP9_NOTIFY_DATA_HALTED,
177 xdr_ndmp9_notify_data_halted_request,
180 { NDMP9_NOTIFY_CONNECTED,
181 xdr_ndmp9_notify_connected_request,
184 { NDMP9_NOTIFY_MOVER_HALTED,
185 xdr_ndmp9_notify_mover_halted_request,
188 { NDMP9_NOTIFY_MOVER_PAUSED,
189 xdr_ndmp9_notify_mover_paused_request,
192 { NDMP9_NOTIFY_DATA_READ,
193 xdr_ndmp9_notify_data_read_request,
197 xdr_ndmp9_log_file_request,
201 xdr_ndmp9_log_message_request,
205 xdr_ndmp9_fh_add_file_request,
209 xdr_ndmp9_fh_add_dir_request,
213 xdr_ndmp9_fh_add_node_request,
216 { NDMP9_MOVER_GET_STATE,
217 xdr_ndmp9_mover_get_state_request,
218 xdr_ndmp9_mover_get_state_reply,
220 { NDMP9_MOVER_LISTEN,
221 xdr_ndmp9_mover_listen_request,
222 xdr_ndmp9_mover_listen_reply,
224 { NDMP9_MOVER_CONTINUE,
225 xdr_ndmp9_mover_continue_request,
226 xdr_ndmp9_mover_continue_reply,
229 xdr_ndmp9_mover_abort_request,
230 xdr_ndmp9_mover_abort_reply,
233 xdr_ndmp9_mover_stop_request,
234 xdr_ndmp9_mover_stop_reply,
236 { NDMP9_MOVER_SET_WINDOW,
237 xdr_ndmp9_mover_set_window_request,
238 xdr_ndmp9_mover_set_window_reply,
241 xdr_ndmp9_mover_read_request,
242 xdr_ndmp9_mover_read_reply,
245 xdr_ndmp9_mover_close_request,
246 xdr_ndmp9_mover_close_reply,
248 { NDMP9_MOVER_SET_RECORD_SIZE,
249 xdr_ndmp9_mover_set_record_size_request,
250 xdr_ndmp9_mover_set_record_size_reply,
252 { NDMP9_MOVER_CONNECT,
253 xdr_ndmp9_mover_connect_request,
254 xdr_ndmp9_mover_connect_reply,
262 * XDR unsigned long integers
263 * same as xdr_long - open coded to save a proc call!
266 xdr_ndmp9_u_quad(xdrs, objp)
272 switch (xdrs->x_op) {
274 if (XDR_GETLONG(xdrs, (long*)&hi)
275 && XDR_GETLONG(xdrs, (long*)&lo)) {
276 *objp = ((unsigned long long)hi << 32) | (lo & 0xffffffff);
284 return XDR_PUTLONG(xdrs, (long*)&hi)
285 && XDR_PUTLONG(xdrs, (long*)&lo);
295 xdr_ndmp9_no_arguments(xdrs, objp)