summaryrefslogtreecommitdiffhomepage
path: root/Kernel/Sources/Network
diff options
context:
space:
mode:
authorAmlal <amlalelmahrouss@icloud.com>2024-06-19 07:59:04 +0000
committerAmlal <amlalelmahrouss@icloud.com>2024-06-19 07:59:04 +0000
commitb820eb6a5a7948597d81998137b05ddc0eb0dbad (patch)
treedb4eaea0b6863076c4f1476f361e2317823a663a /Kernel/Sources/Network
parent36ff25861676cd1f5fb94b901fa59b015c614bc5 (diff)
parent6735570c44516661260546dadb81f0f5c238d1db (diff)
Merged in MHR-31 (pull request #16)
MHR-31: Round robin scheduler.
Diffstat (limited to 'Kernel/Sources/Network')
-rw-r--r--Kernel/Sources/Network/NetworkDevice.cxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/Kernel/Sources/Network/NetworkDevice.cxx b/Kernel/Sources/Network/NetworkDevice.cxx
index 511246c7..027613ac 100644
--- a/Kernel/Sources/Network/NetworkDevice.cxx
+++ b/Kernel/Sources/Network/NetworkDevice.cxx
@@ -5,11 +5,31 @@
------------------------------------------- */
#include <NetworkKit/NetworkDevice.hpp>
+#include <NewKit/Utils.hpp>
namespace NewOS
{
+ /// \brief Getter for fNetworkName.
const char* NetworkDevice::Name() const
{
- return "NetworkDevice";
+ return this->fNetworkName;
+ }
+
+ /// \brief Setter for fNetworkName.
+ Boolean NetworkDevice::Name(const char* strView)
+ {
+ if (strView == nullptr)
+ return false;
+
+ if (*strView == 0)
+ return false;
+
+ if (rt_string_len(strView) > cNetworkNameLen)
+ return false;
+
+ rt_copy_memory((VoidPtr)strView,
+ (VoidPtr)this->fNetworkName, rt_string_len(strView));
+
+ return true;
}
} // namespace NewOS