public interface INetworkUtilityService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SERVICE_NAME
service name of this interface for the bundle activator
(com.esf.util.net.service)
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
calculateBroadcast(java.lang.String ipAddress,
java.lang.String netmask)
calculates the broadcast based on an IP address and subnet mask
|
java.lang.String |
calculateNetwork(java.lang.String ipAddress,
java.lang.String netmask)
calculates the network based on an IP address and subnet mask
|
boolean |
canPing(java.lang.String ipAddress,
int count)
pings a peer address a number of times.
|
java.lang.String[] |
getAllInterfaceNames()
gets the interface names as would be shown by the output of ifconfig -a
|
java.lang.String |
getBroadcastAddress(java.lang.String ifaceName)
gets the broadcast address for a specified interface.
|
INetworkInterface |
getIface(java.lang.String name)
gets the interface with the supplied name
|
java.lang.String[] |
getInterfaceNames()
gets the interface names as would be shown by the output of ifconfig
|
java.lang.String |
getIpAddress(java.lang.String ifaceName)
gets the IP address for a specified interface.
|
java.lang.String |
getMacAddress(java.lang.String ifaceName)
gets the MAC address for a specified interface.
|
java.lang.String |
getNetmask(java.lang.String ifaceName)
gets the netmask for a specified interface.
|
int |
getNetmaskIntForm(java.lang.String netmask)
gets the integer representation of the netmask (i.e. 8 for 255.0.0.0 and 16 for 255.255.0.0)
|
boolean |
isLinkUp(java.lang.String ifaceName)
checks to see if a valid link is present
|
boolean |
isUp(java.lang.String ifaceName)
checks to see if an interface is 'up'
|
static final java.lang.String SERVICE_NAME
java.lang.String[] getInterfaceNames()
java.lang.String[] getAllInterfaceNames()
boolean isUp(java.lang.String ifaceName)
ifaceName
- the interface to checkjava.lang.String getIpAddress(java.lang.String ifaceName)
ifaceName
- the interface to get the IP address ofjava.lang.String getNetmask(java.lang.String ifaceName)
ifaceName
- the interface to get the netmask ofjava.lang.String getBroadcastAddress(java.lang.String ifaceName)
ifaceName
- the interface to get the broadcast address ofboolean isLinkUp(java.lang.String ifaceName)
ifaceName
- the interface to checkjava.lang.String getMacAddress(java.lang.String ifaceName)
ifaceName
- the interface to get the MAC address ofjava.lang.String calculateNetwork(java.lang.String ipAddress, java.lang.String netmask)
ipAddress
- the IP address to use as a base for the calculationnetmask
- the network mask to use as a base for the calculationjava.lang.String calculateBroadcast(java.lang.String ipAddress, java.lang.String netmask)
ipAddress
- the IP address to use as a base for the calculationnetmask
- the network mask to use as a base for the calculationint getNetmaskIntForm(java.lang.String netmask) throws java.lang.Exception
netmask
- the netmask to convert it 'dotted notation' (i.e. 255.255.255.0)java.lang.Exception
- if the passed in subnet mask is invalidboolean canPing(java.lang.String ipAddress, int count)
ipAddress
- the IP Address to pingcount
- the number of times to try to ping the peerINetworkInterface getIface(java.lang.String name)
name
- the interface to getINetworkInterface
Object representing the interfaceCopyright © 2009 Eurotech Inc. All rights reserved.