diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-30 08:46:09 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-30 08:46:09 +0100 |
| commit | d7112cd6909640afd7609b3a142bc6ecf921ee25 (patch) | |
| tree | 55033ad28d58d536c4b3bad715d8635f00773bfd /Private/Source/Network | |
| parent | f22e69b8837b84548f79e0b8ca7bef24605c6611 (diff) | |
Kernel: Breaking changes, see source code.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/Source/Network')
| -rw-r--r-- | Private/Source/Network/IP.cpp | 12 | ||||
| -rw-r--r-- | Private/Source/Network/NetworkDevice.cpp | 6 |
2 files changed, 10 insertions, 8 deletions
diff --git a/Private/Source/Network/IP.cpp b/Private/Source/Network/IP.cpp index 4e8f602a..f58e59b6 100644 --- a/Private/Source/Network/IP.cpp +++ b/Private/Source/Network/IP.cpp @@ -1,7 +1,7 @@ /* * ======================================================== * - * NewKit + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -10,7 +10,7 @@ #include <NetworkKit/IP.hpp> #include <NewKit/Utils.hpp> -namespace hCore { +namespace HCore { char* RawIPAddress::Address() { return m_Addr; } RawIPAddress::RawIPAddress(char bytes[4]) { rt_copy_memory(bytes, m_Addr, 4); } @@ -34,7 +34,8 @@ bool RawIPAddress::operator!=(const RawIPAddress& ipv4) { char& RawIPAddress::operator[](const Size& index) { kcout << "[RawIPAddress::operator[]] Fetching Index...\r\n"; - if (index > 4) panic(RUNTIME_CHECK_EXPRESSION); + static char IP_PLACEHOLDER = '0'; + if (index > 4) return IP_PLACEHOLDER; return m_Addr[index]; } @@ -46,7 +47,8 @@ RawIPAddress6::RawIPAddress6(char bytes[8]) { char& RawIPAddress6::operator[](const Size& index) { kcout << "[RawIPAddress6::operator[]] Fetching Index...\r\n"; - if (index > 8) panic(RUNTIME_CHECK_EXPRESSION); + static char IP_PLACEHOLDER = '0'; + if (index > 8) return IP_PLACEHOLDER; return m_Addr[index]; } @@ -92,4 +94,4 @@ bool IPFactory::IpCheckVersion4(const char* ip) { return true; } -} // namespace hCore +} // namespace HCore diff --git a/Private/Source/Network/NetworkDevice.cpp b/Private/Source/Network/NetworkDevice.cpp index bd75d7ed..4f07a5eb 100644 --- a/Private/Source/Network/NetworkDevice.cpp +++ b/Private/Source/Network/NetworkDevice.cpp @@ -1,7 +1,7 @@ /* * ======================================================== * - * NewKit + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -12,7 +12,7 @@ // network devices implementation. // PPPNetworkService, TCPNetworkDevice, UDPNetworkService -namespace hCore { +namespace HCore { NetworkDevice::NetworkDevice(void (*out)(NetworkDeviceCommand), void (*in)(NetworkDeviceCommand), void (*on_cleanup)(void)) @@ -29,4 +29,4 @@ NetworkDevice::~NetworkDevice() { if (fCleanup) fCleanup(); } -} // namespace hCore +} // namespace HCore |
