Class Ethers
java.lang.Object
org.harctoolbox.harchardware.misc.Ethers
This class is a read interface to /etc/ethers, or any file with that format.
- See Also:
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getEtherAddress
(String hostname) static String
getEtherAddress
(String hostname, File ethersPathname) Returns MAC address.getMacOrNull
(String hostname) Returns MAC address.static void
Command line interface to getMac.
-
Field Details
-
defaultPathname
-
-
Constructor Details
-
Ethers
- Throws:
IOException
-
Ethers
- Throws:
IOException
-
-
Method Details
-
getEtherAddress
public static String getEtherAddress(String hostname, File ethersPathname) throws Ethers.MacAddressNotFound, IOException - Throws:
Ethers.MacAddressNotFound
IOException
-
getEtherAddress
- Throws:
IOException
Ethers.MacAddressNotFound
-
main
Command line interface to getMac.- Parameters:
args
- hostname to be resolved
-
getMacOrNull
Returns MAC address.- Parameters:
hostname
-- Returns:
- Mac-address belonging to the host in the argument, or null if not found.
-
getMac
Returns MAC address.- Parameters:
hostname
-- Returns:
- Mac-address belonging to the host in the argument, or null if not found.
- Throws:
Ethers.MacAddressNotFound
-