--- nono/host/netdriver_bpf.h 2026/04/29 17:04:54 1.1.1.5 +++ nono/host/netdriver_bpf.h 2026/04/29 17:05:11 1.1.1.6 @@ -4,25 +4,27 @@ // Licensed under nono-license.txt // +// +// ホストネットワークの BPF ドライバ +// + #pragma once #include "netdriver.h" +#include "hostnet.h" class NetDriverBPF : public NetDriver { using inherited = NetDriver; public: - // コンストラクタ - NetDriverBPF(EthernetDevice *parent_, int loglevel_, - const std::string& ifname_); - // デストラクタ + NetDriverBPF(HostDevice *hostdev_, const std::string& ifname_); ~NetDriverBPF() override; bool InitDriver() override; - bool SendPacket(const std::vector& data) override; - protected: - ssize_t RecvPacket() override; + int Read(NetPacket *p) override; + void Write(const void *buf, int buflen) override; + void MonitorUpdateMD(TextScreen&) override; private: @@ -33,6 +35,7 @@ class NetDriverBPF : public NetDriver // デバイスファイルパス std::string devpath {}; - std::unique_ptr bpfbuf {}; - int bpfbuflen {}; + std::vector bpfbuf {}; + uint8 *bpfptr {}; + ssize_t bpflen {}; };