--- nono/vm/virtio_net.h 2026/04/29 17:05:33 1.1.1.3 +++ nono/vm/virtio_net.h 2026/04/29 17:06:00 1.1.1.7 @@ -11,11 +11,10 @@ #pragma once #include "virtio_base.h" -#include "event.h" #include "hostnet.h" #include "message.h" -class VirtIONetDevice : public VirtIODevice +class VirtIONetDevice : public VirtIODevice, public IHWAddrFilter { using inherited = VirtIODevice; public: @@ -25,8 +24,10 @@ class VirtIONetDevice : public VirtIODev bool Create() override; bool Init() override; + int HWAddrFilter(const MacAddr& dstaddr) const override; + private: - DECLARE_MONITOR_CALLBACK(MonitorUpdate); + DECLARE_MONITOR_SCREEN(MonitorScreen); void QueueReadyChanged(VirtQueue *) override; void ProcessDesc(VirtIOReq&) override; @@ -34,17 +35,17 @@ class VirtIONetDevice : public VirtIODev const char *GetFeatureName(uint feature) const override; // 受信 - void HostRxCallback(); + void HostRxCallback(uint32); void RxMessage(MessageID, uint32); - void RxEvent(Event&); + void RxEvent(Event *); void Rx(VirtQueue *); - // MAC アドレス自体は動作中は不要なので表示用の文字列だけ持っておく。 + MacAddr macaddr {}; std::string macaddr_str {}; NetPacket rx_packet {}; std::unique_ptr hostnet /*{}*/; - Event event { this }; + Event *event {}; };