diff options
Diffstat (limited to 'Kernel/Sources/Network')
| -rw-r--r-- | Kernel/Sources/Network/NetworkDevice.cxx | 22 |
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 |
