From 5339d016c07bf717ee388f4feb73544087324af0 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 6 Jan 2024 09:14:11 +0100 Subject: git: port from mercurial repo. Signed-off-by: Amlal El Mahrouss --- NetworkKit/NetworkDevice.hpp | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 NetworkKit/NetworkDevice.hpp (limited to 'NetworkKit/NetworkDevice.hpp') diff --git a/NetworkKit/NetworkDevice.hpp b/NetworkKit/NetworkDevice.hpp new file mode 100644 index 00000000..fd6b1d2b --- /dev/null +++ b/NetworkKit/NetworkDevice.hpp @@ -0,0 +1,53 @@ +/* + * ======================================================== + * + * hCore + * Copyright XPX Corp, all rights reserved. + * + * ======================================================== + */ + +#ifndef _INC_NETWORKDEVICE_HPP__ +#define _INC_NETWORKDEVICE_HPP__ + +#include +#include + +namespace hCore +{ + struct NetworkDeviceCommand; + + class NetworkDevice final : public IDevice + { + public: + NetworkDevice(void(*out)(NetworkDeviceCommand), void(*in)(NetworkDeviceCommand), + void(*on_cleanup)(void) = nullptr); + + ~NetworkDevice() override; + + public: + NetworkDevice &operator=(const NetworkDevice &) = default; + NetworkDevice(const NetworkDevice &) = default; + + public: + const char* Name() const override { return ("NetworkDevice"); } + + private: + void(*fCleanup)(void); + + }; + + struct NetworkDeviceCommand + { + UInt32 Command; + UInt32 VLan; + UInt32 DmaLow; + UInt32 DmaHigh; + }; + + using TCPNetworkDevice = NetworkDevice; + using UDPNetworkDevice = NetworkDevice; + using PPPNetworkDevice = NetworkDevice; +} // namespace hCore + +#endif // !_INC_NETWORKDEVICE_HPP__ -- cgit v1.2.3