mirror of
https://github.com/akuker/RASCSI.git
synced 2024-06-10 17:29:35 +00:00
Compare commits
9 Commits
9418b8db6f
...
74a7a0f332
Author | SHA1 | Date | |
---|---|---|---|
|
74a7a0f332 | ||
|
adfe0e4823 | ||
|
e45117d4af | ||
|
e540da06c4 | ||
|
3223f2ad64 | ||
|
5c74ca177f | ||
|
6b867346bc | ||
|
806fa25609 | ||
|
a307a85d2f |
|
@ -29,8 +29,9 @@ using namespace std;
|
|||
using namespace piscsi_util;
|
||||
using namespace network_util;
|
||||
|
||||
const string CTapDriver::BRIDGE_NAME = "piscsi_bridge";
|
||||
// const string CTapDriver::BRIDGE_NAME = "piscsi_bridge";
|
||||
|
||||
#if 0
|
||||
static string br_setif(int br_socket_fd, const string& bridgename, const string& ifname, bool add) {
|
||||
#ifndef __linux__
|
||||
return "if_nametoindex: Linux is required";
|
||||
|
@ -47,6 +48,7 @@ static string br_setif(int br_socket_fd, const string& bridgename, const string&
|
|||
return "";
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
string ip_link(int fd, const char* ifname, bool up) {
|
||||
#ifndef __linux__
|
||||
|
@ -113,6 +115,7 @@ bool CTapDriver::Init(const param_map& const_params)
|
|||
return false;
|
||||
}
|
||||
|
||||
#if 0
|
||||
const int br_socket_fd = socket(AF_LOCAL, SOCK_STREAM, 0);
|
||||
if (br_socket_fd < 0) {
|
||||
LogErrno("Can't open bridge socket");
|
||||
|
@ -121,15 +124,17 @@ bool CTapDriver::Init(const param_map& const_params)
|
|||
close(ip_fd);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
auto cleanUp = [&] (const string& error) {
|
||||
LogErrno(error);
|
||||
close(m_hTAP);
|
||||
close(ip_fd);
|
||||
close(br_socket_fd);
|
||||
// close(br_socket_fd);
|
||||
return false;
|
||||
};
|
||||
|
||||
#if 0
|
||||
// Check if the bridge has already been created
|
||||
// TODO Find an alternative to accessing a file, there is most likely a system call/ioctl
|
||||
if (access(string("/sys/class/net/" + BRIDGE_NAME).c_str(), F_OK)) {
|
||||
|
@ -162,6 +167,7 @@ bool CTapDriver::Init(const param_map& const_params)
|
|||
else {
|
||||
spdlog::info(BRIDGE_NAME + " is already available");
|
||||
}
|
||||
#endif
|
||||
|
||||
spdlog::trace(">ip link set piscsi0 up");
|
||||
|
||||
|
@ -169,11 +175,13 @@ bool CTapDriver::Init(const param_map& const_params)
|
|||
return cleanUp(error);
|
||||
}
|
||||
|
||||
#if 0
|
||||
spdlog::trace(">brctl addif " + BRIDGE_NAME + " piscsi0");
|
||||
|
||||
if (const string error = br_setif(br_socket_fd, BRIDGE_NAME, "piscsi0", true); !error.empty()) {
|
||||
return cleanUp(error);
|
||||
}
|
||||
#endif
|
||||
|
||||
spdlog::trace("Getting the MAC address");
|
||||
|
||||
|
@ -186,7 +194,7 @@ bool CTapDriver::Init(const param_map& const_params)
|
|||
memcpy(m_MacAddr.data(), ifr.ifr_hwaddr.sa_data, m_MacAddr.size());
|
||||
|
||||
close(ip_fd);
|
||||
close(br_socket_fd);
|
||||
// close(br_socket_fd);
|
||||
|
||||
spdlog::info("Tap device " + string(ifr.ifr_name) + " created");
|
||||
|
||||
|
@ -197,6 +205,7 @@ bool CTapDriver::Init(const param_map& const_params)
|
|||
void CTapDriver::CleanUp() const
|
||||
{
|
||||
if (m_hTAP != -1) {
|
||||
#if 0
|
||||
if (const int br_socket_fd = socket(AF_LOCAL, SOCK_STREAM, 0); br_socket_fd < 0) {
|
||||
LogErrno("Can't open bridge socket");
|
||||
} else {
|
||||
|
@ -207,6 +216,7 @@ void CTapDriver::CleanUp() const
|
|||
}
|
||||
close(br_socket_fd);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Release TAP device
|
||||
close(m_hTAP);
|
||||
|
@ -243,6 +253,7 @@ pair<string, string> CTapDriver::ExtractAddressAndMask(const string& s)
|
|||
return { address, netmask };
|
||||
}
|
||||
|
||||
#if 0
|
||||
string CTapDriver::SetUpEth0(int socket_fd, const string& bridge_interface)
|
||||
{
|
||||
#ifdef __linux__
|
||||
|
@ -261,7 +272,9 @@ string CTapDriver::SetUpEth0(int socket_fd, const string& bridge_interface)
|
|||
|
||||
return "";
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
string CTapDriver::SetUpNonEth0(int socket_fd, int ip_fd, const string& s)
|
||||
{
|
||||
#ifdef __linux__
|
||||
|
@ -301,6 +314,7 @@ string CTapDriver::SetUpNonEth0(int socket_fd, int ip_fd, const string& s)
|
|||
|
||||
return "";
|
||||
}
|
||||
#endif
|
||||
|
||||
string CTapDriver::IpLink(bool enable) const
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@ using namespace std;
|
|||
|
||||
class CTapDriver
|
||||
{
|
||||
static const string BRIDGE_NAME;
|
||||
// static const string BRIDGE_NAME;
|
||||
|
||||
const inline static string DEFAULT_IP = "10.10.20.1/24"; //NOSONAR This hardcoded IP address is safe
|
||||
|
||||
|
@ -56,7 +56,7 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
static string SetUpEth0(int, const string&);
|
||||
//static string SetUpEth0(int, const string&);
|
||||
static string SetUpNonEth0(int, int, const string&);
|
||||
static pair<string, string> ExtractAddressAndMask(const string&);
|
||||
|
||||
|
|
|
@ -72,10 +72,12 @@ bool SCSIDaynaPort::Init(const param_map& params)
|
|||
return true;
|
||||
}
|
||||
|
||||
#if 0
|
||||
void SCSIDaynaPort::CleanUp()
|
||||
{
|
||||
tap.CleanUp();
|
||||
}
|
||||
#endif
|
||||
|
||||
vector<uint8_t> SCSIDaynaPort::InquiryInternal() const
|
||||
{
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
~SCSIDaynaPort() override = default;
|
||||
|
||||
bool Init(const param_map&) override;
|
||||
void CleanUp() override;
|
||||
// void CleanUp() override;
|
||||
|
||||
param_map GetDefaultParams() const override { return tap.GetDefaultParams(); }
|
||||
|
||||
|
|
|
@ -67,10 +67,12 @@ bool SCSIBR::Init(const param_map& params)
|
|||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
void SCSIBR::CleanUp()
|
||||
{
|
||||
tap.CleanUp();
|
||||
}
|
||||
#endif
|
||||
|
||||
vector<uint8_t> SCSIBR::InquiryInternal() const
|
||||
{
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
~SCSIBR() override = default;
|
||||
|
||||
bool Init(const param_map&) override;
|
||||
void CleanUp() override;
|
||||
// void CleanUp() override;
|
||||
|
||||
param_map GetDefaultParams() const override { return tap.GetDefaultParams(); }
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
#include <iomanip>
|
||||
|
||||
// The following should be updated for each release
|
||||
const int piscsi_major_version = 23; // Last two digits of year
|
||||
const int piscsi_minor_version = 11; // Month
|
||||
const int piscsi_major_version = 24; // Last two digits of year
|
||||
const int piscsi_minor_version = 5; // Month
|
||||
const int piscsi_patch_version = -1; // Patch number - increment for each update
|
||||
|
||||
using namespace std;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PiSCSI\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/PiSCSI/piscsi/issues\n"
|
||||
"POT-Creation-Date: 2024-02-18 10:00+0900\n"
|
||||
"POT-Creation-Date: 2024-04-30 16:53+0900\n"
|
||||
"PO-Revision-Date: 2024-02-18 09:29+0900\n"
|
||||
"Last-Translator: Daniel Markstedt <markstedt@gmail.com>\n"
|
||||
"Language: sv\n"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user