mirror of
https://github.com/akuker/RASCSI.git
synced 2024-06-08 05:29:40 +00:00
1df7cdb1f3
* Use vector for INQUIRY data, Inquiry() is const, moved EVPD check
* Moved code
* Fixed warning
* Updated memcpy
* Set length
* Limit result vector size
* Limit result buffer size
* Inquiry() result buffer handling update
* Logging update
* Inquiry cleanup
* NEC drive can also use PrimaryDevice::Inquiry()
* NEC drive is never removable
* Comment update
* Bridge can also use PrimaryDevice::Inquiry()
* Removed unused method argument
* Comment update
* Updated comment
* Updated REQUEST SENSE buffer handling
* Fixed typo
* Fixed typo
* Re-added comment
* Updated additional length handling
* Check for INQUIRY command support first
* Added assertion
* Size handling update
* Renaming
* Renaming
* Removed obsolete casts
* Cleanup
* Moved error codes to scsi_defs namespace
* Fixed ReadDefectData10
* Comment update
* Updated buffer handling
* Data type update
* SendDiagnostic is now const
* Removed obsolete forward declaration
* removed unused enum
* Reduced method visibility
* Renaming
* GetSendDelay() can be const
* Made method const
* Made method const
* Added TODO
* Use iterator
* Made method const
* Revert "Made method const"
This reverts commit 38412b8ddd
.
* No need to sort all set/maps
* Do not sort all sets
* Removed more unnecessary sorting
* Cleaned up includes
* More include cleanups
* Updated REPORT LUNS
* LUNs must not be consecutive anymore
* Updated detaching of LUN
* Improvements for devices without LUN 0
* Assume LUN 0 is always present
* Enforce presence of LUN 0
* Updated error handling
62 lines
2.2 KiB
C++
62 lines
2.2 KiB
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator RaSCSI (*^..^*)
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2021 Uwe Seimet
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "devices/device_factory.h"
|
|
#include "rascsi_interface.pb.h"
|
|
#include <vector>
|
|
#include <string>
|
|
|
|
using namespace std;
|
|
using namespace rascsi_interface;
|
|
|
|
class DeviceFactory;
|
|
class RascsiImage;
|
|
class Device;
|
|
|
|
class RascsiResponse
|
|
{
|
|
public:
|
|
|
|
RascsiResponse(DeviceFactory *, const RascsiImage *);
|
|
~RascsiResponse() {};
|
|
|
|
bool GetImageFile(PbImageFile *, const string&);
|
|
PbImageFilesInfo *GetAvailableImages(PbResult&, const string&, const string&, int);
|
|
PbReservedIdsInfo *GetReservedIds(PbResult&, const unordered_set<int>&);
|
|
void GetDevices(PbServerInfo&, const vector<Device *>&);
|
|
void GetDevicesInfo(PbResult&, const PbCommand&, const vector<Device *>&, int);
|
|
PbDeviceTypesInfo *GetDeviceTypesInfo(PbResult&, const PbCommand&);
|
|
PbVersionInfo *GetVersionInfo(PbResult&);
|
|
PbServerInfo *GetServerInfo(PbResult&, const vector<Device *>&, const unordered_set<int>&, const string&,
|
|
const string&, const string&, int);
|
|
PbNetworkInterfacesInfo *GetNetworkInterfacesInfo(PbResult&);
|
|
PbMappingInfo *GetMappingInfo(PbResult&);
|
|
PbLogLevelInfo *GetLogLevelInfo(PbResult&, const string&);
|
|
PbOperationInfo *GetOperationInfo(PbResult&, int);
|
|
|
|
private:
|
|
|
|
DeviceFactory *device_factory;
|
|
const RascsiImage *rascsi_image;
|
|
|
|
vector<string> log_levels { "trace", "debug", "info", "warn", "err", "critical", "off" };
|
|
|
|
PbDeviceProperties *GetDeviceProperties(const Device *);
|
|
void GetDevice(const Device *, PbDevice *);
|
|
void GetAllDeviceTypeProperties(PbDeviceTypesInfo&);
|
|
void GetDeviceTypeProperties(PbDeviceTypesInfo&, PbDeviceType);
|
|
void GetAvailableImages(PbImageFilesInfo&, const string&, const string&, const string&, const string&, int);
|
|
void GetAvailableImages(PbResult& result, PbServerInfo&, const string&, const string&, int);
|
|
void CreateOperation(PbOperationInfo *, PbOperationMetaData *, const PbOperation&, const string&);
|
|
PbOperationParameter *AddOperationParameter(PbOperationMetaData *, const string&, const string&,
|
|
const string& = "", bool = false);
|
|
};
|