mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-29 16:49:55 +00:00
52c2aa474f
* Rebrand project to PiSCSI - rascsi ->piscsi - rasctl -> scsictl - rasdump -> scsidump - ras* -> piscsi* (rasutil -> piscsi_util, etc.) * Refined the formatting and wording of the app startup banner * Kept some references to rascsi and rasctl where backwards compatibility is concerned * Point to the new github repo URL Co-authored-by: nucleogenic <nr@nucleogenic.com> Co-authored-by: Uwe Seimet <Uwe.Seimet@seimet.de>
66 lines
1.6 KiB
C++
66 lines
1.6 KiB
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator PiSCSI
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2021-2022 Uwe Seimet
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "shared/protobuf_serializer.h"
|
|
#include "generated/piscsi_interface.pb.h"
|
|
#include "scsictl_display.h"
|
|
#include <string>
|
|
|
|
using namespace piscsi_interface;
|
|
|
|
struct sockaddr_in;
|
|
|
|
class ScsictlCommands
|
|
{
|
|
public:
|
|
|
|
ScsictlCommands(PbCommand& command, const string& hostname, int port)
|
|
: command(command), hostname(hostname), port(port) {}
|
|
~ScsictlCommands() = default;
|
|
|
|
bool Execute(const string&, const string&, const string&, const string&, const string&);
|
|
|
|
bool CommandDevicesInfo();
|
|
|
|
private:
|
|
|
|
bool CommandLogLevel(const string&);
|
|
bool CommandReserveIds(const string&);
|
|
bool CommandCreateImage(const string&);
|
|
bool CommandDeleteImage(const string&);
|
|
bool CommandRenameImage(const string&);
|
|
bool CommandCopyImage(const string&);
|
|
bool CommandDefaultImageFolder(const string&);
|
|
bool CommandDeviceInfo();
|
|
bool CommandDeviceTypesInfo();
|
|
bool CommandVersionInfo();
|
|
bool CommandServerInfo();
|
|
bool CommandDefaultImageFilesInfo();
|
|
bool CommandImageFileInfo(const string&);
|
|
bool CommandNetworkInterfacesInfo();
|
|
bool CommandLogLevelInfo();
|
|
bool CommandReservedIdsInfo();
|
|
bool CommandMappingInfo();
|
|
bool CommandOperationInfo();
|
|
bool SendCommand();
|
|
|
|
static bool ResolveHostName(const string&, sockaddr_in *);
|
|
|
|
ProtobufSerializer serializer;
|
|
PbCommand& command;
|
|
string hostname;
|
|
int port;
|
|
|
|
PbResult result;
|
|
|
|
ScsictlDisplay scsictl_display;
|
|
};
|