summaryrefslogtreecommitdiff
path: root/java/net
diff options
context:
space:
mode:
authorRobert Schuster <theBohemian@gmx.net>2008-05-15 18:44:28 +0000
committerRobert Schuster <theBohemian@gmx.net>2008-05-15 18:44:28 +0000
commitd988b0c8a3a5f0b792cc025e7ae57cbc0dd2838d (patch)
tree3113449d427d692286ef3f3f3a3fccfff6aa9c40 /java/net
parent02921b01621bc91bc1c1b9729e33515fea757e59 (diff)
downloadclasspath-d988b0c8a3a5f0b792cc025e7ae57cbc0dd2838d.tar.gz
2008-05-15 Robert Schuster <robertschuster@fsfe.org>
* java/net/NetworkInterface.java: (isUp): New method. (isPointToPoint): Dito. (isLoopback): Dito. (supportsMulticast): Dito. * vm/reference/java/net/VMNetworkInterface.java: (isUp): New method. (isPointToPoint): Dito. (isLoopback): Dito. (supportsMulticast): Dito. * native/jni/java-net/java_net_VMNetworkInterface.c: (isUp): New method. (isPointToPoint): Dito. (isLoopback): Dito. (supportsMulticast): Dito.
Diffstat (limited to 'java/net')
-rw-r--r--java/net/NetworkInterface.java48
1 files changed, 47 insertions, 1 deletions
diff --git a/java/net/NetworkInterface.java b/java/net/NetworkInterface.java
index f7ea553ce..5ec64ff16 100644
--- a/java/net/NetworkInterface.java
+++ b/java/net/NetworkInterface.java
@@ -1,5 +1,5 @@
/* NetworkInterface.java --
- Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -267,4 +267,50 @@ public final class NetworkInterface
return result.toString();
}
+
+ /**
+ * Determines whether this interface is ready to transfer data.
+ *
+ * @return whether the interface is up
+ */
+ public boolean isUp()
+ throws SocketException
+ {
+ return VMNetworkInterface.isUp(netif.name);
+ }
+
+ /**
+ * Determines whether this interface does point to point
+ * transmission.
+ *
+ * @return whether the interface does point to point transmission
+ */
+ public boolean isPointToPoint()
+ throws SocketException
+ {
+ return VMNetworkInterface.isPointToPoint(netif.name);
+ }
+
+ /**
+ * Determines whether this interface is the loopback interface.
+ *
+ * @return whether the interface is the loopback interface
+ */
+ public boolean isLoopback()
+ throws SocketException
+ {
+ return VMNetworkInterface.isLoopback(netif.name);
+ }
+
+ /**
+ * Determines whether this interface supports multicast transmission.
+ *
+ * @return whether the interface supports multicast transmission.
+ */
+ public boolean supportsMulticast()
+ throws SocketException
+ {
+ return VMNetworkInterface.supportsMulticast(netif.name);
+ }
+
}