2021-10-06 21:25:43 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2022-12-05 17:58:23 +00:00
|
|
|
// SCSI Target Emulator PiSCSI
|
2021-10-06 21:25:43 +00:00
|
|
|
// for Raspberry Pi
|
|
|
|
//
|
2023-10-15 06:38:15 +00:00
|
|
|
// Copyright (C) 2021-2023 Uwe Seimet
|
2021-10-06 21:25:43 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-12-05 17:58:23 +00:00
|
|
|
#include "generated/piscsi_interface.pb.h"
|
|
|
|
#include "scsictl_display.h"
|
2021-10-06 21:25:43 +00:00
|
|
|
#include <string>
|
|
|
|
|
2022-12-05 17:58:23 +00:00
|
|
|
using namespace piscsi_interface;
|
2021-10-06 21:25:43 +00:00
|
|
|
|
2022-10-23 19:51:39 +00:00
|
|
|
struct sockaddr_in;
|
|
|
|
|
2022-12-05 17:58:23 +00:00
|
|
|
class ScsictlCommands
|
2021-10-06 21:25:43 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2022-12-05 17:58:23 +00:00
|
|
|
ScsictlCommands(PbCommand& command, const string& hostname, int port)
|
2022-10-23 19:51:39 +00:00
|
|
|
: command(command), hostname(hostname), port(port) {}
|
2022-12-05 17:58:23 +00:00
|
|
|
~ScsictlCommands() = default;
|
2021-10-06 21:25:43 +00:00
|
|
|
|
2023-10-15 06:38:15 +00:00
|
|
|
bool Execute(string_view, string_view, string_view, string_view, string_view);
|
2022-09-25 21:49:24 +00:00
|
|
|
|
2022-10-23 19:51:39 +00:00
|
|
|
bool CommandDevicesInfo();
|
2022-09-25 21:49:24 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2023-10-15 06:38:15 +00:00
|
|
|
bool CommandLogLevel(string_view);
|
|
|
|
bool CommandReserveIds(string_view);
|
|
|
|
bool CommandCreateImage(string_view);
|
|
|
|
bool CommandDeleteImage(string_view);
|
|
|
|
bool CommandRenameImage(string_view);
|
|
|
|
bool CommandCopyImage(string_view);
|
|
|
|
bool CommandDefaultImageFolder(string_view);
|
2022-10-23 19:51:39 +00:00
|
|
|
bool CommandDeviceInfo();
|
|
|
|
bool CommandDeviceTypesInfo();
|
|
|
|
bool CommandVersionInfo();
|
|
|
|
bool CommandServerInfo();
|
|
|
|
bool CommandDefaultImageFilesInfo();
|
2023-10-15 06:38:15 +00:00
|
|
|
bool CommandImageFileInfo(string_view);
|
2022-10-23 19:51:39 +00:00
|
|
|
bool CommandNetworkInterfacesInfo();
|
|
|
|
bool CommandLogLevelInfo();
|
|
|
|
bool CommandReservedIdsInfo();
|
|
|
|
bool CommandMappingInfo();
|
|
|
|
bool CommandOperationInfo();
|
|
|
|
bool SendCommand();
|
2023-10-15 06:38:15 +00:00
|
|
|
bool EvaluateParams(string_view, const string&, const string&);
|
2021-10-06 21:25:43 +00:00
|
|
|
|
2022-10-23 19:51:39 +00:00
|
|
|
PbCommand& command;
|
2021-10-06 21:25:43 +00:00
|
|
|
string hostname;
|
|
|
|
int port;
|
|
|
|
|
|
|
|
PbResult result;
|
|
|
|
|
2023-10-15 06:38:15 +00:00
|
|
|
[[no_unique_address]] const ScsictlDisplay scsictl_display;
|
2021-10-06 21:25:43 +00:00
|
|
|
};
|