#include <network.hpp>
Public Member Functions | |
| Network ()=delete | |
Static Public Member Functions | |
| static std::optional< anch::device::NetworkInterface > | getInterface (const std::string &ifName) |
| static std::map< std::string, anch::device::NetworkInterface > | getInterfaces () |
| static void | reload () |
Network interfaces.
Network interfaces are listed with getifaddrs : every interface is listed, with or without IP address, with its IPv4 and IPv6 addresses. They are loaded on first access and kept until reload .
Interfaces are returned by copy: a reload does not invalidate what has been retrieved before, and every method can be called concurrently.
|
delete |
Utility class: no instance
|
static |
Retrieve network interface by its name.
| ifName | the interface name |
std::nullopt otherwise| anch::device::DeviceException | Network interfaces error |
|
static |
Retrieve all network interfaces.
| anch::device::DeviceException | Network interfaces error |
|
static |
Reload network interfaces. On error, the previously loaded interfaces are kept.
| anch::device::DeviceException | Network interfaces error |