Detect network interface of the default route without use of ip

This commit is contained in:
Alexey Rybalchenko
2020-01-17 14:46:07 +01:00
committed by Dennis Klein
parent f2da29a650
commit 15de80cfd3
3 changed files with 49 additions and 13 deletions

View File

@@ -11,6 +11,7 @@
#include <map>
#include <string>
#include <stdexcept>
// forward declarations
namespace boost
@@ -31,6 +32,8 @@ namespace mq
namespace tools
{
struct DefaultRouteDetectionError : std::runtime_error { using std::runtime_error::runtime_error; };
// returns a map with network interface names as keys and their IP addresses as values
std::map<std::string, std::string> getHostIPs();