libcaf  0.15.5
Public Types | Static Public Member Functions | List of all members
caf::io::network::interfaces Class Reference

Utility class bundling access to network interface names and addresses. More...

#include <interfaces.hpp>

Public Types

using consumer = std::function< void(const char *, protocol::network, bool, const char *)>
 Consumes {interface_name, protocol_type, is_localhost, address} entries.
 

Static Public Member Functions

static void traverse (std::initializer_list< protocol::network > ps, consumer f)
 Traverses all network interfaces for given protocols using f.
 
static void traverse (consumer f)
 Traverses all network interfaces using f.
 
static interfaces_map list_all (bool include_localhost=true)
 Returns a map listing each interface by its name.
 
static address_listing list_addresses (bool include_localhost=true)
 Returns all addresses for all devices for all protocols.
 
static std::vector< std::string > list_addresses (std::initializer_list< protocol::network > procs, bool include_localhost=true)
 Returns all addresses for all devices for given protocols.
 
static std::vector< std::string > list_addresses (protocol::network proc, bool include_localhost=true)
 Returns all addresses for all devices for given protocol.
 
static optional< std::pair< std::string, protocol::network > > native_address (const std::string &host, optional< protocol::network > preferred=none)
 Returns a native IPv4 or IPv6 translation of host.
 
static std::vector< std::pair< std::string, protocol::network > > server_address (uint16_t port, const char *host, optional< protocol::network > preferred=none)
 Returns the host and protocol available for a local server socket.
 

Detailed Description

Utility class bundling access to network interface names and addresses.


The documentation for this class was generated from the following file: