📄 spec.v1.txt
字号:
Request Arguments device Name of tape device to open. mode Tape open mode.Reply Arguments error Error code.Reply Errors NDMP_NO_ERR Tape device successfully opened. NDMP_DEVICE_OPENED_ERRThe NDMP server already has a SCSI device or tape device open.Stager,Hitz Page 40Internet Draft Network Data Management Protocol October 1996 NDMP_NO_DEVICE_ERR The specified device does not exist. NDMP_DEVICE_BUSY_ERR The device is already open by another NDMP server or system process. NDMP_IO_ERR Device I/O error. NDMP_WRITE_PROTECT_ERRDevice can not be opened in write mode because the tape is write protected. NDMP_NO_TAPE_LOADED_ERR No tape loaded in the tape device.3.4.2 Close DeviceClose the tape drive. Drive can be opened by others. No further requestscan be processed until another open request is successfully executed.Message XDR definition /* No request message body. */ struct ndmp_tape_close_reply { ndmp_error error; };Request Arguments This message does not have a message body.Reply Arguments error Error code.Reply ErrorsStager,Hitz Page 41Internet Draft Network Data Management Protocol October 1996 NDMP_NO_ERR Tape device successfully closed. NDMP_DEV_NOT_OPEN_ERR No tape device currently open by the connection. NDMP_IO_ERR Device I/O error.3.4.3 Get Tape StateReturn the state of the tape drive interface.Message XDR definition /* No request message body. */ struct ndmp_u_quad { u_long high; u_long low; }; /* flags */ const NDMP_TAPE_NOREWIND = 0x0008; const NDMP_TAPE_WR_PROT = 0x0010; const NDMP_TAPE_ERROR = 0x0020; const NDMP_TAPE_UNLOAD = 0x0040; struct ndmp_tape_get_state_reply { ndmp_error error; u_long flags; u_long file_num; u_long record_num; u_long record_size; u_long soft_errors; u_long block_size; u_long blockno; ndmp_u_quad total_space; ndmp_u_quad space_remain; };Request ArgumentsStager,Hitz Page 42Internet Draft Network Data Management Protocol October 1996 This message does not have a message body.Reply Arguments error Error code. Flags Bitmask of the following tape device mode flags: NDMP_TAPE_NOREWIND Upon device close, the tape will not be rewound. NDMP_TAPE_WR_PROT The loaded tape is write-protected. NDMP_TAPE_ERROR A media error was detected during the previous tape operation. This bit is cleared at the start of each tape operation. NDMP_TAPE_UNLOADThe currently loaded tape will automatically be unloaded when the device is closed. Only applies to media changer devices such as tape stackers and jukeboxes. file_num Current file position. First file on the tape is file number 0. record_num Current record position. First record in a file is record number 0. record_size Tape record size in bytes. soft_errors Total number of soft media errors detected since the device was opened. block_size Tape block size in bytes. 0 if the device is not a fixed block device. blockno Current tape block number. First tape block is block number 0.Stager,Hitz Page 43Internet Draft Network Data Management Protocol October 1996 total_space Total tape capacity in bytes. 0 if this feature not supported by the NDMP server implementation. space_remain Total remaining tape capacity in bytes. 0 if this feature not supported by the NDMP server implementation.Reply Errors NDMP_NO_ERR Tape state successfully returned. NDMP_DEV_NOT_OPEN_ERR No tape device currently open by the connection. NDMP_IO_ERR Device I/O error.3.4.4 MTIOProvides access to the standard magnetic tape I/O operations. Whenspacing forward over a record, the tape head is positioned in the tape gapbetween the record just skipped and the next record. When spacing forwardover file marks, the tape head is positioned in the tape gap between thenext file mark and the record that follows it. When spacing backward overa record data, the tape head is positioned in the tape gap immediatelypreceding the tape record where the tape head is currently positioned.When spacing backward over file marks, the tape head is positioned in thetape gap preceding the file mark the next read would fetch the EOF.Message XDR definitionStager,Hitz Page 44Internet Draft Network Data Management Protocol October 1996 enum ndmp_tape_mtio_op { NDMP_MTIO_FSF, NDMP_MTIO_BSF, NDMP_MTIO_FSR, NDMP_MTIO_BSR, NDMP_MTIO_REW, NDMP_MTIO_EOF, NDMP_MTIO_OFF }; struct ndmp_tape_mtio_request { ndmp_tape_mtio_op tape_op; u_long count; }; struct ndmp_tape_mtio_reply { ndmp_error error; u_long resid_count; };Request Arguments tape_op One of the following tape operations: NDMP_MTIO_FSF Forward space over file marks. The tape head is positioned in the tape gap between the file mark and the record that follows it. NDMP_MTIO_BSF Backward space over file marks. The tape head is positioned in the tape gap preceeding the file mark such that the next read encounters EOF. NDMP_MTIO_FSR Forward space over tape records. The tape head is positioned in the tape gap between the record just skipped and the next record.Stager,Hitz Page 45Internet Draft Network Data Management Protocol October 1996 NDMP_MTIO_BSR Backward space over tape records. The tape head is positioned in the tape gap preceeding the tape record just skipped. NDMP_MTIO_REW Rewind the tape. NDMP_MTIO_EOF Write end of file marks. NDMP_MTIO_OFF Eject the tape from the device. count Number of operations to perform.Reply Arguments error Error code. resid_count Residual operation count. Represents the number of operations that were not able to be performed due to encountering beginning of tape, end of tape, end of written media, or a tape error.Reply Errors NDMP_NO_ERR Tape operation successfully completed. NDMP_DEV_NOT_OPEN_ERR No tape device currently open by the connection. NDMP_IO_ERR Device I/O error. NDMP_ILLEGAL_ARGS_ERR Invalid tape operation specified. NDMP_WRITE_PROTECT_ERRTape is write protected.3.4.5 WriteWrites data to the tape device. The NDMP server writes the specified dataas a single record. It is the responsibility of the NDMP client to ensureStager,Hitz Page 46Internet Draft Network Data Management Protocol October 1996that the length of the data is a multiple of the tape device block size ifthe device is a fixed block device. The NDMP server performs no bufferingor padding of the data. . This request is typically used by the NDMPclient to write tape header and trailer file data.Message XDR definition struct ndmp_tape_write_request { opaque data_out<>; }; struct ndmp_tape_write_reply { ndmp_error error; u_long count; };Request Arguments data_out The data to be written to the tape device.Reply Arguments error Error code. count Number of data bytes written..Reply Errors NDMP_NO_ERR All data successfully written to the tape device. NDMP_DEV_NOT_OPEN_ERR No tape device currently open by the connection. NDMP_IO_ERR Device I/O error.Stager,Hitz Page 47Internet Draft Network Data Management Protocol October 1996 NDMP_WRITE_PROTECT_ERRTape is write protected. NDMP_EOM_ERR End of tape was encountered while writing.3.4.6 ReadReads data from the tape drive. The NDMP server always reads a completerecord. It is the responsibility of the NDMP client to specify a lengththat is greater that or equal to the size of the record to be read. Anattempt to read less than a full record will result in an I/O error. Thisrequest is typically used by the NDMP client to read tape header andtrailer file data.Message XDR definition struct ndmp_tape_read_request { u_long count; }; struct ndmp_tape_read_reply { ndmp_error error; opaque data_in<>; };Request Arguments count Number of bytes to read.Reply Arguments error Error code. data_in The data read from the tape drive. The returned number of bytes may be less than the number requested if the requested amount was larger than the read tape record.Stager,Hitz Page 48Internet Draft Network Data Management Protocol October 1996Reply Errors NDMP_NO_ERR Data successfully read from the tape device. NDMP_DEV_NOT_OPEN_ERR No tape device currently open by the connection. NDMP_IO_ERR Device I/O error during read. NDMP_EOF_ERR End of file was encountered while reading. The number of returned data bytes may be less than the number of bytes requested.3.4.7 Set Record SizeSets the tape record size used when writing/reading the tape duringbackup/recover operations. Note that the tape record size has no effect onthe ndmp_tape_write and ndmp_tape_read requests.Message XDR definition struct ndmp_tape_set_record_size_request { u_long len; }; struct ndmp_tape_set_record_size_reply { ndmp_error error; }Request Arguments len Tape record size in bytes.Stager,Hitz Page 49Internet Draft Network Data Management Protocol October 1996Reply Arguments error Error code.Reply Errors NDMP_NO_ERR Tape record size successfully set.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -