--- nono/vm/virtio_net.h 2026/04/29 17:05:25 1.1 +++ nono/vm/virtio_net.h 2026/04/29 17:05:46 1.1.1.5 @@ -14,35 +14,34 @@ #include "event.h" #include "hostnet.h" #include "message.h" -#include "monitor.h" -class HostNetDevice; - -class VirtIONetDevice : public VirtIODevice +class VirtIONetDevice : public VirtIODevice, public IHWAddrFilter { using inherited = VirtIODevice; public: - VirtIONetDevice(int slot_); + explicit VirtIONetDevice(uint slot_); ~VirtIONetDevice() override; bool Create() override; bool Init() override; + int HWAddrFilter(const MacAddr& dstaddr) const override; + private: DECLARE_MONITOR_CALLBACK(MonitorUpdate); - void QueueReady() override; - void ProcessDesc(VirtQueue *) override; + void QueueReadyChanged(VirtQueue *) override; + void ProcessDesc(VirtIOReq&) override; - const char *GetFeatureName(int feature) const override; + const char *GetFeatureName(uint feature) const override; // 受信 - void HostRxCallback(); + void HostRxCallback(uint32); void RxMessage(MessageID, uint32); void RxEvent(Event&); void Rx(VirtQueue *); - // MAC アドレス自体は動作中は不要なので表示用の文字列だけ持っておく。 + MacAddr macaddr {}; std::string macaddr_str {}; NetPacket rx_packet {}; @@ -50,6 +49,4 @@ class VirtIONetDevice : public VirtIODev std::unique_ptr hostnet /*{}*/; Event event { this }; - - Monitor monitor { this }; };