aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/net/VMInetAddress.java
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2006-11-03 10:16:04 +0000
committerGary Benson <gary@gcc.gnu.org>2006-11-03 10:16:04 +0000
commitadefdaca2d8aa874f3e1f5b8be2736355292b6a4 (patch)
tree8a6600d7ecfed57029e5fe6bcacbb895c3ca5b97 /libjava/java/net/VMInetAddress.java
parent5d7de335d797bb22671a929a0b3712fa25aeb4fe (diff)
downloadgcc-adefdaca2d8aa874f3e1f5b8be2736355292b6a4.zip
gcc-adefdaca2d8aa874f3e1f5b8be2736355292b6a4.tar.gz
gcc-adefdaca2d8aa874f3e1f5b8be2736355292b6a4.tar.bz2
InetAddress.java: Removed.
2006-11-03 Gary Benson <gbenson@redhat.com> * java/net/InetAddress.java: Removed. * java/net/natInetAddressNoNet.cc: Likewise. * java/net/natInetAddressPosix.cc: Likewise. * java/net/natInetAddressWin32.cc: Likewise. * java/net/VMInetAddress.java (getLocalHostname, lookupInaddrAny, getHostByAddr, getHostByName, aton): Replace glue methods with native ones. * java/net/natVMInetAddressNoNet.cc: New file. * java/net/natVMInetAddressPosix.cc: Likewise. * java/net/natVMInetAddressWin32.cc: Likewise. * Makefile.am, configure.ac: Reflect the above. * sources.am, Makefile.in, configure: Rebuilt. * java/net/natVMNetworkInterfaceWin32.cc (winsock2GetRealNetworkInterfaces): Create InetAddress objects using InetAddress.getByAddress. * gnu/java/net/natPlainSocketImplWin32.cc (accept, getOption): Likewise. * gnu/java/net/natPlainDatagramSocketImplWin32.cc (peekData, receive, getOption): Likewise. From-SVN: r118451
Diffstat (limited to 'libjava/java/net/VMInetAddress.java')
-rw-r--r--libjava/java/net/VMInetAddress.java34
1 files changed, 7 insertions, 27 deletions
diff --git a/libjava/java/net/VMInetAddress.java b/libjava/java/net/VMInetAddress.java
index b10cf25..a99c216 100644
--- a/libjava/java/net/VMInetAddress.java
+++ b/libjava/java/net/VMInetAddress.java
@@ -58,18 +58,12 @@ class VMInetAddress implements Serializable
*
* @return The local hostname.
*/
- public static String getLocalHostname()
- {
- return InetAddress.getLocalHostname();
- }
+ public static native String getLocalHostname();
/**
* Returns the value of the special address INADDR_ANY
*/
- public static byte[] lookupInaddrAny() throws UnknownHostException
- {
- return new byte[] {0, 0, 0, 0};
- }
+ public static native byte[] lookupInaddrAny() throws UnknownHostException;
/**
* This method returns the hostname for a given IP address. It will
@@ -81,26 +75,15 @@ class VMInetAddress implements Serializable
*
* @exception UnknownHostException If the reverse lookup fails
*/
- public static String getHostByAddr(byte[] ip) throws UnknownHostException
- {
- InetAddress addr = InetAddress.getByAddress(ip);
- InetAddress.lookup(null, addr, false);
- return addr.getHostName();
- }
+ public static native String getHostByAddr(byte[] ip)
+ throws UnknownHostException;
/**
* Returns a list of all IP addresses for a given hostname. Will throw
* an UnknownHostException if the hostname cannot be resolved.
*/
- public static byte[][] getHostByName(String hostname)
- throws UnknownHostException
- {
- InetAddress[] iaddrs = InetAddress.lookup(hostname, null, true);
- byte[][] addrs = new byte[iaddrs.length][];
- for (int i = 0; i < iaddrs.length; i++)
- addrs[i] = iaddrs[i].getAddress();
- return addrs;
- }
+ public static native byte[][] getHostByName(String hostname)
+ throws UnknownHostException;
/**
* Return the IP address represented by a literal address.
@@ -110,8 +93,5 @@ class VMInetAddress implements Serializable
*
* @return The IP address as a byte array
*/
- public static byte[] aton(String address)
- {
- return InetAddress.aton(address);
- }
+ public static native byte[] aton(String address);
}