From 457aa9dc20c71c62940d063f7f63135facda9b19 Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Fri, 24 Nov 2023 20:10:15 +0100 Subject: [PATCH] Rename proto file --- 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/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 ++-- cpp/{piscsi_interface.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 | 2 +- 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 ++-- 36 files changed, 58 insertions(+), 58 deletions(-) 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/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..239ccf0d 100644 --- a/cpp/test/mocks.h +++ b/cpp/test/mocks.h @@ -93,7 +93,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;