mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-29 01:49:19 +00:00
41bdcd4aed
* Update logging * Remove duplicate code * Update unit tests * Clean up includes * Merge ProtobufSerializer into protobuf_util namespace * Precompile regex * Add const * Add Split() convenience method, update log level/ID parsing * Move log.h to legacy folder * Elimininate gotos * Fixes for gcc 13 * Update compiler flags * Update default folder handling * Use references instead of pointers * Move code for better encapsulation * Move code * Remove unused method argument * Move device logger * Remove redundant to_string * Rename for consistency * Update handling of protobuf pointers * Simplify protobuf usage * Memory handling update * Add hasher
63 lines
1.5 KiB
C++
63 lines
1.5 KiB
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator PiSCSI
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2021-2023 Uwe Seimet
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#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(string_view, string_view, string_view, string_view, string_view);
|
|
|
|
bool CommandDevicesInfo();
|
|
|
|
private:
|
|
|
|
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);
|
|
bool CommandDeviceInfo();
|
|
bool CommandDeviceTypesInfo();
|
|
bool CommandVersionInfo();
|
|
bool CommandServerInfo();
|
|
bool CommandDefaultImageFilesInfo();
|
|
bool CommandImageFileInfo(string_view);
|
|
bool CommandNetworkInterfacesInfo();
|
|
bool CommandLogLevelInfo();
|
|
bool CommandReservedIdsInfo();
|
|
bool CommandMappingInfo();
|
|
bool CommandOperationInfo();
|
|
bool SendCommand();
|
|
bool EvaluateParams(string_view, const string&, const string&);
|
|
|
|
PbCommand& command;
|
|
string hostname;
|
|
int port;
|
|
|
|
PbResult result;
|
|
|
|
[[no_unique_address]] const ScsictlDisplay scsictl_display;
|
|
};
|