Network interface.
More...
#include <networkInterface.hpp>
|
|
class | anch::device::Network |
Network interface.
Snapshot of a network interface configuration built by Network . Every information is optional: an empty string (or 0 ) means that the interface does not have it (no IPv4 address, no broadcast address on a point-to-point interface, no hardware address on a tunnel, ...).
- Author
- Vincent Lachenal
◆ getBroadcastAddress()
| const std::string & anch::device::NetworkInterface::getBroadcastAddress |
( |
| ) |
const |
|
inline |
Interface broadcast address getter
- Returns
- The interface IPv4 broadcast address, empty if none
◆ getIpAddress()
| const std::string & anch::device::NetworkInterface::getIpAddress |
( |
| ) |
const |
|
inline |
Interface IPv4 address getter. When the interface has several IPv4 addresses, the first one is returned.
- Returns
- The interface IPv4 address, empty if none
◆ getIpv6Addresses()
| const std::vector< std::string > & anch::device::NetworkInterface::getIpv6Addresses |
( |
| ) |
const |
|
inline |
Interface IPv6 addresses getter. Link-local addresses have their scope ( %<interface> ).
- Returns
- The interface IPv6 addresses
- Since
- 0.2
◆ getMacAddress()
| const std::string & anch::device::NetworkInterface::getMacAddress |
( |
| ) |
const |
|
inline |
MAC address getter
- Returns
- The hardware address (hexadecimal bytes separated by
: ), empty if none
◆ getMetric()
| int anch::device::NetworkInterface::getMetric |
( |
| ) |
const |
|
inline |
Interface metric getter (Linux always reports 0 )
- Returns
- The interface metric
◆ getMtu()
| int anch::device::NetworkInterface::getMtu |
( |
| ) |
const |
|
inline |
Interface MTU getter
- Returns
- The interface MTU,
0 if unknown
◆ getName()
| const std::string & anch::device::NetworkInterface::getName |
( |
| ) |
const |
|
inline |
Interface name getter
- Returns
- The interface name
◆ getNetmask()
| const std::string & anch::device::NetworkInterface::getNetmask |
( |
| ) |
const |
|
inline |
Interface netmask getter
- Returns
- The interface IPv4 netmask, empty if none
◆ isLocalhost()
| bool anch::device::NetworkInterface::isLocalhost |
( |
| ) |
const |
|
inline |
Is interface localhost getter
- Returns
true if interface is local loopback, false otherwise
◆ isUp()
| bool anch::device::NetworkInterface::isUp |
( |
| ) |
const |
|
inline |
Is interface up getter
- Returns
true if interface is up, false otherwise
- Since
- 0.2
The documentation for this class was generated from the following file: