xref: /freebsd/usr.sbin/rmt/rmt.8 (revision 7c43148a974877188a930e4078a164f83da8e652)
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. 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.Dd June 1, 1994
29.Dt RMT 8
30.Os
31.Sh NAME
32.Nm rmt
33.Nd remote magtape protocol module
34.Sh SYNOPSIS
35.Nm
36.Sh DESCRIPTION
37The
38.Nm
39utility is used by the remote dump and restore programs
40in manipulating a magnetic tape drive through an interprocess
41communication connection.
42It is normally started up with an
43.Xr rcmd 3
44call.
45.Pp
46The
47.Nm
48utility accepts requests specific to the manipulation of
49magnetic tapes, performs the commands, then responds with
50a status indication.
51All responses are in
52.Tn ASCII
53and in
54one of two forms.
55Successful commands have responses of:
56.Bd -ragged -offset indent
57.Sm off
58.Sy A Ar number No \en
59.Sm on
60.Ed
61.Pp
62.Ar Number
63is an
64.Tn ASCII
65representation of a decimal number.
66Unsuccessful commands are responded to with:
67.Bd -ragged -offset indent
68.Sm off
69.Xo Sy E Ar error-number
70.No \en Ar error-message
71.No \en
72.Xc
73.Sm on
74.Ed
75.Pp
76.Ar Error-number
77is one of the possible error
78numbers described in
79.Xr intro 2
80and
81.Ar error-message
82is the corresponding error string as printed
83from a call to
84.Xr perror 3 .
85The protocol is comprised of the
86following commands, which are sent as indicated - no spaces are supplied
87between the command and its arguments, or between its arguments, and
88.Ql \en
89indicates that a newline should be supplied:
90.Bl -tag -width Ds
91.Sm off
92.It Xo Sy \&O Ar device
93.No \en Ar mode No \en
94.Xc
95.Sm on
96Open the specified
97.Ar device
98using the indicated
99.Ar mode .
100.Ar Device
101is a full pathname and
102.Ar mode
103is an
104.Tn ASCII
105representation of a decimal
106number suitable for passing to
107.Xr open 2 .
108If a device had already been opened, it is
109closed before a new open is performed.
110.Sm off
111.It Xo Sy C Ar device No \en
112.Xc
113.Sm on
114Close the currently open device.
115The
116.Ar device
117specified is ignored.
118.Sm off
119.It Xo Sy L
120.Ar whence No \en
121.Ar offset No \en
122.Xc
123.Sm on
124Perform an
125.Xr lseek 2
126operation using the specified parameters.
127The response value is that returned from the
128.Xr lseek 2
129call.
130.Sm off
131.It Sy W Ar count No \en
132.Sm on
133Write data onto the open device.
134The
135.Nm
136utility reads
137.Ar count
138bytes from the connection, aborting if
139a premature end-of-file is encountered.
140The response value is that returned from
141the
142.Xr write 2
143call.
144.Sm off
145.It Sy R Ar count No \en
146.Sm on
147Read
148.Ar count
149bytes of data from the open device.
150If
151.Ar count
152exceeds the size of the data buffer (10 kilobytes), it is
153truncated to the data buffer size.
154The
155.Nm
156utility then performs the requested
157.Xr read 2
158and responds with
159.Sm off
160.Sy A Ar count-read No \en
161.Sm on
162if the read was
163successful; otherwise an error in the
164standard format is returned.
165If the read
166was successful, the data read is then sent.
167.Sm off
168.It Xo Sy I Ar operation
169.No \en Ar count No \en
170.Xc
171.Sm on
172Perform a
173.Dv MTIOCOP
174.Xr ioctl 2
175command using the specified parameters.
176The parameters are interpreted as the
177.Tn ASCII
178representations of the decimal values
179to place in the
180.Ar mt_op
181and
182.Ar mt_count
183fields of the structure used in the
184.Xr ioctl 2
185call.
186The return value is the
187.Ar count
188parameter when the operation is successful.
189.It Sy S
190Return the status of the open device, as
191obtained with a
192.Dv MTIOCGET
193.Xr ioctl 2
194call.
195If the operation was successful,
196an ``ack'' is sent with the size of the
197status buffer, then the status buffer is
198sent (in binary).
199.El
200.Pp
201Any other command causes
202.Nm
203to exit.
204.Sh DIAGNOSTICS
205All responses are of the form described above.
206.Sh SEE ALSO
207.Xr rcmd 3 ,
208.Xr mtio 4 ,
209.Xr rdump 8 ,
210.Xr rrestore 8
211.Sh HISTORY
212The
213.Nm
214utility appeared in
215.Bx 4.2 .
216.Sh BUGS
217People should be discouraged from using this for a remote
218file access protocol.
219