1.\" Copyright (c) 1983, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)rmt.8 8.3 (Berkeley) 6/1/94 33.\" $FreeBSD$ 34.\" 35.Dd June 1, 1994 36.Dt RMT 8 37.Os 38.Sh NAME 39.Nm rmt 40.Nd remote magtape protocol module 41.Sh SYNOPSIS 42.Nm 43.Sh DESCRIPTION 44The 45.Nm 46utility is used by the remote dump and restore programs 47in manipulating a magnetic tape drive through an interprocess 48communication connection. 49It is normally started up with an 50.Xr rexec 3 51or 52.Xr rcmd 3 53call. 54.Pp 55The 56.Nm 57utility accepts requests specific to the manipulation of 58magnetic tapes, performs the commands, then responds with 59a status indication. 60All responses are in 61.Tn ASCII 62and in 63one of two forms. 64Successful commands have responses of: 65.Bd -ragged -offset indent 66.Sm off 67.Sy A Ar number No \en 68.Sm on 69.Ed 70.Pp 71.Ar Number 72is an 73.Tn ASCII 74representation of a decimal number. 75Unsuccessful commands are responded to with: 76.Bd -ragged -offset indent 77.Sm off 78.Xo Sy E Ar error-number 79.No \en Ar error-message 80.No \en 81.Xc 82.Sm on 83.Ed 84.Pp 85.Ar Error-number 86is one of the possible error 87numbers described in 88.Xr intro 2 89and 90.Ar error-message 91is the corresponding error string as printed 92from a call to 93.Xr perror 3 . 94The protocol is comprised of the 95following commands, which are sent as indicated - no spaces are supplied 96between the command and its arguments, or between its arguments, and 97.Ql \en 98indicates that a newline should be supplied: 99.Bl -tag -width Ds 100.Sm off 101.It Xo Sy \&O Ar device 102.No \en Ar mode No \en 103.Xc 104.Sm on 105Open the specified 106.Ar device 107using the indicated 108.Ar mode . 109.Ar Device 110is a full pathname and 111.Ar mode 112is an 113.Tn ASCII 114representation of a decimal 115number suitable for passing to 116.Xr open 2 . 117If a device had already been opened, it is 118closed before a new open is performed. 119.Sm off 120.It Xo Sy C Ar device No \en 121.Xc 122.Sm on 123Close the currently open device. 124The 125.Ar device 126specified is ignored. 127.Sm off 128.It Xo Sy L 129.Ar whence No \en 130.Ar offset No \en 131.Xc 132.Sm on 133Perform an 134.Xr lseek 2 135operation using the specified parameters. 136The response value is that returned from the 137.Xr lseek 2 138call. 139.Sm off 140.It Sy W Ar count No \en 141.Sm on 142Write data onto the open device. 143The 144.Nm 145utility reads 146.Ar count 147bytes from the connection, aborting if 148a premature end-of-file is encountered. 149The response value is that returned from 150the 151.Xr write 2 152call. 153.Sm off 154.It Sy R Ar count No \en 155.Sm on 156Read 157.Ar count 158bytes of data from the open device. 159If 160.Ar count 161exceeds the size of the data buffer (10 kilobytes), it is 162truncated to the data buffer size. 163The 164.Nm 165utility then performs the requested 166.Xr read 2 167and responds with 168.Sm off 169.Sy A Ar count-read No \en 170.Sm on 171if the read was 172successful; otherwise an error in the 173standard format is returned. 174If the read 175was successful, the data read is then sent. 176.Sm off 177.It Xo Sy I Ar operation 178.No \en Ar count No \en 179.Xc 180.Sm on 181Perform a 182.Dv MTIOCOP 183.Xr ioctl 2 184command using the specified parameters. 185The parameters are interpreted as the 186.Tn ASCII 187representations of the decimal values 188to place in the 189.Ar mt_op 190and 191.Ar mt_count 192fields of the structure used in the 193.Xr ioctl 2 194call. 195The return value is the 196.Ar count 197parameter when the operation is successful. 198.It Sy S 199Return the status of the open device, as 200obtained with a 201.Dv MTIOCGET 202.Xr ioctl 2 203call. 204If the operation was successful, 205an ``ack'' is sent with the size of the 206status buffer, then the status buffer is 207sent (in binary). 208.El 209.Pp 210Any other command causes 211.Nm 212to exit. 213.Sh DIAGNOSTICS 214All responses are of the form described above. 215.Sh SEE ALSO 216.Xr rcmd 3 , 217.Xr rexec 3 , 218.Xr mtio 4 , 219.Xr rdump 8 , 220.Xr rrestore 8 221.Sh BUGS 222People should be discouraged from using this for a remote 223file access protocol. 224.Sh HISTORY 225The 226.Nm 227utility appeared in 228.Bx 4.2 . 229