mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-29 12:45:22 +01:00
few ifconfig sample fixes
This commit is contained in:
parent
903553c9e2
commit
f4121bcb92
@ -68,30 +68,59 @@ int main(int argc, char** argv)
|
||||
std::cout << intf.name() << " [" << intf.index() << "]: ";
|
||||
std::cout << "<";
|
||||
if (intf.isUp())
|
||||
std::cout << sep << "UP"; sep = ",";
|
||||
{
|
||||
std::cout << sep << "UP";
|
||||
sep = ",";
|
||||
}
|
||||
|
||||
if (intf.isRunning())
|
||||
std::cout << sep << "RUNNING"; sep = ",";
|
||||
{
|
||||
std::cout << sep << "RUNNING";
|
||||
sep = ",";
|
||||
}
|
||||
|
||||
if (intf.isLoopback())
|
||||
std::cout << sep << "LOOPBACK"; sep = ",";
|
||||
{
|
||||
std::cout << sep << "LOOPBACK";
|
||||
sep = ",";
|
||||
}
|
||||
|
||||
if (intf.isPointToPoint())
|
||||
std::cout << sep << "P2P"; sep = ",";
|
||||
{
|
||||
std::cout << sep << "P2P";
|
||||
sep = ",";
|
||||
}
|
||||
|
||||
if (intf.supportsIPv4())
|
||||
std::cout << sep << "IPv4"; sep = ",";
|
||||
{
|
||||
std::cout << sep << "IPv4";
|
||||
sep = ",";
|
||||
}
|
||||
|
||||
if (intf.supportsIPv6())
|
||||
std::cout << sep << "IPv6"; sep = ",";
|
||||
{
|
||||
std::cout << sep << "IPv6";
|
||||
sep = ",";
|
||||
}
|
||||
|
||||
if (intf.supportsBroadcast())
|
||||
std::cout << sep << "BCAST"; sep = ",";
|
||||
{
|
||||
std::cout << sep << "BCAST";
|
||||
sep = ",";
|
||||
}
|
||||
|
||||
if (intf.supportsMulticast())
|
||||
std::cout << sep << "MCAST"; sep = ",";
|
||||
{
|
||||
std::cout << sep << "MCAST";
|
||||
sep = ",";
|
||||
}
|
||||
|
||||
if (!intf.isLoopback())
|
||||
{
|
||||
std::cout << sep << std::dec << intf.mtu();
|
||||
sep = ",";
|
||||
}
|
||||
|
||||
std::cout << sep << std::dec << intf.mtu(); sep = ",";
|
||||
std::cout << ">" << std::endl;
|
||||
|
||||
const NetworkInterface::AddressList& ipList = intf.addressList();
|
||||
|
Loading…
x
Reference in New Issue
Block a user