Annotation of nono/vm/virtio_net.h, revision 1.1.1.6

1.1       root        1: //
                      2: // nono
                      3: // Copyright (C) 2024 nono project
                      4: // Licensed under nono-license.txt
                      5: //
                      6: 
                      7: //
                      8: // VirtIO ネットワークデバイス
                      9: //
                     10: 
                     11: #pragma once
                     12: 
                     13: #include "virtio_base.h"
                     14: #include "hostnet.h"
                     15: #include "message.h"
                     16: 
1.1.1.4   root       17: class VirtIONetDevice : public VirtIODevice, public IHWAddrFilter
1.1       root       18: {
                     19:        using inherited = VirtIODevice;
                     20:  public:
1.1.1.2   root       21:        explicit VirtIONetDevice(uint slot_);
1.1       root       22:        ~VirtIONetDevice() override;
                     23: 
                     24:        bool Create() override;
                     25:        bool Init() override;
                     26: 
1.1.1.4   root       27:        int HWAddrFilter(const MacAddr& dstaddr) const override;
                     28: 
1.1       root       29:  private:
                     30:        DECLARE_MONITOR_CALLBACK(MonitorUpdate);
                     31: 
1.1.1.3   root       32:        void QueueReadyChanged(VirtQueue *) override;
1.1.1.2   root       33:        void ProcessDesc(VirtIOReq&) override;
1.1       root       34: 
1.1.1.2   root       35:        const char *GetFeatureName(uint feature) const override;
1.1       root       36: 
                     37:        // 受信
1.1.1.5   root       38:        void HostRxCallback(uint32);
1.1       root       39:        void RxMessage(MessageID, uint32);
1.1.1.6 ! root       40:        void RxEvent(Event *);
1.1       root       41:        void Rx(VirtQueue *);
                     42: 
1.1.1.4   root       43:        MacAddr macaddr {};
1.1       root       44:        std::string macaddr_str {};
                     45: 
                     46:        NetPacket rx_packet {};
                     47: 
                     48:        std::unique_ptr<HostNetDevice> hostnet /*{}*/;
                     49: 
1.1.1.6 ! root       50:        Event *event {};
1.1       root       51: };

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.