--- nono/host/netdriver_tap.h 2026/04/29 17:04:48 1.1.1.3 +++ nono/host/netdriver_tap.h 2026/04/29 17:06:02 1.1.1.8 @@ -4,6 +4,10 @@ // Licensed under nono-license.txt // +// +// ホストネットワークの tap ドライバ +// + #pragma once #include "netdriver.h" @@ -12,16 +16,14 @@ class NetDriverTap : public NetDriver { using inherited = NetDriver; public: - // コンストラクタ - NetDriverTap(EthernetDevice *parent_, - std::mutex *mtx_, std::condition_variable *cv_, - const std::string& devpath_); - // デストラクタ + 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 MonitorScreenMD(TextScreen&, int y) override; private: #if defined(__linux__) @@ -31,11 +33,8 @@ class NetDriverTap : public NetDriver bool OpenNumbered(); bool OpenCloning(); - void CloseFd(); void Close(); - // Open*() のエラーメッセージ。 - // Open*() は複数呼ぶ場合もあったりするのでエラーは基本的にログレベル1 - // で表示しておき、最後に一つだけそれっぽいのを warn() で出力する。 - std::string errmsg {}; + // デバイスファイルパス + std::string devpath {}; };