}
}
}
public void output(String name) throws SigarException {
NetInterfaceConfig ifconfig =
this.sigar.getNetInterfaceConfig(name);
long flags = ifconfig.getFlags();
String hwaddr = "";
if (!NetFlags.NULL_HWADDR.equals(ifconfig.getHwaddr())) {
hwaddr = " HWaddr " + ifconfig.getHwaddr();
}
if (!ifconfig.getName().equals(ifconfig.getDescription())) {
println(ifconfig.getDescription());
}
println(ifconfig.getName() + "\t" +
"Link encap:" + ifconfig.getType() +
hwaddr);
String ptp = "";
if ((flags & NetFlags.IFF_POINTOPOINT) > 0) {
ptp = " P-t-P:" + ifconfig.getDestination();
}
String bcast = "";
if ((flags & NetFlags.IFF_BROADCAST) > 0) {
bcast = " Bcast:" + ifconfig.getBroadcast();
}
println("\t" +
"inet addr:" + ifconfig.getAddress() +
ptp + //unlikely
bcast +
" Mask:" + ifconfig.getNetmask());
if (ifconfig.getPrefix6Length() != 0) {
println("\t" +
"inet6 addr: " + ifconfig.getAddress6() + "/" +
ifconfig.getPrefix6Length() +
" Scope:" + NetFlags.getScopeString(ifconfig.getScope6()));
}
println("\t" +
NetFlags.getIfFlagsString(flags) +
" MTU:" + ifconfig.getMtu() +
" Metric:" + ifconfig.getMetric());
try {
NetInterfaceStat ifstat =
this.sigar.getNetInterfaceStat(name);
println("\t" +