46 #include "io_fd_vpp_jvpp_core_JVppCoreImpl.h" 47 #include "jvpp_core_gen.h" 50 (JNIEnv * env, jclass clazz, jobject callback, jlong queue_address, jint my_client_index) {
56 plugin_main->
callbackClass = (jclass)(*env)->NewGlobalRef(env, (*env)->GetObjectClass(env, callback));
60 if (get_message_id(env, #N) == 0) return; 61 foreach_supported_api_message;
65 vl_msg_api_set_handlers(get_message_id(env, #N), #n, \ 66 vl_api_##n##_t_handler, \ 70 sizeof(vl_api_##n##_t), 1); 71 foreach_api_reply_handler;
76 (JNIEnv *env, jclass clazz) {
90 if ((*vm)->GetEnv(vm, (
void**) &env, JNI_VERSION_1_8) != JNI_OK) {
94 if (cache_class_references(env) != 0) {
99 return JNI_VERSION_1_8;
104 if ((*vm)->GetEnv(vm, (
void**) &env, JNI_VERSION_1_8) != JNI_OK) {
107 delete_class_references(env);
111 static void _host_to_net_string(JNIEnv * env, jstring javaString,
vl_api_string_t * vl_api_string)
113 const char *nativeString;
115 if (
NULL != javaString) {
116 nativeString = (*env)->GetStringUTFChars(env, javaString, 0);
123 (*env)->ReleaseStringUTFChars(env, javaString, nativeString);
127 static jstring _net_to_host_string(JNIEnv * env,
const vl_api_string_t * _net)
129 return (*env)->NewStringUTF(env, (
char *)_net->
buf);
135 return ((
int) (*env)->GetStringUTFLength(env,
string));
svm_queue_t * vl_input_queue
static size_t jstr_length(JNIEnv *env, jstring string)
static int vl_api_to_api_string(u32 len, const char *buf, vl_api_string_t *str)
JNIEXPORT void JNICALL Java_io_fd_vpp_jvpp_core_JVppCoreImpl_init0(JNIEnv *env, jclass clazz, jobject callback, jlong queue_address, jint my_client_index)
jint JNI_OnLoad(JavaVM *vm, void *reserved)
void JNI_OnUnload(JavaVM *vm, void *reserved)
#define clib_warning(format, args...)
#define uword_to_pointer(u, type)
JNIEXPORT void JNICALL Java_io_fd_vpp_jvpp_core_JVppCoreImpl_close0(JNIEnv *env, jclass clazz)
struct _svm_queue svm_queue_t