From ffd7609c12aaf3567e17b49cad5c5f04d4f29ed1 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 29 Jul 2009 16:07:52 -0700 Subject: [PATCH] add net_scope_to_string java wrapper --- bindings/java/src/jni/javasigar.c | 7 +++++++ bindings/java/src/org/hyperic/sigar/NetFlags.java | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/bindings/java/src/jni/javasigar.c b/bindings/java/src/jni/javasigar.c index 138c1497..45dd0e26 100644 --- a/bindings/java/src/jni/javasigar.c +++ b/bindings/java/src/jni/javasigar.c @@ -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) { diff --git a/bindings/java/src/org/hyperic/sigar/NetFlags.java b/bindings/java/src/org/hyperic/sigar/NetFlags.java index b28cc313..ed680032 100644 --- a/bindings/java/src/org/hyperic/sigar/NetFlags.java +++ b/bindings/java/src/org/hyperic/sigar/NetFlags.java @@ -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) ||