Represents a network interface in the system.
More...
#include <network_interface.hpp>
Represents a network interface in the system.
Definition at line 59 of file network_interface.hpp.
◆ Identifier
◆ Type
The type of the network interface.
| Enumerator |
|---|
| undefined | |
| wired_ethernet | |
| wifi | |
| cellular | |
| loopback | |
| other | |
Definition at line 65 of file network_interface.hpp.
◆ NetworkInterface()
| rav::NetworkInterface::NetworkInterface |
( |
Identifier | identifier | ) |
|
|
inlineexplicit |
Constructs a network interface with the given identifier.
The identifier is used to uniquely identify the interface, and should be the BSD name on BSD-style platforms and the AdapterName on Windows platforms.
- Parameters
-
| identifier | The unique identifier of the network interface. |
Definition at line 96 of file network_interface.hpp.
◆ get_addresses()
| const std::vector< boost::asio::ip::address > & rav::NetworkInterface::get_addresses |
( |
| ) |
const |
|
inlinenodiscard |
◆ get_all()
| tl::expected< std::vector< NetworkInterface >, int > rav::NetworkInterface::get_all |
( |
| ) |
|
|
static |
- Returns
- A list of all network interfaces on the system. Only several operating systems are supported: macOS, Windows and Linux. Not Android.
◆ get_description()
| const std::string & rav::NetworkInterface::get_description |
( |
| ) |
const |
|
inlinenodiscard |
◆ get_display_name()
| const std::string & rav::NetworkInterface::get_display_name |
( |
| ) |
const |
|
inlinenodiscard |
◆ get_extended_display_name()
| std::string rav::NetworkInterface::get_extended_display_name |
( |
| ) |
const |
|
inlinenodiscard |
- Returns
- The display name of the network interface, including the identifier and the first ipv4 address.
Definition at line 116 of file network_interface.hpp.
◆ get_first_ipv4_address()
| boost::asio::ip::address_v4 rav::NetworkInterface::get_first_ipv4_address |
( |
| ) |
const |
|
inlinenodiscard |
- Returns
- The first IPv4 address of the interface, which will be unspecified if the interface has no IPv4 address.
Definition at line 157 of file network_interface.hpp.
◆ get_identifier()
| const Identifier & rav::NetworkInterface::get_identifier |
( |
| ) |
const |
|
nodiscard |
- Returns
- The name of the network interface.
◆ get_interface_index()
| std::optional< uint32_t > rav::NetworkInterface::get_interface_index |
( |
| ) |
const |
|
nodiscard |
- Returns
- The index of the network interface, or nullopt if the index could not be found. Note: this is the index as defined by the operating system.
◆ get_interface_luid()
| IF_LUID rav::NetworkInterface::get_interface_luid |
( |
| ) |
|
- Returns
- The LUID of the interface.
◆ get_mac_address()
| const std::optional< MacAddress > & rav::NetworkInterface::get_mac_address |
( |
| ) |
const |
|
inlinenodiscard |
- Returns
- The MAC address of the network interface, or nullopt if the interface does not have a MAC address.
Definition at line 143 of file network_interface.hpp.
◆ get_type()
| Type rav::NetworkInterface::get_type |
( |
| ) |
const |
|
inlinenodiscard |
◆ tie()
| auto rav::NetworkInterface::tie |
( |
| ) |
const |
|
inlinenodiscard |
◆ to_string()
| std::string rav::NetworkInterface::to_string |
( |
| ) |
const |
|
nodiscard |
- Returns
- A description of the network interface as string.
◆ type_to_string()
| const char * rav::NetworkInterface::type_to_string |
( |
Type | type | ) |
|
|
static |
Converts the given type to a string.
- Parameters
-
- Returns
- The string representation of the type.
◆ operator!=
◆ operator==
The documentation for this class was generated from the following file: