2 * Copyright (c) 2000,2001
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
34 * NDMPv9, represented here, is a ficticious version
35 * used internally and never over-the-wire. This
36 * isolates higher-level routines from variations
37 * between NDMP protocol version. At this time,
38 * NDMPv2, NDMPv3 and NDMPv4 are deployed. NDMPv9 tends
39 * to be bits and pieces of all supported protocol versions
42 * While we want the higher-level routines isolated,
43 * for clarity we still want them to use data structures
44 * and construct that resemble NDMP. Higher-level routines
45 * manipulate NDMPv9 data structures. Mid-level routines
46 * translate between NDMPv9 and the over-the-wire version
47 * in use. Low-level routines do the over-the-wire functions.
49 * The approach of using the latest version internally
50 * and retrofiting earlier versions was rejected for
51 * two reasons. First, it means a tear-up of higher-level
52 * functions as new versions are deployed. Second,
53 * it makes building with selected version impossible.
54 * No matter what approach is taken, there will be
55 * some sort of retrofit between versions. NDMPv9
56 * is simply the internal version, and all bona-fide
57 * versions are retrofitted. v9 was chosen because
58 * it is unlikely the NDMP version will reach 9
59 * within the useful life of the NDMP architecture.
61 * NDMPv9 could be implemented in a hand-crafted header (.h)
62 * file, yet we continue to use the ONC RPC (.x) description
63 * for convenvience. It's easy to cut-n-paste from the other
64 * NDMP.x files. It's important that ndmp9_xdr.c never be
65 * generated nor compiled.
73 * Description : NDMP protocol rpcgen file.
75 * Copyright (c) 1999 Intelliguard Software, Network Appliance.
76 * All Rights Reserved.
81 * Copyright (c) 1997 Network Appliance. All Rights Reserved.
83 * Network Appliance makes no representations concerning either
84 * the merchantability of this software or the suitability of this
85 * software for any particular purpose. It is provided "as is"
86 * without express or implied warranty of any kind.
88 * These notices must be retained in any copies of any part of this
89 * documentation and/or software.
98 ****************************************************************
105 NDMP9_NO_ERR, /* No error */
106 NDMP9_NOT_SUPPORTED_ERR, /* Call is not supported */
107 NDMP9_DEVICE_BUSY_ERR, /* The device is in use */
108 NDMP9_DEVICE_OPENED_ERR, /* Another tape or scsi device
110 NDMP9_NOT_AUTHORIZED_ERR, /* connection has not been authorized*/
111 NDMP9_PERMISSION_ERR, /* some sort of permission problem */
112 NDMP9_DEV_NOT_OPEN_ERR, /* SCSI device is not open */
113 NDMP9_IO_ERR, /* I/O error */
114 NDMP9_TIMEOUT_ERR, /* command timed out */
115 NDMP9_ILLEGAL_ARGS_ERR, /* illegal arguments in request */
116 NDMP9_NO_TAPE_LOADED_ERR, /* Cannot open because there is
118 NDMP9_WRITE_PROTECT_ERR, /* tape cannot be open for write */
119 NDMP9_EOF_ERR, /* Command encountered EOF */
120 NDMP9_EOM_ERR, /* Command encountered EOM */
121 NDMP9_FILE_NOT_FOUND_ERR, /* File not found during recover */
122 NDMP9_BAD_FILE_ERR, /* The file descriptor is invalid */
123 NDMP9_NO_DEVICE_ERR, /* The device is not at that target */
124 NDMP9_NO_BUS_ERR, /* Invalid controller */
125 NDMP9_XDR_DECODE_ERR, /* Can't decode the request argument */
126 NDMP9_ILLEGAL_STATE_ERR, /* Call can't be done at this state */
127 NDMP9_UNDEFINED_ERR, /* Undefined Error */
128 NDMP9_XDR_ENCODE_ERR, /* Can't encode the reply argument */
129 NDMP9_NO_MEM_ERR, /* no memory */
130 NDMP9_CONNECT_ERR, /* Error connecting to another
132 NDMP9_SEQUENCE_NUM_ERR,
133 NDMP9_READ_IN_PROGRESS_ERR = 25,
134 NDMP9_PRECONDITION_ERR = 26,
135 NDMP9_CLASS_NOT_SUPPORTED = 27,
136 NDMP9_VERSION_NOT_SUPPORTED = 28,
137 NDMP9_EXT_DUPL_CLASSES = 29,
138 NDMP9_EXT_DN_ILLEGAL = 30
146 NDMP9_CONNECT_OPEN = 0x900, /* CONNECT INTERFACE */
147 NDMP9_CONNECT_CLIENT_AUTH = 0x901,
148 NDMP9_CONNECT_CLOSE = 0x902,
149 NDMP9_CONNECT_SERVER_AUTH = 0x903,
151 NDMP9_CONFIG_GET_HOST_INFO = 0x100, /* CONFIG INTERFACE */
152 NDMP9_CONFIG_GET_CONNECTION_TYPE = 0x102, /* NDMP2_CONFIG_GET_MOVER_TYPE on v2*/
153 NDMP9_CONFIG_GET_AUTH_ATTR = 0x103,
154 NDMP9_CONFIG_GET_BUTYPE_INFO = 0x104, /* NDMPv3 and forward */
155 NDMP9_CONFIG_GET_FS_INFO = 0x105, /* NDMPv3 and forward */
156 NDMP9_CONFIG_GET_TAPE_INFO = 0x106, /* NDMPv3 and forward */
157 NDMP9_CONFIG_GET_SCSI_INFO = 0x107, /* NDMPv3 and forward */
158 NDMP9_CONFIG_GET_SERVER_INFO =0x108, /* NDMPv3 and forward */
160 NDMP9_SCSI_OPEN = 0x200, /* SCSI INTERFACE */
161 NDMP9_SCSI_CLOSE = 0x201,
162 NDMP9_SCSI_GET_STATE = 0x202,
163 NDMP9_SCSI_SET_TARGET = 0x203,
164 NDMP9_SCSI_RESET_DEVICE = 0x204,
165 NDMP9_SCSI_RESET_BUS = 0x205,
166 NDMP9_SCSI_EXECUTE_CDB = 0x206,
168 NDMP9_TAPE_OPEN = 0x300, /* TAPE INTERFACE */
169 NDMP9_TAPE_CLOSE = 0x301,
170 NDMP9_TAPE_GET_STATE = 0x302,
171 NDMP9_TAPE_MTIO = 0x303,
172 NDMP9_TAPE_WRITE = 0x304,
173 NDMP9_TAPE_READ = 0x305,
174 NDMP9_TAPE_EXECUTE_CDB = 0x307,
176 NDMP9_DATA_GET_STATE = 0x400, /* DATA INTERFACE */
177 NDMP9_DATA_START_BACKUP = 0x401,
178 NDMP9_DATA_START_RECOVER = 0x402,
179 NDMP9_DATA_ABORT = 0x403,
180 NDMP9_DATA_GET_ENV = 0x404,
181 NDMP9_DATA_STOP = 0x407,
182 NDMP9_DATA_LISTEN = 0x409,
183 NDMP9_DATA_CONNECT = 0x40a,
184 NDMP9_DATA_START_RECOVER_FILEHIST = 0x40b,
186 NDMP9_NOTIFY_DATA_HALTED =0x501,/* NOTIFY INTERFACE */
187 NDMP9_NOTIFY_CONNECTED = 0x502,
188 NDMP9_NOTIFY_MOVER_HALTED = 0x503,
189 NDMP9_NOTIFY_MOVER_PAUSED = 0x504,
190 NDMP9_NOTIFY_DATA_READ =0x505,
192 NDMP9_LOG_FILE = 0x602, /* LOGGING INTERFACE */
193 NDMP9_LOG_MESSAGE = 0x603,
195 NDMP9_FH_ADD_FILE = 0x703, /* FILE HISTORY INTERFACE */
196 NDMP9_FH_ADD_DIR = 0x704,
197 NDMP9_FH_ADD_NODE = 0x705,
199 NDMP9_MOVER_GET_STATE = 0xa00, /* MOVER INTERFACE */
200 NDMP9_MOVER_LISTEN = 0xa01,
201 NDMP9_MOVER_CONTINUE = 0xa02,
202 NDMP9_MOVER_ABORT = 0xa03,
203 NDMP9_MOVER_STOP = 0xa04,
204 NDMP9_MOVER_SET_WINDOW = 0xa05,
205 NDMP9_MOVER_READ = 0xa06,
206 NDMP9_MOVER_CLOSE =0xa07,
207 NDMP9_MOVER_SET_RECORD_SIZE =0xa08,
208 NDMP9_MOVER_CONNECT =0xa09
213 * Common message bodies
215 %extern bool_t xdr_ndmp9_no_arguments();
216 %#define ndmp9_no_arguments int
218 struct ndmp9_just_error_reply {
226 %extern bool_t xdr_ndmp9_u_quad();
227 %#define ndmp9_u_quad unsigned long long
230 * Valid values. Sometimes we have values, and sometimes we don't.
232 enum ndmp9_validity {
233 NDMP9_VALIDITY_INVALID = 0,
234 NDMP9_VALIDITY_VALID,
235 NDMP9_VALIDITY_MAYBE_INVALID,
236 NDMP9_VALIDITY_MAYBE_VALID
239 %#define NDMP9_INVALID_U_LONG 0xFFFFFFFFul
240 struct ndmp9_valid_u_long {
241 ndmp9_validity valid;
245 %#define NDMP9_INVALID_U_QUAD 0xFFFFFFFFFFFFFFFFull
246 struct ndmp9_valid_u_quad {
247 ndmp9_validity valid;
253 * Property values. A simple name/value pair. Used in lots of places.
262 * Authorization data. Three authorization types each
263 * with their particular values. Authorization is done
265 * 1) Client determines which types of authorization are available
267 * 2) Client may get parameters (challenge) from server.
268 * 3) Client requests authorization based on a shared
269 * secret (password) with parameters (challenge) applied.
271 enum ndmp9_auth_type {
272 NDMP9_AUTH_NONE, /* no password is required */
273 NDMP9_AUTH_TEXT, /* the clear text password */
274 NDMP9_AUTH_MD5 /* md5 */
277 union ndmp9_auth_attr switch (enum ndmp9_auth_type auth_type) {
278 case NDMP9_AUTH_NONE:
280 case NDMP9_AUTH_TEXT:
283 opaque challenge[64];
286 struct ndmp9_auth_text {
287 string auth_id<>; /* account/user name */
288 string auth_password<>; /* clear-text password */
291 struct ndmp9_auth_md5 {
292 string auth_id<>; /* account/user name */
293 opaque auth_digest[16]; /* MD5 "hashed" password */
296 union ndmp9_auth_data switch (enum ndmp9_auth_type auth_type) {
297 case NDMP9_AUTH_NONE:
299 case NDMP9_AUTH_TEXT:
300 struct ndmp9_auth_text auth_text;
302 struct ndmp9_auth_md5 auth_md5;
307 * The data connection (data stream, image stream, big ol' pipe)
308 * has two endpoints, Once side instigates the connection (connects),
309 * the other side receives the connection (listen/accept).
310 * Appears in DATA and MOVER interfaces.
312 enum ndmp9_addr_type {
315 /* IPC and FC addr types contemplated but never deployed */
316 NDMP9_ADDR_AS_CONNECTED = 0x1000
319 struct ndmp9_tcp_addr {
324 union ndmp9_addr switch (ndmp9_addr_type addr_type) {
325 case NDMP9_ADDR_LOCAL:
326 case NDMP9_ADDR_AS_CONNECTED:
329 ndmp9_tcp_addr tcp_addr;
337 ****************************************************************
339 * The CONNECT INTERFACE is used to condition and authorize
340 * the control connection from the CONTROL Agent (DMA, Client)
341 * to the DATA, TAPE, or SCSI Agent (DSP, Servers).
343 * Most of this is addressed by NDMP0 (zero), which is a companion
344 * ficticious version. The NDMP0 features must never change to
345 * support protocol version negotiation. Once the version is
346 * negotiated, subsequent negotiations and authorization can
350 /* NDMP9_CONNECT_OPEN -- must never change, negotiate protocol version */
351 struct ndmp9_connect_open_request {
352 u_short protocol_version; /* the version of protocol supported */
354 typedef ndmp9_just_error_reply ndmp9_connect_open_reply;
356 /* NDMP9_CONNECT_CLIENT_AUTH -- authorize client */
357 struct ndmp9_connect_client_auth_request {
358 ndmp9_auth_data auth_data;
360 typedef ndmp9_just_error_reply ndmp9_connect_client_auth_reply;
363 /* NDMP9_CONNECT_CLOSE -- must never change, terminate control connection */
364 typedef ndmp9_no_arguments ndmp9_connect_close_request;
365 typedef ndmp9_no_arguments ndmp9_connect_close_reply;
367 /* NDMP9_CONNECT_SERVER_AUTH -- once client is authorized, ask server to
368 * prove itself -- nobody is using this */
369 struct ndmp9_connect_server_auth_request {
370 ndmp9_auth_attr client_attr;
373 struct ndmp9_connect_server_auth_reply {
375 ndmp9_auth_data server_result;
381 ****************************************************************
383 * The CONFIG interfaces allow the CONTROL Agent (DMA, client) to
384 * obtain resource and other information from the DATA/TAPE/SCSI
385 * Agent (DSP, server).
387 * For NDMPv9, the whole show is lumped into a single data structure.
388 * The specific CONFIG interfaces, which vary between versions,
389 * pick-n-choose the info needed.
392 struct ndmp9_butype_info {
393 string butype_name<>;
394 ndmp9_valid_u_long v2attr;
395 ndmp9_valid_u_long v3attr;
396 ndmp9_valid_u_long v4attr;
397 ndmp9_pval default_env<>;
400 struct ndmp9_fs_info {
402 string fs_logical_device<>;
403 string fs_physical_device<>;
404 ndmp9_valid_u_quad total_size;
405 ndmp9_valid_u_quad used_size;
406 ndmp9_valid_u_quad avail_size;
407 ndmp9_valid_u_quad total_inodes;
408 ndmp9_valid_u_quad used_inodes;
413 struct ndmp9_device_capability {
415 ndmp9_valid_u_long v3attr;
416 ndmp9_valid_u_long v4attr;
417 ndmp9_pval capability<>;
420 struct ndmp9_device_info {
422 ndmp9_device_capability caplist<>;
425 const NDMP9_CONFIG_CONNTYPE_LOCAL = 0x0001;
426 const NDMP9_CONFIG_CONNTYPE_TCP = 0x0002;
428 const NDMP9_CONFIG_AUTHTYPE_NONE = 0x0001;
429 const NDMP9_CONFIG_AUTHTYPE_TEXT = 0x0002;
430 const NDMP9_CONFIG_AUTHTYPE_MD5 = 0x0004;
432 struct ndmp9_config_info {
435 /* ndmp[23]_config_get_host_info_reply */
436 string hostname<>; /* host name */
437 string os_type<>; /* The O/S type (e.g. SOLARIS) */
438 string os_vers<>; /* The O/S version (e.g. 2.5) */
441 /* ndmp[34]_config_get_server_info_reply */
442 string vendor_name<>;
443 string product_name<>;
444 string revision_number<>;
446 /* ndmp2_config_get_host_info */
447 /* ndmp[34]_config_get_server_info */
450 /* ndmp2_config_get_mover_type */
451 /* ndmp[34]_config_get_connection_type */
454 /* ndmp2_config_get_butype_attr */
455 /* ndmp[34]_config_get_butype_info */
456 ndmp9_butype_info butype_info<>;
458 /* ndmp[34]_config_get_fs_info */
459 ndmp9_fs_info fs_info<>;
461 /* ndmp[34]_config_get_tape_info */
462 ndmp9_device_info tape_info<>;
464 /* ndmp[34]_config_get_scsi_info */
465 ndmp9_device_info scsi_info<>;
468 /* NDMP9_CONFIG_GET_INFO */
469 typedef ndmp9_no_arguments ndmp9_config_get_info_request;
470 struct ndmp9_config_get_info_reply {
472 ndmp9_config_info config_info;
475 /* NDMP9_CONFIG_GET_HOST_INFO */
476 typedef ndmp9_no_arguments ndmp9_config_get_host_info_request;
477 typedef ndmp9_config_get_info_reply ndmp9_config_get_host_info_reply;
479 /* NDMP9_CONFIG_GET_CONNECTION_TYPE */
480 typedef ndmp9_no_arguments ndmp9_config_get_connection_type_request;
481 typedef ndmp9_config_get_info_reply ndmp9_config_get_connection_type_reply;
483 /* NDMP9_CONFIG_GET_SERVER_INFO */
484 typedef ndmp9_no_arguments ndmp9_config_get_server_info_request;
485 typedef ndmp9_config_get_info_reply ndmp9_config_get_server_info_reply;
487 /* NDMP9_CONFIG_GET_BUTYPE_INFO */
488 typedef ndmp9_no_arguments ndmp9_config_get_butype_info_request;
489 typedef ndmp9_config_get_info_reply ndmp9_config_get_butype_info_reply;
491 /* NDMP9_CONFIG_GET_FS_INFO */
492 typedef ndmp9_no_arguments ndmp9_config_get_fs_info_request;
493 typedef ndmp9_config_get_info_reply ndmp9_config_get_fs_info_reply;
495 /* NDMP9_CONFIG_GET_TAPE_INFO */
496 typedef ndmp9_no_arguments ndmp9_config_get_tape_info_request;
497 typedef ndmp9_config_get_info_reply ndmp9_config_get_tape_info_reply;
499 /* NDMP9_CONFIG_GET_SCSI_INFO */
500 typedef ndmp9_no_arguments ndmp9_config_get_scsi_info_request;
501 typedef ndmp9_config_get_info_reply ndmp9_config_get_scsi_info_reply;
504 /* NDMP9_CONFIG_GET_AUTH_ATTR */
505 struct ndmp9_config_get_auth_attr_request {
506 ndmp9_auth_type auth_type;
509 struct ndmp9_config_get_auth_attr_reply {
511 ndmp9_auth_attr server_attr;
518 ****************************************************************
520 * A SCSI pass-thru service. The CONTROL Agent (DMA, Client)
521 * manipulates a SCSI Media Changer through this interface.
522 * It may be used for other purposes.
525 /* NDMP9_SCSI_OPEN */
526 struct ndmp9_scsi_open_request {
529 typedef ndmp9_just_error_reply ndmp9_scsi_open_reply;
531 /* NDMP9_SCSI_CLOSE */
532 typedef ndmp9_no_arguments ndmp9_scsi_close_request;
533 typedef ndmp9_just_error_reply ndmp9_scsi_close_reply;
535 /* NDMP9_SCSI_GET_STATE */
536 typedef ndmp9_no_arguments ndmp9_scsi_get_state_request;
537 struct ndmp9_scsi_get_state_reply {
539 short target_controller;
544 /* NDMP9_SCSI_SET_TARGET -- deleted for NDMPv4 */
545 struct ndmp9_scsi_set_target_request {
547 u_short target_controller;
551 typedef ndmp9_just_error_reply ndmp9_scsi_set_target_reply;
554 /* NDMP9_SCSI_RESET_DEVICE */
555 typedef ndmp9_no_arguments ndmp9_scsi_reset_device_request;
556 typedef ndmp9_just_error_reply ndmp9_scsi_reset_device_reply;
558 /* NDMP9_SCSI_RESET_BUS -- deleted for NDMPv4 */
559 typedef ndmp9_no_arguments ndmp9_scsi_reset_bus_request;
560 typedef ndmp9_just_error_reply ndmp9_scsi_reset_bus_reply;
563 /* NDMP9_SCSI_EXECUTE_CDB */
564 enum ndmp9_scsi_data_dir {
565 NDMP9_SCSI_DATA_DIR_NONE = 0,
566 NDMP9_SCSI_DATA_DIR_IN = 1, /* Expect data from SCSI device */
567 NDMP9_SCSI_DATA_DIR_OUT = 2 /* Transfer data to SCSI device */
570 struct ndmp9_execute_cdb_request {
571 ndmp9_scsi_data_dir data_dir;
573 u_long datain_len; /* Set for expected datain */
578 struct ndmp9_execute_cdb_reply {
580 u_char status; /* SCSI status bytes */
582 opaque datain<>; /* SCSI datain */
583 opaque ext_sense<>; /* Extended sense data */
586 typedef ndmp9_execute_cdb_request ndmp9_scsi_execute_cdb_request;
587 typedef ndmp9_execute_cdb_reply ndmp9_scsi_execute_cdb_reply;
594 /* NDMP9_TAPE_OPEN */
595 enum ndmp9_tape_open_mode {
596 NDMP9_TAPE_READ_MODE,
597 NDMP9_TAPE_RDWR_MODE,
598 NDMP9_TAPE_RAW_MODE /* new for NDMPv4 */
601 enum ndmp9_tape_state {
602 NDMP9_TAPE_STATE_IDLE, /* not doing anything */
603 NDMP9_TAPE_STATE_OPEN, /* open, tape operations OK */
604 NDMP9_TAPE_STATE_MOVER /* mover active, tape ops locked out */
605 /* ie read, write, mtio, close, cdb */
608 struct ndmp9_tape_open_request {
610 ndmp9_tape_open_mode mode;
612 typedef ndmp9_just_error_reply ndmp9_tape_open_reply;
614 /* NDMP9_TAPE_CLOSE */
615 typedef ndmp9_no_arguments ndmp9_tape_close_request;
616 typedef ndmp9_just_error_reply ndmp9_tape_close_reply;
619 /* NDMP9_TAPE_GET_STATE */
620 const NDMP9_TAPE_STATE_NOREWIND = 0x0008; /* non-rewind device */
621 const NDMP9_TAPE_STATE_WR_PROT = 0x0010; /* write-protected */
622 const NDMP9_TAPE_STATE_ERROR = 0x0020; /* media error */
623 const NDMP9_TAPE_STATE_UNLOAD = 0x0040; /* tape will be unloaded when
624 * the device is closed */
626 typedef ndmp9_no_arguments ndmp9_tape_get_state_request;
627 struct ndmp9_tape_get_state_reply {
629 u_long flags; /* compatible NDMP[2349] */
630 ndmp9_tape_state state;
631 ndmp9_tape_open_mode open_mode;
632 ndmp9_valid_u_long file_num;
633 ndmp9_valid_u_long soft_errors;
634 ndmp9_valid_u_long block_size;
635 ndmp9_valid_u_long blockno;
636 ndmp9_valid_u_quad total_space;
637 ndmp9_valid_u_quad space_remain;
638 ndmp9_valid_u_long partition;
641 /* NDMP9_TAPE_MTIO */
642 enum ndmp9_tape_mtio_op {
652 struct ndmp9_tape_mtio_request {
653 ndmp9_tape_mtio_op tape_op;
657 struct ndmp9_tape_mtio_reply {
663 /* NDMP9_TAPE_WRITE */
664 struct ndmp9_tape_write_request {
668 struct ndmp9_tape_write_reply {
674 /* NDMP9_TAPE_READ */
675 struct ndmp9_tape_read_request {
679 struct ndmp9_tape_read_reply {
684 /* NDMP9_TAPE_EXECUTE_CDB */
685 typedef ndmp9_execute_cdb_request ndmp9_tape_execute_cdb_request;
686 typedef ndmp9_execute_cdb_reply ndmp9_tape_execute_cdb_reply;
691 /********************************/
692 /* MOVER INTERFACE */
693 /********************************/
694 enum ndmp9_mover_state {
695 NDMP9_MOVER_STATE_IDLE,
696 NDMP9_MOVER_STATE_LISTEN,
697 NDMP9_MOVER_STATE_ACTIVE,
698 NDMP9_MOVER_STATE_PAUSED,
699 NDMP9_MOVER_STATE_HALTED,
700 NDMP9_MOVER_STATE_STANDBY /* awaiting mover_read_request */
703 enum ndmp9_mover_mode {
704 NDMP9_MOVER_MODE_READ, /* read from data conn; write to tape */
705 NDMP9_MOVER_MODE_WRITE /* write to data conn; read from tape */
708 enum ndmp9_mover_pause_reason {
709 NDMP9_MOVER_PAUSE_NA,
710 NDMP9_MOVER_PAUSE_EOM,
711 NDMP9_MOVER_PAUSE_EOF,
712 NDMP9_MOVER_PAUSE_SEEK,
713 NDMP9_MOVER_PAUSE_MEDIA_ERROR,
714 NDMP9_MOVER_PAUSE_EOW
717 enum ndmp9_mover_halt_reason {
719 NDMP9_MOVER_HALT_CONNECT_CLOSED,
720 NDMP9_MOVER_HALT_ABORTED,
721 NDMP9_MOVER_HALT_INTERNAL_ERROR,
722 NDMP9_MOVER_HALT_CONNECT_ERROR,
723 NDMP9_MOVER_HALT_MEDIA_ERROR
726 /* NDMP9_MOVER_GET_STATE */
727 typedef ndmp9_no_arguments ndmp9_mover_get_state_request;
728 struct ndmp9_mover_get_state_reply {
730 ndmp9_mover_state state;
731 ndmp9_mover_mode mode;
732 ndmp9_mover_pause_reason pause_reason;
733 ndmp9_mover_halt_reason halt_reason;
736 ndmp9_u_quad bytes_moved;
737 ndmp9_u_quad seek_position;
738 ndmp9_u_quad bytes_left_to_read;
739 ndmp9_u_quad window_offset;
740 ndmp9_u_quad window_length;
741 ndmp9_addr data_connection_addr;
744 /* NDMP9_MOVER_LISTEN */
745 struct ndmp9_mover_listen_request {
746 ndmp9_mover_mode mode;
747 ndmp9_addr_type addr_type;
750 struct ndmp9_mover_listen_reply {
752 ndmp9_addr data_connection_addr;
755 /* NDMP9_MOVER_CONNECT */
756 struct ndmp9_mover_connect_request {
757 ndmp9_mover_mode mode;
760 typedef ndmp9_just_error_reply ndmp9_mover_connect_reply;
762 /* NDMP9_MOVER_SET_RECORD_SIZE */
763 struct ndmp9_mover_set_record_size_request {
766 typedef ndmp9_just_error_reply ndmp9_mover_set_record_size_reply;
768 /* NDMP9_MOVER_SET_WINDOW */
769 struct ndmp9_mover_set_window_request {
773 typedef ndmp9_just_error_reply ndmp9_mover_set_window_reply;
775 /* NDMP9_MOVER_CONTINUE */
776 typedef ndmp9_no_arguments ndmp9_mover_continue_request;
777 typedef ndmp9_just_error_reply ndmp9_mover_continue_reply;
780 /* NDMP9_MOVER_ABORT */
781 typedef ndmp9_no_arguments ndmp9_mover_abort_request;
782 typedef ndmp9_just_error_reply ndmp9_mover_abort_reply;
784 /* NDMP9_MOVER_STOP */
785 typedef ndmp9_no_arguments ndmp9_mover_stop_request;
786 typedef ndmp9_just_error_reply ndmp9_mover_stop_reply;
788 /* NDMP9_MOVER_READ */
789 struct ndmp9_mover_read_request {
793 typedef ndmp9_just_error_reply ndmp9_mover_read_reply;
795 /* NDMP9_MOVER_CLOSE */
796 typedef ndmp9_no_arguments ndmp9_mover_close_request;
797 typedef ndmp9_just_error_reply ndmp9_mover_close_reply;
802 /****************************/
804 /****************************/
806 enum ndmp9_data_operation {
807 NDMP9_DATA_OP_NOACTION,
808 NDMP9_DATA_OP_BACKUP,
809 NDMP9_DATA_OP_RECOVER,
810 NDMP9_DATA_OP_RECOVER_FILEHIST
813 enum ndmp9_data_state {
814 NDMP9_DATA_STATE_IDLE,
815 NDMP9_DATA_STATE_ACTIVE,
816 NDMP9_DATA_STATE_HALTED,
817 NDMP9_DATA_STATE_LISTEN,
818 NDMP9_DATA_STATE_CONNECTED
821 enum ndmp9_data_halt_reason {
823 NDMP9_DATA_HALT_SUCCESSFUL,
824 NDMP9_DATA_HALT_ABORTED,
825 NDMP9_DATA_HALT_INTERNAL_ERROR,
826 NDMP9_DATA_HALT_CONNECT_ERROR
829 /* NDMP9_DATA_START_BACKUP */
830 typedef ndmp9_no_arguments ndmp9_data_get_state_request;
831 struct ndmp9_data_get_state_reply {
833 ndmp9_data_operation operation;
834 ndmp9_data_state state;
835 ndmp9_data_halt_reason halt_reason;
836 ndmp9_u_quad bytes_processed;
837 ndmp9_valid_u_quad est_bytes_remain;
838 ndmp9_valid_u_long est_time_remain;
839 ndmp9_addr data_connection_addr;
840 ndmp9_u_quad read_offset;
841 ndmp9_u_quad read_length;
845 string original_path<>; /* relative to backup root */
846 string destination_path<>;
847 /* nt_destination_path<> */
848 ndmp9_valid_u_quad fh_info;
853 /* NDMP9_DATA_START_BACKUP */
854 struct ndmp9_data_start_backup_request {
855 string bu_type<>; /* backup method to use */
856 ndmp9_pval env<>; /* Parameters that may modify backup */
859 typedef ndmp9_just_error_reply ndmp9_data_start_backup_reply;
861 /* NDMP9_DATA_START_RECOVER */
862 struct ndmp9_data_start_recover_request {
868 typedef ndmp9_just_error_reply ndmp9_data_start_recover_reply;
870 /* NDMP9_DATA_START_RECOVER_FILEHIST */
871 typedef ndmp9_data_start_recover_request ndmp9_data_start_recover_filehist_request;
872 typedef ndmp9_data_start_recover_reply ndmp9_data_start_recover_filehist_reply;
875 /* NDMP9_DATA_ABORT */
876 typedef ndmp9_no_arguments ndmp9_data_abort_request;
877 typedef ndmp9_just_error_reply ndmp9_data_abort_reply;
879 /* NDMP9_DATA_STOP */
880 typedef ndmp9_no_arguments ndmp9_data_stop_request;
881 typedef ndmp9_just_error_reply ndmp9_data_stop_reply;
883 /* NDMP9_DATA_GET_ENV */
884 typedef ndmp9_no_arguments ndmp9_data_get_env_request;
885 struct ndmp9_data_get_env_reply {
890 /* NDMP9_DATA_LISTEN */
891 struct ndmp9_data_listen_request {
892 ndmp9_addr_type addr_type;
895 struct ndmp9_data_listen_reply {
897 ndmp9_addr data_connection_addr;
900 /* NDMP9_DATA_CONNECT */
901 struct ndmp9_data_connect_request {
904 typedef ndmp9_just_error_reply ndmp9_data_connect_reply;
909 /****************************/
910 /* NOTIFY INTERFACE */
911 /****************************/
913 /* NDMP9_NOTIFY_DATA_HALTED */
914 struct ndmp9_notify_data_halted_request {
915 ndmp9_data_halt_reason reason;
918 enum ndmp9_connect_reason {
919 NDMP9_CONNECTED, /* Connect sucessfully */
920 NDMP9_SHUTDOWN, /* Connection shutdown */
921 NDMP9_REFUSED /* reach the maximum number of connections */
924 /* NDMP9_NOTIFY_CONNECTED */
925 struct ndmp9_notify_connected_request {
926 ndmp9_connect_reason reason;
927 u_short protocol_version;
928 string text_reason<>;
931 /* NDMP9_NOTIFY_MOVER_HALTED */
932 struct ndmp9_notify_mover_halted_request {
933 ndmp9_mover_halt_reason reason;
936 /* NDMP9_NOTIFY_MOVER_PAUSED */
937 struct ndmp9_notify_mover_paused_request {
938 ndmp9_mover_pause_reason reason;
939 ndmp9_u_quad seek_position;
942 /* NDMP9_NOTIFY_DATA_READ */
943 struct ndmp9_notify_data_read_request {
949 /********************************/
951 /********************************/
952 /* NDMP9_LOG_MESSAGE */
953 enum ndmp9_log_type {
960 struct ndmp9_log_message_request {
961 ndmp9_log_type log_type;
964 ndmp9_valid_u_long associated_message_sequence;
968 enum ndmp9_recovery_status {
969 NDMP9_RECOVERY_SUCCESSFUL = 0,
970 NDMP9_RECOVERY_FAILED_PERMISSION = 1,
971 NDMP9_RECOVERY_FAILED_NOT_FOUND = 2,
972 NDMP9_RECOVERY_FAILED_NO_DIRECTORY = 3,
973 NDMP9_RECOVERY_FAILED_OUT_OF_MEMORY = 4,
974 NDMP9_RECOVERY_FAILED_IO_ERROR = 5,
975 NDMP9_RECOVERY_FAILED_UNDEFINED_ERROR = 6
979 struct ndmp9_log_file_request {
981 ndmp9_recovery_status recovery_status;
988 * FILE HISTORY INTERFACES
989 ****************************************************************
993 enum ndmp9_file_type {
1001 NDMP9_FILE_REGISTRY,
1005 struct ndmp9_file_stat {
1006 ndmp9_file_type ftype;
1007 ndmp9_valid_u_long mtime;
1008 ndmp9_valid_u_long atime;
1009 ndmp9_valid_u_long ctime;
1010 ndmp9_valid_u_long uid;
1011 ndmp9_valid_u_long gid;
1012 ndmp9_valid_u_long mode;
1013 ndmp9_valid_u_quad size;
1014 ndmp9_valid_u_long links;
1017 * Add NT attributes here as ndmp9_valid_....
1020 ndmp9_valid_u_quad node; /* id on disk at backup time */
1021 ndmp9_valid_u_quad fh_info; /* id on tape at backup time */
1031 /* nt_path<> here */
1032 /* dos_path<> here */
1033 ndmp9_file_stat fstat;
1036 struct ndmp9_fh_add_file_request {
1047 /* nt_name<> here */
1048 /* dos_name<> here */
1050 ndmp9_u_quad parent;
1053 struct ndmp9_fh_add_dir_request {
1063 ndmp9_file_stat fstat;
1066 struct ndmp9_fh_add_node_request {