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