| 125 | } |
| 126 | |
| 127 | static std::optional<std::string> find_ethernet_device_name() { |
| 128 | auto devices = OHDFilesystemUtil::getAllEntriesFilenameOnlyInDirectory( |
| 129 | "/sys/class/net/"); |
| 130 | for (auto& device : devices) { |
| 131 | if (OHDUtil::startsWith(device, "enx") || |
| 132 | OHDUtil::startsWith(device, "eth") || |
| 133 | OHDUtil::startsWith(device, "enp")) { |
| 134 | return device; |
| 135 | } |
| 136 | } |
| 137 | return std::nullopt; |
| 138 | } |
| 139 | |
| 140 | EthernetManager::EthernetManager() { |
| 141 | m_console = openhd::log::create_or_get("eth_manager"); |