com.eurotech.framework.net
Interface NetInterfaceAddress

All Known Subinterfaces:
ModemInterfaceAddress, ModemInterfaceAddressConfig, NetInterfaceAddressConfig, WifiInterfaceAddress, WifiInterfaceAddressConfig

public interface NetInterfaceAddress

This class represents a Network Interface address as currently running on the system In short it's an IP address, a subnet mask and a broadcast address when the address is an IPv4 one. An IP address and a network prefix length in the case of IPv6 address. Both IPv4 and IPv6 addresses will have a gateway and one or more DNS addresses.


Method Summary
 IPAddress getAddress()
          Returns an InetAddress for this address.
 IPAddress getBroadcast()
          Returns an InetAddress for the broadcast address for this InterfaceAddress.
 List<? extends IPAddress> getDnsServers()
          Gets the list of DNS servers associated with this interface
 IPAddress getGateway()
          Returns the InetAddress for the gateway.
 IPAddress getNetmask()
          Returns the network mask for this address Typical IPv4 values would be 255.0.0.0, 255.255.0.0 or 255.255.255.0.
 short getNetworkPrefixLength()
          Returns the network prefix length for this address.
 

Method Detail

getAddress

IPAddress getAddress()
Returns an InetAddress for this address.

Returns:
the address

getNetworkPrefixLength

short getNetworkPrefixLength()
Returns the network prefix length for this address. This is also known as the subnet mask in the context of IPv4 addresses. Typical IPv4 values would be 8 (255.0.0.0), 16 (255.255.0.0) or 24 (255.255.255.0). Typical IPv6 values would be 128 (::1/128) or 10 (fe80::203:baff:fe27:1243/10)

Returns:
a short representing the prefix length for the subnet of that address.

getNetmask

IPAddress getNetmask()
Returns the network mask for this address Typical IPv4 values would be 255.0.0.0, 255.255.0.0 or 255.255.255.0. Typical IPv6 values would be ::1/128 or fe80::203:baff:fe27:1243/10

Returns:
an IPaddress representing the subnet mask of that address

getGateway

IPAddress getGateway()
Returns the InetAddress for the gateway.

Returns:
the gateway address

getBroadcast

IPAddress getBroadcast()
Returns an InetAddress for the broadcast address for this InterfaceAddress.

Returns:
the broadcast address

getDnsServers

List<? extends IPAddress> getDnsServers()
Gets the list of DNS servers associated with this interface

Returns:
the list of DNS servers


Copyright © 2013. All Rights Reserved.