37 |
|
|
38 |
package java.net; |
package java.net; |
39 |
|
|
40 |
|
import gnu.classpath.Configuration; |
41 |
import java.util.Enumeration; |
import java.util.Enumeration; |
42 |
import java.util.Vector; |
import java.util.Vector; |
43 |
|
|
53 |
*/ |
*/ |
54 |
public final class NetworkInterface |
public final class NetworkInterface |
55 |
{ |
{ |
56 |
|
static |
57 |
|
{ |
58 |
|
if (Configuration.INIT_LOAD_LIBRARY) |
59 |
|
{ |
60 |
|
System.loadLibrary ("javanet"); |
61 |
|
} |
62 |
|
} |
63 |
|
|
64 |
private String name; |
private String name; |
65 |
|
|
66 |
private Vector inetAddresses; |
private Vector inetAddresses; |
194 |
public static Enumeration getNetworkInterfaces () |
public static Enumeration getNetworkInterfaces () |
195 |
throws SocketException |
throws SocketException |
196 |
{ |
{ |
197 |
Vector networkInterfaces = getRealNetworkInterfaces (); |
Vector networkInterfaces = getRealNetworkInterfaces(); |
|
|
|
|
Enumeration tmp = networkInterfaces.elements (); |
|
198 |
|
|
199 |
if (tmp.hasMoreElements ()) |
if (networkInterfaces.isEmpty()) |
200 |
return tmp; |
return null; |
201 |
|
|
202 |
return null; |
return networkInterfaces.elements(); |
203 |
} |
} |
204 |
|
|
205 |
/** |
/** |