--- nono/vm/virtio_net.h 2026/04/29 17:05:29 1.1.1.2 +++ nono/vm/virtio_net.h 2026/04/29 17:06:00 1.1.1.7 @@ -11,12 +11,10 @@ #pragma once #include "virtio_base.h" -#include "event.h" #include "hostnet.h" #include "message.h" -#include "monitor.h" -class VirtIONetDevice : public VirtIODevice +class VirtIONetDevice : public VirtIODevice, public IHWAddrFilter { using inherited = VirtIODevice; public: @@ -26,26 +24,28 @@ 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 QueueReady() override; + void QueueReadyChanged(VirtQueue *) override; void ProcessDesc(VirtIOReq&) override; 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 {}; };