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. 12*fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors 1359fe2c14SBruce Evans.\" may be used to endorse or promote products derived from this software 1459fe2c14SBruce Evans.\" without specific prior written permission. 1559fe2c14SBruce Evans.\" 1659fe2c14SBruce Evans.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1759fe2c14SBruce Evans.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1859fe2c14SBruce Evans.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1959fe2c14SBruce Evans.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2059fe2c14SBruce Evans.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2159fe2c14SBruce Evans.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2259fe2c14SBruce Evans.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2359fe2c14SBruce Evans.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2459fe2c14SBruce Evans.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2559fe2c14SBruce Evans.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2659fe2c14SBruce Evans.\" SUCH DAMAGE. 2759fe2c14SBruce Evans.\" 2859fe2c14SBruce Evans.Dd June 1, 1994 2959fe2c14SBruce Evans.Dt RMT 8 30a4c37c81SRuslan Ermilov.Os 3159fe2c14SBruce Evans.Sh NAME 3259fe2c14SBruce Evans.Nm rmt 3359fe2c14SBruce Evans.Nd remote magtape protocol module 3459fe2c14SBruce Evans.Sh SYNOPSIS 35e97407b4SRuslan Ermilov.Nm 3659fe2c14SBruce Evans.Sh DESCRIPTION 37490d5836SPhilippe CharnierThe 38490d5836SPhilippe Charnier.Nm 39490d5836SPhilippe Charnierutility is used by the remote dump and restore programs 4059fe2c14SBruce Evansin manipulating a magnetic tape drive through an interprocess 4107bfccd7SRuslan Ermilovcommunication connection. 4207bfccd7SRuslan ErmilovIt is normally started up with an 4359fe2c14SBruce Evans.Xr rcmd 3 4459fe2c14SBruce Evanscall. 4559fe2c14SBruce Evans.Pp 4659fe2c14SBruce EvansThe 4712873ebfSPhilippe Charnier.Nm 48490d5836SPhilippe Charnierutility accepts requests specific to the manipulation of 4959fe2c14SBruce Evansmagnetic tapes, performs the commands, then responds with 5007bfccd7SRuslan Ermilova status indication. 5107bfccd7SRuslan ErmilovAll responses are in 5259fe2c14SBruce Evans.Tn ASCII 5359fe2c14SBruce Evansand in 5459fe2c14SBruce Evansone of two forms. 5559fe2c14SBruce EvansSuccessful commands have responses of: 5646eea498SRuslan Ermilov.Bd -ragged -offset indent 5759fe2c14SBruce Evans.Sm off 5859fe2c14SBruce Evans.Sy A Ar number No \en 5959fe2c14SBruce Evans.Sm on 6059fe2c14SBruce Evans.Ed 6159fe2c14SBruce Evans.Pp 6259fe2c14SBruce Evans.Ar Number 6359fe2c14SBruce Evansis an 6459fe2c14SBruce Evans.Tn ASCII 6559fe2c14SBruce Evansrepresentation of a decimal number. 6659fe2c14SBruce EvansUnsuccessful commands are responded to with: 6746eea498SRuslan Ermilov.Bd -ragged -offset indent 6859fe2c14SBruce Evans.Sm off 6959fe2c14SBruce Evans.Xo Sy E Ar error-number 7059fe2c14SBruce Evans.No \en Ar error-message 7159fe2c14SBruce Evans.No \en 7259fe2c14SBruce Evans.Xc 7359fe2c14SBruce Evans.Sm on 7459fe2c14SBruce Evans.Ed 7559fe2c14SBruce Evans.Pp 7659fe2c14SBruce Evans.Ar Error-number 7759fe2c14SBruce Evansis one of the possible error 7859fe2c14SBruce Evansnumbers described in 7959fe2c14SBruce Evans.Xr intro 2 8059fe2c14SBruce Evansand 8159fe2c14SBruce Evans.Ar error-message 8259fe2c14SBruce Evansis the corresponding error string as printed 8359fe2c14SBruce Evansfrom a call to 8459fe2c14SBruce Evans.Xr perror 3 . 8559fe2c14SBruce EvansThe protocol is comprised of the 8659fe2c14SBruce Evansfollowing commands, which are sent as indicated - no spaces are supplied 8759fe2c14SBruce Evansbetween the command and its arguments, or between its arguments, and 8859fe2c14SBruce Evans.Ql \en 8959fe2c14SBruce Evansindicates that a newline should be supplied: 9059fe2c14SBruce Evans.Bl -tag -width Ds 9159fe2c14SBruce Evans.Sm off 9259fe2c14SBruce Evans.It Xo Sy \&O Ar device 9359fe2c14SBruce Evans.No \en Ar mode No \en 9459fe2c14SBruce Evans.Xc 95610a5778SRuslan Ermilov.Sm on 9659fe2c14SBruce EvansOpen the specified 9759fe2c14SBruce Evans.Ar device 9859fe2c14SBruce Evansusing the indicated 9959fe2c14SBruce Evans.Ar mode . 10059fe2c14SBruce Evans.Ar Device 10159fe2c14SBruce Evansis a full pathname and 10259fe2c14SBruce Evans.Ar mode 10359fe2c14SBruce Evansis an 10459fe2c14SBruce Evans.Tn ASCII 10559fe2c14SBruce Evansrepresentation of a decimal 10659fe2c14SBruce Evansnumber suitable for passing to 10759fe2c14SBruce Evans.Xr open 2 . 10859fe2c14SBruce EvansIf a device had already been opened, it is 10959fe2c14SBruce Evansclosed before a new open is performed. 110610a5778SRuslan Ermilov.Sm off 11159fe2c14SBruce Evans.It Xo Sy C Ar device No \en 11259fe2c14SBruce Evans.Xc 113610a5778SRuslan Ermilov.Sm on 11407bfccd7SRuslan ErmilovClose the currently open device. 11507bfccd7SRuslan ErmilovThe 11659fe2c14SBruce Evans.Ar device 11759fe2c14SBruce Evansspecified is ignored. 118610a5778SRuslan Ermilov.Sm off 11959fe2c14SBruce Evans.It Xo Sy L 12059fe2c14SBruce Evans.Ar whence No \en 12159fe2c14SBruce Evans.Ar offset No \en 12259fe2c14SBruce Evans.Xc 12359fe2c14SBruce Evans.Sm on 12459fe2c14SBruce EvansPerform an 12559fe2c14SBruce Evans.Xr lseek 2 12659fe2c14SBruce Evansoperation using the specified parameters. 12759fe2c14SBruce EvansThe response value is that returned from the 128aae2e035SPhilippe Charnier.Xr lseek 2 12959fe2c14SBruce Evanscall. 13059fe2c14SBruce Evans.Sm off 13159fe2c14SBruce Evans.It Sy W Ar count No \en 13259fe2c14SBruce Evans.Sm on 13359fe2c14SBruce EvansWrite data onto the open device. 134490d5836SPhilippe CharnierThe 135490d5836SPhilippe Charnier.Nm 136490d5836SPhilippe Charnierutility reads 13759fe2c14SBruce Evans.Ar count 13859fe2c14SBruce Evansbytes from the connection, aborting if 13959fe2c14SBruce Evansa premature end-of-file is encountered. 14059fe2c14SBruce EvansThe response value is that returned from 14159fe2c14SBruce Evansthe 14259fe2c14SBruce Evans.Xr write 2 14359fe2c14SBruce Evanscall. 14459fe2c14SBruce Evans.Sm off 14559fe2c14SBruce Evans.It Sy R Ar count No \en 14659fe2c14SBruce Evans.Sm on 14759fe2c14SBruce EvansRead 14859fe2c14SBruce Evans.Ar count 14959fe2c14SBruce Evansbytes of data from the open device. 15059fe2c14SBruce EvansIf 15159fe2c14SBruce Evans.Ar count 15259fe2c14SBruce Evansexceeds the size of the data buffer (10 kilobytes), it is 15359fe2c14SBruce Evanstruncated to the data buffer size. 154490d5836SPhilippe CharnierThe 155490d5836SPhilippe Charnier.Nm 156490d5836SPhilippe Charnierutility then performs the requested 15759fe2c14SBruce Evans.Xr read 2 15859fe2c14SBruce Evansand responds with 15959fe2c14SBruce Evans.Sm off 16059fe2c14SBruce Evans.Sy A Ar count-read No \en 16159fe2c14SBruce Evans.Sm on 16259fe2c14SBruce Evansif the read was 16359fe2c14SBruce Evanssuccessful; otherwise an error in the 16407bfccd7SRuslan Ermilovstandard format is returned. 16507bfccd7SRuslan ErmilovIf the read 16659fe2c14SBruce Evanswas successful, the data read is then sent. 16759fe2c14SBruce Evans.Sm off 16859fe2c14SBruce Evans.It Xo Sy I Ar operation 16959fe2c14SBruce Evans.No \en Ar count No \en 17059fe2c14SBruce Evans.Xc 17159fe2c14SBruce Evans.Sm on 17259fe2c14SBruce EvansPerform a 17359fe2c14SBruce Evans.Dv MTIOCOP 17459fe2c14SBruce Evans.Xr ioctl 2 17559fe2c14SBruce Evanscommand using the specified parameters. 17659fe2c14SBruce EvansThe parameters are interpreted as the 17759fe2c14SBruce Evans.Tn ASCII 17859fe2c14SBruce Evansrepresentations of the decimal values 17959fe2c14SBruce Evansto place in the 18059fe2c14SBruce Evans.Ar mt_op 18159fe2c14SBruce Evansand 18259fe2c14SBruce Evans.Ar mt_count 18359fe2c14SBruce Evansfields of the structure used in the 184af20a13dSPhilippe Charnier.Xr ioctl 2 18507bfccd7SRuslan Ermilovcall. 18607bfccd7SRuslan ErmilovThe return value is the 18759fe2c14SBruce Evans.Ar count 18859fe2c14SBruce Evansparameter when the operation is successful. 18959fe2c14SBruce Evans.It Sy S 19059fe2c14SBruce EvansReturn the status of the open device, as 19159fe2c14SBruce Evansobtained with a 19259fe2c14SBruce Evans.Dv MTIOCGET 193af20a13dSPhilippe Charnier.Xr ioctl 2 19407bfccd7SRuslan Ermilovcall. 19507bfccd7SRuslan ErmilovIf the operation was successful, 19659fe2c14SBruce Evansan ``ack'' is sent with the size of the 19759fe2c14SBruce Evansstatus buffer, then the status buffer is 19859fe2c14SBruce Evanssent (in binary). 19959fe2c14SBruce Evans.El 20059fe2c14SBruce Evans.Pp 20159fe2c14SBruce EvansAny other command causes 20212873ebfSPhilippe Charnier.Nm 20359fe2c14SBruce Evansto exit. 20459fe2c14SBruce Evans.Sh DIAGNOSTICS 20559fe2c14SBruce EvansAll responses are of the form described above. 20659fe2c14SBruce Evans.Sh SEE ALSO 20759fe2c14SBruce Evans.Xr rcmd 3 , 20859fe2c14SBruce Evans.Xr mtio 4 , 20959fe2c14SBruce Evans.Xr rdump 8 , 21059fe2c14SBruce Evans.Xr rrestore 8 21159fe2c14SBruce Evans.Sh HISTORY 21259fe2c14SBruce EvansThe 21359fe2c14SBruce Evans.Nm 214490d5836SPhilippe Charnierutility appeared in 21559fe2c14SBruce Evans.Bx 4.2 . 21659a3c79dSRuslan Ermilov.Sh BUGS 21759a3c79dSRuslan ErmilovPeople should be discouraged from using this for a remote 21859a3c79dSRuslan Ermilovfile access protocol. 219