From 64b267c7ea6ae8aa2637cb6199902904a897dfaa Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Sat, 6 Feb 2016 16:04:51 -0800 Subject: [PATCH] Add friendly name to interface info example --- examples/interfaces_info.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/interfaces_info.cpp b/examples/interfaces_info.cpp index e5d23be..e2db82c 100644 --- a/examples/interfaces_info.cpp +++ b/examples/interfaces_info.cpp @@ -32,6 +32,7 @@ #include using std::cout; +using std::wcout; using std::endl; using std::string; @@ -50,7 +51,14 @@ int main() { NetworkInterface::Info info = iface.info(); // Now print all of this info. - cout << name << ": " << endl; + cout << name; + + #ifdef _WIN32 + // If this is running on Windows, also print the friendly name + wcout << " (" << iface.friendly_name() << ")"; + #endif // _WIN32 + cout << ": " << endl; + cout << " HW address: " << info.hw_addr << endl << " IP address: " << info.ip_addr << endl << " Netmask: " << info.netmask << endl