--- nono/host/netdriver_bpf.h 2026/04/29 17:04:30 1.1.1.2 +++ nono/host/netdriver_bpf.h 2026/04/29 17:04:54 1.1.1.5 @@ -1,6 +1,7 @@ // // nono -// Copyright (C) 2019 isaki@NetBSD.org +// Copyright (C) 2020 nono project +// Licensed under nono-license.txt // #pragma once @@ -9,22 +10,29 @@ class NetDriverBPF : public NetDriver { - typedef NetDriver inherited; + using inherited = NetDriver; public: // コンストラクタ - NetDriverBPF(EthernetDevice *p, std::mutex *m, std::condition_variable *c); + NetDriverBPF(EthernetDevice *parent_, int loglevel_, + const std::string& ifname_); // デストラクタ - virtual ~NetDriverBPF(); + ~NetDriverBPF() override; - virtual bool Init(); - virtual bool SendPacket(const std::vector& data); - virtual void ThreadRun(); + bool InitDriver() override; + bool SendPacket(const std::vector& data) override; + + protected: + ssize_t RecvPacket() override; + void MonitorUpdateMD(TextScreen&) override; private: - virtual void Close(); + void Close(); + + std::string FindInterface() const; - std::string FindInterface(); + // デバイスファイルパス + std::string devpath {}; - std::unique_ptr bpfbuf {}; - int bpfbuflen = 0; + std::unique_ptr bpfbuf {}; + int bpfbuflen {}; };