summaryrefslogtreecommitdiffhomepage
path: root/Private/NetworkKit/NetworkDevice.hpp
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-26 22:26:48 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-26 22:27:09 +0100
commiteba8b7ddd0a455d9e49f32dcae712c5612c0093c (patch)
tree749a3d34546d055507a920bce4ab10e8a9945719 /Private/NetworkKit/NetworkDevice.hpp
parentdd192787a70a973f2474720aea49af3f6ddabb7a (diff)
Kernel: Major repository refactor.
Rework the repo into Private and Public modules. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/NetworkKit/NetworkDevice.hpp')
-rw-r--r--Private/NetworkKit/NetworkDevice.hpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/Private/NetworkKit/NetworkDevice.hpp b/Private/NetworkKit/NetworkDevice.hpp
new file mode 100644
index 00000000..ce4361a9
--- /dev/null
+++ b/Private/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 DeviceInterface<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__