Class MacNetworkIF
java.lang.Object
oshi.hardware.common.AbstractNetworkIF
oshi.hardware.common.platform.mac.MacNetworkIF
- All Implemented Interfaces:
NetworkIF
Base class for macOS NetworkIF implementations. Subclasses provide platform-specific display name resolution and
network statistics updates.
-
Nested Class Summary
Nested classes/interfaces inherited from interface NetworkIF
NetworkIF.IfOperStatusModifier and TypeInterfaceDescriptionstatic enumThe current operational state of a network interface. -
Field Summary
Fields inherited from class AbstractNetworkIF
bytesRecv, bytesSent, collisions, inDrops, inErrors, outErrors, packetsRecv, packetsSent, speed, timeStampModifier and TypeFieldDescriptionprotected longprotected longprotected longprotected longprotected longprotected longprotected longprotected longprotected longprotected long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMacNetworkIF(NetworkInterface netint, String displayName) Creates a MacNetworkIF. -
Method Summary
Methods inherited from class AbstractNetworkIF
getBytesRecv, getBytesSent, getCollisions, getDisplayName, getIndex, getInDrops, getInErrors, getIPv4addr, getIPv6addr, getMacaddr, getMTU, getName, getNetworkInterfaces, getOutErrors, getPacketsRecv, getPacketsSent, getPrefixLengths, getSpeed, getSubnetMasks, getTimeStamp, isKnownVmMacAddr, queryNetworkInterface, toStringModifier and TypeMethodDescriptionlongGetter for the fieldbytesRecv.longGetter for the fieldbytesSent.longGetter for the fieldcollisions.Interface description.intgetIndex()Interface index.longGetter for the fieldinDrops.longGetter for the fieldinErrors.String[]The Internet Protocol (IP) v4 address.String[]The Internet Protocol (IP) v6 address.The Media Access Control (MAC) address.longgetMTU()The interface Maximum Transmission Unit (MTU).getName()Interface name.protected static List<NetworkInterface> getNetworkInterfaces(boolean includeLocalInterfaces) Returns network interfaces on this machine.longGetter for the fieldoutErrors.longGetter for the fieldpacketsRecv.longGetter for the fieldpacketsSent.Short[]The Internet Protocol (IP) v6 address.longgetSpeed()Getter for the fieldspeed.Short[]The Internet Protocol (IP) v4 subnet masks.longGetter for the fieldtimeStamp.booleanDetermines if the MAC address on this interface corresponds to a known Virtual Machine.Gets theNetworkInterfaceobject.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface NetworkIF
getIfAlias, getIfOperStatus, getNdisPhysicalMediumType, isConnectorPresent, updateAttributesModifier and TypeMethodDescriptiondefault StringTheifAliasas described in RFC 2863.default NetworkIF.IfOperStatusTheifOperStatusas described in RFC 2863.default int(Windows Vista and higher only) The NDIS physical medium type.default boolean(Windows Vista and higher) Set if a connector is present on the network interface.booleanUpdates interface network statistics on this interface.
-
Constructor Details
-
MacNetworkIF
Creates a MacNetworkIF.- Parameters:
netint- the network interfacedisplayName- the display name- Throws:
InstantiationException- if the interface cannot be instantiated
-
-
Method Details
-
getIfType
public int getIfType()Description copied from interface:NetworkIF(Windows, macOS) The NDIS Interface Type. NDIS interface types are registered with the Internet Assigned Numbers Authority (IANA), which publishes a list of interface types periodically in the Assigned Numbers RFC, or in a derivative of it that is specific to Internet network management number assignments.(Linux) ARP Protocol hardware identifiers defined in
include/uapi/linux/if_arp.h- Returns:
- the ifType
-
setIfType
protected void setIfType(int ifType) Sets the interface type.- Parameters:
ifType- the interface type to set
-