summaryrefslogtreecommitdiffhomepage
path: root/Private/NetworkKit/NetworkDevice.hpp
blob: 31a304cf55ec1b8e74a971e4457ef81d366668c8 (plain)
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
48
49
50
51
52
53
/*
 *	========================================================
 *
 *	HCore
 * 	Copyright Mahrouss Logic, 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__