159fe2c14SBruce Evans.\" Copyright (c) 1983, 1991, 1993 259fe2c14SBruce Evans.\" The Regents of the University of California. All rights reserved. 359fe2c14SBruce Evans.\" 459fe2c14SBruce Evans.\" Redistribution and use in source and binary forms, with or without 559fe2c14SBruce Evans.\" modification, are permitted provided that the following conditions 659fe2c14SBruce Evans.\" are met: 759fe2c14SBruce Evans.\" 1. Redistributions of source code must retain the above copyright 859fe2c14SBruce Evans.\" notice, this list of conditions and the following disclaimer. 959fe2c14SBruce Evans.\" 2. Redistributions in binary form must reproduce the above copyright 1059fe2c14SBruce Evans.\" notice, this list of conditions and the following disclaimer in the 1159fe2c14SBruce Evans.\" documentation and/or other materials provided with the distribution. 1259fe2c14SBruce Evans.\" 3. All advertising materials mentioning features or use of this software 1359fe2c14SBruce Evans.\" must display the following acknowledgement: 1459fe2c14SBruce Evans.\" This product includes software developed by the University of 1559fe2c14SBruce Evans.\" California, Berkeley and its contributors. 1659fe2c14SBruce Evans.\" 4. Neither the name of the University nor the names of its contributors 1759fe2c14SBruce Evans.\" may be used to endorse or promote products derived from this software 1859fe2c14SBruce Evans.\" without specific prior written permission. 1959fe2c14SBruce Evans.\" 2059fe2c14SBruce Evans.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2159fe2c14SBruce Evans.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2259fe2c14SBruce Evans.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2359fe2c14SBruce Evans.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2459fe2c14SBruce Evans.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2559fe2c14SBruce Evans.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2659fe2c14SBruce Evans.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2759fe2c14SBruce Evans.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2859fe2c14SBruce Evans.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2959fe2c14SBruce Evans.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3059fe2c14SBruce Evans.\" SUCH DAMAGE. 3159fe2c14SBruce Evans.\" 3259fe2c14SBruce Evans.\" @(#)rmt.8 8.3 (Berkeley) 6/1/94 3397d92980SPeter Wemm.\" $FreeBSD$ 3459fe2c14SBruce Evans.\" 3559fe2c14SBruce Evans.Dd June 1, 1994 3659fe2c14SBruce Evans.Dt RMT 8 37a4c37c81SRuslan Ermilov.Os 3859fe2c14SBruce Evans.Sh NAME 3959fe2c14SBruce Evans.Nm rmt 4059fe2c14SBruce Evans.Nd remote magtape protocol module 4159fe2c14SBruce Evans.Sh SYNOPSIS 42e97407b4SRuslan Ermilov.Nm 4359fe2c14SBruce Evans.Sh DESCRIPTION 44490d5836SPhilippe CharnierThe 45490d5836SPhilippe Charnier.Nm 46490d5836SPhilippe Charnierutility is used by the remote dump and restore programs 4759fe2c14SBruce Evansin manipulating a magnetic tape drive through an interprocess 48490d5836SPhilippe Charniercommunication connection. It is normally started up with an 4959fe2c14SBruce Evans.Xr rexec 3 5059fe2c14SBruce Evansor 5159fe2c14SBruce Evans.Xr rcmd 3 5259fe2c14SBruce Evanscall. 5359fe2c14SBruce Evans.Pp 5459fe2c14SBruce EvansThe 5512873ebfSPhilippe Charnier.Nm 56490d5836SPhilippe Charnierutility accepts requests specific to the manipulation of 5759fe2c14SBruce Evansmagnetic tapes, performs the commands, then responds with 5859fe2c14SBruce Evansa status indication. All responses are in 5959fe2c14SBruce Evans.Tn ASCII 6059fe2c14SBruce Evansand in 6159fe2c14SBruce Evansone of two forms. 6259fe2c14SBruce EvansSuccessful commands have responses of: 6346eea498SRuslan Ermilov.Bd -ragged -offset indent 6459fe2c14SBruce Evans.Sm off 6559fe2c14SBruce Evans.Sy A Ar number No \en 6659fe2c14SBruce Evans.Sm on 6759fe2c14SBruce Evans.Ed 6859fe2c14SBruce Evans.Pp 6959fe2c14SBruce Evans.Ar Number 7059fe2c14SBruce Evansis an 7159fe2c14SBruce Evans.Tn ASCII 7259fe2c14SBruce Evansrepresentation of a decimal number. 7359fe2c14SBruce EvansUnsuccessful commands are responded to with: 7446eea498SRuslan Ermilov.Bd -ragged -offset indent 7559fe2c14SBruce Evans.Sm off 7659fe2c14SBruce Evans.Xo Sy E Ar error-number 7759fe2c14SBruce Evans.No \en Ar error-message 7859fe2c14SBruce Evans.No \en 7959fe2c14SBruce Evans.Xc 8059fe2c14SBruce Evans.Sm on 8159fe2c14SBruce Evans.Ed 8259fe2c14SBruce Evans.Pp 8359fe2c14SBruce Evans.Ar Error-number 8459fe2c14SBruce Evansis one of the possible error 8559fe2c14SBruce Evansnumbers described in 8659fe2c14SBruce Evans.Xr intro 2 8759fe2c14SBruce Evansand 8859fe2c14SBruce Evans.Ar error-message 8959fe2c14SBruce Evansis the corresponding error string as printed 9059fe2c14SBruce Evansfrom a call to 9159fe2c14SBruce Evans.Xr perror 3 . 9259fe2c14SBruce EvansThe protocol is comprised of the 9359fe2c14SBruce Evansfollowing commands, which are sent as indicated - no spaces are supplied 9459fe2c14SBruce Evansbetween the command and its arguments, or between its arguments, and 9559fe2c14SBruce Evans.Ql \en 9659fe2c14SBruce Evansindicates that a newline should be supplied: 9759fe2c14SBruce Evans.Bl -tag -width Ds 9859fe2c14SBruce Evans.Sm off 9959fe2c14SBruce Evans.It Xo Sy \&O Ar device 10059fe2c14SBruce Evans.No \en Ar mode No \en 10159fe2c14SBruce Evans.Xc 102610a5778SRuslan Ermilov.Sm on 10359fe2c14SBruce EvansOpen the specified 10459fe2c14SBruce Evans.Ar device 10559fe2c14SBruce Evansusing the indicated 10659fe2c14SBruce Evans.Ar mode . 10759fe2c14SBruce Evans.Ar Device 10859fe2c14SBruce Evansis a full pathname and 10959fe2c14SBruce Evans.Ar mode 11059fe2c14SBruce Evansis an 11159fe2c14SBruce Evans.Tn ASCII 11259fe2c14SBruce Evansrepresentation of a decimal 11359fe2c14SBruce Evansnumber suitable for passing to 11459fe2c14SBruce Evans.Xr open 2 . 11559fe2c14SBruce EvansIf a device had already been opened, it is 11659fe2c14SBruce Evansclosed before a new open is performed. 117610a5778SRuslan Ermilov.Sm off 11859fe2c14SBruce Evans.It Xo Sy C Ar device No \en 11959fe2c14SBruce Evans.Xc 120610a5778SRuslan Ermilov.Sm on 12159fe2c14SBruce EvansClose the currently open device. The 12259fe2c14SBruce Evans.Ar device 12359fe2c14SBruce Evansspecified is ignored. 124610a5778SRuslan Ermilov.Sm off 12559fe2c14SBruce Evans.It Xo Sy L 12659fe2c14SBruce Evans.Ar whence No \en 12759fe2c14SBruce Evans.Ar offset No \en 12859fe2c14SBruce Evans.Xc 12959fe2c14SBruce Evans.Sm on 13059fe2c14SBruce EvansPerform an 13159fe2c14SBruce Evans.Xr lseek 2 13259fe2c14SBruce Evansoperation using the specified parameters. 13359fe2c14SBruce EvansThe response value is that returned from the 134aae2e035SPhilippe Charnier.Xr lseek 2 13559fe2c14SBruce Evanscall. 13659fe2c14SBruce Evans.Sm off 13759fe2c14SBruce Evans.It Sy W Ar count No \en 13859fe2c14SBruce Evans.Sm on 13959fe2c14SBruce EvansWrite data onto the open device. 140490d5836SPhilippe CharnierThe 141490d5836SPhilippe Charnier.Nm 142490d5836SPhilippe Charnierutility reads 14359fe2c14SBruce Evans.Ar count 14459fe2c14SBruce Evansbytes from the connection, aborting if 14559fe2c14SBruce Evansa premature end-of-file is encountered. 14659fe2c14SBruce EvansThe response value is that returned from 14759fe2c14SBruce Evansthe 14859fe2c14SBruce Evans.Xr write 2 14959fe2c14SBruce Evanscall. 15059fe2c14SBruce Evans.Sm off 15159fe2c14SBruce Evans.It Sy R Ar count No \en 15259fe2c14SBruce Evans.Sm on 15359fe2c14SBruce EvansRead 15459fe2c14SBruce Evans.Ar count 15559fe2c14SBruce Evansbytes of data from the open device. 15659fe2c14SBruce EvansIf 15759fe2c14SBruce Evans.Ar count 15859fe2c14SBruce Evansexceeds the size of the data buffer (10 kilobytes), it is 15959fe2c14SBruce Evanstruncated to the data buffer size. 160490d5836SPhilippe CharnierThe 161490d5836SPhilippe Charnier.Nm 162490d5836SPhilippe Charnierutility then performs the requested 16359fe2c14SBruce Evans.Xr read 2 16459fe2c14SBruce Evansand responds with 16559fe2c14SBruce Evans.Sm off 16659fe2c14SBruce Evans.Sy A Ar count-read No \en 16759fe2c14SBruce Evans.Sm on 16859fe2c14SBruce Evansif the read was 16959fe2c14SBruce Evanssuccessful; otherwise an error in the 17059fe2c14SBruce Evansstandard format is returned. If the read 17159fe2c14SBruce Evanswas successful, the data read is then sent. 17259fe2c14SBruce Evans.Sm off 17359fe2c14SBruce Evans.It Xo Sy I Ar operation 17459fe2c14SBruce Evans.No \en Ar count No \en 17559fe2c14SBruce Evans.Xc 17659fe2c14SBruce Evans.Sm on 17759fe2c14SBruce EvansPerform a 17859fe2c14SBruce Evans.Dv MTIOCOP 17959fe2c14SBruce Evans.Xr ioctl 2 18059fe2c14SBruce Evanscommand using the specified parameters. 18159fe2c14SBruce EvansThe parameters are interpreted as the 18259fe2c14SBruce Evans.Tn ASCII 18359fe2c14SBruce Evansrepresentations of the decimal values 18459fe2c14SBruce Evansto place in the 18559fe2c14SBruce Evans.Ar mt_op 18659fe2c14SBruce Evansand 18759fe2c14SBruce Evans.Ar mt_count 18859fe2c14SBruce Evansfields of the structure used in the 189af20a13dSPhilippe Charnier.Xr ioctl 2 19059fe2c14SBruce Evanscall. The return value is the 19159fe2c14SBruce Evans.Ar count 19259fe2c14SBruce Evansparameter when the operation is successful. 19359fe2c14SBruce Evans.It Sy S 19459fe2c14SBruce EvansReturn the status of the open device, as 19559fe2c14SBruce Evansobtained with a 19659fe2c14SBruce Evans.Dv MTIOCGET 197af20a13dSPhilippe Charnier.Xr ioctl 2 19859fe2c14SBruce Evanscall. If the operation was successful, 19959fe2c14SBruce Evansan ``ack'' is sent with the size of the 20059fe2c14SBruce Evansstatus buffer, then the status buffer is 20159fe2c14SBruce Evanssent (in binary). 20259fe2c14SBruce Evans.El 20359fe2c14SBruce Evans.Pp 20459fe2c14SBruce EvansAny other command causes 20512873ebfSPhilippe Charnier.Nm 20659fe2c14SBruce Evansto exit. 20759fe2c14SBruce Evans.Sh DIAGNOSTICS 20859fe2c14SBruce EvansAll responses are of the form described above. 20959fe2c14SBruce Evans.Sh SEE ALSO 21059fe2c14SBruce Evans.Xr rcmd 3 , 21159fe2c14SBruce Evans.Xr rexec 3 , 21259fe2c14SBruce Evans.Xr mtio 4 , 21359fe2c14SBruce Evans.Xr rdump 8 , 21459fe2c14SBruce Evans.Xr rrestore 8 21559fe2c14SBruce Evans.Sh BUGS 21659fe2c14SBruce EvansPeople should be discouraged from using this for a remote 21759fe2c14SBruce Evansfile access protocol. 21859fe2c14SBruce Evans.Sh HISTORY 21959fe2c14SBruce EvansThe 22059fe2c14SBruce Evans.Nm 221490d5836SPhilippe Charnierutility appeared in 22259fe2c14SBruce Evans.Bx 4.2 . 223