Class IFdata

java.lang.Object
oshi.driver.common.mac.IFdata

@Immutable public class IFdata extends Object
Encapsulates network interface statistics read from the macOS NET_RT_IFLIST2 sysctl, shared between the JNA and FFM NetStat drivers.
  • 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. The long counters are masked to 32 bits because the underlying if_data64 fields wrap at 2^32.
      Parameters:
      ifType - the interface type
      oPackets - packets sent
      iPackets - packets received
      oBytes - bytes sent
      iBytes - bytes received
      oErrors - output errors
      iErrors - input errors
      collisions - collisions
      iDrops - input drops
      speed - 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