summaryrefslogtreecommitdiffhomepage
path: root/Private/NetworkKit/IP.hpp
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-05-08 12:32:41 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-05-08 12:32:41 +0200
commit09dd11ddf800898c00ecb04a65fb5cd10fb481fa (patch)
treeeda0b4e23d6a71da7de3a78f0bb76ec3201dd2f9 /Private/NetworkKit/IP.hpp
parentca83108fd138cc0398f900e6a6c0a53ad51aee31 (diff)
MHR-23: :boom: changes, reworked project tree.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/NetworkKit/IP.hpp')
-rw-r--r--Private/NetworkKit/IP.hpp83
1 files changed, 0 insertions, 83 deletions
diff --git a/Private/NetworkKit/IP.hpp b/Private/NetworkKit/IP.hpp
deleted file mode 100644
index f61bbdfd..00000000
--- a/Private/NetworkKit/IP.hpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -------------------------------------------
-
- Copyright Mahrouss Logic
-
-------------------------------------------- */
-
-#pragma once
-
-#include <KernelKit/DebugOutput.hpp>
-#include <NewKit/Defines.hpp>
-#include <NewKit/Ref.hpp>
-#include <NewKit/String.hpp>
-
-namespace NewOS
-{
- class RawIPAddress6;
- class RawIPAddress;
- class IPFactory;
-
- class RawIPAddress final
- {
- private:
- explicit RawIPAddress(char bytes[4]);
- ~RawIPAddress() = default;
-
- RawIPAddress& operator=(const RawIPAddress&) = delete;
- RawIPAddress(const RawIPAddress&) = default;
-
- public:
- char* Address();
-
- char& operator[](const Size& index);
-
- bool operator==(const RawIPAddress& ipv6);
- bool operator!=(const RawIPAddress& ipv6);
-
- private:
- char fAddr[4];
-
- friend IPFactory; // it is the one creating these addresses, thus this
- // is why the constructors are private.
- };
-
- /**
- * @brief IPv6 address.
- */
- class RawIPAddress6 final
- {
- private:
- explicit RawIPAddress6(char Bytes[8]);
- ~RawIPAddress6() = default;
-
- RawIPAddress6& operator=(const RawIPAddress6&) = delete;
- RawIPAddress6(const RawIPAddress6&) = default;
-
- public:
- char* Address()
- {
- return fAddr;
- }
-
- char& operator[](const Size& index);
-
- bool operator==(const RawIPAddress6& ipv6);
- bool operator!=(const RawIPAddress6& ipv6);
-
- private:
- char fAddr[8];
-
- friend IPFactory;
- };
-
- /**
- * @brief IP Creation helpers
- */
- class IPFactory final
- {
- public:
- static ErrorOr<StringView> ToStringView(Ref<RawIPAddress6> ipv6);
- static ErrorOr<StringView> ToStringView(Ref<RawIPAddress> ipv4);
- static bool IpCheckVersion4(const char* ip);
- };
-} // namespace NewOS