1*9ae0c77aSjoerg.\" $NetBSD: rmt.8,v 1.14 2009/03/11 18:23:38 joerg Exp $ 2181be486Smikel.\" 33bbeacd1Smrg.\" Copyright (c) 1983, 1991, 1993 43bbeacd1Smrg.\" The Regents of the University of California. All rights reserved. 561f28255Scgd.\" 661f28255Scgd.\" Redistribution and use in source and binary forms, with or without 761f28255Scgd.\" modification, are permitted provided that the following conditions 861f28255Scgd.\" are met: 961f28255Scgd.\" 1. Redistributions of source code must retain the above copyright 1061f28255Scgd.\" notice, this list of conditions and the following disclaimer. 1161f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright 1261f28255Scgd.\" notice, this list of conditions and the following disclaimer in the 1361f28255Scgd.\" documentation and/or other materials provided with the distribution. 14326b2259Sagc.\" 3. Neither the name of the University nor the names of its contributors 1561f28255Scgd.\" may be used to endorse or promote products derived from this software 1661f28255Scgd.\" without specific prior written permission. 1761f28255Scgd.\" 1861f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1961f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2061f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2161f28255Scgd.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2261f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2361f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2461f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2561f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2661f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2761f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2861f28255Scgd.\" SUCH DAMAGE. 2961f28255Scgd.\" 303bbeacd1Smrg.\" @(#)rmt.8 8.3 (Berkeley) 6/1/94 3161f28255Scgd.\" 323bbeacd1Smrg.Dd June 1, 1994 3361f28255Scgd.Dt RMT 8 34d1407362Sgarbled.Os 3561f28255Scgd.Sh NAME 3661f28255Scgd.Nm rmt 3761f28255Scgd.Nd remote magtape protocol module 3861f28255Scgd.Sh SYNOPSIS 39166448c2Slukem.Nm 4061f28255Scgd.Sh DESCRIPTION 41166448c2Slukem.Nm 4261f28255Scgdis a program used by the remote dump and restore programs 4361f28255Scgdin manipulating a magnetic tape drive through an interprocess 4461f28255Scgdcommunication connection. 45166448c2Slukem.Nm 4661f28255Scgdis normally started up with an 4761f28255Scgd.Xr rexec 3 4861f28255Scgdor 4961f28255Scgd.Xr rcmd 3 5061f28255Scgdcall. 5161f28255Scgd.Pp 5261f28255ScgdThe 53166448c2Slukem.Nm 5461f28255Scgdprogram accepts requests specific to the manipulation of 5561f28255Scgdmagnetic tapes, performs the commands, then responds with 5661f28255Scgda status indication. All responses are in 5761f28255Scgd.Tn ASCII 5861f28255Scgdand in 5961f28255Scgdone of two forms. 6061f28255ScgdSuccessful commands have responses of: 6161f28255Scgd.Bd -filled -offset indent 6261f28255Scgd.Sm off 6361f28255Scgd.Sy A Ar number No \en 6461f28255Scgd.Sm on 6561f28255Scgd.Ed 6661f28255Scgd.Pp 6761f28255Scgd.Ar Number 6861f28255Scgdis an 6961f28255Scgd.Tn ASCII 7061f28255Scgdrepresentation of a decimal number. 7161f28255ScgdUnsuccessful commands are responded to with: 7261f28255Scgd.Bd -filled -offset indent 7361f28255Scgd.Sm off 7461f28255Scgd.Xo Sy E Ar error-number 7561f28255Scgd.No \en Ar error-message 7661f28255Scgd.No \en 7761f28255Scgd.Xc 7861f28255Scgd.Sm on 7961f28255Scgd.Ed 8061f28255Scgd.Pp 8161f28255Scgd.Ar Error-number 8261f28255Scgdis one of the possible error 8361f28255Scgdnumbers described in 8461f28255Scgd.Xr intro 2 8561f28255Scgdand 8661f28255Scgd.Ar error-message 8761f28255Scgdis the corresponding error string as printed 8861f28255Scgdfrom a call to 8961f28255Scgd.Xr perror 3 . 90ccb6f405SwizThe protocol comprises the 9161f28255Scgdfollowing commands, which are sent as indicated - no spaces are supplied 9261f28255Scgdbetween the command and its arguments, or between its arguments, and 9361f28255Scgd.Ql \en 9461f28255Scgdindicates that a newline should be supplied: 9561f28255Scgd.Bl -tag -width Ds 96*9ae0c77aSjoerg.It Sy \&O Ns Ar device Ns \en Ns Ar mode Ns \en 9761f28255ScgdOpen the specified 9861f28255Scgd.Ar device 9961f28255Scgdusing the indicated 10061f28255Scgd.Ar mode . 10161f28255Scgd.Ar Device 10261f28255Scgdis a full pathname and 10361f28255Scgd.Ar mode 10461f28255Scgdis an 10561f28255Scgd.Tn ASCII 10661f28255Scgdrepresentation of a decimal 10761f28255Scgdnumber suitable for passing to 10861f28255Scgd.Xr open 2 . 10961f28255ScgdIf a device had already been opened, it is 11061f28255Scgdclosed before a new open is performed. 111*9ae0c77aSjoerg.It Sy C Ns Ar device Ns \en 11261f28255ScgdClose the currently open device. The 11361f28255Scgd.Ar device 11461f28255Scgdspecified is ignored. 115*9ae0c77aSjoerg.It Sy L Ns Ar offset Ns \en Ns Ar whence Ns \en 11661f28255ScgdPerform an 11761f28255Scgd.Xr lseek 2 11861f28255Scgdoperation using the specified parameters. 11961f28255ScgdThe response value is that returned from the 1204dea6943Swiz.Xr lseek 2 12161f28255Scgdcall. 12261f28255Scgd.Sm off 12361f28255Scgd.It Sy W Ar count No \en 12461f28255Scgd.Sm on 12561f28255ScgdWrite data onto the open device. 126166448c2Slukem.Nm 12761f28255Scgdreads 12861f28255Scgd.Ar count 12961f28255Scgdbytes from the connection, aborting if 13061f28255Scgda premature end-of-file is encountered. 13161f28255ScgdThe response value is that returned from 13261f28255Scgdthe 13361f28255Scgd.Xr write 2 13461f28255Scgdcall. 13561f28255Scgd.Sm off 13661f28255Scgd.It Sy R Ar count No \en 13761f28255Scgd.Sm on 13861f28255ScgdRead 13961f28255Scgd.Ar count 14061f28255Scgdbytes of data from the open device. 14161f28255ScgdIf 14261f28255Scgd.Ar count 14361f28255Scgdexceeds the size of the data buffer (10 kilobytes), it is 14461f28255Scgdtruncated to the data buffer size. 145166448c2Slukem.Nm 14661f28255Scgdthen performs the requested 14761f28255Scgd.Xr read 2 14861f28255Scgdand responds with 14961f28255Scgd.Sm off 15061f28255Scgd.Sy A Ar count-read No \en 15161f28255Scgd.Sm on 15261f28255Scgdif the read was 15361f28255Scgdsuccessful; otherwise an error in the 15461f28255Scgdstandard format is returned. If the read 15561f28255Scgdwas successful, the data read is then sent. 156*9ae0c77aSjoerg.It Sy I Ns Ar operation Ns \en Ns Ar count Ns \en 15761f28255Scgd.Sm on 15861f28255ScgdPerform a 15961f28255Scgd.Dv MTIOCOP 16061f28255Scgd.Xr ioctl 2 16161f28255Scgdcommand using the specified parameters. 16261f28255ScgdThe parameters are interpreted as the 16361f28255Scgd.Tn ASCII 16461f28255Scgdrepresentations of the decimal values 16561f28255Scgdto place in the 16661f28255Scgd.Ar mt_op 16761f28255Scgdand 16861f28255Scgd.Ar mt_count 16961f28255Scgdfields of the structure used in the 1704dea6943Swiz.Xr ioctl 2 17161f28255Scgdcall. The return value is the 17261f28255Scgd.Ar count 17361f28255Scgdparameter when the operation is successful. 17461f28255Scgd.It Sy S 17561f28255ScgdReturn the status of the open device, as 17661f28255Scgdobtained with a 17761f28255Scgd.Dv MTIOCGET 1784dea6943Swiz.Xr ioctl 2 17961f28255Scgdcall. If the operation was successful, 18061f28255Scgdan ``ack'' is sent with the size of the 18161f28255Scgdstatus buffer, then the status buffer is 18261f28255Scgdsent (in binary). 18361f28255Scgd.El 18461f28255Scgd.Pp 18561f28255ScgdAny other command causes 186166448c2Slukem.Nm 18761f28255Scgdto exit. 18861f28255Scgd.Sh DIAGNOSTICS 18961f28255ScgdAll responses are of the form described above. 19061f28255Scgd.Sh SEE ALSO 19161f28255Scgd.Xr rcmd 3 , 19261f28255Scgd.Xr rexec 3 , 19361f28255Scgd.Xr mtio 4 , 19461f28255Scgd.Xr rdump 8 , 19561f28255Scgd.Xr rrestore 8 19661f28255Scgd.Sh HISTORY 19761f28255ScgdThe 19861f28255Scgd.Nm 19961f28255Scgdcommand appeared in 20061f28255Scgd.Bx 4.2 . 2010cedb12bSwiz.Sh BUGS 2020cedb12bSwizPeople should be discouraged from using this for a remote 2030cedb12bSwizfile access protocol. 204