| 258 | // AdapterMAC. |
| 259 | #ifdef _WIN32 |
| 260 | std::optional<MAC_Address> AdapterUtils::GetAdapterMAC(const Adapter* adapter) |
| 261 | { |
| 262 | if (adapter != nullptr && adapter->PhysicalAddressLength == 6) |
| 263 | { |
| 264 | MAC_Address macAddr{}; |
| 265 | std::memcpy(&macAddr, adapter->PhysicalAddress, sizeof(macAddr)); |
| 266 | return macAddr; |
| 267 | } |
| 268 | |
| 269 | return std::nullopt; |
| 270 | } |
| 271 | #else |
| 272 | std::optional<MAC_Address> AdapterUtils::GetAdapterMAC(const Adapter* adapter) |
| 273 | { |