summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/dinetwork.h
blob: bc1546e17c42b4ce1ff3601b448f30b051ec877b (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
#ifndef __DINETWORK_H__
#define __DINETWORK_H__

class 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() { return m_mac; }
	bool get_promisc() { return m_promisc; }
	int get_interface() { return m_intf; }

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

protected:
	bool m_promisc;
	char m_mac[6];
	float m_bandwidth;
	class netdev *m_dev;
	int m_intf;
};


// iterator
typedef device_interface_iterator<device_network_interface> network_interface_iterator;

#endif