Skip to content

Commit

Permalink
Add friendly name to interface info example
Browse files Browse the repository at this point in the history
  • Loading branch information
mfontanini committed Feb 7, 2016
1 parent 0832184 commit 64b267c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion examples/interfaces_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <tins/network_interface.h>

using std::cout;
using std::wcout;
using std::endl;
using std::string;

Expand All @@ -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
Expand Down

0 comments on commit 64b267c

Please sign in to comment.