use NetInterfaceConfig.getType()

This commit is contained in:
Doug MacEachern 2005-11-18 18:09:12 +00:00
parent e8e6f86666
commit 583922f3d0

View File

@ -70,17 +70,13 @@ public class Ifconfig extends SigarCommandBase {
this.sigar.getNetInterfaceConfig(name); this.sigar.getNetInterfaceConfig(name);
long flags = ifconfig.getFlags(); long flags = ifconfig.getFlags();
//XXX cannot assume ethernet
String encap = (flags & NetFlags.IFF_LOOPBACK) > 0 ?
"Local Loopback" : "Ethernet";
String hwaddr = ""; String hwaddr = "";
if (!NetFlags.NULL_HWADDR.equals(ifconfig.getHwaddr())) { if (!NetFlags.NULL_HWADDR.equals(ifconfig.getHwaddr())) {
hwaddr = " HWaddr " + ifconfig.getHwaddr(); hwaddr = " HWaddr " + ifconfig.getHwaddr();
} }
println(ifconfig.getName() + "\t" + println(ifconfig.getName() + "\t" +
"Link encap:" + encap + "Link encap:" + ifconfig.getType() +
hwaddr); hwaddr);
String ptp = ""; String ptp = "";