Lines Matching defs:env

316 static void throwException(JNIEnv *env, int error, const char *message)
319 jniThrowException(env, "java/lang/IllegalStateException", message);
321 jniThrowException(env, "java/lang/IllegalArgumentException", message);
325 static jint create(JNIEnv *env, jobject thiz, jint mtu)
329 throwException(env, tun, "Cannot create interface");
335 static jstring getName(JNIEnv *env, jobject thiz, jint tun)
339 throwException(env, SYSTEM_ERROR, "Cannot get interface name");
342 return env->NewStringUTF(name);
345 static jint setAddresses(JNIEnv *env, jobject thiz, jstring jName,
352 name = jName ? env->GetStringUTFChars(jName, NULL) : NULL;
354 jniThrowNullPointerException(env, "name");
357 addresses = jAddresses ? env->GetStringUTFChars(jAddresses, NULL) : NULL;
359 jniThrowNullPointerException(env, "addresses");
364 throwException(env, count, "Cannot set address");
370 env->ReleaseStringUTFChars(jName, name);
373 env->ReleaseStringUTFChars(jAddresses, addresses);
378 static jint setRoutes(JNIEnv *env, jobject thiz, jstring jName,
385 name = jName ? env->GetStringUTFChars(jName, NULL) : NULL;
387 jniThrowNullPointerException(env, "name");
390 routes = jRoutes ? env->GetStringUTFChars(jRoutes, NULL) : NULL;
392 jniThrowNullPointerException(env, "routes");
397 throwException(env, count, "Cannot set route");
403 env->ReleaseStringUTFChars(jName, name);
406 env->ReleaseStringUTFChars(jRoutes, routes);
411 static void reset(JNIEnv *env, jobject thiz, jstring jName)
413 const char *name = jName ? env->GetStringUTFChars(jName, NULL) : NULL;
415 jniThrowNullPointerException(env, "name");
419 throwException(env, SYSTEM_ERROR, "Cannot reset interface");
421 env->ReleaseStringUTFChars(jName, name);
424 static jint check(JNIEnv *env, jobject thiz, jstring jName)
426 const char *name = jName ? env->GetStringUTFChars(jName, NULL) : NULL;
428 jniThrowNullPointerException(env, "name");
432 env->ReleaseStringUTFChars(jName, name);
436 static void protect(JNIEnv *env, jobject thiz, jint socket, jstring jName)
438 const char *name = jName ? env->GetStringUTFChars(jName, NULL) : NULL;
440 jniThrowNullPointerException(env, "name");
444 throwException(env, SYSTEM_ERROR, "Cannot protect socket");
446 env->ReleaseStringUTFChars(jName, name);
461 int register_android_server_connectivity_Vpn(JNIEnv *env)
469 return jniRegisterNativeMethods(env, "com/android/server/connectivity/Vpn",