From 4a9e36091447a7f933f71d20b916c7f158017ad1 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 6 Apr 2007 13:54:42 +0000 Subject: [PATCH] add primary interface info --- .../java/src/org/hyperic/sigar/cmd/NetInfo.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bindings/java/src/org/hyperic/sigar/cmd/NetInfo.java b/bindings/java/src/org/hyperic/sigar/cmd/NetInfo.java index 2ab84499..d4cce700 100644 --- a/bindings/java/src/org/hyperic/sigar/cmd/NetInfo.java +++ b/bindings/java/src/org/hyperic/sigar/cmd/NetInfo.java @@ -18,6 +18,7 @@ package org.hyperic.sigar.cmd; +import org.hyperic.sigar.NetInterfaceConfig; import org.hyperic.sigar.SigarException; /** @@ -38,6 +39,19 @@ public class NetInfo extends SigarCommandBase { } public void output(String[] args) throws SigarException { + NetInterfaceConfig config = this.sigar.getNetInterfaceConfig(null); + println("primary interface....." + + config.getName()); + + println("primary ip address...." + + config.getAddress()); + + println("primary mac address..." + + config.getHwaddr()); + + println("primary netmask......." + + config.getNetmask()); + org.hyperic.sigar.NetInfo info = this.sigar.getNetInfo();