summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/interface/nethandler.h
blob: 3a9a47ebd8b94a78d23caf7c5c872ce90f54930c (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
38
39
40
41
42
43
44
45
46
47
// license:BSD-3-Clause
// copyright-holders:Vas Crabb
/***************************************************************************

    nethandler.h

    OSD interface to virtual networking handlers

***************************************************************************/
#ifndef MAME_OSD_INTERFACE_NETHANDLER_H
#define MAME_OSD_INTERFACE_NETHANDLER_H

#pragma once

#include "osdcomm.h"

#include <array>


namespace osd {

//**************************************************************************
//  TYPE DEFINITIONS
//**************************************************************************

// base for virtual network interface handler

class network_handler
{
public:
	network_handler() noexcept;

	virtual void recv_cb(u8 *buf, int len) = 0;

	std::array<u8, 6> const &get_mac() noexcept { return m_mac; }
	bool get_promisc() noexcept { return m_promisc; }

protected:
	~network_handler() = default;

	bool m_promisc;
	std::array<u8, 6> m_mac;
};

} // namespace osd

#endif // MAME_OSD_INTERFACE_NETHANDLER_H