com.eurotech.framework.net
Interface NetInterface<T extends NetInterfaceAddress>

All Known Subinterfaces:
EthernetInterface<T>, LoopbackInterface<T>, ModemInterface<T>, NetInterfaceConfig<T>, WifiInterface<T>

public interface NetInterface<T extends NetInterfaceAddress>

NetworkInterface represent a network interface of the system. Its APIs are purposefully modeled after the java.net.NetworkInterface. Compared to the standard Java API, this class provides additional information such as the NetworkInterfaceType, whether the interface is provided to the system through a USB Adapter, and additional low-level characteristics of the interface.


Method Summary
 String getDriver()
          The driver handling the device.
 String getDriverVersion()
          The version of the driver handling the device.
 String getFirmwareVersion()
          The firmware version for the device.
 byte[] getHardwareAddress()
          Returns the hardware address (usually MAC) of the interface if it has one.
 int getMTU()
          Returns the Maximum Transmission Unit (MTU) of this interface - Design speed of the device, in megabits/second (Mb/s).
 String getName()
          Returns the name of this NetworkInterface.
 List<T> getNetInterfaceAddresses()
          Returns a List of all InterfaceAddresses of this network interface.
 NetInterfaceState getState()
          The current state of the device.
 NetInterfaceType getType()
          Returns the type of this NetworkInterface.
 UsbDevice getUsbDevice()
          Returns the UsbDevice which provided this NetworkInterface to the system if any.
 boolean isAutoConnect()
          Returns whether a network interface will auto connect.
 boolean isLoopback()
          Returns whether a network interface is a loopback interface.
 boolean isPointToPoint()
          Returns whether a network interface is a point to point interface.
 boolean isUp()
          Returns whether a network interface is up and running.
 boolean isVirtual()
          Returns whether this interface is a virtual interface (also called subinterface).
 boolean supportsMulticast()
          Returns whether a network interface supports multicasting or not.
 

Method Detail

getName

String getName()
Returns the name of this NetworkInterface.

Returns:
interface name

getType

NetInterfaceType getType()
Returns the type of this NetworkInterface.

Returns:
interface type

getDriver

String getDriver()
The driver handling the device.

Returns:

getDriverVersion

String getDriverVersion()
The version of the driver handling the device.

Returns:

getFirmwareVersion

String getFirmwareVersion()
The firmware version for the device.

Returns:

getState

NetInterfaceState getState()
The current state of the device.

Returns:

getHardwareAddress

byte[] getHardwareAddress()
Returns the hardware address (usually MAC) of the interface if it has one.

Returns:
a byte array containing the address or null if the address doesn't exist

getNetInterfaceAddresses

List<T> getNetInterfaceAddresses()
Returns a List of all InterfaceAddresses of this network interface.

Returns:
a List object with all or a subset of the InterfaceAddresss of this network interface

isLoopback

boolean isLoopback()
Returns whether a network interface is a loopback interface.

Returns:
true if the interface is a loopback interface.

isPointToPoint

boolean isPointToPoint()
Returns whether a network interface is a point to point interface. A typical point to point interface would be a PPP connection through a modem.

Returns:
true if the interface is a point to point interface.

isVirtual

boolean isVirtual()
Returns whether this interface is a virtual interface (also called subinterface). Virtual interfaces are, on some systems, interfaces created as a child of a physical interface and given different settings (like address or MTU). Usually the name of the interface will the name of the parent followed by a colon (:) and a number identifying the child since there can be several virtual interfaces attached to a single physical interface.

Returns:
true if this interface is a virtual interface.

supportsMulticast

boolean supportsMulticast()
Returns whether a network interface supports multicasting or not.

Returns:
true if the interface supports Multicasting.

isUp

boolean isUp()
Returns whether a network interface is up and running.

Returns:
true if the interface is up and running.

isAutoConnect

boolean isAutoConnect()
Returns whether a network interface will auto connect.

Returns:
true if the interface will auto connect.

getMTU

int getMTU()
Returns the Maximum Transmission Unit (MTU) of this interface - Design speed of the device, in megabits/second (Mb/s).

Returns:
the value of the MTU for that interface.

getUsbDevice

UsbDevice getUsbDevice()
Returns the UsbDevice which provided this NetworkInterface to the system if any.

Returns:
the UsbDevice providing this NetworkInterface to the system or null if this NetworkInterface is not provided by a USB device


Copyright © 2013. All Rights Reserved.