add net_scope_to_string java wrapper

This commit is contained in:
Doug MacEachern 2009-07-29 16:07:52 -07:00
parent 75b83e6cf5
commit ffd7609c12
2 changed files with 14 additions and 0 deletions

View File

@ -882,6 +882,13 @@ JNIEXPORT jstring SIGAR_JNI(NetFlags_getIfFlagsString)
return JENV->NewStringUTF(env, buf);
}
JNIEXPORT jstring SIGAR_JNI(NetFlags_getScopeString)
(JNIEnv *env, jclass cls, jint scope)
{
const char *buf = sigar_net_scope_to_string(scope);
return JENV->NewStringUTF(env, buf);
}
JNIEXPORT jobjectArray SIGAR_JNIx(getNetConnectionList)
(JNIEnv *env, jobject sigar_obj, jint flags)
{

View File

@ -157,6 +157,13 @@ public class NetFlags {
*/
public static native String getIfFlagsString(long flags);
/**
* @param network interface ipv6 address scope.
* @return String representation of ipv6 address scope.
* @see org.hyperic.sigar.NetInterfaceConfig#getScope6
*/
public static native String getScopeString(int scope);
public static boolean isAnyAddress(String address) {
return
(address == null) ||