scclib
Stable Cloud Computing C++ Library
|
A network interface. More...
#include <net_if.h>
Public Types | |
enum class | SocketType { any , tcp_stream , udp_datagram } |
Public Member Functions | |
const std::string & | name () const |
Name of the interface. | |
const int | index () const |
The interface index. | |
const std::string & | hw_addr () const |
Hardware address for the interface. | |
const size_t | speed () const |
Link speed in bytes / second, 0 means loopback. | |
const size_t | mtu () const |
Maximum transmission unit. | |
int | flags () const |
Flags for this interface. More... | |
bool | test_flags (int f) const |
const std::vector< NetIfAddr > & | addrs () const |
Zero or more addresses associated with this interface. | |
std::string | str () const |
String representation of network interface. More... | |
Static Public Member Functions | |
static std::vector< NetIf > | all_interfaces () |
List network interfaces on the local system. | |
static std::vector< InetAddr > | host_addrs (const std::string &name, SocketType=SocketType::any) |
List addresses for the specified host (do a name lookup). More... | |
Friends | |
class | NetIfIterator |
A network interface.
Contains zero or more internet addresses.
|
inline |
|
static |
List addresses for the specified host (do a name lookup).
Returns a list of host addresses to that can used with bind() or connect().
Can specify a filter for a specific capability (tcp or udp).
This will carry out a name resolution and return the list of addresses that map to the host name.
If both ipv4 and ipv6 are specified, ipv6 addresses are preferred.
std::string NetIf::str | ( | ) | const |