Class CastLink.Interface
java.lang.Object
com.iizigo.panel.CastLink.Interface
- Enclosing class:
CastLink
A network interface as the address filter reads it: what the system says about it, and its addresses. A test builds these directly;
CastLink.enumerate() builds them from the system.- Author:
- Christopher Mindus
Constructor Summary
ConstructorsConstructorDescriptionInterface(String name, String label, String kind, boolean up, boolean loopback, boolean pointToPoint, boolean hasHardwareAddress, boolean virtualMachine, boolean defaultRoute, List<InetAddress> addresses) Creates an interface.Interface(String name, String label, String kind, boolean up, boolean loopback, boolean pointToPoint, boolean hasHardwareAddress, boolean virtualMachine, List<InetAddress> addresses) Creates an interface.Method Summary
Modifier and TypeMethodDescriptionGets the addresses.Gets the name shown in the chooser: the name a user knows the interface by, followed by its kind in parentheses when the name does not already say it, e.g.getName()Gets the system name.booleanTells whether the interface carries the default route (IPv4 or IPv6).booleanTells whether the filter offers this interface's addresses at all.toString()Debug string.
Constructor Details
Interface
public Interface(String name, String label, String kind, boolean up, boolean loopback, boolean pointToPoint, boolean hasHardwareAddress, boolean virtualMachine, List<InetAddress> addresses) Creates an interface.- Parameters:
name- The system name, e.g."eth0".label- The name a user knows it by, e.g."Wi-Fi"; null or empty for the system name.kind- The kind,"Wi-Fi"or"Ethernet", null when not known.up- The interface is up.loopback- The interface is a loopback interface.pointToPoint- The interface is a point-to-point interface.hasHardwareAddress- The interface has a hardware (MAC) address.virtualMachine- The hardware address belongs to a virtual machine vendor.addresses- The addresses.
Interface
public Interface(String name, String label, String kind, boolean up, boolean loopback, boolean pointToPoint, boolean hasHardwareAddress, boolean virtualMachine, boolean defaultRoute, List<InetAddress> addresses) Creates an interface.- Parameters:
name- The system name, e.g."eth0".label- The name a user knows it by, e.g."Wi-Fi"; null or empty for the system name.kind- The kind,"Wi-Fi"or"Ethernet", null when not known.up- The interface is up.loopback- The interface is a loopback interface.pointToPoint- The interface is a point-to-point interface.hasHardwareAddress- The interface has a hardware (MAC) address.virtualMachine- The hardware address belongs to a virtual machine vendor.defaultRoute- The interface carries the default route (IPv4 or IPv6).addresses- The addresses.
Method Details
getName
getDisplayName
Gets the name shown in the chooser: the name a user knows the interface by, followed by its kind in parentheses when the name does not already say it, e.g."Ethernet - 1 GBE","en0","Intel(R) Wi-Fi 6E AX210 (Wi-Fi)".- Returns:
- The text.
getAddresses
isDefaultRoute
public boolean isDefaultRoute()Tells whether the interface carries the default route (IPv4 or IPv6).- Returns:
truewhen this computer sends from one of its addresses on a default route.
isOffered
public boolean isOffered()Tells whether the filter offers this interface's addresses at all.- Returns:
truefor an interface a phone may reach: up, not a loopback, not point-to-point, with a hardware address that is not a virtual machine vendor's - or is one, on the interface of the default route.
toString