summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/dinetwork.h
blob: dd78dbcea15eb8c50b3d314ba23fe917dfa1c1db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// license:BSD-3-Clause
// copyright-holders:Carl, Miodrag Milanovic
#ifndef __DINETWORK_H__
#define __DINETWORK_H__

class osd_netdev;

class device_network_interface : public device_interface
{
public:
	device_network_interface(const machine_config &mconfig, device_t &device, float bandwidth);
	virtual ~device_network_interface();

	void set_interface(int id);
	void set_promisc(bool promisc);
	void set_mac(const char *mac);

	const char *get_mac() const { return m_mac; }
	bool get_promisc() const { return m_promisc; }
	int get_interface() const { return m_intf; }

	int send(UINT8 *buf, int len) const;
	virtual void recv_cb(UINT8 *buf, int len);

protected:
	bool m_promisc;
	char m_mac[6];
	float m_bandwidth;
	std::unique_ptr<osd_netdev> m_dev;
	int m_intf;
};


// iterator
typedef device_interface_iterator<device_network_interface> network_interface_iterator;

#endif