Skip to content

Commit

Permalink
code reduction
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertvanheusden committed Oct 26, 2024
1 parent f51fba1 commit 75034f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 40 deletions.
32 changes: 0 additions & 32 deletions iscsi-pdu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,6 @@ iscsi_pdu_login_request::iscsi_pdu_login_request(session *const ses): iscsi_pdu_
*login_req = { };
}

iscsi_pdu_login_request::~iscsi_pdu_login_request()
{
}

bool has_CRC32C(const std::string & value)
{
auto parts = split(value, ",");
Expand Down Expand Up @@ -400,10 +396,6 @@ iscsi_pdu_scsi_cmd::iscsi_pdu_scsi_cmd(session *const ses): iscsi_pdu_bhs(ses)
assert(offsetof(__cdb_pdu_req__, CmdSN ) == 24);
}

iscsi_pdu_scsi_cmd::~iscsi_pdu_scsi_cmd()
{
}

bool iscsi_pdu_scsi_cmd::set(const uint8_t *const in, const size_t n)
{
if (iscsi_pdu_bhs::set(in, n) == false) {
Expand Down Expand Up @@ -815,10 +807,6 @@ iscsi_pdu_nop_out::iscsi_pdu_nop_out(session *const ses): iscsi_pdu_bhs(ses)
assert(sizeof(*nop_out) == 48);
}

iscsi_pdu_nop_out::~iscsi_pdu_nop_out()
{
}

std::optional<iscsi_response_set> iscsi_pdu_nop_out::get_response(scsi *const sd)
{
DOLOG(logging::ll_debug, "iscsi_pdu_nop_out::get_response", ses->get_endpoint_name(), "invoked");
Expand All @@ -841,10 +829,6 @@ iscsi_pdu_nop_in::iscsi_pdu_nop_in(session *const ses): iscsi_pdu_bhs(ses)
assert(sizeof(*nop_in) == 48);
}

iscsi_pdu_nop_in::~iscsi_pdu_nop_in()
{
}

bool iscsi_pdu_nop_in::set(const iscsi_pdu_nop_out & reply_to)
{
auto ping_data = reply_to.get_data();
Expand Down Expand Up @@ -916,10 +900,6 @@ iscsi_pdu_text_request::iscsi_pdu_text_request(session *const ses): iscsi_pdu_bh
*text_req = { };
}

iscsi_pdu_text_request::~iscsi_pdu_text_request()
{
}

bool iscsi_pdu_text_request::set(const uint8_t *const in, const size_t n)
{
if (iscsi_pdu_bhs::set(in, n) == false)
Expand Down Expand Up @@ -1020,10 +1000,6 @@ iscsi_pdu_logout_request::iscsi_pdu_logout_request(session *const ses): iscsi_pd
*logout_req = { };
}

iscsi_pdu_logout_request::~iscsi_pdu_logout_request()
{
}

bool iscsi_pdu_logout_request::set(const uint8_t *const in, const size_t n)
{
if (iscsi_pdu_bhs::set(in, n) == false)
Expand Down Expand Up @@ -1091,10 +1067,6 @@ iscsi_pdu_taskman_request::iscsi_pdu_taskman_request(session *const ses): iscsi_
*taskman_req = { };
}

iscsi_pdu_taskman_request::~iscsi_pdu_taskman_request()
{
}

bool iscsi_pdu_taskman_request::set(const uint8_t *const in, const size_t n)
{
if (iscsi_pdu_bhs::set(in, n) == false)
Expand Down Expand Up @@ -1140,10 +1112,6 @@ iscsi_pdu_taskman_reply::iscsi_pdu_taskman_reply(session *const ses): iscsi_pdu_
assert(sizeof(*taskman_reply) == 48);
}

iscsi_pdu_taskman_reply::~iscsi_pdu_taskman_reply()
{
}

bool iscsi_pdu_taskman_reply::set(const iscsi_pdu_taskman_request & reply_to)
{
*taskman_reply = { };
Expand Down
16 changes: 8 additions & 8 deletions iscsi-pdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class iscsi_pdu_login_request : public iscsi_pdu_bhs // login request 0x03

public:
iscsi_pdu_login_request(session *const ses);
virtual ~iscsi_pdu_login_request();
virtual ~iscsi_pdu_login_request() { }

std::vector<blob_t> get() const override;

Expand Down Expand Up @@ -285,7 +285,7 @@ class iscsi_pdu_scsi_cmd : public iscsi_pdu_bhs // 0x01

public:
iscsi_pdu_scsi_cmd(session *const ses);
virtual ~iscsi_pdu_scsi_cmd();
virtual ~iscsi_pdu_scsi_cmd() { }

bool set(const uint8_t *const in, const size_t n) override;
std::vector<blob_t> get() const override;
Expand Down Expand Up @@ -482,7 +482,7 @@ class iscsi_pdu_nop_out : public iscsi_pdu_bhs // NOP-Out 0x00

public:
iscsi_pdu_nop_out(session *const ses);
virtual ~iscsi_pdu_nop_out();
virtual ~iscsi_pdu_nop_out() { }

const uint8_t *get_LUN() const { return nop_out->LUN; }
uint32_t get_Itasktag() const { return nop_out->Itasktag; }
Expand Down Expand Up @@ -520,7 +520,7 @@ class iscsi_pdu_nop_in : public iscsi_pdu_bhs // NOP-In

public:
iscsi_pdu_nop_in(session *const ses);
virtual ~iscsi_pdu_nop_in();
virtual ~iscsi_pdu_nop_in() { }

bool set(const iscsi_pdu_nop_out & reply_to);
std::vector<blob_t> get() const override;
Expand Down Expand Up @@ -600,7 +600,7 @@ class iscsi_pdu_text_request : public iscsi_pdu_bhs // text request 0x04

public:
iscsi_pdu_text_request(session *const ses);
virtual ~iscsi_pdu_text_request();
virtual ~iscsi_pdu_text_request() { }

bool set(const uint8_t *const in, const size_t n) override;
std::vector<blob_t> get() const override;
Expand Down Expand Up @@ -681,7 +681,7 @@ class iscsi_pdu_logout_request : public iscsi_pdu_bhs // logout request 0x06

public:
iscsi_pdu_logout_request(session *const ses);
virtual ~iscsi_pdu_logout_request();
virtual ~iscsi_pdu_logout_request() { }

bool set(const uint8_t *const in, const size_t n) override;
std::vector<blob_t> get() const override;
Expand Down Expand Up @@ -765,7 +765,7 @@ class iscsi_pdu_taskman_request : public iscsi_pdu_bhs // taskman request 0x02

public:
iscsi_pdu_taskman_request(session *const ses);
virtual ~iscsi_pdu_taskman_request();
virtual ~iscsi_pdu_taskman_request() { }

bool set(const uint8_t *const in, const size_t n) override;
std::vector<blob_t> get() const override;
Expand Down Expand Up @@ -807,7 +807,7 @@ class iscsi_pdu_taskman_reply : public iscsi_pdu_bhs

public:
iscsi_pdu_taskman_reply(session *const ses);
virtual ~iscsi_pdu_taskman_reply();
virtual ~iscsi_pdu_taskman_reply() { }

bool set(const iscsi_pdu_taskman_request & reply_to);
std::vector<blob_t> get() const override;
Expand Down

0 comments on commit 75034f7

Please sign in to comment.