--- nono/host/netdriver_tap.h 2026/04/29 17:04:34 1.1.1.2 +++ nono/host/netdriver_tap.h 2026/04/29 17:05:47 1.1.1.7 @@ -4,6 +4,10 @@ // Licensed under nono-license.txt // +// +// ホストネットワークの tap ドライバ +// + #pragma once #include "netdriver.h" @@ -12,16 +16,25 @@ class NetDriverTap : public NetDriver { using inherited = NetDriver; public: - // コンストラクタ - NetDriverTap(EthernetDevice *parent_, - std::mutex *mtx_, std::condition_variable *cv_); - // デストラクタ + NetDriverTap(HostDevice *hostdev_, const std::string& devpath_); ~NetDriverTap() override; - bool Init() override; - bool SendPacket(const std::vector& data) override; - void ThreadRun() override; + bool InitDriver(bool startup) override; + int Read(NetPacket *p) override; + void Write(const void *buf, int buflen) override; + + void MonitorUpdateMD(TextScreen&, int y) override; private: +#if defined(__linux__) + bool OpenLinux(); +#endif + bool OpenDirect(); + bool OpenNumbered(); + bool OpenCloning(); + void Close(); + + // デバイスファイルパス + std::string devpath {}; };