/[classpath]/classpath/java/net/NetworkInterface.java
ViewVC logotype

Diff of /classpath/java/net/NetworkInterface.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by mkoch, Wed Feb 16 12:36:21 2005 UTC revision 1.13 by mkoch, Mon Apr 11 18:58:39 2005 UTC
# Line 38  exception statement from your version. * Line 38  exception statement from your version. *
38    
39  package java.net;  package java.net;
40    
 import gnu.classpath.Configuration;  
   
41  import java.util.Enumeration;  import java.util.Enumeration;
42  import java.util.Vector;  import java.util.Vector;
43    
# Line 55  import java.util.Vector; Line 53  import java.util.Vector;
53   */   */
54  public final class NetworkInterface  public final class NetworkInterface
55  {  {
   static  
     {  
       if (Configuration.INIT_LOAD_LIBRARY)  
         System.loadLibrary("javanet");  
     }  
   
56    private String name;    private String name;
57    private Vector inetAddresses;    private Vector inetAddresses;
58    
# Line 71  public final class NetworkInterface Line 63  public final class NetworkInterface
63      this.inetAddresses.add(address);      this.inetAddresses.add(address);
64    }    }
65    
   private static native Vector getRealNetworkInterfaces()  
     throws SocketException;  
   
66    /**    /**
67     * Returns the name of the network interface     * Returns the name of the network interface
68     *     *
# Line 145  public final class NetworkInterface Line 134  public final class NetworkInterface
134    public static NetworkInterface getByName(String name)    public static NetworkInterface getByName(String name)
135      throws SocketException      throws SocketException
136    {    {
137      Vector networkInterfaces = getRealNetworkInterfaces();      Vector networkInterfaces = VMNetworkInterface.getInterfaces();
138    
139      for (Enumeration e = networkInterfaces.elements(); e.hasMoreElements();)      for (Enumeration e = networkInterfaces.elements(); e.hasMoreElements();)
140        {        {
# Line 172  public final class NetworkInterface Line 161  public final class NetworkInterface
161    public static NetworkInterface getByInetAddress(InetAddress addr)    public static NetworkInterface getByInetAddress(InetAddress addr)
162      throws SocketException      throws SocketException
163    {    {
164      Vector networkInterfaces = getRealNetworkInterfaces();      Vector networkInterfaces = VMNetworkInterface.getInterfaces();
165    
166      for (Enumeration interfaces = networkInterfaces.elements();      for (Enumeration interfaces = networkInterfaces.elements();
167           interfaces.hasMoreElements();)           interfaces.hasMoreElements();)
# Line 199  public final class NetworkInterface Line 188  public final class NetworkInterface
188     */     */
189    public static Enumeration getNetworkInterfaces() throws SocketException    public static Enumeration getNetworkInterfaces() throws SocketException
190    {    {
191      Vector networkInterfaces = getRealNetworkInterfaces();      Vector networkInterfaces = VMNetworkInterface.getInterfaces();
192    
193      if (networkInterfaces.isEmpty())      if (networkInterfaces.isEmpty())
194        return null;        return null;

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26