Skip to content

Commit

Permalink
Rename proto file
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Nov 24, 2023
1 parent 668cc96 commit 457aa9d
Show file tree
Hide file tree
Showing 36 changed files with 58 additions and 58 deletions.
8 changes: 4 additions & 4 deletions cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 $@
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cpp/devices/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

#pragma once

#include "generated/piscsi_interface.pb.h"
#include "generated/scsi2pi_interface.pb.h"
#include "shared/piscsi_util.h"
#include <unordered_map>
#include <string>

using namespace std;
using namespace piscsi_interface;
using namespace scsi2pi_interface;

// A combination of device ID and LUN
using id_set = pair<int, int>;
Expand Down
4 changes: 2 additions & 2 deletions cpp/devices/device_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

#include <string>
#include <unordered_map>
#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;

Expand Down
4 changes: 2 additions & 2 deletions cpp/devices/disk_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

#pragma once

#include "generated/piscsi_interface.pb.h"
#include "generated/scsi2pi_interface.pb.h"
#include <span>
#include <array>
#include <memory>
#include <string>

using namespace std;
using namespace piscsi_interface;
using namespace scsi2pi_interface;

class DiskCache
{
Expand Down
6 changes: 3 additions & 3 deletions cpp/devices/host_services.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 <google/protobuf/util/json_util.h>
#include <google/protobuf/text_format.h>
#include <algorithm>
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion cpp/devices/host_services.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <map>

using namespace std;
using namespace piscsi_interface;
using namespace scsi2pi_interface;

class HostServices: public ModePageDevice
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/piscsi/command_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <iostream>

using namespace std;
using namespace piscsi_interface;
using namespace scsi2pi_interface;
using namespace protobuf_util;

bool CommandContext::ReadCommand()
Expand Down
4 changes: 2 additions & 2 deletions cpp/piscsi/command_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#pragma once

#include "localizer.h"
#include "generated/piscsi_interface.pb.h"
#include "generated/scsi2pi_interface.pb.h"
#include <string>

using namespace std;
using namespace piscsi_interface;
using namespace scsi2pi_interface;

class CommandContext
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/piscsi/command_dispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion cpp/piscsi/command_dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion cpp/piscsi/piscsi_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion cpp/piscsi/piscsi_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <span>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion cpp/piscsi/piscsi_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

using namespace std;
using namespace filesystem;
using namespace piscsi_interface;
using namespace scsi2pi_interface;
using namespace protobuf_util;

PiscsiImage::PiscsiImage()
Expand Down
4 changes: 2 additions & 2 deletions cpp/piscsi/piscsi_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

#pragma once

#include "generated/piscsi_interface.pb.h"
#include "generated/scsi2pi_interface.pb.h"
#include "command_context.h"
#include <string>
#include <filesystem>

using namespace std;
using namespace filesystem;
using namespace piscsi_interface;
using namespace scsi2pi_interface;

class PiscsiImage
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/piscsi/piscsi_response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions cpp/piscsi/piscsi_response.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string>
#include <span>
#include <set>

using namespace std;
using namespace filesystem;
using namespace piscsi_interface;
using namespace scsi2pi_interface;

class PiscsiResponse
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/piscsi_interface.proto → cpp/scsi2pi_interface.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

syntax = "proto3";

package piscsi_interface;
package scsi2pi_interface;

// The available device types
enum PbDeviceType {
Expand Down
2 changes: 1 addition & 1 deletion cpp/scsictl/scsictl_commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions cpp/scsictl/scsictl_commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

#pragma once

#include "generated/piscsi_interface.pb.h"
#include "generated/scsi2pi_interface.pb.h"
#include "scsictl_display.h"
#include <string>

using namespace piscsi_interface;
using namespace scsi2pi_interface;

struct sockaddr_in;

Expand Down
2 changes: 1 addition & 1 deletion cpp/scsictl/scsictl_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <fstream>

using namespace std;
using namespace piscsi_interface;
using namespace scsi2pi_interface;
using namespace piscsi_util;
using namespace protobuf_util;

Expand Down
2 changes: 1 addition & 1 deletion cpp/scsictl/scsictl_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <iomanip>

using namespace std;
using namespace piscsi_interface;
using namespace scsi2pi_interface;
using namespace piscsi_util;
using namespace protobuf_util;

Expand Down
4 changes: 2 additions & 2 deletions cpp/scsictl/scsictl_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

#pragma once

#include "generated/piscsi_interface.pb.h"
#include "generated/scsi2pi_interface.pb.h"
#include <string>

using namespace std;
using namespace piscsi_interface;
using namespace scsi2pi_interface;

class ScsictlDisplay
{
Expand Down
4 changes: 2 additions & 2 deletions cpp/scsictl/scsictl_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

#include <string>
#include <unordered_map>
#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
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/scsiexec/scsiexec_phase_executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#pragma once

#include "hal/bus.h"
#include "generated/piscsi_interface.pb.h"
#include "generated/scsi2pi_interface.pb.h"
#include <ctime>
#include <stdexcept>
#include <span>
Expand Down
2 changes: 1 addition & 1 deletion cpp/scsiexec/scsiexec_scsi_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/scsiexec/scsiexec_scsi_executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <string>

using namespace std;
using namespace piscsi_interface;
using namespace scsi2pi_interface;

class ScsiExecutor
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/shared/protobuf_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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__ )

Expand Down
4 changes: 2 additions & 2 deletions cpp/shared/protobuf_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
#include <string>
#include <span>
#include <vector>
#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
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/mocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class MockAbstractController : public AbstractController //NOSONAR Having many f
{
friend class TestInquiry;

friend shared_ptr<PrimaryDevice> CreateDevice(piscsi_interface::PbDeviceType, AbstractController&, int);
friend shared_ptr<PrimaryDevice> CreateDevice(scsi2pi_interface::PbDeviceType, AbstractController&, int);

FRIEND_TEST(AbstractControllerTest, AllocateCmd);
FRIEND_TEST(AbstractControllerTest, Reset);
Expand Down
4 changes: 2 additions & 2 deletions cpp/test/piscsi_executor_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <filesystem>

using namespace filesystem;
using namespace piscsi_interface;
using namespace scsi2pi_interface;
using namespace protobuf_util;

TEST(PiscsiExecutorTest, ProcessDeviceCmd)
Expand Down
4 changes: 2 additions & 2 deletions cpp/test/piscsi_image_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading

0 comments on commit 457aa9d

Please sign in to comment.