| 1 | .\" Copyright (c) 1983 The Regents of the University of California. |
| 2 | .\" All rights reserved. |
| 3 | .\" |
| 4 | .\" Redistribution and use in source and binary forms are permitted |
| 5 | .\" provided that the above copyright notice and this paragraph are |
| 6 | .\" duplicated in all such forms and that any documentation, |
| 7 | .\" advertising materials, and other materials related to such |
| 8 | .\" distribution and use acknowledge that the software was developed |
| 9 | .\" by the University of California, Berkeley. The name of the |
| 10 | .\" University may not be used to endorse or promote products derived |
| 11 | .\" from this software without specific prior written permission. |
| 12 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR |
| 13 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED |
| 14 | .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 15 | .\" |
| 16 | .\" @(#)rmt.8 6.3 (Berkeley) %G% |
| 17 | .\" |
| 18 | .TH RMT 8 "" |
| 19 | .UC 5 |
| 20 | .SH NAME |
| 21 | rmt \- remote magtape protocol module |
| 22 | .SH SYNOPSIS |
| 23 | .B /etc/rmt |
| 24 | .SH DESCRIPTION |
| 25 | .I Rmt |
| 26 | is a program used by the remote dump and restore programs |
| 27 | in manipulating a magnetic tape drive through an interprocess |
| 28 | communication connection. |
| 29 | .I Rmt |
| 30 | is normally started up with an |
| 31 | .IR rexec (3X) |
| 32 | or |
| 33 | .IR rcmd (3X) |
| 34 | call. |
| 35 | .PP |
| 36 | The |
| 37 | .I rmt |
| 38 | program accepts requests specific to the manipulation of |
| 39 | magnetic tapes, performs the commands, then responds with |
| 40 | a status indication. All responses are in ASCII and in |
| 41 | one of two forms. |
| 42 | Successful commands have responses of |
| 43 | .IP |
| 44 | .BI A number \en |
| 45 | .PP |
| 46 | where |
| 47 | .I number |
| 48 | is an ASCII representation of a decimal number. |
| 49 | Unsuccessful commands are responded to with |
| 50 | .PP |
| 51 | .IP |
| 52 | .BI E error-number \en error-message \en |
| 53 | .PP |
| 54 | where |
| 55 | .I error-number |
| 56 | is one of the possible error |
| 57 | numbers described in |
| 58 | .IR intro (2) |
| 59 | and |
| 60 | .I error-message |
| 61 | is the corresponding error string as printed |
| 62 | from a call to |
| 63 | .IR perror (3). |
| 64 | The protocol is comprised of the |
| 65 | following commands, which are sent as indicated - no spaces are supplied |
| 66 | between the command and its arguments, or between its arguments, and |
| 67 | .B \en |
| 68 | indicates that a newline should be supplied: |
| 69 | .TP 15 |
| 70 | .BI O device \en mode \en |
| 71 | Open the specified |
| 72 | .I device |
| 73 | using the indicated |
| 74 | .IR mode . |
| 75 | .I Device |
| 76 | is a full pathname and |
| 77 | .I mode |
| 78 | is an ASCII representation of a decimal |
| 79 | number suitable for passing to |
| 80 | .IR open (2). |
| 81 | If a device had already been opened, it is |
| 82 | closed before a new open is performed. |
| 83 | .TP 15 |
| 84 | .BI C device \en |
| 85 | Close the currently open device. The |
| 86 | .I device |
| 87 | specified is ignored. |
| 88 | .TP 15 |
| 89 | .BI L whence \en offset \en |
| 90 | Perform an |
| 91 | .IR lseek (2) |
| 92 | operation using the specified parameters. |
| 93 | The response value is that returned from the |
| 94 | .I lseek |
| 95 | call. |
| 96 | .TP 15 |
| 97 | .BI W count \en |
| 98 | Write data onto the open device. |
| 99 | .I Rmt |
| 100 | reads |
| 101 | .I count |
| 102 | bytes from the connection, aborting if |
| 103 | a premature end-of-file is encountered. |
| 104 | The response value is that returned from |
| 105 | the |
| 106 | .IR write (2) |
| 107 | call. |
| 108 | .TP 15 |
| 109 | .BI R count \en |
| 110 | Read |
| 111 | .I count |
| 112 | bytes of data from the open device. |
| 113 | If |
| 114 | .I count |
| 115 | exceeds the size of the data buffer (10 kilobytes), it is |
| 116 | truncated to the data buffer size. |
| 117 | .I Rmt |
| 118 | then performs the requested |
| 119 | .IR read (2) |
| 120 | and responds with |
| 121 | .BI A count-read \en |
| 122 | if the read was |
| 123 | successful; otherwise an error in the |
| 124 | standard format is returned. If the read |
| 125 | was successful, the data read is then sent. |
| 126 | .TP 15 |
| 127 | .BI I operation \en count \en |
| 128 | Perform a MTIOCOP |
| 129 | .IR ioctl (2) |
| 130 | command using the specified parameters. |
| 131 | The parameters are interpreted as the |
| 132 | ASCII representations of the decimal values |
| 133 | to place in the |
| 134 | .I mt_op |
| 135 | and |
| 136 | .I mt_count |
| 137 | fields of the structure used in the |
| 138 | .I ioctl |
| 139 | call. The return value is the |
| 140 | .I count |
| 141 | parameter when the operation is successful. |
| 142 | .TP 15 |
| 143 | .B S |
| 144 | Return the status of the open device, as |
| 145 | obtained with a MTIOCGET |
| 146 | .I ioctl |
| 147 | call. If the operation was successful, |
| 148 | an ``ack'' is sent with the size of the |
| 149 | status buffer, then the status buffer is |
| 150 | sent (in binary). |
| 151 | .PP |
| 152 | Any other command causes |
| 153 | .I rmt |
| 154 | to exit. |
| 155 | .SH DIAGNOSTICS |
| 156 | All responses are of the form described above. |
| 157 | .SH "SEE ALSO" |
| 158 | rcmd(3), rexec(3), mtio(4), rdump(8), rrestore(8) |
| 159 | .SH BUGS |
| 160 | People tempted to use this for a remote file access protocol |
| 161 | are discouraged. |