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 3759fe2c14SBruce Evans.Os BSD 4.2 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 4459fe2c14SBruce Evans.Nm Rmt 4559fe2c14SBruce Evansis a program used by the remote dump and restore programs 4659fe2c14SBruce Evansin manipulating a magnetic tape drive through an interprocess 4759fe2c14SBruce Evanscommunication connection. 4859fe2c14SBruce Evans.Nm Rmt 4959fe2c14SBruce Evansis normally started up with an 5059fe2c14SBruce Evans.Xr rexec 3 5159fe2c14SBruce Evansor 5259fe2c14SBruce Evans.Xr rcmd 3 5359fe2c14SBruce Evanscall. 5459fe2c14SBruce Evans.Pp 5559fe2c14SBruce EvansThe 5612873ebfSPhilippe Charnier.Nm 5759fe2c14SBruce Evansprogram accepts requests specific to the manipulation of 5859fe2c14SBruce Evansmagnetic tapes, performs the commands, then responds with 5959fe2c14SBruce Evansa status indication. All responses are in 6059fe2c14SBruce Evans.Tn ASCII 6159fe2c14SBruce Evansand in 6259fe2c14SBruce Evansone of two forms. 6359fe2c14SBruce EvansSuccessful commands have responses of: 6446eea498SRuslan Ermilov.Bd -ragged -offset indent 6559fe2c14SBruce Evans.Sm off 6659fe2c14SBruce Evans.Sy A Ar number No \en 6759fe2c14SBruce Evans.Sm on 6859fe2c14SBruce Evans.Ed 6959fe2c14SBruce Evans.Pp 7059fe2c14SBruce Evans.Ar Number 7159fe2c14SBruce Evansis an 7259fe2c14SBruce Evans.Tn ASCII 7359fe2c14SBruce Evansrepresentation of a decimal number. 7459fe2c14SBruce EvansUnsuccessful commands are responded to with: 7546eea498SRuslan Ermilov.Bd -ragged -offset indent 7659fe2c14SBruce Evans.Sm off 7759fe2c14SBruce Evans.Xo Sy E Ar error-number 7859fe2c14SBruce Evans.No \en Ar error-message 7959fe2c14SBruce Evans.No \en 8059fe2c14SBruce Evans.Xc 8159fe2c14SBruce Evans.Sm on 8259fe2c14SBruce Evans.Ed 8359fe2c14SBruce Evans.Pp 8459fe2c14SBruce Evans.Ar Error-number 8559fe2c14SBruce Evansis one of the possible error 8659fe2c14SBruce Evansnumbers described in 8759fe2c14SBruce Evans.Xr intro 2 8859fe2c14SBruce Evansand 8959fe2c14SBruce Evans.Ar error-message 9059fe2c14SBruce Evansis the corresponding error string as printed 9159fe2c14SBruce Evansfrom a call to 9259fe2c14SBruce Evans.Xr perror 3 . 9359fe2c14SBruce EvansThe protocol is comprised of the 9459fe2c14SBruce Evansfollowing commands, which are sent as indicated - no spaces are supplied 9559fe2c14SBruce Evansbetween the command and its arguments, or between its arguments, and 9659fe2c14SBruce Evans.Ql \en 9759fe2c14SBruce Evansindicates that a newline should be supplied: 9859fe2c14SBruce Evans.Bl -tag -width Ds 9959fe2c14SBruce Evans.Sm off 10059fe2c14SBruce Evans.It Xo Sy \&O Ar device 10159fe2c14SBruce Evans.No \en Ar mode No \en 10259fe2c14SBruce Evans.Xc 103610a5778SRuslan Ermilov.Sm on 10459fe2c14SBruce EvansOpen the specified 10559fe2c14SBruce Evans.Ar device 10659fe2c14SBruce Evansusing the indicated 10759fe2c14SBruce Evans.Ar mode . 10859fe2c14SBruce Evans.Ar Device 10959fe2c14SBruce Evansis a full pathname and 11059fe2c14SBruce Evans.Ar mode 11159fe2c14SBruce Evansis an 11259fe2c14SBruce Evans.Tn ASCII 11359fe2c14SBruce Evansrepresentation of a decimal 11459fe2c14SBruce Evansnumber suitable for passing to 11559fe2c14SBruce Evans.Xr open 2 . 11659fe2c14SBruce EvansIf a device had already been opened, it is 11759fe2c14SBruce Evansclosed before a new open is performed. 118610a5778SRuslan Ermilov.Sm off 11959fe2c14SBruce Evans.It Xo Sy C Ar device No \en 12059fe2c14SBruce Evans.Xc 121610a5778SRuslan Ermilov.Sm on 12259fe2c14SBruce EvansClose the currently open device. The 12359fe2c14SBruce Evans.Ar device 12459fe2c14SBruce Evansspecified is ignored. 125610a5778SRuslan Ermilov.Sm off 12659fe2c14SBruce Evans.It Xo Sy L 12759fe2c14SBruce Evans.Ar whence No \en 12859fe2c14SBruce Evans.Ar offset No \en 12959fe2c14SBruce Evans.Xc 13059fe2c14SBruce Evans.Sm on 13159fe2c14SBruce EvansPerform an 13259fe2c14SBruce Evans.Xr lseek 2 13359fe2c14SBruce Evansoperation using the specified parameters. 13459fe2c14SBruce EvansThe response value is that returned from the 13559fe2c14SBruce Evans.Xr lseek 13659fe2c14SBruce Evanscall. 13759fe2c14SBruce Evans.Sm off 13859fe2c14SBruce Evans.It Sy W Ar count No \en 13959fe2c14SBruce Evans.Sm on 14059fe2c14SBruce EvansWrite data onto the open device. 14159fe2c14SBruce Evans.Nm Rmt 14259fe2c14SBruce Evansreads 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. 16012873ebfSPhilippe Charnier.Nm Rmt 16159fe2c14SBruce Evansthen performs the requested 16259fe2c14SBruce Evans.Xr read 2 16359fe2c14SBruce Evansand responds with 16459fe2c14SBruce Evans.Sm off 16559fe2c14SBruce Evans.Sy A Ar count-read No \en 16659fe2c14SBruce Evans.Sm on 16759fe2c14SBruce Evansif the read was 16859fe2c14SBruce Evanssuccessful; otherwise an error in the 16959fe2c14SBruce Evansstandard format is returned. If the read 17059fe2c14SBruce Evanswas successful, the data read is then sent. 17159fe2c14SBruce Evans.Sm off 17259fe2c14SBruce Evans.It Xo Sy I Ar operation 17359fe2c14SBruce Evans.No \en Ar count No \en 17459fe2c14SBruce Evans.Xc 17559fe2c14SBruce Evans.Sm on 17659fe2c14SBruce EvansPerform a 17759fe2c14SBruce Evans.Dv MTIOCOP 17859fe2c14SBruce Evans.Xr ioctl 2 17959fe2c14SBruce Evanscommand using the specified parameters. 18059fe2c14SBruce EvansThe parameters are interpreted as the 18159fe2c14SBruce Evans.Tn ASCII 18259fe2c14SBruce Evansrepresentations of the decimal values 18359fe2c14SBruce Evansto place in the 18459fe2c14SBruce Evans.Ar mt_op 18559fe2c14SBruce Evansand 18659fe2c14SBruce Evans.Ar mt_count 18759fe2c14SBruce Evansfields of the structure used in the 188af20a13dSPhilippe Charnier.Xr ioctl 2 18959fe2c14SBruce Evanscall. The return value is the 19059fe2c14SBruce Evans.Ar count 19159fe2c14SBruce Evansparameter when the operation is successful. 19259fe2c14SBruce Evans.It Sy S 19359fe2c14SBruce EvansReturn the status of the open device, as 19459fe2c14SBruce Evansobtained with a 19559fe2c14SBruce Evans.Dv MTIOCGET 196af20a13dSPhilippe Charnier.Xr ioctl 2 19759fe2c14SBruce Evanscall. If the operation was successful, 19859fe2c14SBruce Evansan ``ack'' is sent with the size of the 19959fe2c14SBruce Evansstatus buffer, then the status buffer is 20059fe2c14SBruce Evanssent (in binary). 20159fe2c14SBruce Evans.El 20259fe2c14SBruce Evans.Pp 20359fe2c14SBruce EvansAny other command causes 20412873ebfSPhilippe Charnier.Nm 20559fe2c14SBruce Evansto exit. 20659fe2c14SBruce Evans.Sh DIAGNOSTICS 20759fe2c14SBruce EvansAll responses are of the form described above. 20859fe2c14SBruce Evans.Sh SEE ALSO 20959fe2c14SBruce Evans.Xr rcmd 3 , 21059fe2c14SBruce Evans.Xr rexec 3 , 21159fe2c14SBruce Evans.Xr mtio 4 , 21259fe2c14SBruce Evans.Xr rdump 8 , 21359fe2c14SBruce Evans.Xr rrestore 8 21459fe2c14SBruce Evans.Sh BUGS 21559fe2c14SBruce EvansPeople should be discouraged from using this for a remote 21659fe2c14SBruce Evansfile access protocol. 21759fe2c14SBruce Evans.Sh HISTORY 21859fe2c14SBruce EvansThe 21959fe2c14SBruce Evans.Nm 22059fe2c14SBruce Evanscommand appeared in 22159fe2c14SBruce Evans.Bx 4.2 . 222