use NetInterfaceConfig.getType()
This commit is contained in:
parent
e8e6f86666
commit
583922f3d0
@ -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 = "";
|
||||||
|
Loading…
Reference in New Issue
Block a user