From 216b585ef3b74488303dfeff90192df8ccab4b9c Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Fri, 24 Nov 2023 20:30:27 +0100 Subject: [PATCH] Code removal --- cpp/Makefile | 8 +- cpp/devices/device.h | 4 +- cpp/devices/device_factory.h | 4 +- cpp/devices/disk_cache.h | 4 +- cpp/devices/host_services.cpp | 6 +- cpp/devices/host_services.h | 2 +- cpp/hal/bus.h | 4 +- cpp/hal/data_sample.cpp | 40 ------- cpp/hal/data_sample.h | 53 --------- cpp/hal/data_sample_raspberry.h | 101 ------------------ cpp/hal/gpiobus_raspberry.h | 11 +- cpp/hal/in_process_bus.h | 6 -- cpp/piscsi/command_context.cpp | 2 +- cpp/piscsi/command_context.h | 4 +- cpp/piscsi/command_dispatcher.cpp | 2 +- cpp/piscsi/command_dispatcher.h | 2 +- cpp/piscsi/piscsi_core.cpp | 2 +- cpp/piscsi/piscsi_core.h | 2 +- cpp/piscsi/piscsi_image.cpp | 2 +- cpp/piscsi/piscsi_image.h | 4 +- cpp/piscsi/piscsi_response.cpp | 2 +- cpp/piscsi/piscsi_response.h | 4 +- ...nterface.proto => scsi2pi_interface.proto} | 2 +- cpp/scsictl/scsictl_commands.cpp | 2 +- cpp/scsictl/scsictl_commands.h | 4 +- cpp/scsictl/scsictl_core.cpp | 2 +- cpp/scsictl/scsictl_display.cpp | 2 +- cpp/scsictl/scsictl_display.h | 4 +- cpp/scsictl/scsictl_parser.h | 4 +- cpp/scsiexec/scsiexec_phase_executor.h | 2 +- cpp/scsiexec/scsiexec_scsi_executor.cpp | 2 +- cpp/scsiexec/scsiexec_scsi_executor.h | 2 +- cpp/shared/protobuf_util.cpp | 2 +- cpp/shared/protobuf_util.h | 4 +- cpp/test/mocks.h | 3 +- cpp/test/piscsi_executor_test.cpp | 4 +- cpp/test/piscsi_image_test.cpp | 4 +- cpp/test/piscsi_response_test.cpp | 4 +- cpp/test/piscsi_service_test.cpp | 4 +- cpp/test/protobuf_util_test.cpp | 4 +- cpp/test/scsictl_commands_test.cpp | 4 +- cpp/test/test_shared.h | 4 +- 42 files changed, 62 insertions(+), 270 deletions(-) delete mode 100644 cpp/hal/data_sample.cpp delete mode 100644 cpp/hal/data_sample.h delete mode 100644 cpp/hal/data_sample_raspberry.h rename cpp/{piscsi_interface.proto => scsi2pi_interface.proto} (99%) diff --git a/cpp/Makefile b/cpp/Makefile index 3f3c925c..5f719d89 100644 --- a/cpp/Makefile +++ b/cpp/Makefile @@ -70,9 +70,9 @@ ifeq ($(CONNECT_TYPE), FULLSPEC) BIN_ALL += $(BINDIR)/$(SCSIEXEC) endif -SRC_PROTOC = piscsi_interface.proto +SRC_PROTOC = scsi2pi_interface.proto -SRC_GENERATED = $(GENERATED_DIR)/piscsi_interface.pb.cpp +SRC_GENERATED = $(GENERATED_DIR)/scsi2pi_interface.pb.cpp SRC_PROTOBUF = \ shared/protobuf_util.cpp @@ -158,7 +158,7 @@ $(OBJDIR)/%.o: %.cpp | $(OBJDIR) $(SRC_GENERATED) : $(SRC_PROTOC) mkdir -p $(GENERATED_DIR) protoc --cpp_out=$(GENERATED_DIR) $(SRC_PROTOC) - mv $(GENERATED_DIR)/piscsi_interface.pb.cc $@ + mv $(GENERATED_DIR)/scsi2pi_interface.pb.cc $@ $(OBJ_GENERATED) : $(SRC_GENERATED) | $(OBJDIR) $(CXX) $(CXXFLAGS) -c $< -o $@ @@ -187,7 +187,7 @@ coverage: test lcov: CXXFLAGS += --coverage lcov: test - lcov -q -c -d . --include '*/cpp/*' -o $(COVERAGE_FILE) --exclude '*/test/*' --exclude '*/interfaces/*' --exclude '*/piscsi_interface.pb*' + lcov -q -c -d . --include '*/cpp/*' -o $(COVERAGE_FILE) --exclude '*/test/*' --exclude '*/interfaces/*' --exclude '*/scsi2pi_interface.pb*' genhtml -q -o $(COVERAGE_DIR) --legend $(COVERAGE_FILE) docs: $(DOC_DIR)/piscsi_man_page.txt $(DOC_DIR)/scsictl_man_page.txt $(DOC_DIR)/scsidump_man_page.txt diff --git a/cpp/devices/device.h b/cpp/devices/device.h index edff1d13..103dbdea 100644 --- a/cpp/devices/device.h +++ b/cpp/devices/device.h @@ -9,13 +9,13 @@ #pragma once -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include "shared/piscsi_util.h" #include #include using namespace std; -using namespace piscsi_interface; +using namespace scsi2pi_interface; // A combination of device ID and LUN using id_set = pair; diff --git a/cpp/devices/device_factory.h b/cpp/devices/device_factory.h index 253a56ae..7df4c1cb 100644 --- a/cpp/devices/device_factory.h +++ b/cpp/devices/device_factory.h @@ -13,11 +13,11 @@ #include #include -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include "shared/piscsi_util.h" using namespace std; -using namespace piscsi_interface; +using namespace scsi2pi_interface; class PrimaryDevice; diff --git a/cpp/devices/disk_cache.h b/cpp/devices/disk_cache.h index ec486edd..a4adc957 100644 --- a/cpp/devices/disk_cache.h +++ b/cpp/devices/disk_cache.h @@ -15,14 +15,14 @@ #pragma once -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include #include #include #include using namespace std; -using namespace piscsi_interface; +using namespace scsi2pi_interface; class DiskCache { diff --git a/cpp/devices/host_services.cpp b/cpp/devices/host_services.cpp index 0c440db6..ef34ee21 100644 --- a/cpp/devices/host_services.cpp +++ b/cpp/devices/host_services.cpp @@ -75,7 +75,7 @@ // | 9 | Control | // +============================================================================== // -// The piscsi commands that can be executed are defined in the piscsi_interface.proto file. +// The piscsi commands that can be executed are defined in the scsi2pi_interface.proto file. // The BIN, JSON and TEXT flags control the input and output format of the protobuf data. // Exactly one of them must be set. Input and output format do not have to be identical. // ReceiveOperationResults returns the result of the last operation executed. @@ -86,7 +86,7 @@ #include "controllers/scsi_controller.h" #include "scsi_command_util.h" #include "host_services.h" -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include #include #include @@ -95,7 +95,7 @@ using namespace std::chrono; using namespace google::protobuf; using namespace google::protobuf::util; -using namespace piscsi_interface; +using namespace scsi2pi_interface; using namespace scsi_defs; using namespace scsi_command_util; using namespace protobuf_util; diff --git a/cpp/devices/host_services.h b/cpp/devices/host_services.h index 1e166959..d44e5ab2 100644 --- a/cpp/devices/host_services.h +++ b/cpp/devices/host_services.h @@ -21,7 +21,7 @@ #include using namespace std; -using namespace piscsi_interface; +using namespace scsi2pi_interface; class HostServices: public ModePageDevice { diff --git a/cpp/hal/bus.h b/cpp/hal/bus.h index 6c264e8d..fd20112a 100644 --- a/cpp/hal/bus.h +++ b/cpp/hal/bus.h @@ -10,8 +10,8 @@ #pragma once -#include "hal/data_sample.h" #include "hal/pin_control.h" +#include "shared/scsi.h" #include "shared/config.h" #include "shared/scsi.h" #include @@ -22,6 +22,7 @@ #include using namespace std; +using namespace scsi_defs; // SCSI Bus timings taken from https://www.staff.uni-mainz.de/tacke/scsi/SCSI2-05.html const static int SCSI_DELAY_ARBITRATION_DELAY_NS = 2400; @@ -73,7 +74,6 @@ class BUS : public PinControl static string GetPhaseName(phase_t); virtual uint32_t Acquire() = 0; - virtual unique_ptr GetSample(uint64_t = 0) = 0; virtual int CommandHandShake(vector &) = 0; virtual int ReceiveHandShake(uint8_t *, int) = 0; virtual int SendHandShake(uint8_t *, int, int = SEND_NO_DELAY) = 0; diff --git a/cpp/hal/data_sample.cpp b/cpp/hal/data_sample.cpp deleted file mode 100644 index 145f5c36..00000000 --- a/cpp/hal/data_sample.cpp +++ /dev/null @@ -1,40 +0,0 @@ -//--------------------------------------------------------------------------- -// -// SCSI Target Emulator PiSCSI -// for Raspberry Pi -// -// Copyright (C) 2022 akuker -// -// [ SCSI Bus Monitor ] -// -//--------------------------------------------------------------------------- - -#include "hal/bus.h" -#include "hal/data_sample.h" -#include - -using namespace std; - -string DataSample::GetPhaseStr() const -{ - return BUS::GetPhaseName(GetPhase()); -} - -phase_t DataSample::GetPhase() const -{ - // Selection Phase - if (GetSEL()) { - return phase_t::selection; - } - - // Bus busy phase - if (!GetBSY()) { - return phase_t::busfree; - } - - // Get target phase from bus signal line - uint32_t mci = GetMSG() ? 0x04 : 0x00; - mci |= GetCD() ? 0x02 : 0x00; - mci |= GetIO() ? 0x01 : 0x00; - return BUS::GetPhase(mci); -} diff --git a/cpp/hal/data_sample.h b/cpp/hal/data_sample.h deleted file mode 100644 index e291c0b1..00000000 --- a/cpp/hal/data_sample.h +++ /dev/null @@ -1,53 +0,0 @@ -//--------------------------------------------------------------------------- -// -// SCSI Target Emulator PiSCSI -// for Raspberry Pi -// -// Copyright (C) 2022 akuker -// -// [ Logical representation of a single data sample ] -// -//--------------------------------------------------------------------------- - -#pragma once - -#include "shared/scsi.h" -#include -#include - -using namespace scsi_defs; - -class DataSample -{ - public: - virtual bool GetBSY() const = 0; - virtual bool GetSEL() const = 0; - virtual bool GetATN() const = 0; - virtual bool GetACK() const = 0; - virtual bool GetRST() const = 0; - virtual bool GetMSG() const = 0; - virtual bool GetCD() const = 0; - virtual bool GetIO() const = 0; - virtual bool GetREQ() const = 0; - virtual uint8_t GetDAT() const = 0; - - virtual uint32_t GetRawCapture() const = 0; - - phase_t GetPhase() const; - virtual bool GetSignal(int pin) const = 0; - - uint64_t GetTimestamp() const - { - return timestamp; - } - - string GetPhaseStr() const; - - virtual ~DataSample() = default; - - explicit DataSample(uint64_t in_timestamp) : timestamp{in_timestamp} {} - DataSample() = default; - - private: - uint64_t timestamp = 0; -}; diff --git a/cpp/hal/data_sample_raspberry.h b/cpp/hal/data_sample_raspberry.h deleted file mode 100644 index 886e37c3..00000000 --- a/cpp/hal/data_sample_raspberry.h +++ /dev/null @@ -1,101 +0,0 @@ -//--------------------------------------------------------------------------- -// -// SCSI Target Emulator PiSCSI -// for Raspberry Pi -// -// Copyright (C) 2022 akuker -// -// [ Logical representation of a single data sample ] -// -//--------------------------------------------------------------------------- - -#pragma once - -#include "hal/data_sample.h" -#include "shared/scsi.h" - -#if defined CONNECT_TYPE_STANDARD -#include "hal/connection_type/connection_standard.h" -#elif defined CONNECT_TYPE_FULLSPEC -#include "hal/connection_type/connection_fullspec.h" -#elif defined CONNECT_TYPE_AIBOM -#include "hal/connection_type/connection_aibom.h" -#elif defined CONNECT_TYPE_GAMERNIUM -#include "hal/connection_type/connection_gamernium.h" -#else -#error Invalid connection type or none specified -#endif - -class DataSample_Raspberry final : public DataSample -{ - public: - bool GetSignal(int pin) const override - { - return (bool)((data >> pin) & 1); - }; - - bool GetBSY() const override - { - return GetSignal(PIN_BSY); - } - bool GetSEL() const override - { - return GetSignal(PIN_SEL); - } - bool GetATN() const override - { - return GetSignal(PIN_ATN); - } - bool GetACK() const override - { - return GetSignal(PIN_ACK); - } - bool GetRST() const override - { - return GetSignal(PIN_RST); - } - bool GetMSG() const override - { - return GetSignal(PIN_MSG); - } - bool GetCD() const override - { - return GetSignal(PIN_CD); - } - bool GetIO() const override - { - return GetSignal(PIN_IO); - } - bool GetREQ() const override - { - return GetSignal(PIN_REQ); - } - uint8_t GetDAT() const override - { - uint8_t ret_val = 0; - ret_val |= (data >> (PIN_DT0 - 0)) & 0x01; // NOSONAR: GCC 10 doesn't support shift operations on std::byte - ret_val |= (data >> (PIN_DT1 - 1)) & 0x02; // NOSONAR: GCC 10 doesn't support shift operations on std::byte - ret_val |= (data >> (PIN_DT2 - 2)) & 0x04; // NOSONAR: GCC 10 doesn't support shift operations on std::byte - ret_val |= (data >> (PIN_DT3 - 3)) & 0x08; // NOSONAR: GCC 10 doesn't support shift operations on std::byte - ret_val |= (data >> (PIN_DT4 - 4)) & 0x10; // NOSONAR: GCC 10 doesn't support shift operations on std::byte - ret_val |= (data >> (PIN_DT5 - 5)) & 0x20; // NOSONAR: GCC 10 doesn't support shift operations on std::byte - ret_val |= (data >> (PIN_DT6 - 6)) & 0x40; // NOSONAR: GCC 10 doesn't support shift operations on std::byte - ret_val |= (data >> (PIN_DT7 - 7)) & 0x80; // NOSONAR: GCC 10 doesn't support shift operations on std::byte - return ret_val; - } - - uint32_t GetRawCapture() const override - { - return data; - } - - DataSample_Raspberry(const uint32_t in_data, const uint64_t in_timestamp) : DataSample{in_timestamp}, data{in_data} - { - } - DataSample_Raspberry() = default; - - ~DataSample_Raspberry() override = default; - - private: - uint32_t data = 0; -}; diff --git a/cpp/hal/gpiobus_raspberry.h b/cpp/hal/gpiobus_raspberry.h index d5e9e7a6..91ed2010 100644 --- a/cpp/hal/gpiobus_raspberry.h +++ b/cpp/hal/gpiobus_raspberry.h @@ -11,9 +11,7 @@ #pragma once -#include "hal/data_sample_raspberry.h" #include "hal/gpiobus.h" -#include "shared/scsi.h" // Constant declarations (GIC) const static uint32_t ARM_GICD_BASE = 0xFF841000; @@ -38,7 +36,8 @@ const static int GICC_EOIR = 0x004; // Constant declarations (GIC IRQ) const static int GIC_IRQLOCAL0 = (16 + 14); -const static int GIC_GPIO_IRQ = (32 + 116); // GPIO3 +// GPIO3 +const static int GIC_GPIO_IRQ = (32 + 116); class GPIOBUS_Raspberry : public GPIOBUS { @@ -95,12 +94,6 @@ class GPIOBUS_Raspberry : public GPIOBUS } static uint32_t bcm_host_get_peripheral_address(); - unique_ptr GetSample(uint64_t timestamp) override - { - Acquire(); - return make_unique(signals, timestamp); - } - protected: // All bus signals diff --git a/cpp/hal/in_process_bus.h b/cpp/hal/in_process_bus.h index dfdb4357..4c061468 100644 --- a/cpp/hal/in_process_bus.h +++ b/cpp/hal/in_process_bus.h @@ -178,12 +178,6 @@ class InProcessBus: public GPIOBUS assert(false); } - unique_ptr GetSample(uint64_t) override - { - assert(false); - return nullptr; - } - mutex write_locker; atomic dat = 0; diff --git a/cpp/piscsi/command_context.cpp b/cpp/piscsi/command_context.cpp index ab4eeac4..21b4e063 100644 --- a/cpp/piscsi/command_context.cpp +++ b/cpp/piscsi/command_context.cpp @@ -14,7 +14,7 @@ #include using namespace std; -using namespace piscsi_interface; +using namespace scsi2pi_interface; using namespace protobuf_util; bool CommandContext::ReadCommand() diff --git a/cpp/piscsi/command_context.h b/cpp/piscsi/command_context.h index 25c4dbb8..d65507a3 100644 --- a/cpp/piscsi/command_context.h +++ b/cpp/piscsi/command_context.h @@ -10,11 +10,11 @@ #pragma once #include "localizer.h" -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include using namespace std; -using namespace piscsi_interface; +using namespace scsi2pi_interface; class CommandContext { diff --git a/cpp/piscsi/command_dispatcher.cpp b/cpp/piscsi/command_dispatcher.cpp index 5ccbf20d..52690f63 100644 --- a/cpp/piscsi/command_dispatcher.cpp +++ b/cpp/piscsi/command_dispatcher.cpp @@ -15,7 +15,7 @@ using namespace std; using namespace spdlog; -using namespace piscsi_interface; +using namespace scsi2pi_interface; using namespace piscsi_util; using namespace protobuf_util; diff --git a/cpp/piscsi/command_dispatcher.h b/cpp/piscsi/command_dispatcher.h index 435cd516..bc6901ca 100644 --- a/cpp/piscsi/command_dispatcher.h +++ b/cpp/piscsi/command_dispatcher.h @@ -13,7 +13,7 @@ #include "piscsi/piscsi_executor.h" #include "piscsi/piscsi_image.h" #include "piscsi/piscsi_response.h" -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" using namespace std; diff --git a/cpp/piscsi/piscsi_core.cpp b/cpp/piscsi/piscsi_core.cpp index 098b5025..016bf4d2 100644 --- a/cpp/piscsi/piscsi_core.cpp +++ b/cpp/piscsi/piscsi_core.cpp @@ -32,7 +32,7 @@ using namespace std; using namespace filesystem; using namespace spdlog; -using namespace piscsi_interface; +using namespace scsi2pi_interface; using namespace piscsi_util; using namespace protobuf_util; using namespace scsi_defs; diff --git a/cpp/piscsi/piscsi_core.h b/cpp/piscsi/piscsi_core.h index 45ad3e22..46a518bf 100644 --- a/cpp/piscsi/piscsi_core.h +++ b/cpp/piscsi/piscsi_core.h @@ -16,7 +16,7 @@ #include "piscsi/piscsi_image.h" #include "piscsi/piscsi_response.h" #include "piscsi/piscsi_executor.h" -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include "spdlog/sinks/stdout_color_sinks.h" #include #include diff --git a/cpp/piscsi/piscsi_image.cpp b/cpp/piscsi/piscsi_image.cpp index 8e569e04..735ad897 100644 --- a/cpp/piscsi/piscsi_image.cpp +++ b/cpp/piscsi/piscsi_image.cpp @@ -18,7 +18,7 @@ using namespace std; using namespace filesystem; -using namespace piscsi_interface; +using namespace scsi2pi_interface; using namespace protobuf_util; PiscsiImage::PiscsiImage() diff --git a/cpp/piscsi/piscsi_image.h b/cpp/piscsi/piscsi_image.h index f53e894d..a6b9738c 100644 --- a/cpp/piscsi/piscsi_image.h +++ b/cpp/piscsi/piscsi_image.h @@ -9,14 +9,14 @@ #pragma once -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include "command_context.h" #include #include using namespace std; using namespace filesystem; -using namespace piscsi_interface; +using namespace scsi2pi_interface; class PiscsiImage { diff --git a/cpp/piscsi/piscsi_response.cpp b/cpp/piscsi/piscsi_response.cpp index b9d38ae5..49e5f83a 100644 --- a/cpp/piscsi/piscsi_response.cpp +++ b/cpp/piscsi/piscsi_response.cpp @@ -19,7 +19,7 @@ using namespace std; using namespace filesystem; -using namespace piscsi_interface; +using namespace scsi2pi_interface; using namespace piscsi_util; using namespace network_util; using namespace protobuf_util; diff --git a/cpp/piscsi/piscsi_response.h b/cpp/piscsi/piscsi_response.h index 634b3688..41d99e56 100644 --- a/cpp/piscsi/piscsi_response.h +++ b/cpp/piscsi/piscsi_response.h @@ -12,14 +12,14 @@ #include "devices/device_factory.h" #include "devices/primary_device.h" #include "shared/piscsi_util.h" -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include #include #include using namespace std; using namespace filesystem; -using namespace piscsi_interface; +using namespace scsi2pi_interface; class PiscsiResponse { diff --git a/cpp/piscsi_interface.proto b/cpp/scsi2pi_interface.proto similarity index 99% rename from cpp/piscsi_interface.proto rename to cpp/scsi2pi_interface.proto index c34f4a8d..b68b05b9 100644 --- a/cpp/piscsi_interface.proto +++ b/cpp/scsi2pi_interface.proto @@ -18,7 +18,7 @@ syntax = "proto3"; -package piscsi_interface; +package scsi2pi_interface; // The available device types enum PbDeviceType { diff --git a/cpp/scsictl/scsictl_commands.cpp b/cpp/scsictl/scsictl_commands.cpp index e43669b3..b6d92ecd 100644 --- a/cpp/scsictl/scsictl_commands.cpp +++ b/cpp/scsictl/scsictl_commands.cpp @@ -26,7 +26,7 @@ using namespace std; using namespace google::protobuf; using namespace google::protobuf::util; -using namespace piscsi_interface; +using namespace scsi2pi_interface; using namespace network_util; using namespace piscsi_util; using namespace protobuf_util; diff --git a/cpp/scsictl/scsictl_commands.h b/cpp/scsictl/scsictl_commands.h index e6c3273f..cc74cfba 100644 --- a/cpp/scsictl/scsictl_commands.h +++ b/cpp/scsictl/scsictl_commands.h @@ -9,11 +9,11 @@ #pragma once -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include "scsictl_display.h" #include -using namespace piscsi_interface; +using namespace scsi2pi_interface; struct sockaddr_in; diff --git a/cpp/scsictl/scsictl_core.cpp b/cpp/scsictl/scsictl_core.cpp index 6ec02eeb..7e267fc0 100644 --- a/cpp/scsictl/scsictl_core.cpp +++ b/cpp/scsictl/scsictl_core.cpp @@ -25,7 +25,7 @@ #include using namespace std; -using namespace piscsi_interface; +using namespace scsi2pi_interface; using namespace piscsi_util; using namespace protobuf_util; diff --git a/cpp/scsictl/scsictl_display.cpp b/cpp/scsictl/scsictl_display.cpp index 7250910a..3dd41bfc 100644 --- a/cpp/scsictl/scsictl_display.cpp +++ b/cpp/scsictl/scsictl_display.cpp @@ -17,7 +17,7 @@ #include using namespace std; -using namespace piscsi_interface; +using namespace scsi2pi_interface; using namespace piscsi_util; using namespace protobuf_util; diff --git a/cpp/scsictl/scsictl_display.h b/cpp/scsictl/scsictl_display.h index 94ebcf93..9ab4d609 100644 --- a/cpp/scsictl/scsictl_display.h +++ b/cpp/scsictl/scsictl_display.h @@ -9,11 +9,11 @@ #pragma once -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include using namespace std; -using namespace piscsi_interface; +using namespace scsi2pi_interface; class ScsictlDisplay { diff --git a/cpp/scsictl/scsictl_parser.h b/cpp/scsictl/scsictl_parser.h index 681e294b..872195d7 100644 --- a/cpp/scsictl/scsictl_parser.h +++ b/cpp/scsictl/scsictl_parser.h @@ -9,10 +9,10 @@ #include #include -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" using namespace std; -using namespace piscsi_interface; +using namespace scsi2pi_interface; class ScsictlParser { diff --git a/cpp/scsiexec/scsiexec_phase_executor.h b/cpp/scsiexec/scsiexec_phase_executor.h index 666fb007..82e4dc23 100644 --- a/cpp/scsiexec/scsiexec_phase_executor.h +++ b/cpp/scsiexec/scsiexec_phase_executor.h @@ -10,7 +10,7 @@ #pragma once #include "hal/bus.h" -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include #include #include diff --git a/cpp/scsiexec/scsiexec_scsi_executor.cpp b/cpp/scsiexec/scsiexec_scsi_executor.cpp index 6ac94ebf..d7efa3e5 100644 --- a/cpp/scsiexec/scsiexec_scsi_executor.cpp +++ b/cpp/scsiexec/scsiexec_scsi_executor.cpp @@ -20,7 +20,7 @@ using namespace filesystem; using namespace google::protobuf; using namespace google::protobuf::util; using namespace scsi_defs; -using namespace piscsi_interface; +using namespace scsi2pi_interface; string ScsiExecutor::Execute(const string& filename, protobuf_format input_format, PbResult& result) { diff --git a/cpp/scsiexec/scsiexec_scsi_executor.h b/cpp/scsiexec/scsiexec_scsi_executor.h index fe5d6745..0d97e50f 100644 --- a/cpp/scsiexec/scsiexec_scsi_executor.h +++ b/cpp/scsiexec/scsiexec_scsi_executor.h @@ -15,7 +15,7 @@ #include using namespace std; -using namespace piscsi_interface; +using namespace scsi2pi_interface; class ScsiExecutor { diff --git a/cpp/shared/protobuf_util.cpp b/cpp/shared/protobuf_util.cpp index 31cbed1d..577e4667 100644 --- a/cpp/shared/protobuf_util.cpp +++ b/cpp/shared/protobuf_util.cpp @@ -18,7 +18,7 @@ using namespace std; using namespace piscsi_util; -using namespace piscsi_interface; +using namespace scsi2pi_interface; #define FPRT(fp, ...) fprintf(fp, __VA_ARGS__ ) diff --git a/cpp/shared/protobuf_util.h b/cpp/shared/protobuf_util.h index f07b0322..1befa71a 100644 --- a/cpp/shared/protobuf_util.h +++ b/cpp/shared/protobuf_util.h @@ -14,10 +14,10 @@ #include #include #include -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" using namespace std; -using namespace piscsi_interface; +using namespace scsi2pi_interface; namespace protobuf_util { diff --git a/cpp/test/mocks.h b/cpp/test/mocks.h index dfd140c6..e2f81c82 100644 --- a/cpp/test/mocks.h +++ b/cpp/test/mocks.h @@ -57,7 +57,6 @@ class MockBus : public BUS //NOSONAR Having many fields/methods cannot be avoide MOCK_METHOD(bool, GetSignal, (int), (const override)); MOCK_METHOD(void, SetSignal, (int, bool), (override)); MOCK_METHOD(bool, WaitForSelectEvent, (), (override)); - MOCK_METHOD(unique_ptr, GetSample, (uint64_t), (override)); MOCK_METHOD(void, PinConfig, (int, int), (override)); MOCK_METHOD(void, PullConfig, (int , int ), (override)); MOCK_METHOD(void, SetControl, (int , bool ), (override)); @@ -93,7 +92,7 @@ class MockAbstractController : public AbstractController //NOSONAR Having many f { friend class TestInquiry; - friend shared_ptr CreateDevice(piscsi_interface::PbDeviceType, AbstractController&, int); + friend shared_ptr CreateDevice(scsi2pi_interface::PbDeviceType, AbstractController&, int); FRIEND_TEST(AbstractControllerTest, AllocateCmd); FRIEND_TEST(AbstractControllerTest, Reset); diff --git a/cpp/test/piscsi_executor_test.cpp b/cpp/test/piscsi_executor_test.cpp index 0692eb81..ab7f2cca 100644 --- a/cpp/test/piscsi_executor_test.cpp +++ b/cpp/test/piscsi_executor_test.cpp @@ -12,14 +12,14 @@ #include "shared/piscsi_exceptions.h" #include "controllers/controller_manager.h" #include "devices/device_factory.h" -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include "piscsi/command_context.h" #include "piscsi/piscsi_response.h" #include "piscsi/piscsi_executor.h" #include using namespace filesystem; -using namespace piscsi_interface; +using namespace scsi2pi_interface; using namespace protobuf_util; TEST(PiscsiExecutorTest, ProcessDeviceCmd) diff --git a/cpp/test/piscsi_image_test.cpp b/cpp/test/piscsi_image_test.cpp index aa5bbdab..89ee0159 100644 --- a/cpp/test/piscsi_image_test.cpp +++ b/cpp/test/piscsi_image_test.cpp @@ -9,10 +9,10 @@ #include "mocks.h" #include "shared/protobuf_util.h" -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include "piscsi/piscsi_image.h" -using namespace piscsi_interface; +using namespace scsi2pi_interface; using namespace protobuf_util; TEST(PiscsiImageTest, SetGetDepth) diff --git a/cpp/test/piscsi_response_test.cpp b/cpp/test/piscsi_response_test.cpp index 9b5e0b44..ae2b6619 100644 --- a/cpp/test/piscsi_response_test.cpp +++ b/cpp/test/piscsi_response_test.cpp @@ -12,11 +12,11 @@ #include "shared/protobuf_util.h" #include "controllers/controller_manager.h" #include "devices/device_factory.h" -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include "piscsi/piscsi_response.h" #include -using namespace piscsi_interface; +using namespace scsi2pi_interface; using namespace spdlog; using namespace protobuf_util; diff --git a/cpp/test/piscsi_service_test.cpp b/cpp/test/piscsi_service_test.cpp index 80a1c8c6..2a18db7f 100644 --- a/cpp/test/piscsi_service_test.cpp +++ b/cpp/test/piscsi_service_test.cpp @@ -11,7 +11,7 @@ #include -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include "shared/protobuf_util.h" #include "shared/network_util.h" #include "shared/piscsi_exceptions.h" @@ -23,7 +23,7 @@ #include #include -using namespace piscsi_interface; +using namespace scsi2pi_interface; using namespace protobuf_util; using namespace network_util; diff --git a/cpp/test/protobuf_util_test.cpp b/cpp/test/protobuf_util_test.cpp index 86d41022..5bc21a53 100644 --- a/cpp/test/protobuf_util_test.cpp +++ b/cpp/test/protobuf_util_test.cpp @@ -10,10 +10,10 @@ #include "mocks.h" #include "shared/protobuf_util.h" #include "shared/piscsi_exceptions.h" -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include -using namespace piscsi_interface; +using namespace scsi2pi_interface; using namespace protobuf_util; void TestSpecialDevice(const string& name) diff --git a/cpp/test/scsictl_commands_test.cpp b/cpp/test/scsictl_commands_test.cpp index cf7d3466..94e3f8cb 100644 --- a/cpp/test/scsictl_commands_test.cpp +++ b/cpp/test/scsictl_commands_test.cpp @@ -13,11 +13,11 @@ #include "shared/protobuf_util.h" #include "shared/piscsi_exceptions.h" -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include "scsictl/scsictl_commands.h" using namespace testing; -using namespace piscsi_interface; +using namespace scsi2pi_interface; using namespace protobuf_util; TEST(ScsictlCommandsTest, Execute) diff --git a/cpp/test/test_shared.h b/cpp/test/test_shared.h index 8c87f294..332bf025 100644 --- a/cpp/test/test_shared.h +++ b/cpp/test/test_shared.h @@ -9,7 +9,7 @@ #pragma once -#include "generated/piscsi_interface.pb.h" +#include "generated/scsi2pi_interface.pb.h" #include "shared/scsi.h" #include #include @@ -18,7 +18,7 @@ using namespace std; using namespace filesystem; -using namespace piscsi_interface; +using namespace scsi2pi_interface; class PrimaryDevice; class MockAbstractController;