Package oshi.driver.mac.net
Class NetStat
- java.lang.Object
-
- oshi.driver.mac.net.NetStat
-
@ThreadSafe public final class NetStat extends java.lang.Object
Utility to query NetStat.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNetStat.IFdataClass to encapsulate IF data for method return
-
Field Summary
Fields Modifier and Type Field Description private static intCTL_NETprivate static org.slf4j.LoggerLOGprivate static intNET_RT_IFLIST2private static intPF_ROUTEprivate static intRTM_IFINFO2
-
Constructor Summary
Constructors Modifier Constructor Description privateNetStat()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map<java.lang.Integer,NetStat.IFdata>queryIFdata(int index)Map data for network interfaces.
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
CTL_NET
private static final int CTL_NET
- See Also:
- Constant Field Values
-
PF_ROUTE
private static final int PF_ROUTE
- See Also:
- Constant Field Values
-
NET_RT_IFLIST2
private static final int NET_RT_IFLIST2
- See Also:
- Constant Field Values
-
RTM_IFINFO2
private static final int RTM_IFINFO2
- See Also:
- Constant Field Values
-
-
Method Detail
-
queryIFdata
public static java.util.Map<java.lang.Integer,NetStat.IFdata> queryIFdata(int index)
Map data for network interfaces.- Parameters:
index- If positive, limit the map to only return data for this interface index. If negative, returns data for all indices.- Returns:
- a map of
NetStat.IFdataobject indexed by the interface index, encapsulating the stats
-
-