diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-06 09:14:11 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-06 09:14:11 +0100 |
| commit | 5339d016c07bf717ee388f4feb73544087324af0 (patch) | |
| tree | 94be6f67ed626091f24aee24ec3b3be03d01e4e7 /NetworkKit/NetworkDevice.hpp | |
git: port from mercurial repo.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'NetworkKit/NetworkDevice.hpp')
| -rw-r--r-- | NetworkKit/NetworkDevice.hpp | 53 |
1 files changed, 53 insertions, 0 deletions
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 <KernelKit/Device.hpp> +#include <NetworkKit/IP.hpp> + +namespace hCore +{ + struct NetworkDeviceCommand; + + class NetworkDevice final : public IDevice<NetworkDeviceCommand> + { + 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__ |
