Commit Graph

226 Commits

Author SHA1 Message Date
Uwe Seimet
ff468aafa8 Added support for default value 2021-12-17 23:09:18 +01:00
Uwe Seimet
2da717a0a0 For completeness sake added permitted boolean values 2021-12-17 22:57:59 +01:00
Uwe Seimet
5d894d2e4f Display permitted values 2021-12-17 22:53:07 +01:00
Uwe Seimet
acc7d3cba5 Comment update 2021-12-17 20:37:03 +01:00
Uwe Seimet
f846242aea Code cleanup 2021-12-17 20:35:07 +01:00
Uwe Seimet
5a9592f102 Added convenience method 2021-12-17 20:24:33 +01:00
Uwe Seimet
9d258d9979 Added convenience method 2021-12-17 20:05:53 +01:00
Uwe Seimet
6c4103989b Comment update 2021-12-17 19:45:20 +01:00
Uwe Seimet
7d543451f0 Description updates 2021-12-17 19:27:50 +01:00
Uwe Seimet
f4b0e50e66 Comment update 2021-12-17 19:23:29 +01:00
Uwe Seimet
35dd3f6282 Type update 2021-12-17 19:21:12 +01:00
Uwe Seimet
4179110bac rasctl -s returns operation meta data 2021-12-17 19:13:42 +01:00
Uwe Seimet
eed83bb005 Completed meta data 2021-12-17 19:05:29 +01:00
Uwe Seimet
4a7528d9d3 Sort operations 2021-12-17 18:39:18 +01:00
Uwe Seimet
d3af9a142c Support for localized descriptions 2021-12-17 18:29:22 +01:00
Uwe Seimet
b4ff4f52ab Interface update 2021-12-17 17:53:11 +01:00
Uwe Seimet
e8d9e97fe5 Comment update 2021-12-17 16:59:49 +01:00
Uwe Seimet
22753b1547 Added messages 2021-12-17 16:57:39 +01:00
Uwe Seimet
0abbff200e
Support for RaSCSI shutdown, system shutdown or reboot (#515)
* Initial reboot support

* Moved code

* Fixed typo

* Shutdown update

* rasctl passes mode "rascsi"

* Use reboot() instead of syscall()

* Fixed typo

* Renaming

* Comment update

* Error message update

* Updated error handling

* Error message update

* Added comment
2021-12-10 16:03:01 -06:00
Uwe Seimet
5ec5a5f730
Link rasctl with -lpthread, updated cross-compiler default setting (#508)
* Link rasctl with -lpthread, as -lprotobuf may require it

* Made non-cross compiling the default setting

* Comment update

* No need for initial definition of CROSS_COMPILE

* Update
2021-12-06 11:45:44 -08:00
Uwe Seimet
b9f2d3d448
Logging update (#505) 2021-12-03 10:25:36 -08:00
Tony Kuker
5775cd1fb2 Update version for next development version 2021-11-28 18:27:56 -06:00
Uwe Seimet
1ad1242fad
Feature READ/WRITE LONG(10/16) (#481)
* Partial implementation of READ/WRITE LONG(10)

* Comment update

* Comment update

* Fixed typo

* Updated dispatcher table

* Added READ/LONG(16)

* Added 16 byte opcode

* Updated flushing

* Logging update

* Fixed typo

* Check start sector

* Renaming
2021-11-26 22:29:21 -06:00
Daniel Markstedt
4287145615
Create the manpage dir if it doesn't exist (#482) 2021-11-24 21:27:17 -06:00
Uwe Seimet
d0b3c54700
Updated manpath path to /usr/local/man/man1 (#474) 2021-11-18 19:41:33 -06:00
Uwe Seimet
f46453bbd2
Various DaynaPort related logging updates (#477)
* Removed duplicate CDB logging

* Updated logging

* Logging update

* Log level update

* Removed more duplicate logging

* Logging update

* Logging update

* Comment update

* Logging update

* Removed assertion

* Removed dummy method (doing nothing)

* Logging update
2021-11-18 19:24:36 -06:00
Daniel Markstedt
e1a4a963ed
Updates for running on Bullseye (#469)
* Conditionally use compiler flags needed for gcc 10+

* Cleanup

* Remove deprecated systemd options

* Better message
2021-11-14 19:34:24 +01:00
Pacjunk
a3645dfecc
Update disk.cpp - modesense10 command length (#464)
Modesense(10) has 2 length bytes, therefore the size adjustment must be 2, not 1!
2021-11-14 10:41:34 +01:00
Pacjunk
641e7df64c
Update scsihd.cpp Inquiry data length (#463)
The inquiry command only returns up to the revision information, so don't return more data than this. This gives a total of 36 bytes returned, which is the required minimum in the spec.
2021-11-14 10:41:10 +01:00
Uwe Seimet
41c3405b99
Code cleanup (#442)
* Fixed clang warnings

* Removed obsolete logging

* Collection usage cleanup

* Use sorted collections

* Updated sorting, added comments

* Improved locality of code

* Simplified vector initialization

* Fixed typo

* Collection usage cleanup

* Removed useless comments and assertions

* Removed useless comments, removed code inconsistencies

* Removed useless comments, renaming

* Replaced cast by a more explicit logical operation

* Removed target with hard-coded paths

* Include file cleanup

* Use more standard includes

* Fixed log level name

* Updated switch

* Fixed typo

* Improvoded locality of code, removed useless comments
2021-11-13 19:36:35 -06:00
Uwe Seimet
5abd403c78
IMAGE_FILE_INFO used hostname instead of filename (#457) 2021-11-12 20:28:40 -08:00
joshua stein
b54977daa6
DaynaPort: Remove scsi_cmd_read_6_t struct, it was not correct (#435)
The DWORDs in `cdb *` are not raw packed data from the wire, they
are manually copied in a previous function.  Trying to cast that
unpacked, aligned-on-byte-boundary data into the packed
scsi_cmd_read_6_t structure is not correct and does not put the
correct DWORDs into the proper fields.

Just do away with this struct and refer to the 2 cdb DWORDs (opcode
and length) manually.
2021-11-08 22:56:18 +01:00
joshua stein
f2b5d86fa0
DaynaPort: Ignore commands with a bogus control value (#433)
All traffic from the DaynaPort will have a control value of 0xc0 or
0x80, so any commands that don't should be ignored.

This helps the Mac Plus which will try to READ(6) from the DaynaPort
device if it's attached at boot and then try to interpret the
ethernet packet as hard drive data and crash.

See issue akuker#419
2021-11-08 22:42:54 +01:00
Uwe Seimet
f7ec0de834
Fix clang warnings (#423)
* Fixed clang compiler warnings

* Removed unused code

* Reset compiler
2021-11-07 21:30:21 +01:00
Uwe Seimet
817c1cde31
Fix issue 422 (#425)
* Use the effective filename when checking for duplicates

* Fixed check for asynchronous notifications

* Added additional filename check

* Applied fix also for attach
2021-11-07 21:18:58 +01:00
Tony Kuker
0f52e72915 Restore version to development version 2021-10-29 21:59:27 -05:00
Tony Kuker
21a8805d5d Updated copyrights and versions 2021-10-29 21:55:24 -05:00
Uwe Seimet
8f7e0fa880
Added missing CR/LF to rasctl error message output (#403) 2021-10-29 11:14:54 -07:00
Uwe Seimet
79c5da9432
Use long long instead of long for image size (#383) 2021-10-26 06:41:17 -07:00
Uwe Seimet
cc1783c1cd
Improved remote connection error handling (#376)
* Improved remote connection error handling

* Improved error handling by adding a magic string to each message

* Interface comment update

* Interface comment update

* Improve error messages

* Clients send the magic word to authenticate

Co-authored-by: Daniel Markstedt <markstedt@gmail.com>
2021-10-25 16:04:10 -07:00
Uwe Seimet
dcbee64750
Do not consider NONE operation an error (#369)
* Do not consider NONE operation an error

* Cleanup

* Code cleanup from other PR
2021-10-23 23:10:31 -07:00
Troy
40432c9de0
All Sense/ASC/ASCQ data is cleared properly (#367)
* All Sense/ASC/ASCQ data is cleared properly

* Forgot to guard the status clear for REQUEST SENSE

Co-authored-by: Troy <jokker@gmail.com>
2021-10-22 20:16:37 +02:00
Uwe Seimet
ac4abbbe73
Unlink created image file if fallocate() or copying failed (#363)
* Unlink created image file if fallocate() failed

* Also delete destination file after copying if something goes wrong
2021-10-21 18:17:58 -07:00
Uwe Seimet
dbaf5dcd30
rasctl output update (#357) 2021-10-20 19:55:48 -05:00
Daniel Markstedt
3856fd853b
Remove legacy device status logging (#355) 2021-10-20 18:21:08 -05:00
Uwe Seimet
00e8855e41
Fixed capacity calculation for small drives (#346) 2021-10-19 08:45:41 -07:00
Daniel Markstedt
b8722efe0b
Graceful shutdown of rascsi in the systemd service (#338) 2021-10-18 08:43:57 -07:00
Uwe Seimet
62a104f75d
Added SHUT_DOWN command, split rascsi.cpp (#334)
* Added TERMINATE command

* Help text update

* Created ras_util namespace

* Created protobuf_util namespace

* Extracted RascsiImage from rascsi for better modularity

* Fixed wrong filenames (class name differed)

* No need for response handler to be a singleton

* Class renaming

* Renaming

* Moved code

* Moved code

* Image folder handling optimizations

* Updated device factory handling

* DeviceFactory constructor should be private (singleton)

* Renamed TERMINATE to SHUT_DOWN

* Fixed capacity calculation for INQUIRY data

* ATTACH and DETACH return the resulting device list for convenience

* Interface comment update

* Moved code, check fd

* Use new command when returning result for ATTACH/DETACH

* Updated interface comments
2021-10-17 08:51:14 +02:00
Uwe Seimet
84f40c7fe9
Issue 319, detach all devices on SIGKILL/SIGTERM (#328)
* Removed size validation for MOs

* rasctl -D detaches all devices

* Detach all devices on Ctrl-C (KILL signal)

* Added comment

* Also detach all devices on SIGTERM
2021-10-14 13:25:10 -07:00
Uwe Seimet
c68c17e366
File size filtering update (#320)
* Updated logging

* Updated logging

* Updated logging

* Updated ID/LUN parsing

* Updated handling of max_id

* The -HD option sets type to SAHD

* Replaced is_sasi by device type

* Updated logging

* Logging update

* Improved LUN evaluation

* Check LUN against UnitMax

* Comment update

* LUN parsing update

* Logging update

* Logging update

* Updated ReportLuns

* Updated REPORT LUNS

* Cleanup

* Updated REPORT LUNS

* Updated Execute()

* Updated LUN handling

* Check for consecutive LUNs

* Added LUN check for remotely attached devices

* Remember LUN selected by IDENTIFY

* Evaluate LUN from IDENTIFY message

* Added comment

* Updated REPORT LUNS

* Initlize LUN

* Logging update

* Support 32 LUNs

* rasctl display update

* Updated LUN check for LUNSs > 7

* Simplified LUN validation

* Fixed wrong ID/LUN handling with values > 9

* Log level update

* Manpage update

* rascsi parser update

* Updated error handling

* Updated error handling

* Updated LUN setup validation

* Updated logging

* Improved validation of consecutive LUNs

* Renaming

* Detach all LUNs equal to or higher than the one specified

* File size is not required anymore to be a multiple of the block size

* Renaming
2021-10-13 09:41:21 -07:00