RASCSI/doc/rasctl.1
Uwe Seimet 419dca3c4c
Added support for SCSI printer device (SCLP) (#670)
* Fixed buster compile-time issue

* Host services inherit from ModePageDevice

* Call base class

* Visibility update

* Updated includes

* Updated dispatcher

* Added TODOs

* Logging update

* Code cleanup

* Use namespace instead of class for ScsiDefs

* Renaming

* Cleanup

* Use dispatcher template in order to remove duplicate code

* Updated all dispatchers

* Clean up commands

* Removed duplicate code

* Removed duplicate code

* Updated template definition

* Fixed typo

* Fixed warning

* Code cleanup

* Device list must be static

* Cleanup

* Logging update

* Added comments

* Cleanup

* Base class update

* SCSIBR is not a subclass of Disk anymore, but of PrimaryDevice

* Updated includes

* Fixed compile-time issue on the Pi

* Header file cleanup

* Interface cleanup

* Removed wrong override

* include file cleanup

* Removed obsolete usage of streams

* Removed more stream usages

* Stream usage cleanup

* Include cleanup

* Renaming

* Include cleanup

* Interface update

* SCLP device skeleton

* Initial RELEASE/RESERVE UNIT

* Added full set of commands

* Extracted command phase code

* Stripped SCSI controller code

* Removed unused code

* Commented out code

* Initial naive implementation

* Added debug output

* Disable printing for now

* Updated file handling

* Updated DataOut()

* Added comment

* Updated assertion

* Comment update

* Updated assertion

* Code cleanup

* Reset bytes to transfer

* Reverted change

* Refactoring

* Moved assertion

* Updated ReceiveBytes()

* Removed override

* Added interface

* Code cleanup

* Updated TEST UNIT READY

* Added flag for byte-oriented transfer

* Updated TEST UNIT READY

* Length handling update

* Updated bytecount handling

* Fixed warning

* Added TODO

* Updated assertion

* Enabled priting

* Updated error handling

* Code cleanup

* Logging update

* First working version

* Use temporary file

* Logging update

* Handle parameters

* Updated format string

* Updated logging

* File handling update

* Code cleanup

* Fixed buffer size

* Updated file handling

* Manpage update

* Initial reservation handling

* Updated reservation handling

* Initial reservation testing

* Remember initiator ID

* Extract initiator ID

* Updated SCSI initiator ID handling

* Logging update

* Added reservation timeout

* Updated timeout handling

* Code cleanup

* Only pass initiator ID to *SCSI* controller

* Added comments

* Added comment

* Implemented STOP PRINT

* Comment update

* Comment update

* Comment update

* Added comment

* Comment update

* Removed useless comments

* Updated printer parameter handling

* Updated parameter handling

* Manpage update

* Manpage update

* Comment update

* Default printer product name update

* Renaming

* Updated logging

* Logging update

* Logging update

* Comment update

* Code cleanup

* Added printer shortcut

* Comment update

* Comment update

* Output formatting update

* Updated error handling

* Code cleanup

* More cleanup

* Revert "More cleanup"

This reverts commit 05708986ee.

* Output formatting update

* Output format update

* Sort parameters

* Comment update

* Improved parsing of parameters

* Manpage update

* Updated SCSI level

* Removed magic constants

* Removed magic constant

* Template update

* Template usage update

* Get rid of SASIDEV for printer

* Get rid of SASIDEV for host services

* Moved initiator_id field

* Moved field

* Moved field

* Added comment

* Error handling must use effective LUN

* Removed obsolete casts

* Removed unused method declarations

* Comment update

* Code cleanup

* More code cleanup

* Optimization

* Removed duplicate code

* Logging update

* Fixed warning

* Code cleanup

* Added TODOs

* TODO update

* Backwards compatibility update

* Comment update
2022-02-16 20:04:42 -06:00

180 lines
5.7 KiB
Groff

.TH rascsi 1
.SH NAME
rasctl \- Sends management commands to the rascsi process
.SH SYNOPSIS
.B rasctl
\fB\-e\fR |
\fB\-l\fR |
\fB\-m\fR |
\fB\-o\fR |
\fB\-s\fR |
\fB\-v\fR |
\fB\-D\fR |
\fB\-I\fR |
\fB\-L\fR |
\fB\-O\fR |
\fB\-P\fR |
\fB\-T\fR |
\fB\-V\fR |
\fB\-X\fR |
[\fB\-C\fR \fIFILENAME:FILESIZE\fR]
[\fB\-E\fR \fIFILENAME\fR]
[\fB\-F\fR \fIIMAGE_FOLDER\fR]
[\fB\-R\fR \fICURRENT_NAME:NEW_NAME\fR]
[\fB\-c\fR \fICMD\fR]
[\fB\-f\fR \fIFILE|PARAM\fR]
[\fB\-g\fR \fILOG_LEVEL\fR]
[\fB\-h\fR \fIHOST\fR]
[\fB\-i\fR \fIID\fR
[\fB\-n\fR \fINAME\fR]
[\fB\-p\fR \fIPORT\fR]
[\fB\-r\fR \fIRESERVED_IDS\fR]
[\fB\-t\fR \fITYPE\fR]
[\fB\-u\fR \fIUNIT\fR]
[\fB\-x\fR \fICURRENT_NAME:NEW_NAME\fR]
[\fB\-z\fR \fILOCALE\fR]
.SH DESCRIPTION
.B rasctl
Sends commands to the rascsi process to make configuration adjustments at runtime or to check the status of the devices.
Either the -i or -l option should be specified at one time. Not both.
You do NOT need root privileges to use rasctl.
Note: The command and type arguments are case insensitive. Only the first letter of the command/type is evaluated by the tool.
.SH OPTIONS
.TP
.BR \-C\fI " "\fIFILENAME:FILESIZE
Create an image file in the default image folder with the specified name and size in bytes.
.TP
.BR \-D\fI
Detach all devices.
.TP
.BR \-E\fI " " \fIFILENAME
Display information on an image file.
.TP
.BR \-F\fI " "\fIIMAGE_FOLDER
Set the default image folder.
.TP
.BR \-I\fI
Gets the list of reserved device IDs.
.TP
.BR \-L\fI " "\fILOG_LEVEL
Set the rascsi log level (trace, debug, info, warn, err, critical, off).
.TP
.BR \-h\fI " " \fIHOST
The rascsi host to connect to, default is 'localhost'.
.TP
.BR \-e\fI
List all images files in the default image folder.
.TP
.BR \-N\fI
Lists all available network interfaces provided that they are up.
.TP
.BR \-O\fI
Display the available rascsi server log levels and the current log level.
.TP
.BR \-P\fI
Prompt for the access token in case rascsi requires authentication.
.TP
.BR \-l\fI
List all of the devices that are currently being emulated by RaSCSI, as well as their current status.
.TP
.BR \-m\fI
List all file extensions recognized by RaSCSI and the device types they map to.
.TP
.BR \-o\fI
Display operation meta data information.
.TP
.BR \-R\fI " "\fICURRENT_NAME:NEW_NAME
Rename an image file in the default image folder.
.TP
.BR \-p\fI " " \fIPORT
The rascsi port to connect to, default is 6868.
.TP
.BR \-r\fI " " \fIRESERVED_IDS
Comma-separated list of IDs to reserve.
.TP
.BR \-s\fI
Display server-side settings like available images or supported device types.
.TP
.BR \-T\fI
Display all device types and their properties.
.TP
.BR \-v\fI " " \fI
Display the rascsi server version.
.TP
.BR \-V\fI " " \fI
Display the rasctl version.
.TP
.BR \-X\fI " " \fI
Shut down the rascsi process.
.TP
.BR \-d\fI " "\fIFILENAME
Delete an image file in the default image folder.
.TP
.BR \-x\fI " "\fICURRENT_NAME:NEW_NAME
Copy an image file in the default image folder.
.TP
.BR \-z\fI " "\fILOCALE
Overrides the default locale for client-facing error messages.
.TP
.BR \-i\fI " " \fIID
ID is the SCSI ID that you want to control. (0-7)
.TP
.BR \-c\fI " " \fICMD
Command is the operation being requested. Options are:
a(ttach): Attach disk
d(etach): Detach disk
i(nsert): Insert media (removable media devices only)
e(ject): Eject media (removable media devices only)
p(rotect): Write protect the medium (not for CD-ROMs, which are always read-only)
u(nprotect): Remove write protection from the medium (not for CD-ROMs, which are always read-only)
s(how): Display device information
.IP
eject, protect and unprotect are idempotent.
.TP
.BR \-b\fI " " \fIBLOCK_SIZE
The optional block size. For SCSI drives 512, 1024, 2048 or 4096 bytes, default size is 512 bytes. For SASI drives 256 or 1024 bytes, default is 256 bytes.
.TP
.BR \-f\fI " " \fIFILE|PARAM
Device-specific: Either a path to a disk image file, or a parameter for a non-disk device. See the rascsi(1) man page for permitted file types.
.TP
.BR \-t\fI " " \fITYPE
Specifies the device type. This type overrides the type derived from the file extension of the specified image. See the rascsi(1) man page for the available device types. For some types there are shortcuts (only the first letter is required):
hd: SCSI hard disk drive
rm: SCSI removable media drive
cd: CD-ROM
mo: Magneto-Optical disk
lp: SCSI printer
bridge: Bridge device (Only applicable to the Sharp X68000)
daynaport: DaynaPort network adapter
services: Host services device
.TP
.BR \-n\fI " " \fIVENDOR:PRODUCT:REVISION
The vendor, product and revision for the device, to be returned with the INQUIRY data. A complete set of name components must be provided. VENDOR may have up to 8, PRODUCT up to 16, REVISION up to 4 characters. Padding with blanks to the maxium length is automatically applied. Once set the name of a device cannot be changed.
.TP
.BR \-u\fI " " \fIUNIT
Unit number (0-31). This will default to 0. This option is only used when there are multiple SCSI devices on a shared SCSI controller. (This is not common)
.SH EXAMPLES
Show a listing of all of the SCSI devices and their current status.
rasctl -l
Example output:
+----+-----+------+-------------------------------------
| ID | LUN | TYPE | IMAGE FILE
+----+-----+------+-------------------------------------
| 0 | 1 | SCHD | /home/pi/harddisk.hda
+----+-----+------+-------------------------------------
Request the RaSCSI process to attach a disk (assumed) to SCSI ID 0 with the contents of the file system image "HDIIMAGE0.HDS".
rasctl -i 0 -f HDIIMAGE0.HDS
.SH SEE ALSO
rascsi(1), scsimon(1), rasdump(1), sasidump(1)
Full documentation is available at: <https://www.github.com/akuker/RASCSI/wiki/>