File:  [Isaki's NoNo m68k/m88k emulator] / nono / vm / virtio_net.h
Revision 1.1.1.7 (vendor branch): download - view: text, annotated - select for diffs
Wed Apr 29 17:06:00 2026 UTC (2 months, 3 weeks ago) by root
Branches: MAIN, Isaki
CVS tags: v027, HEAD
nono 1.7.0

//
// nono
// Copyright (C) 2024 nono project
// Licensed under nono-license.txt
//

//
// VirtIO ネットワークデバイス
//

#pragma once

#include "virtio_base.h"
#include "hostnet.h"
#include "message.h"

class VirtIONetDevice : public VirtIODevice, public IHWAddrFilter
{
	using inherited = VirtIODevice;
 public:
	explicit VirtIONetDevice(uint slot_);
	~VirtIONetDevice() override;

	bool Create() override;
	bool Init() override;

	int HWAddrFilter(const MacAddr& dstaddr) const override;

 private:
	DECLARE_MONITOR_SCREEN(MonitorScreen);

	void QueueReadyChanged(VirtQueue *) override;
	void ProcessDesc(VirtIOReq&) override;

	const char *GetFeatureName(uint feature) const override;

	// 受信
	void HostRxCallback(uint32);
	void RxMessage(MessageID, uint32);
	void RxEvent(Event *);
	void Rx(VirtQueue *);

	MacAddr macaddr {};
	std::string macaddr_str {};

	NetPacket rx_packet {};

	std::unique_ptr<HostNetDevice> hostnet /*{}*/;

	Event *event {};
};

unix.superglobalmegacorp.com

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