Class NetBsdNetworkIF

java.lang.Object
oshi.hardware.common.AbstractNetworkIF
oshi.hardware.common.platform.unix.netbsd.NetBsdNetworkIF
All Implemented Interfaces:
NetworkIF

@ThreadSafe public final class NetBsdNetworkIF extends AbstractNetworkIF
NetBSD-specific NetworkIF implementation. NetBSD's netstat output format differs from FreeBSD/OpenBSD.
  • Constructor Details

  • Method Details

    • getNetworks

      public static List<NetworkIF> getNetworks(boolean includeLocalInterfaces)
      Gets all network interfaces on this machine
      Parameters:
      includeLocalInterfaces - include local interfaces in the result
      Returns:
      A list of NetworkIF objects representing the interfaces
    • updateAttributes

      public boolean updateAttributes()
      Description copied from interface: NetworkIF
      Updates interface network statistics on this interface. Statistics include packets and bytes sent and received, and interface speed.

      This method is intended for updating a single interface that is being individually monitored. If you are updating multiple interfaces, it is more efficient to re-query the entire list from HardwareAbstractionLayer.getNetworkIFs() and correlate the results, since on many platforms the full list must be queried to provide any individual result.

      Returns:
      true if the update was successful, false otherwise.