Class IFdata
java.lang.Object
oshi.driver.common.mac.IFdata
Encapsulates network interface statistics read from the macOS
NET_RT_IFLIST2 sysctl, shared between the JNA
and FFM NetStat drivers.-
Constructor Summary
ConstructorsConstructorDescriptionIFdata(int ifType, long oPackets, long iPackets, long oBytes, long iBytes, long oErrors, long iErrors, long collisions, long iDrops, long speed, long timeStamp) Creates an immutable interface-data record. -
Method Summary
Modifier and TypeMethodDescriptionlonglonglonglongintlonglonglonglonglonggetSpeed()long
-
Constructor Details
-
IFdata
public IFdata(int ifType, long oPackets, long iPackets, long oBytes, long iBytes, long oErrors, long iErrors, long collisions, long iDrops, long speed, long timeStamp) Creates an immutable interface-data record. Thelongcounters are masked to 32 bits because the underlyingif_data64fields wrap at2^32.- Parameters:
ifType- the interface typeoPackets- packets sentiPackets- packets receivedoBytes- bytes sentiBytes- bytes receivedoErrors- output errorsiErrors- input errorscollisions- collisionsiDrops- input dropsspeed- interface speed (baud rate)timeStamp- the time the data was sampled, in milliseconds since the epoch
-
-
Method Details
-
getIfType
public int getIfType()- Returns:
- the ifType
-
getOPackets
public long getOPackets()- Returns:
- the oPackets
-
getIPackets
public long getIPackets()- Returns:
- the iPackets
-
getOBytes
public long getOBytes()- Returns:
- the oBytes
-
getIBytes
public long getIBytes()- Returns:
- the iBytes
-
getOErrors
public long getOErrors()- Returns:
- the oErrors
-
getIErrors
public long getIErrors()- Returns:
- the iErrors
-
getCollisions
public long getCollisions()- Returns:
- the collisions
-
getIDrops
public long getIDrops()- Returns:
- the iDrops
-
getSpeed
public long getSpeed()- Returns:
- the speed
-
getTimeStamp
public long getTimeStamp()- Returns:
- the timeStamp
-