xref: /freebsd/usr.sbin/rmt/rmt.8 (revision e97407b4f202c33851c3ee51572c0cde85095e83)
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:
6459fe2c14SBruce Evans.Bd -filled -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:
7559fe2c14SBruce Evans.Bd -filled -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
10359fe2c14SBruce EvansOpen the specified
10459fe2c14SBruce Evans.Ar device
10559fe2c14SBruce Evansusing the indicated
10659fe2c14SBruce Evans.Ar mode .
10759fe2c14SBruce Evans.Ar Device
10859fe2c14SBruce Evansis a full pathname and
10959fe2c14SBruce Evans.Ar mode
11059fe2c14SBruce Evansis an
11159fe2c14SBruce Evans.Tn ASCII
11259fe2c14SBruce Evansrepresentation of a decimal
11359fe2c14SBruce Evansnumber suitable for passing to
11459fe2c14SBruce Evans.Xr open 2 .
11559fe2c14SBruce EvansIf a device had already been opened, it is
11659fe2c14SBruce Evansclosed before a new open is performed.
11759fe2c14SBruce Evans.It Xo Sy C Ar device No \en
11859fe2c14SBruce Evans.Xc
11959fe2c14SBruce EvansClose the currently open device.  The
12059fe2c14SBruce Evans.Ar device
12159fe2c14SBruce Evansspecified is ignored.
12259fe2c14SBruce Evans.It Xo Sy L
12359fe2c14SBruce Evans.Ar whence No \en
12459fe2c14SBruce Evans.Ar offset No \en
12559fe2c14SBruce Evans.Xc
12659fe2c14SBruce Evans.Sm on
12759fe2c14SBruce EvansPerform an
12859fe2c14SBruce Evans.Xr lseek 2
12959fe2c14SBruce Evansoperation using the specified parameters.
13059fe2c14SBruce EvansThe response value is that returned from the
13159fe2c14SBruce Evans.Xr lseek
13259fe2c14SBruce Evanscall.
13359fe2c14SBruce Evans.Sm off
13459fe2c14SBruce Evans.It Sy W Ar count No \en
13559fe2c14SBruce Evans.Sm on
13659fe2c14SBruce EvansWrite data onto the open device.
13759fe2c14SBruce Evans.Nm Rmt
13859fe2c14SBruce Evansreads
13959fe2c14SBruce Evans.Ar count
14059fe2c14SBruce Evansbytes from the connection, aborting if
14159fe2c14SBruce Evansa premature end-of-file is encountered.
14259fe2c14SBruce EvansThe response value is that returned from
14359fe2c14SBruce Evansthe
14459fe2c14SBruce Evans.Xr write 2
14559fe2c14SBruce Evanscall.
14659fe2c14SBruce Evans.Sm off
14759fe2c14SBruce Evans.It Sy R Ar count No \en
14859fe2c14SBruce Evans.Sm on
14959fe2c14SBruce EvansRead
15059fe2c14SBruce Evans.Ar count
15159fe2c14SBruce Evansbytes of data from the open device.
15259fe2c14SBruce EvansIf
15359fe2c14SBruce Evans.Ar count
15459fe2c14SBruce Evansexceeds the size of the data buffer (10 kilobytes), it is
15559fe2c14SBruce Evanstruncated to the data buffer size.
15612873ebfSPhilippe Charnier.Nm Rmt
15759fe2c14SBruce Evansthen performs the requested
15859fe2c14SBruce Evans.Xr read 2
15959fe2c14SBruce Evansand responds with
16059fe2c14SBruce Evans.Sm off
16159fe2c14SBruce Evans.Sy A Ar count-read No \en
16259fe2c14SBruce Evans.Sm on
16359fe2c14SBruce Evansif the read was
16459fe2c14SBruce Evanssuccessful; otherwise an error in the
16559fe2c14SBruce Evansstandard format is returned.  If 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
18559fe2c14SBruce Evanscall.  The return value is the
18659fe2c14SBruce Evans.Ar count
18759fe2c14SBruce Evansparameter when the operation is successful.
18859fe2c14SBruce Evans.It Sy S
18959fe2c14SBruce EvansReturn the status of the open device, as
19059fe2c14SBruce Evansobtained with a
19159fe2c14SBruce Evans.Dv MTIOCGET
192af20a13dSPhilippe Charnier.Xr ioctl 2
19359fe2c14SBruce Evanscall.  If the operation was successful,
19459fe2c14SBruce Evansan ``ack'' is sent with the size of the
19559fe2c14SBruce Evansstatus buffer, then the status buffer is
19659fe2c14SBruce Evanssent (in binary).
19759fe2c14SBruce Evans.El
19859fe2c14SBruce Evans.Sm on
19959fe2c14SBruce Evans.Pp
20059fe2c14SBruce EvansAny other command causes
20112873ebfSPhilippe Charnier.Nm
20259fe2c14SBruce Evansto exit.
20359fe2c14SBruce Evans.Sh DIAGNOSTICS
20459fe2c14SBruce EvansAll responses are of the form described above.
20559fe2c14SBruce Evans.Sh SEE ALSO
20659fe2c14SBruce Evans.Xr rcmd 3 ,
20759fe2c14SBruce Evans.Xr rexec 3 ,
20859fe2c14SBruce Evans.Xr mtio 4 ,
20959fe2c14SBruce Evans.Xr rdump 8 ,
21059fe2c14SBruce Evans.Xr rrestore 8
21159fe2c14SBruce Evans.Sh BUGS
21259fe2c14SBruce EvansPeople should be discouraged from using this for a remote
21359fe2c14SBruce Evansfile access protocol.
21459fe2c14SBruce Evans.Sh HISTORY
21559fe2c14SBruce EvansThe
21659fe2c14SBruce Evans.Nm
21759fe2c14SBruce Evanscommand appeared in
21859fe2c14SBruce Evans.Bx 4.2 .
219