summaryrefslogtreecommitdiffhomepage
path: root/src/kernel/NetworkKit/IP.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/NetworkKit/IP.h')
-rw-r--r--src/kernel/NetworkKit/IP.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/kernel/NetworkKit/IP.h b/src/kernel/NetworkKit/IP.h
index d195bbee..38afeb8e 100644
--- a/src/kernel/NetworkKit/IP.h
+++ b/src/kernel/NetworkKit/IP.h
@@ -18,12 +18,13 @@ class IPFactory;
class RawIPAddress final {
private:
explicit RawIPAddress(UInt8 bytes[4]);
+
+ public:
~RawIPAddress() = default;
- RawIPAddress& operator=(const RawIPAddress&) = delete;
+ RawIPAddress& operator=(const RawIPAddress&) = default;
RawIPAddress(const RawIPAddress&) = default;
- public:
UInt8* Address();
UInt8& operator[](const Size& index);
@@ -32,7 +33,7 @@ class RawIPAddress final {
BOOL operator!=(const RawIPAddress& ipv6);
private:
- UInt8 fAddr[4];
+ UInt8 fAddr[4] = {};
friend IPFactory; // it is the one creating these addresses, thus this
// is why the constructors are private.
@@ -44,13 +45,14 @@ class RawIPAddress final {
class RawIPAddress6 final {
private:
explicit RawIPAddress6(UInt8 Bytes[16]);
+
+ public:
~RawIPAddress6() = default;
- RawIPAddress6& operator=(const RawIPAddress6&) = delete;
+ RawIPAddress6& operator=(const RawIPAddress6&) = default;
RawIPAddress6(const RawIPAddress6&) = default;
- public:
- UInt8* Address() { return fAddr; }
+ UInt8* Address();
UInt8& operator[](const Size& index);
@@ -58,7 +60,7 @@ class RawIPAddress6 final {
bool operator!=(const RawIPAddress6& ipv6);
private:
- UInt8 fAddr[16];
+ UInt8 fAddr[16] = {};
friend IPFactory;
};
@@ -68,9 +70,9 @@ class RawIPAddress6 final {
*/
class IPFactory final {
public:
- static ErrorOr<KString> ToKString(Ref<RawIPAddress6>& ipv6);
- static ErrorOr<KString> ToKString(Ref<RawIPAddress>& ipv4);
- static bool IpCheckVersion4(const Char* ip);
+ static ErrorOr<KBasicString<UInt8>> ToKString(Ref<RawIPAddress6>& ipv6);
+ static ErrorOr<KBasicString<UInt8>> ToKString(Ref<RawIPAddress>& ipv4);
+ static bool IpCheckVersion4(const Char* ip);
};
} // namespace Kernel