org.safehaus.uuid
Class NativeInterfaces
java.lang.Object
org.safehaus.uuid.NativeInterfaces
public class NativeInterfaces
- extends java.lang.Object
Proxy class that uses JNI-based functionality to obtain information
about local interfaces.
Note that there are two different places where platform-dependant
native code libraries can be located under:
- System-dependant standard library location (in unix systems
often something like /lib or /usr/lib). This is not the default;
if you want to enable this loading, you need to call
setUseStdLibDir(boolean)
before accessing any access method in
this class.
- Application dependant directory; often located in same directory
as app, or one of sub-directories. This is default setting; default
sub-directory (under current directory when starting app that uses
JUG) is specified as
sDefaultLibSubdir
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sDefaultLibSubdir
protected static final java.lang.String sDefaultLibSubdir
- See Also:
- Constant Field Values
NativeInterfaces
public NativeInterfaces()
setLibDir
public static void setLibDir(java.io.File f)
- Method that allows overriding of default library directory, to
allow loading of native interface access code from specific
application dependant location.
setUseStdLibDir
public static void setUseStdLibDir(boolean b)
checkLoad
protected static void checkLoad()
getPrimaryInterface
public static EthernetAddress getPrimaryInterface()
getAllInterfaces
public static EthernetAddress[] getAllInterfaces()
main
public static void main(java.lang.String[] args)
- Test driver to test if native ethernet adapter/interface access
works ok. Tries to get the primary interface and output it; prints
out error message if access fails.