1 /* 2 * Copyright (c) 2000,2001 3 * Traakan, Inc., Los Altos, CA 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice unmodified, this list of conditions, and the following 11 * disclaimer. 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. 15 * 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 26 * SUCH DAMAGE. 27 */ 28 29 /* 30 * Project: NDMJOB 31 * Ident: $Id: $ 32 * 33 * Description: 34 * 35 */ 36 37 38 39 /* 40 * ndmp4.x 41 * 42 * Description : NDMP protocol rpcgen file. 43 * 44 * Copyright (c) 1999 Intelliguard Software, Network Appliance. 45 * All Rights Reserved. 46 * 47 * $Id: ndmp.x,v 1.11 1998/05/26 03:52:12 tim Exp $ 48 */ 49 50 %#if __clang__ 51 %#pragma clang diagnostic ignored "-Wunused-variable" 52 %#pragma clang diagnostic ignored "-Wunused-const-variable" 53 %#elif __GNUC__ 54 %#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 55 %#pragma GCC diagnostic ignored "-Wunused-variable" 56 %#endif 57 %#endif 58 59 %#ifndef NDMOS_OPTION_NO_NDMP4 60 61 const NDMP4VER = 4; 62 const NDMP4PORT = 10000; 63 64 %#define ndmp4_u_quad uint64_t 65 %extern bool_t xdr_ndmp4_u_quad(register XDR *xdrs, ndmp4_u_quad *objp); 66 67 struct _ndmp4_u_quad 68 { 69 uint32_t high; 70 uint32_t low; 71 }; 72 73 74 75 enum ndmp4_header_message_type 76 { 77 NDMP4_MESSAGE_REQUEST, 78 NDMP4_MESSAGE_REPLY 79 }; 80 81 const NDMP4_MESSAGE_POST = NDMP4_MESSAGE_REQUEST; 82 83 84 /* Note: because of extensibility, this is */ 85 /* Not a complete list of errors. */ 86 87 enum ndmp4_error { 88 NDMP4_NO_ERR = 0, 89 NDMP4_NOT_SUPPORTED_ERR = 1, 90 NDMP4_DEVICE_BUSY_ERR = 2, 91 NDMP4_DEVICE_OPENED_ERR = 3, 92 NDMP4_NOT_AUTHORIZED_ERR = 4, 93 NDMP4_PERMISSION_ERR = 5, 94 NDMP4_DEV_NOT_OPEN_ERR = 6, 95 NDMP4_IO_ERR = 7, 96 NDMP4_TIMEOUT_ERR = 8, 97 NDMP4_ILLEGAL_ARGS_ERR = 9, 98 NDMP4_NO_TAPE_LOADED_ERR = 10, 99 NDMP4_WRITE_PROTECT_ERR = 11, 100 NDMP4_EOF_ERR = 12, 101 NDMP4_EOM_ERR = 13, 102 NDMP4_FILE_NOT_FOUND_ERR = 14, 103 NDMP4_BAD_FILE_ERR = 15, 104 NDMP4_NO_DEVICE_ERR = 16, 105 NDMP4_NO_BUS_ERR = 17, 106 NDMP4_XDR_DECODE_ERR = 18, 107 NDMP4_ILLEGAL_STATE_ERR = 19, 108 NDMP4_UNDEFINED_ERR = 20, 109 NDMP4_XDR_ENCODE_ERR = 21, 110 NDMP4_NO_MEM_ERR = 22, 111 NDMP4_CONNECT_ERR = 23, 112 NDMP4_SEQUENCE_NUM_ERR = 24, 113 NDMP4_READ_IN_PROGRESS_ERR = 25, 114 NDMP4_PRECONDITION_ERR = 26, 115 NDMP4_CLASS_NOT_SUPPORTED = 27, 116 NDMP4_VERSION_NOT_SUPPORTED = 28, 117 NDMP4_EXT_DUPL_CLASSES = 29, 118 NDMP4_EXT_DN_ILLEGAL = 30 119 }; 120 121 122 123 /* Note: Because of extensibility, this */ 124 /* is not a complete list of messages */ 125 126 enum ndmp4_message { 127 128 /* CONNECT INTERFACE */ 129 NDMP4_CONNECT_OPEN = 0x900, 130 NDMP4_CONNECT_CLIENT_AUTH = 0x901, 131 NDMP4_CONNECT_CLOSE = 0x902, 132 NDMP4_CONNECT_SERVER_AUTH = 0x903, 133 134 /* CONFIG INTERFACE */ 135 NDMP4_CONFIG_GET_HOST_INFO = 0x100, 136 NDMP4_CONFIG_GET_CONNECTION_TYPE = 0x102, 137 NDMP4_CONFIG_GET_AUTH_ATTR = 0x103, 138 NDMP4_CONFIG_GET_BUTYPE_INFO = 0x104, 139 NDMP4_CONFIG_GET_FS_INFO = 0x105, 140 NDMP4_CONFIG_GET_TAPE_INFO = 0x106, 141 NDMP4_CONFIG_GET_SCSI_INFO = 0x107, 142 NDMP4_CONFIG_GET_SERVER_INFO = 0x108, 143 NDMP4_CONFIG_SET_EXT_LIST = 0x109, 144 NDMP4_CONFIG_GET_EXT_LIST = 0x10A, 145 146 /* SCSI INTERFACE */ 147 NDMP4_SCSI_OPEN = 0x200, 148 NDMP4_SCSI_CLOSE = 0x201, 149 NDMP4_SCSI_GET_STATE = 0x202, 150 NDMP4_SCSI_RESET_DEVICE = 0x204, 151 NDMP4_SCSI_EXECUTE_CDB = 0x206, 152 153 /* TAPE INTERFACE */ 154 NDMP4_TAPE_OPEN = 0x300, 155 NDMP4_TAPE_CLOSE = 0x301, 156 NDMP4_TAPE_GET_STATE = 0x302, 157 NDMP4_TAPE_MTIO = 0x303, 158 NDMP4_TAPE_WRITE = 0x304, 159 NDMP4_TAPE_READ = 0x305, 160 NDMP4_TAPE_EXECUTE_CDB = 0x307, 161 162 /* DATA INTERFACE */ 163 NDMP4_DATA_GET_STATE = 0x400, 164 NDMP4_DATA_START_BACKUP = 0x401, 165 NDMP4_DATA_START_RECOVER = 0x402, 166 NDMP4_DATA_ABORT = 0x403, 167 NDMP4_DATA_GET_ENV = 0x404, 168 NDMP4_DATA_STOP = 0x407, 169 NDMP4_DATA_LISTEN = 0x409, 170 NDMP4_DATA_CONNECT = 0x40A, 171 NDMP4_DATA_START_RECOVER_FILEHIST = 0x40B, 172 173 /* NOTIFY INTERFACE */ 174 NDMP4_NOTIFY_DATA_HALTED = 0x501, 175 NDMP4_NOTIFY_CONNECTION_STATUS = 0x502, 176 NDMP4_NOTIFY_MOVER_HALTED = 0x503, 177 NDMP4_NOTIFY_MOVER_PAUSED = 0x504, 178 NDMP4_NOTIFY_DATA_READ = 0x505, 179 180 /* LOGGING INTERFACE */ 181 NDMP4_LOG_FILE = 0x602, 182 NDMP4_LOG_MESSAGE = 0x603, 183 184 /* FILE HISTORY INTERFACE */ 185 NDMP4_FH_ADD_FILE = 0x703, 186 NDMP4_FH_ADD_DIR = 0x704, 187 NDMP4_FH_ADD_NODE = 0x705, 188 189 /* MOVER INTERFACE */ 190 NDMP4_MOVER_GET_STATE = 0xA00, 191 NDMP4_MOVER_LISTEN = 0xA01, 192 NDMP4_MOVER_CONTINUE = 0xA02, 193 NDMP4_MOVER_ABORT = 0xA03, 194 NDMP4_MOVER_STOP = 0xA04, 195 NDMP4_MOVER_SET_WINDOW = 0xA05, 196 NDMP4_MOVER_READ = 0xA06, 197 NDMP4_MOVER_CLOSE = 0xA07, 198 NDMP4_MOVER_SET_RECORD_SIZE = 0xA08, 199 NDMP4_MOVER_CONNECT = 0xA09, 200 201 /* EXTENSIBILITY */ 202 203 /* Reserved for Standard extensions */ 204 NDMP4_EXT_STANDARD_BASE = 0x10000, 205 206 /* Reserved for Proprietary extensions */ 207 NDMP4_EXT_PROPRIETARY_BASE = 0x20000000 208 }; 209 210 211 struct ndmp4_header 212 { 213 uint32_t sequence; 214 uint32_t time_stamp; 215 ndmp4_header_message_type message_type; 216 ndmp4_message message_code; 217 uint32_t reply_sequence; 218 ndmp4_error error_code; 219 }; 220 221 struct ndmp4_pval 222 { 223 string name<>; 224 string value<>; 225 }; 226 227 228 /* Connect messages */ 229 struct ndmp4_connect_open_request 230 { 231 uint16_t protocol_version; 232 }; 233 234 struct ndmp4_connect_open_reply 235 { 236 ndmp4_error error; 237 }; 238 239 240 enum ndmp4_auth_type 241 { 242 NDMP4_AUTH_NONE=0, 243 NDMP4_AUTH_TEXT=1, 244 NDMP4_AUTH_MD5=2 245 }; 246 247 struct ndmp4_auth_text 248 { 249 string auth_id<>; 250 string auth_password<>; 251 }; 252 253 struct ndmp4_auth_md5 254 { 255 string auth_id<>; 256 opaque auth_digest[16]; 257 }; 258 259 union ndmp4_auth_data switch (enum ndmp4_auth_type auth_type) 260 { 261 case NDMP4_AUTH_NONE: 262 void; 263 case NDMP4_AUTH_TEXT: 264 struct ndmp4_auth_text auth_text; 265 case NDMP4_AUTH_MD5: 266 struct ndmp4_auth_md5 auth_md5; 267 }; 268 269 union ndmp4_auth_attr switch (enum ndmp4_auth_type auth_type) 270 { 271 case NDMP4_AUTH_NONE: 272 void; 273 case NDMP4_AUTH_TEXT: 274 void; 275 case NDMP4_AUTH_MD5: 276 opaque challenge[64]; 277 }; 278 279 280 struct ndmp4_connect_client_auth_request 281 { 282 ndmp4_auth_data auth_data; 283 }; 284 285 struct ndmp4_connect_client_auth_reply 286 { 287 ndmp4_error error; 288 }; 289 290 291 struct ndmp4_connect_server_auth_request 292 { 293 ndmp4_auth_attr client_attr; 294 }; 295 296 struct ndmp4_connect_server_auth_reply 297 { 298 ndmp4_error error; 299 ndmp4_auth_data server_result; 300 }; 301 302 303 struct ndmp4_config_get_host_info_reply 304 { 305 ndmp4_error error; 306 string hostname<>; 307 string os_type<>; 308 string os_vers<>; 309 string hostid<>; 310 }; 311 312 313 struct ndmp4_config_get_server_info_reply 314 { 315 ndmp4_error error; 316 string vendor_name<>; 317 string product_name<>; 318 string revision_number<>; 319 ndmp4_auth_type auth_type<>; 320 }; 321 322 323 enum ndmp4_addr_type 324 { 325 NDMP4_ADDR_LOCAL=0, 326 NDMP4_ADDR_TCP=1, 327 NDMP4_ADDR_RESERVED=2, 328 NDMP4_ADDR_IPC=3 329 }; 330 331 struct ndmp4_config_get_connection_type_reply 332 { 333 ndmp4_error error; 334 ndmp4_addr_type addr_types<>; 335 }; 336 337 338 struct ndmp4_config_get_auth_attr_request 339 { 340 ndmp4_auth_type auth_type; 341 }; 342 343 344 345 struct ndmp4_config_get_auth_attr_reply 346 { 347 ndmp4_error error; 348 ndmp4_auth_attr server_attr; 349 }; 350 351 352 const NDMP4_BUTYPE_BACKUP_FILELIST = 0x0002; 353 const NDMP4_BUTYPE_RECOVER_FILELIST = 0x0004; 354 const NDMP4_BUTYPE_BACKUP_DIRECT = 0x0008; 355 const NDMP4_BUTYPE_RECOVER_DIRECT = 0x0010; 356 const NDMP4_BUTYPE_BACKUP_INCREMENTAL = 0x0020; 357 const NDMP4_BUTYPE_RECOVER_INCREMENTAL = 0x0040; 358 const NDMP4_BUTYPE_BACKUP_UTF8 = 0x0080; 359 const NDMP4_BUTYPE_RECOVER_UTF8 = 0x0100; 360 const NDMP4_BUTYPE_BACKUP_FH_FILE = 0x0200; 361 const NDMP4_BUTYPE_BACKUP_FH_DIR = 0x0400; 362 const NDMP4_BUTYPE_RECOVER_FILEHIST = 0x0800; 363 const NDMP4_BUTYPE_RECOVER_FH_FILE = 0x1000; 364 const NDMP4_BUTYPE_RECOVER_FH_DIR = 0x2000; 365 366 367 struct ndmp4_butype_info 368 { 369 string butype_name<>; 370 ndmp4_pval default_env<>; 371 uint32_t attrs; 372 }; 373 374 struct ndmp4_config_get_butype_info_reply 375 { 376 ndmp4_error error; 377 ndmp4_butype_info butype_info<>; 378 }; 379 380 381 const NDMP4_FS_INFO_TOTAL_SIZE_UNS = 0x00000001; 382 const NDMP4_FS_INFO_USED_SIZE_UNS = 0x00000002; 383 const NDMP4_FS_INFO_AVAIL_SIZE_UNS = 0x00000004; 384 const NDMP4_FS_INFO_TOTAL_INODES_UNS = 0x00000008; 385 const NDMP4_FS_INFO_USED_INODES_UNS = 0x00000010; 386 387 struct ndmp4_fs_info 388 { 389 uint32_t unsupported; 390 string fs_type<>; 391 string fs_logical_device<>; 392 string fs_physical_device<>; 393 ndmp4_u_quad total_size; 394 ndmp4_u_quad used_size; 395 ndmp4_u_quad avail_size; 396 ndmp4_u_quad total_inodes; 397 ndmp4_u_quad used_inodes; 398 ndmp4_pval fs_env<>; 399 string fs_status<>; 400 }; 401 402 struct ndmp4_config_get_fs_info_reply 403 { 404 ndmp4_error error; 405 ndmp4_fs_info fs_info<>; 406 }; 407 408 409 const NDMP4_TAPE_ATTR_REWIND = 0x00000001; 410 const NDMP4_TAPE_ATTR_UNLOAD = 0x00000002; 411 const NDMP4_TAPE_ATTR_RAW = 0x00000004; 412 413 struct ndmp4_device_capability 414 { 415 string device<>; 416 uint32_t attr; 417 ndmp4_pval capability<>; 418 }; 419 420 struct ndmp4_device_info 421 { 422 string model<>; 423 ndmp4_device_capability caplist<>; 424 }; 425 426 struct ndmp4_config_get_tape_info_reply 427 { 428 ndmp4_error error; 429 ndmp4_device_info tape_info<>; 430 }; 431 432 struct ndmp4_config_get_scsi_info_reply 433 { 434 ndmp4_error error; 435 ndmp4_device_info scsi_info<>; 436 }; 437 438 struct ndmp4_class_list 439 { 440 uint16_t class_id; 441 uint16_t class_version<>; 442 }; 443 444 struct ndmp4_class_version 445 { 446 uint16_t class_id; 447 uint16_t class_version; 448 }; 449 450 struct ndmp4_config_get_ext_list_reply 451 { 452 ndmp4_error error; 453 ndmp4_class_list class_list<>; 454 }; 455 456 struct ndmp4_config_set_ext_list_request 457 { 458 ndmp4_error error; 459 ndmp4_class_list ndmp4_accepted_ext<>; 460 }; 461 462 struct ndmp4_config_set_ext_list_reply 463 { 464 ndmp4_error error; 465 }; 466 467 468 469 470 struct ndmp4_scsi_open_request 471 { 472 string device<>; 473 }; 474 475 struct ndmp4_scsi_open_reply 476 { 477 ndmp4_error error; 478 }; 479 480 481 struct ndmp4_scsi_close_reply 482 { 483 ndmp4_error error; 484 }; 485 486 487 struct ndmp4_scsi_get_state_reply 488 { 489 ndmp4_error error; 490 short target_controller; 491 short target_id; 492 short target_lun; 493 }; 494 495 496 struct ndmp4_scsi_reset_device_reply 497 { 498 ndmp4_error error; 499 }; 500 501 const NDMP4_SCSI_DATA_IN = 0x00000001; 502 const NDMP4_SCSI_DATA_OUT = 0x00000002; 503 504 struct ndmp4_execute_cdb_request 505 { 506 uint32_t flags; 507 uint32_t timeout; 508 uint32_t datain_len; 509 opaque cdb<>; 510 opaque dataout<>; 511 }; 512 513 struct ndmp4_execute_cdb_reply 514 { 515 ndmp4_error error; 516 u_char status; 517 uint32_t dataout_len; 518 opaque datain<>; 519 opaque ext_sense<>; 520 }; 521 522 typedef ndmp4_execute_cdb_request ndmp4_scsi_execute_cdb_request; 523 typedef ndmp4_execute_cdb_reply ndmp4_scsi_execute_cdb_reply; 524 525 enum ndmp4_tape_open_mode 526 { 527 NDMP4_TAPE_READ_MODE = 0, 528 NDMP4_TAPE_RDWR_MODE = 1, 529 NDMP4_TAPE_RAW_MODE = 2 530 }; 531 532 533 struct ndmp4_tape_open_request { 534 string device<>; 535 ndmp4_tape_open_mode mode; 536 }; 537 538 struct ndmp4_tape_open_reply { 539 ndmp4_error error; 540 }; 541 542 543 struct ndmp4_tape_close_reply 544 { 545 ndmp4_error error; 546 }; 547 548 549 /* flags */ 550 const NDMP4_TAPE_STATE_NOREWIND = 0x0008; /* non-rewind device */ 551 const NDMP4_TAPE_STATE_WR_PROT = 0x0010; /* write-protected */ 552 const NDMP4_TAPE_STATE_ERROR = 0x0020; /* media error */ 553 const NDMP4_TAPE_STATE_UNLOAD = 0x0040; /* tape unloaded upon 554 close */ 555 556 /* unsupported bits */ 557 const NDMP4_TAPE_STATE_FILE_NUM_UNS = 0x00000001; 558 const NDMP4_TAPE_STATE_SOFT_ERRORS_UNS = 0x00000002; 559 const NDMP4_TAPE_STATE_BLOCK_SIZE_UNS = 0x00000004; 560 const NDMP4_TAPE_STATE_BLOCKNO_UNS = 0x00000008; 561 const NDMP4_TAPE_STATE_TOTAL_SPACE_UNS = 0x00000010; 562 const NDMP4_TAPE_STATE_SPACE_REMAIN_UNS = 0x00000020; 563 564 struct ndmp4_tape_get_state_reply 565 { 566 uint32_t unsupported; 567 ndmp4_error error; 568 uint32_t flags; 569 uint32_t file_num; 570 uint32_t soft_errors; 571 uint32_t block_size; 572 uint32_t blockno; 573 574 ndmp4_u_quad total_space; 575 ndmp4_u_quad space_remain; 576 }; 577 578 579 enum ndmp4_tape_mtio_op 580 { 581 NDMP4_MTIO_FSF=0, 582 NDMP4_MTIO_BSF=1, 583 NDMP4_MTIO_FSR=2, 584 NDMP4_MTIO_BSR=3, 585 NDMP4_MTIO_REW=4, 586 NDMP4_MTIO_EOF=5, 587 NDMP4_MTIO_OFF=6, 588 NDMP4_MTIO_TUR=7 589 }; 590 591 struct ndmp4_tape_mtio_request 592 { 593 ndmp4_tape_mtio_op tape_op; 594 uint32_t count; 595 }; 596 597 struct ndmp4_tape_mtio_reply 598 { 599 ndmp4_error error; 600 uint32_t resid_count; 601 }; 602 603 604 struct ndmp4_tape_write_request 605 { 606 opaque data_out<>; 607 }; 608 609 struct ndmp4_tape_write_reply 610 { 611 ndmp4_error error; 612 uint32_t count; 613 }; 614 615 616 struct ndmp4_tape_read_request 617 { 618 uint32_t count; 619 }; 620 621 struct ndmp4_tape_read_reply 622 { 623 ndmp4_error error; 624 opaque data_in<>; 625 }; 626 627 628 typedef ndmp4_scsi_execute_cdb_request ndmp4_tape_execute_cdb_request; 629 typedef ndmp4_scsi_execute_cdb_reply ndmp4_tape_execute_cdb_reply; 630 631 632 enum ndmp4_data_operation 633 { 634 NDMP4_DATA_OP_NOACTION = 0, 635 NDMP4_DATA_OP_BACKUP = 1, 636 NDMP4_DATA_OP_RECOVER = 2, 637 NDMP4_DATA_OP_RECOVER_FILEHIST = 3 638 639 }; 640 641 enum ndmp4_data_state 642 { 643 NDMP4_DATA_STATE_IDLE=0, 644 NDMP4_DATA_STATE_ACTIVE=1, 645 NDMP4_DATA_STATE_HALTED=2, 646 NDMP4_DATA_STATE_LISTEN=3, 647 NDMP4_DATA_STATE_CONNECTED=4 648 }; 649 650 enum ndmp4_data_halt_reason 651 { 652 NDMP4_DATA_HALT_NA=0, 653 NDMP4_DATA_HALT_SUCCESSFUL=1, 654 NDMP4_DATA_HALT_ABORTED=2, 655 NDMP4_DATA_HALT_INTERNAL_ERROR=3, 656 NDMP4_DATA_HALT_CONNECT_ERROR=4 657 }; 658 659 /* ndmp4_addr */ 660 struct ndmp4_tcp_addr 661 { 662 uint32_t ip_addr; 663 uint16_t port; 664 ndmp4_pval addr_env<>; 665 }; 666 667 struct ndmp4_ipc_addr 668 { 669 opaque comm_data<>; 670 }; 671 672 union ndmp4_addr switch (ndmp4_addr_type addr_type) 673 { 674 case NDMP4_ADDR_LOCAL: 675 void; 676 case NDMP4_ADDR_TCP: 677 ndmp4_tcp_addr tcp_addr<>; 678 case NDMP4_ADDR_IPC: 679 ndmp4_ipc_addr ipc_addr; 680 }; 681 682 /* unsupported bitmask bits */ 683 const NDMP4_DATA_STATE_EST_BYTES_REMAIN_UNS = 0x00000001; 684 const NDMP4_DATA_STATE_EST_TIME_REMAIN_UNS = 0x00000002; 685 686 struct ndmp4_data_get_state_reply 687 { 688 uint32_t unsupported; 689 ndmp4_error error; 690 ndmp4_data_operation operation; 691 ndmp4_data_state state; 692 ndmp4_data_halt_reason halt_reason; 693 ndmp4_u_quad bytes_processed; 694 ndmp4_u_quad est_bytes_remain; 695 uint32_t est_time_remain; 696 ndmp4_addr data_connection_addr; 697 ndmp4_u_quad read_offset; 698 ndmp4_u_quad read_length; 699 }; 700 701 702 703 struct ndmp4_data_listen_request 704 { 705 ndmp4_addr_type addr_type; 706 }; 707 708 struct ndmp4_data_listen_reply 709 { 710 ndmp4_error error; 711 ndmp4_addr connect_addr; 712 }; 713 714 715 struct ndmp4_data_connect_request 716 { 717 ndmp4_addr addr; 718 }; 719 720 struct ndmp4_data_connect_reply 721 { 722 ndmp4_error error; 723 }; 724 725 726 struct ndmp4_data_start_backup_request 727 { 728 string butype_name<>; 729 ndmp4_pval env<>; 730 }; 731 732 struct ndmp4_data_start_backup_reply 733 { 734 ndmp4_error error; 735 }; 736 737 738 struct ndmp4_name 739 { 740 string original_path<>; 741 string destination_path<>; 742 string name<>; 743 string other_name<>; 744 ndmp4_u_quad node; 745 ndmp4_u_quad fh_info; 746 }; 747 748 struct ndmp4_data_start_recover_request 749 { 750 ndmp4_pval env<>; 751 ndmp4_name nlist<>; 752 string butype_name<>; 753 }; 754 755 struct ndmp4_data_start_recover_reply 756 { 757 ndmp4_error error; 758 }; 759 760 struct ndmp4_data_start_recover_filehist_request 761 { 762 ndmp4_pval env<>; 763 ndmp4_name nlist<>; 764 string butype_name<>; 765 }; 766 767 struct ndmp4_data_start_recover_filehist_reply 768 { 769 ndmp4_error error; 770 }; 771 772 773 774 struct ndmp4_data_abort_reply 775 { 776 ndmp4_error error; 777 }; 778 779 780 struct ndmp4_data_stop_reply 781 { 782 ndmp4_error error; 783 }; 784 785 786 struct ndmp4_data_get_env_reply 787 { 788 ndmp4_error error; 789 ndmp4_pval env<>; 790 }; 791 792 793 enum ndmp4_mover_mode 794 { 795 NDMP4_MOVER_MODE_READ = 0, 796 NDMP4_MOVER_MODE_WRITE = 1, 797 NDMP4_MOVER_MODE_NOACTION = 2 798 }; 799 800 enum ndmp4_mover_state 801 { 802 NDMP4_MOVER_STATE_IDLE, 803 NDMP4_MOVER_STATE_LISTEN, 804 NDMP4_MOVER_STATE_ACTIVE, 805 NDMP4_MOVER_STATE_PAUSED, 806 NDMP4_MOVER_STATE_HALTED 807 }; 808 809 enum ndmp4_mover_pause_reason 810 { 811 NDMP4_MOVER_PAUSE_NA = 0, 812 NDMP4_MOVER_PAUSE_EOM = 1, 813 NDMP4_MOVER_PAUSE_EOF = 2, 814 NDMP4_MOVER_PAUSE_SEEK = 3, 815 /* NDMPv4 does not have MOVER_PAUSE_MEDIA_ERROR = 4 */ 816 NDMP4_MOVER_PAUSE_EOW = 5 817 }; 818 819 enum ndmp4_mover_halt_reason 820 { 821 NDMP4_MOVER_HALT_NA, 822 NDMP4_MOVER_HALT_CONNECT_CLOSED, 823 NDMP4_MOVER_HALT_ABORTED, 824 NDMP4_MOVER_HALT_INTERNAL_ERROR, 825 NDMP4_MOVER_HALT_CONNECT_ERROR, 826 NDMP4_MOVER_HALT_MEDIA_ERROR 827 }; 828 829 830 831 832 struct ndmp4_mover_set_record_size_request 833 { 834 uint32_t len; 835 }; 836 837 struct ndmp4_mover_set_record_size_reply 838 { 839 ndmp4_error error; 840 }; 841 842 843 struct ndmp4_mover_set_window_request 844 { 845 ndmp4_u_quad offset; 846 ndmp4_u_quad length; 847 }; 848 849 850 struct ndmp4_mover_set_window_reply 851 { 852 ndmp4_error error; 853 }; 854 855 856 struct ndmp4_mover_connect_request 857 { 858 ndmp4_mover_mode mode; 859 ndmp4_addr addr; 860 }; 861 862 struct ndmp4_mover_connect_reply 863 { 864 ndmp4_error error; 865 }; 866 867 868 struct ndmp4_mover_listen_request 869 { 870 ndmp4_mover_mode mode; 871 ndmp4_addr_type addr_type; 872 }; 873 874 struct ndmp4_mover_listen_reply 875 { 876 ndmp4_error error; 877 ndmp4_addr connect_addr; 878 }; 879 880 881 struct ndmp4_mover_read_request 882 { 883 ndmp4_u_quad offset; 884 ndmp4_u_quad length; 885 }; 886 887 struct ndmp4_mover_read_reply 888 { 889 ndmp4_error error; 890 }; 891 892 893 894 struct ndmp4_mover_get_state_reply 895 { 896 ndmp4_error error; 897 ndmp4_mover_mode mode; 898 ndmp4_mover_state state; 899 ndmp4_mover_pause_reason pause_reason; 900 ndmp4_mover_halt_reason halt_reason; 901 uint32_t record_size; 902 uint32_t record_num; 903 ndmp4_u_quad bytes_moved; 904 ndmp4_u_quad seek_position; 905 ndmp4_u_quad bytes_left_to_read; 906 ndmp4_u_quad window_offset; 907 ndmp4_u_quad window_length; 908 ndmp4_addr data_connection_addr; 909 }; 910 911 912 struct ndmp4_mover_continue_reply 913 { 914 ndmp4_error error; 915 }; 916 917 918 struct ndmp4_mover_close_reply 919 { 920 ndmp4_error error; 921 }; 922 923 924 struct ndmp4_mover_abort_reply 925 { 926 ndmp4_error error; 927 }; 928 929 930 struct ndmp4_mover_stop_reply 931 { 932 ndmp4_error error; 933 }; 934 935 936 struct ndmp4_notify_data_halted_post 937 { 938 ndmp4_data_halt_reason reason; 939 }; 940 941 942 enum ndmp4_connection_status_reason 943 { 944 NDMP4_CONNECTED=0, 945 NDMP4_SHUTDOWN=1, 946 NDMP4_REFUSED=2 947 }; 948 949 struct ndmp4_notify_connection_status_post 950 { 951 ndmp4_connection_status_reason reason; 952 uint16_t protocol_version; 953 string text_reason<>; 954 }; 955 956 957 struct ndmp4_notify_mover_halted_post 958 { 959 ndmp4_mover_halt_reason reason; 960 }; 961 962 963 struct ndmp4_notify_mover_paused_post 964 { 965 ndmp4_mover_pause_reason reason; 966 ndmp4_u_quad seek_position; 967 }; 968 969 970 struct ndmp4_notify_data_read_post 971 { 972 ndmp4_u_quad offset; 973 ndmp4_u_quad length; 974 }; 975 976 977 enum ndmp4_has_associated_message 978 { 979 NDMP4_NO_ASSOCIATED_MESSAGE = 0, 980 NDMP4_HAS_ASSOCIATED_MESSAGE = 1 981 }; 982 983 enum ndmp4_log_type 984 { 985 NDMP4_LOG_NORMAL = 0, 986 NDMP4_LOG_DEBUG = 1, 987 NDMP4_LOG_ERROR = 2, 988 NDMP4_LOG_WARNING = 3 989 }; 990 991 struct ndmp4_log_message_post 992 { 993 ndmp4_log_type log_type; 994 uint32_t message_id; 995 string entry<>; 996 ndmp4_has_associated_message associated_message_valid; 997 uint32_t associated_message_sequence; 998 }; 999 1000 1001 enum ndmp4_recovery_status 1002 { 1003 NDMP4_RECOVERY_SUCCESSFUL = 0, 1004 NDMP4_RECOVERY_FAILED_PERMISSION = 1, 1005 NDMP4_RECOVERY_FAILED_NOT_FOUND = 2, 1006 NDMP4_RECOVERY_FAILED_NO_DIRECTORY = 3, 1007 NDMP4_RECOVERY_FAILED_OUT_OF_MEMORY = 4, 1008 NDMP4_RECOVERY_FAILED_IO_ERROR = 5, 1009 NDMP4_RECOVERY_FAILED_UNDEFINED_ERROR = 6 1010 }; 1011 1012 struct ndmp4_log_file_post 1013 { 1014 string name<>; 1015 ndmp4_recovery_status recovery_status; 1016 }; 1017 1018 1019 enum ndmp4_fs_type 1020 { 1021 NDMP4_FS_UNIX=0, 1022 NDMP4_FS_NT=1, 1023 NDMP4_FS_OTHER=2 1024 }; 1025 1026 typedef string ndmp4_path<>; 1027 1028 struct ndmp4_nt_path 1029 { 1030 ndmp4_path nt_path; 1031 ndmp4_path dos_path; 1032 }; 1033 1034 union ndmp4_file_name switch (ndmp4_fs_type fs_type) 1035 { 1036 case NDMP4_FS_UNIX: 1037 ndmp4_path unix_name; 1038 case NDMP4_FS_NT: 1039 ndmp4_nt_path nt_name; 1040 default: 1041 ndmp4_path other_name; 1042 }; 1043 1044 /* file type */ 1045 enum ndmp4_file_type 1046 { 1047 NDMP4_FILE_DIR=0, 1048 NDMP4_FILE_FIFO=1, 1049 NDMP4_FILE_CSPEC=2, 1050 NDMP4_FILE_BSPEC=3, 1051 NDMP4_FILE_REG=4, 1052 NDMP4_FILE_SLINK=5, 1053 NDMP4_FILE_SOCK=6, 1054 NDMP4_FILE_REGISTRY=7, 1055 NDMP4_FILE_OTHER=8 1056 }; 1057 1058 /* file stat */ 1059 /* unsupported bitmask */ 1060 const NDMP4_FILE_STAT_ATIME_UNS = 0x00000001; 1061 const NDMP4_FILE_STAT_CTIME_UNS = 0x00000002; 1062 const NDMP4_FILE_STAT_GROUP_UNS = 0x00000004; 1063 1064 struct ndmp4_file_stat 1065 { 1066 uint32_t unsupported; 1067 ndmp4_fs_type fs_type; 1068 ndmp4_file_type ftype; 1069 uint32_t mtime; 1070 uint32_t atime; 1071 uint32_t ctime; 1072 uint32_t owner; 1073 uint32_t group; 1074 uint32_t fattr; 1075 ndmp4_u_quad size; 1076 uint32_t links; 1077 }; 1078 1079 struct ndmp4_file 1080 { 1081 ndmp4_file_name names<>; 1082 ndmp4_file_stat stats<>; 1083 ndmp4_u_quad node; 1084 ndmp4_u_quad fh_info; 1085 }; 1086 1087 struct ndmp4_fh_add_file_post 1088 { 1089 ndmp4_file files<>; 1090 }; 1091 1092 struct ndmp4_dir 1093 { 1094 ndmp4_file_name names<>; 1095 ndmp4_u_quad node; 1096 ndmp4_u_quad parent; 1097 }; 1098 1099 struct ndmp4_fh_add_dir_post 1100 { 1101 ndmp4_dir dirs<>; 1102 }; 1103 1104 1105 struct ndmp4_node 1106 { 1107 ndmp4_file_stat stats<>; 1108 ndmp4_u_quad node; 1109 ndmp4_u_quad fh_info; 1110 }; 1111 1112 struct ndmp4_fh_add_node_post 1113 { 1114 ndmp4_node nodes<>; 1115 }; 1116 1117 %#endif /* !NDMOS_OPTION_NO_NDMP4 */ 1118