diff --git a/vpp-api/java/Makefile.am b/vpp-api/java/Makefile.am
index 0e16b72..8ad24e1 100644
--- a/vpp-api/java/Makefile.am
+++ b/vpp-api/java/Makefile.am
@@ -90,4 +90,51 @@
 $(demo): $(jarfile)
 	$(JAVAC) -cp $(jarfile) -d $(JAVAROOT) @srcdir@/japi/test/demo.java
 
-all-local: $(jarfile) $(demo)
+#
+# jVpp binding
+#
+
+nobase_include_HEADERS +=		\
+  jvpp/org_openvpp_jvpp_VppJNIConnection.h
+
+lib_LTLIBRARIES += libjvpp.la
+
+libjvpp_la_SOURCES = jvpp/jvpp.c
+libjvpp_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \
+	              -lpthread -lm -lrt
+libjvpp_la_LDFLAGS = -module
+libjvpp_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
+
+# todo make two jars api jar and impl jar
+jarfile_jvpp = jvpp-$(PACKAGE_VERSION).jar
+packagedir_jvpp = org/openvpp/jvpp
+JAVAROOT = .
+
+BUILT_SOURCES += jvpp/org_openvpp_jvpp_VppJNIConnection.h jvpp/jvpp.c
+
+jvpp/org_openvpp_jvpp_VppJNIConnection.h: $(prefix)/../vpp/api/vpe.api
+	@echo "  jVpp API";				\
+	mkdir -p dto future callfacade callback @srcdir@/jvpp/gen/target/org/openvpp/jvpp;				\
+	$(CC) $(CPPFLAGS) -E -P -C -x c $<			                  \
+	| vppapigen --input - --python defs_vpp_papi.py; 				\
+	@srcdir@/jvpp/gen/jvpp_gen.py -i defs_vpp_papi.py;				\
+	cp -rf dto future callfacade callback *.java -t @srcdir@/jvpp/gen/target/org/openvpp/jvpp/;				\
+	cp -rf jvpp_gen.h -t @srcdir@/jvpp/gen/target;				\
+	rm -rf dto future callfacade callback *.java jvpp_gen.h;				\
+	$(JAVAC) -classpath . -d . @srcdir@/jvpp/org/openvpp/jvpp/*.java \
+		@srcdir@/jvpp/org/openvpp/jvpp/dto/*.java  \
+		@srcdir@/jvpp/org/openvpp/jvpp/callback/*.java \
+		@srcdir@/jvpp/org/openvpp/jvpp/future/*.java  \
+		@srcdir@/jvpp/org/openvpp/jvpp/test/*.java  \
+		@srcdir@/jvpp/gen/target/org/openvpp/jvpp/*.java \
+		@srcdir@/jvpp/gen/target/org/openvpp/jvpp/dto/*.java  \
+		@srcdir@/jvpp/gen/target/org/openvpp/jvpp/callback/*.java \
+		@srcdir@/jvpp/gen/target/org/openvpp/jvpp/callfacade/*.java \
+		@srcdir@/jvpp/gen/target/org/openvpp/jvpp/future/*.java ; \
+	$(JAVAH) -classpath . -d jvpp org.openvpp.jvpp.VppJNIConnection ;				\
+	$(JAVAH) -classpath . -d jvpp org.openvpp.jvpp.JVppImpl ;
+
+$(jarfile_jvpp): libjvpp.la
+	cd .libs ; $(JAR) cf $(JARFLAGS) ../$@ libjvpp.so.0.0.0 ../$(packagedir_jvpp)/* ; cd ..
+
+all-local: $(jarfile) $(jarfile_jvpp) $(demo)
diff --git a/vpp-api/java/configure.ac b/vpp-api/java/configure.ac
index 02f2570..35e2023 100644
--- a/vpp-api/java/configure.ac
+++ b/vpp-api/java/configure.ac
@@ -8,12 +8,19 @@
 AC_PROG_CC
 AM_PROG_CC_C_O
 
+if test -f /usr/bin/lsb_release  && test `lsb_release -si` == "Ubuntu"  && test `lsb_release -sr` == "14.04"  && test -d /usr/lib/jvm/java-8-openjdk-amd64/ ; then
+    JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
+    JAVAC=${JAVA_HOME}/bin/javac
+    PATH=${JAVA_HOME}/bin/:${PATH}
+    break
+fi
+
+AX_CHECK_JAVA_HOME
 AX_PROG_JAVAC
 AX_PROG_JAVAH
 AX_PROG_JAR
 AX_PROG_JAVADOC
 AX_PROG_JAVA
-AX_CHECK_JAVA_HOME
 
 AC_OUTPUT([Makefile])
 
diff --git a/vpp-api/java/jvpp/gen/callback_gen.py b/vpp-api/java/jvpp/gen/callback_gen.py
index 218ac62..8a0d201 100644
--- a/vpp-api/java/jvpp/gen/callback_gen.py
+++ b/vpp-api/java/jvpp/gen/callback_gen.py
@@ -25,7 +25,11 @@
 package $base_package.$callback_package;
 
 /**
- * $docs
+ * <p>Represents callback for vpe.api message.
+ * <br>It was generated by callback_gen.py based on $inputfile preparsed data:
+ * <pre>
+$docs
+ * </pre>
  */
 public interface $cls_name extends $base_package.$callback_package.JVppCallback {
 
@@ -38,16 +42,16 @@
 package $base_package.$callback_package;
 
 /**
- *
- *
- * Global aggregated callback interface
+ * <p>Global aggregated callback interface.
+ * <br>It was generated by callback_gen.py based on $inputfile
+ * <br>(python representation of vpe.api generated by vppapigen).
  */
 public interface JVppGlobalCallback extends $callbacks {
 }
 """)
 
 
-def generate_callbacks(func_list, base_package, callback_package, dto_package):
+def generate_callbacks(func_list, base_package, callback_package, dto_package, inputfile):
     """ Generates callback interfaces """
     print "Generating Callback interfaces"
 
@@ -73,7 +77,8 @@
         reply_type = "%s.%s.%s" % (base_package, dto_package, camel_case_name_with_suffix)
         method = "void on{0}({1} reply);".format(camel_case_name_with_suffix, reply_type)
         callback_file.write(
-            callback_template.substitute(docs='Generated from ' + str(func),
+            callback_template.substitute(inputfile=inputfile,
+                                         docs=util.api_message_to_javadoc(func),
                                          cls_name=camel_case_name + callback_suffix,
                                          callback_method=method,
                                          base_package=base_package,
@@ -82,7 +87,8 @@
         callback_file.close()
 
     callback_file = open(os.path.join(callback_package, "JVppGlobalCallback.java"), 'w')
-    callback_file.write(global_callback_template.substitute(callbacks=", ".join(callbacks),
+    callback_file.write(global_callback_template.substitute(inputfile=inputfile,
+                                                            callbacks=", ".join(callbacks),
                                                             base_package=base_package,
                                                             callback_package=callback_package))
     callback_file.flush()
diff --git a/vpp-api/java/jvpp/gen/dto_gen.py b/vpp-api/java/jvpp/gen/dto_gen.py
index 17fde68..378d279 100644
--- a/vpp-api/java/jvpp/gen/dto_gen.py
+++ b/vpp-api/java/jvpp/gen/dto_gen.py
@@ -20,7 +20,11 @@
 package $base_package.$dto_package;
 
 /**
- * $docs
+ * <p>This class represents $description.
+ * <br>It was generated by dto_gen.py based on $inputfile preparsed data:
+ * <pre>
+$docs
+ * </pre>
  */
 public final class $cls_name implements $base_package.$dto_package.$base_type {
 
@@ -36,8 +40,7 @@
         return jvpp.$method_name($args);
     }\n""")
 
-
-def generate_dtos(func_list, base_package, dto_package):
+def generate_dtos(func_list, base_package, dto_package, inputfile):
     """ Generates dto objects in a dedicated package """
     print "Generating DTOs"
 
@@ -60,6 +63,7 @@
         methods = ""
         base_type = ""
         if util.is_reply(camel_case_dto_name):
+            description = "vpe.api reply DTO"
             request_dto_name = get_request_name(camel_case_dto_name, func['name'])
             if util.is_details(camel_case_dto_name):
                 # FIXME assumption that dump calls end with "Dump" suffix. Not enforced in vpe.api
@@ -75,11 +79,15 @@
                                                args=args)
             if util.is_dump(camel_case_dto_name):
                 base_type += "JVppDump"
+                description = "vpe.api dump request DTO"
             else:
                 base_type += "JVppRequest"
+                description = "vpe.api request DTO"
 
         dto_file = open(dto_path, 'w')
-        dto_file.write(dto_template.substitute(docs='Generated from ' + str(func),
+        dto_file.write(dto_template.substitute(inputfile=inputfile,
+                                               description=description,
+                                               docs=util.api_message_to_javadoc(func),
                                                cls_name=camel_case_dto_name,
                                                fields=fields,
                                                methods=methods,
@@ -89,13 +97,12 @@
         dto_file.flush()
         dto_file.close()
 
-    flush_dump_reply_dtos()
+    flush_dump_reply_dtos(inputfile)
 
 
 dump_dto_suffix = "ReplyDump"
 dump_reply_artificial_dtos = {}
 
-
 # Returns request name or special one from unconventional_naming_rep_req map
 def get_request_name(camel_case_dto_name, func_name):
     return util.underscore_to_camelcase_upper(
@@ -103,12 +110,14 @@
         else util.remove_reply_suffix(camel_case_dto_name)
 
 
-def flush_dump_reply_dtos():
+def flush_dump_reply_dtos(inputfile):
     for dump_reply_artificial_dto in dump_reply_artificial_dtos.values():
         dto_path = os.path.join(dump_reply_artificial_dto['dto_package'],
                                 dump_reply_artificial_dto['cls_name'] + ".java")
         dto_file = open(dto_path, 'w')
-        dto_file.write(dto_template.substitute(docs=dump_reply_artificial_dto['docs'],
+        dto_file.write(dto_template.substitute(inputfile=inputfile,
+                                               description="vpe.api dump reply wrapper",
+                                               docs=dump_reply_artificial_dto['docs'],
                                                cls_name=dump_reply_artificial_dto['cls_name'],
                                                fields=dump_reply_artificial_dto['fields'],
                                                methods=dump_reply_artificial_dto['methods'],
@@ -133,7 +142,7 @@
         dump_reply_artificial_dtos[request_dto_name]['fields'] = \
             dump_reply_artificial_dtos[request_dto_name]['fields'] + '\n' + fields
     else:
-        dump_reply_artificial_dtos[request_dto_name] = ({'docs': 'Dump reply wrapper generated from ' + str(func),
+        dump_reply_artificial_dtos[request_dto_name] = ({'docs': util.api_message_to_javadoc(func),
                                                          'cls_name': cls_name,
                                                          'fields': fields,
                                                          'methods': "",
diff --git a/vpp-api/java/jvpp/gen/jvpp_c_gen.py b/vpp-api/java/jvpp/gen/jvpp_c_gen.py
new file mode 100644
index 0000000..c0efed8
--- /dev/null
+++ b/vpp-api/java/jvpp/gen/jvpp_c_gen.py
@@ -0,0 +1,330 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2016 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+# l
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import os, util
+from string import Template
+
+def is_manually_generated(f_name):
+    return f_name in {'control_ping_reply'}
+
+# TODO: cache class/method/field identifiers to achieve better performance
+# https://jira.fd.io/browse/HONEYCOMB-42
+request_class_template = Template("""
+    jclass requestClass = (*env)->FindClass(env, "org/openvpp/jvpp/dto/${java_name_upper}");""")
+
+request_field_identifier_template = Template("""
+    jfieldID ${java_name}FieldId = (*env)->GetFieldID(env, requestClass, "${java_name}", "${jni_signature}");
+    ${jni_type} ${java_name} = (*env)->Get${jni_getter}(env, request, ${java_name}FieldId);
+    """)
+
+u8_struct_setter_template = Template("""
+    mp->${c_name} = ${java_name};""")
+
+u16_struct_setter_template = Template("""
+    mp->${c_name} = clib_host_to_net_u16(${java_name});""")
+
+u32_struct_setter_template = Template("""
+    mp->${c_name} = clib_host_to_net_u32(${java_name});""")
+
+i32_struct_setter_template = Template("""
+    mp->${c_name} = clib_host_to_net_i32(${java_name});!""")
+
+u64_struct_setter_template = Template("""
+    mp->${c_name} = clib_host_to_net_u64(${java_name});""")
+
+u8_array_struct_setter_template = Template("""
+    {
+        jsize cnt = (*env)->GetArrayLength (env, ${java_name});
+        if (cnt > sizeof(mp->${c_name})) cnt = sizeof(mp->${c_name});
+        (*env)->GetByteArrayRegion(env, ${java_name}, 0, cnt, (jbyte *)mp->${c_name});
+    }
+""")
+
+u32_array_struct_setter_template = Template("""
+    jint * ${java_name}ArrayElements = (*env)->GetIntArrayElements(env, ${java_name}, NULL);
+    {
+        int _i;
+        for (_i = 0; _i < 0; _i++) {
+            mp->${c_name}[_i] = clib_host_to_net_u32(${java_name}ArrayElements[_i]);
+        }
+    }
+    (*env)->ReleaseIntArrayElements (env, ${java_name}, ${java_name}ArrayElements, 0);
+    """)
+
+vl_api_ip4_fib_counter_t_array_struct_setter_template = Template("""
+    // vl_api_ip4_fib_counter_t_array_field_setter_template FIXME""")
+
+vl_api_ip6_fib_counter_t_array_struct_setter_template = Template("""
+    // vl_api_ip6_fib_counter_t_array_field_setter_template FIXME""")
+
+struct_setter_templates = {'u8': u8_struct_setter_template,
+                          'u16': u32_struct_setter_template,
+                          'u32': u32_struct_setter_template,
+                          'i32': u32_struct_setter_template,
+                          'u64': u64_struct_setter_template,
+                          'u8[]': u8_array_struct_setter_template,
+                          'u32[]': u32_array_struct_setter_template,
+                          'vl_api_ip4_fib_counter_t[]': vl_api_ip4_fib_counter_t_array_struct_setter_template,
+                          'vl_api_ip6_fib_counter_t[]': vl_api_ip6_fib_counter_t_array_struct_setter_template
+                  }
+
+jni_impl_template = Template("""
+/**
+ * JNI binding for sending ${c_name} vpe.api message.
+ * Generated based on $inputfile preparsed data:
+$api_data
+ */
+JNIEXPORT jint JNICALL Java_org_openvpp_jvpp_JVppImpl_${java_name}0
+(JNIEnv * env, jclass clazz$args) {
+    vppjni_main_t *jm = &vppjni_main;
+    vl_api_${c_name}_t * mp;
+    u32 my_context_id;
+    int rv;
+    rv = vppjni_sanity_check (jm);
+    if (rv) return rv;
+    my_context_id = vppjni_get_context_id (jm);
+    $request_class
+    $field_identifiers
+    M(${c_name_uppercase}, ${c_name});
+    mp->context = clib_host_to_net_u32 (my_context_id);
+    $struct_setters
+    S;
+    return my_context_id;
+}""")
+
+def generate_jni_impl(func_list, inputfile):
+    jni_impl = []
+    for f in func_list:
+        f_name = f['name']
+        camel_case_function_name = util.underscore_to_camelcase(f_name)
+        if is_manually_generated(f_name) or util.is_reply(camel_case_function_name) \
+                or util.is_ignored(f_name) or util.is_notification(f_name):
+            continue
+
+        arguments = ''
+        request_class = ''
+        field_identifiers = ''
+        struct_setters = ''
+        f_name_uppercase = f_name.upper()
+
+        if f['args']:
+            arguments = ', jobject request'
+            camel_case_function_name_upper = util.underscore_to_camelcase_upper(f_name)
+
+            request_class = request_class_template.substitute(java_name_upper=camel_case_function_name_upper)
+
+            # field identifiers
+            for t in zip(f['types'], f['args']):
+                jni_type = t[0]
+                java_field_name = util.underscore_to_camelcase(t[1])
+                jni_signature = util.jni_2_signature_mapping[jni_type]
+                jni_getter = util.jni_field_accessors[jni_type]
+                field_identifiers += request_field_identifier_template.substitute(
+                        jni_type=jni_type,
+                        java_name=java_field_name,
+                        jni_signature=jni_signature,
+                        jni_getter=jni_getter)
+
+            # field setters
+            for t in zip(f['c_types'], f['args']):
+                c_type = t[0]
+                c_name = t[1]
+                java_field_name = util.underscore_to_camelcase(c_name)
+
+                struct_setter_template = struct_setter_templates[c_type]
+
+                struct_setters += struct_setter_template.substitute(
+                        c_name=c_name,
+                        java_name=java_field_name)
+
+        jni_impl.append(jni_impl_template.substitute(
+                inputfile=inputfile,
+                api_data=util.api_message_to_javadoc(f),
+                java_name=camel_case_function_name,
+                c_name_uppercase=f_name_uppercase,
+                c_name=f_name,
+                request_class=request_class,
+                field_identifiers=field_identifiers,
+                struct_setters=struct_setters,
+                args=arguments))
+
+    return "\n".join(jni_impl)
+
+
+dto_field_id_template = Template("""
+    jfieldID ${java_name}FieldId = (*env)->GetFieldID(env, dtoClass, "${java_name}", "${jni_signature}");""")
+
+default_dto_field_setter_template = Template("""
+    (*env)->Set${jni_setter}(env, dto, ${java_name}FieldId, mp->${c_name});
+""")
+
+u32_dto_field_setter_template = Template("""
+    (*env)->Set${jni_setter}(env, dto, ${java_name}FieldId, clib_net_to_host_u32(mp->${c_name}));
+""")
+
+u64_dto_field_setter_template = Template("""
+    (*env)->Set${jni_setter}(env, dto, ${java_name}FieldId, clib_net_to_host_u64(mp->${c_name}));
+""")
+
+u8_array_dto_field_setter_template = Template("""
+    jbyteArray ${java_name} = (*env)->NewByteArray(env, sizeof(mp->${c_name}));
+    (*env)->SetByteArrayRegion(env, ${java_name}, 0, sizeof(mp->${c_name}), (const jbyte*)mp->${c_name});
+    (*env)->SetObjectField(env, dto, ${java_name}FieldId, ${java_name});
+""")
+
+# For each u64 array we get its elements. Then we convert values to host byte order.
+# All changes to  jint* buffer are written to jlongArray (isCopy is set to NULL)
+u64_array_dto_field_setter_template = Template("""
+    jlongArray ${java_name} = (*env)->NewLongArray(env, sizeof(mp->${c_name}));
+    {
+        jlong * ${java_name}ArrayElements = (*env)->GetLongArrayElements(env, ${java_name}, NULL);
+        int _i;
+        for (_i = 0; _i < 0; _i++) {
+            ${java_name}ArrayElements[_i] = clib_net_to_host_u64(mp->${c_name}[_i]);
+        }
+    }
+    (*env)->SetObjectField(env, dto, ${java_name}FieldId, ${java_name});
+""")
+
+dto_field_setter_templates = {'u8': default_dto_field_setter_template,
+                      'u16': u32_dto_field_setter_template,
+                      'u32': u32_dto_field_setter_template,
+                      'i32': u32_dto_field_setter_template,
+                      'u64': u64_dto_field_setter_template,
+                      'f64': default_dto_field_setter_template,
+                      'u64[]': u64_array_dto_field_setter_template,
+                      'u8[]': u8_array_dto_field_setter_template
+                      }
+
+msg_handler_template = Template("""
+/**
+ * Handler for ${handler_name} vpe.api message.
+ * Generated based on $inputfile preparsed data:
+$api_data
+ */
+static void vl_api_${handler_name}_t_handler (vl_api_${handler_name}_t * mp)
+{
+    vppjni_main_t * jm = &vppjni_main;
+    JNIEnv *env = jm->jenv;
+
+    jclass dtoClass = (*env)->FindClass(env, "org/openvpp/jvpp/dto/${dto_name}");
+
+    jmethodID constructor = (*env)->GetMethodID(env, dtoClass, "<init>", "()V");
+    jmethodID callbackMethod = (*env)->GetMethodID(env, jm->callbackClass, "on${dto_name}", "(Lorg/openvpp/jvpp/dto/${dto_name};)V");
+
+    jobject dto = (*env)->NewObject(env, dtoClass, constructor);
+    $dto_setters
+    (*env)->CallVoidMethod(env, jm->callback, callbackMethod, dto);
+}""")
+
+def generate_msg_handlers(func_list, inputfile):
+    handlers = []
+    for f in func_list:
+        handler_name = f['name']
+        dto_name = util.underscore_to_camelcase_upper(handler_name)
+
+        if is_manually_generated(handler_name) or not util.is_reply(dto_name) or util.is_ignored(handler_name) or util.is_notification(handler_name):
+            # TODO handle notifications
+            continue
+
+        dto_setters = ''
+        # dto setters
+        for t in zip(f['c_types'], f['types'], f['args']):
+            c_type = t[0]
+            jni_type = t[1]
+            c_name = t[2]
+
+            java_field_name = util.underscore_to_camelcase(c_name)
+            jni_signature = util.jni_2_signature_mapping[jni_type]
+            jni_setter = util.jni_field_accessors[jni_type]
+
+            dto_setters += dto_field_id_template.substitute(
+                    java_name=java_field_name,
+                    jni_signature=jni_signature)
+
+            dto_setter_template = dto_field_setter_templates[c_type]
+
+            dto_setters += dto_setter_template.substitute(
+                    java_name=java_field_name,
+                    jni_signature=jni_signature,
+                    c_name=c_name,
+                    jni_setter=jni_setter)
+
+        handlers.append(msg_handler_template.substitute(
+                inputfile=inputfile,
+                api_data=util.api_message_to_javadoc(f),
+                handler_name=handler_name,
+                dto_name=dto_name,
+                dto_setters=dto_setters))
+
+    return "\n".join(handlers)
+
+
+handler_registration_template = Template("""_(${upercase_name}, ${name}) \\
+""")
+
+
+def generate_handler_registration(func_list):
+    handler_registration = ["#define foreach_vpe_api_msg \\\n"]
+    for f in func_list:
+        name = f['name']
+        camelcase_name = util.underscore_to_camelcase(f['name'])
+
+        if not util.is_reply(camelcase_name) or util.is_ignored(name) or util.is_notification(name):
+            # TODO handle notifications
+            continue
+
+        handler_registration.append(handler_registration_template.substitute(
+                name=name,
+                upercase_name=name.upper()))
+
+    return "".join(handler_registration)
+
+jvpp_c_template = Template("""
+/**
+ * This file contains JNI bindings for jvpp Java API.
+ * It was generated by jvpp_c_gen.py based on $inputfile
+ * (python representation of vpe.api generated by vppapigen).
+ */
+
+// JNI bindings
+$jni_implementations
+
+// Message handlers
+$msg_handlers
+
+// Registration of message handlers in vlib
+$handler_registration
+""")
+
+def generate_jvpp(func_list, inputfile):
+    """ Generates jvpp C file """
+    print "Generating jvpp C"
+
+    jni_impl = generate_jni_impl(func_list, inputfile)
+    msg_handlers = generate_msg_handlers(func_list, inputfile)
+    handler_registration = generate_handler_registration(func_list)
+
+    jvpp_c_file = open("jvpp_gen.h", 'w')
+    jvpp_c_file.write(jvpp_c_template.substitute(
+            inputfile=inputfile,
+            jni_implementations=jni_impl,
+            msg_handlers=msg_handlers,
+            handler_registration=handler_registration))
+    jvpp_c_file.flush()
+    jvpp_c_file.close()
+
+
diff --git a/vpp-api/java/jvpp/gen/jvpp_callback_facade_gen.py b/vpp-api/java/jvpp/gen/jvpp_callback_facade_gen.py
index 731bd89..7b8723b 100644
--- a/vpp-api/java/jvpp/gen/jvpp_callback_facade_gen.py
+++ b/vpp-api/java/jvpp/gen/jvpp_callback_facade_gen.py
@@ -22,6 +22,11 @@
 jvpp_ifc_template = Template("""
 package $base_package.$callback_facade_package;
 
+/**
+ * <p>Callback Java API representation of vpe.api.
+ * <br>It was generated by jvpp_callback_facade_gen.py based on $inputfile
+ * <br>(python representation of vpe.api generated by vppapigen).
+ */
 public interface CallbackJVpp extends java.lang.AutoCloseable {
 
     @Override
@@ -36,6 +41,11 @@
 jvpp_impl_template = Template("""
 package $base_package.$callback_facade_package;
 
+/**
+ * <p>Default implementation of CallbackJVpp interface.
+ * <br>It was generated by jvpp_callback_facade_gen.py based on $inputfile
+ * <br>(python representation of vpe.api generated by vppapigen).
+ */
 public final class CallbackJVppFacade implements $base_package.$callback_facade_package.CallbackJVpp {
 
     private final $base_package.JVpp jvpp;
@@ -78,7 +88,7 @@
 """)
 
 
-def generate_jvpp(func_list, base_package, dto_package, callback_package, callback_facade_package):
+def generate_jvpp(func_list, base_package, dto_package, callback_package, callback_facade_package, inputfile):
     """ Generates callback facade """
     print "Generating JVpp callback facade"
 
@@ -131,7 +141,8 @@
     join = os.path.join(callback_facade_package, "CallbackJVpp.java")
     jvpp_file = open(join, 'w')
     jvpp_file.write(
-        jvpp_ifc_template.substitute(methods="\n".join(methods),
+        jvpp_ifc_template.substitute(inputfile=inputfile,
+                                     methods="\n".join(methods),
                                      base_package=base_package,
                                      dto_package=dto_package,
                                      callback_facade_package=callback_facade_package))
@@ -139,7 +150,8 @@
     jvpp_file.close()
 
     jvpp_file = open(os.path.join(callback_facade_package, "CallbackJVppFacade.java"), 'w')
-    jvpp_file.write(jvpp_impl_template.substitute(methods="\n".join(methods_impl),
+    jvpp_file.write(jvpp_impl_template.substitute(inputfile=inputfile,
+                                                  methods="\n".join(methods_impl),
                                                   base_package=base_package,
                                                   dto_package=dto_package,
                                                   callback_package=callback_package,
@@ -147,14 +159,16 @@
     jvpp_file.flush()
     jvpp_file.close()
 
-    generate_callback(func_list, base_package, dto_package, callback_package, callback_facade_package)
+    generate_callback(func_list, base_package, dto_package, callback_package, callback_facade_package, inputfile)
 
 
 jvpp_facade_callback_template = Template("""
 package $base_package.$callback_facade_package;
 
 /**
- * Async facade callback setting values to future objects
+ * <p>JVppGlobalCallback implementation for Java Callback API.
+ * <br>It was generated by jvpp_callback_facade_gen.py based on $inputfile
+ * <br>(python representation of vpe.api generated by vppapigen).
  */
 public final class CallbackJVppFacadeCallback implements $base_package.$callback_package.JVppGlobalCallback {
 
@@ -185,7 +199,7 @@
 """)
 
 
-def generate_callback(func_list, base_package, dto_package, callback_package, callback_facade_package):
+def generate_callback(func_list, base_package, dto_package, callback_package, callback_facade_package, inputfile):
     callbacks = []
     for func in func_list:
 
@@ -204,7 +218,8 @@
                                                                          callback_dto=camel_case_name_with_suffix))
 
     jvpp_file = open(os.path.join(callback_facade_package, "CallbackJVppFacadeCallback.java"), 'w')
-    jvpp_file.write(jvpp_facade_callback_template.substitute(base_package=base_package,
+    jvpp_file.write(jvpp_facade_callback_template.substitute(inputfile=inputfile,
+                                                             base_package=base_package,
                                                              dto_package=dto_package,
                                                              callback_package=callback_package,
                                                              methods="".join(callbacks),
diff --git a/vpp-api/java/jvpp/gen/jvpp_future_facade_gen.py b/vpp-api/java/jvpp/gen/jvpp_future_facade_gen.py
index 2aae5b8..60010b1 100644
--- a/vpp-api/java/jvpp/gen/jvpp_future_facade_gen.py
+++ b/vpp-api/java/jvpp/gen/jvpp_future_facade_gen.py
@@ -22,7 +22,9 @@
 package $base_package.$future_package;
 
 /**
- * Async facade callback setting values to future objects
+ * <p>Async facade callback setting values to future objects
+ * <br>It was generated by jvpp_future_facade_gen.py based on $inputfile
+ * <br>(python representation of vpe.api generated by vppapigen).
  */
 public final class FutureJVppFacadeCallback implements $base_package.$callback_package.JVppGlobalCallback {
 
@@ -119,7 +121,7 @@
 """)
 
 
-def generate_jvpp(func_list, base_package, dto_package, callback_package, future_facade_package):
+def generate_jvpp(func_list, base_package, dto_package, callback_package, future_facade_package, inputfile):
     """ Generates JVpp interface and JNI implementation """
     print "Generating JVpp future facade"
 
@@ -159,7 +161,8 @@
                                                                                  callback_dto=camel_case_name_with_suffix))
 
     jvpp_file = open(os.path.join(future_facade_package, "FutureJVppFacadeCallback.java"), 'w')
-    jvpp_file.write(jvpp_facade_callback_template.substitute(base_package=base_package,
+    jvpp_file.write(jvpp_facade_callback_template.substitute(inputfile=inputfile,
+                                                             base_package=base_package,
                                                              dto_package=dto_package,
                                                              callback_package=callback_package,
                                                              methods="".join(callbacks),
diff --git a/vpp-api/java/jvpp/gen/jvpp_gen.py b/vpp-api/java/jvpp/gen/jvpp_gen.py
new file mode 100755
index 0000000..931141e
--- /dev/null
+++ b/vpp-api/java/jvpp/gen/jvpp_gen.py
@@ -0,0 +1,131 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2016 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+# l
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import argparse
+import importlib
+import sys
+
+import callback_gen
+import dto_gen
+import jvpp_callback_facade_gen
+import jvpp_future_facade_gen
+import jvpp_impl_gen
+import jvpp_c_gen
+import util
+
+# Invocation:
+# ~/Projects/vpp/vpp-api/jvpp/gen$ mkdir -p java/org/openvpp/jvpp && cd java/org/openvpp/jvpp
+# ~/Projects/vpp/vpp-api/jvpp/gen/java/org/openvpp/jvpp$ ../../../../jvpp_gen.py -idefs_api_vpp_papi.py
+#
+# Compilation:
+# ~/Projects/vpp/vpp-api/jvpp/gen/java/org/openvpp/jvpp$ javac *.java dto/*.java callback/*.java
+# 
+# where
+# defs_api_vpp_papi.py - vpe.api in python format (generated by vppapigen)
+from util import vpp_2_jni_type_mapping
+
+parser = argparse.ArgumentParser(description='VPP Java API generator')
+parser.add_argument('-i', action="store", dest="inputfile")
+args = parser.parse_args()
+
+sys.path.append(".")
+
+inputfile = args.inputfile.replace('.py', '')
+cfg = importlib.import_module(inputfile, package=None)
+
+
+# FIXME: functions unsupported due to problems with vpe.api
+def is_supported(f_name):
+    return f_name not in {'vnet_ip4_fib_counters', 'vnet_ip6_fib_counters'}
+
+
+def is_request_field(field_name):
+    return field_name not in {'_vl_msg_id', 'client_index', 'context'}
+
+
+def is_response_field(field_name):
+    return field_name not in {'_vl_msg_id'}
+
+
+def get_args(t, filter):
+    arg_list = []
+    for i in t:
+        if not filter(i[1]):
+            continue
+        arg_list.append(i[1])
+    return arg_list
+
+
+def get_types(t, filter):
+    types_list = []
+    c_types_list = []
+    for i in t:
+        if not filter(i[1]):
+            continue
+        if len(i) is 3:  # array type
+            types_list.append(vpp_2_jni_type_mapping[i[0]] + 'Array')
+            c_types_list.append(i[0] + '[]')
+        else:  # primitive type
+            types_list.append(vpp_2_jni_type_mapping[i[0]])
+            c_types_list.append(i[0])
+    return types_list, c_types_list
+
+
+def get_definitions():
+    # Pass 1
+    func_list = []
+    func_name = {}
+    for a in cfg.vppapidef:
+        if not is_supported(a[0]):
+            continue
+
+        java_name = util.underscore_to_camelcase(a[0])
+
+        # For replies include all the arguments except message_id
+        if util.is_reply(java_name):
+            types, c_types = get_types(a[1:], is_response_field)
+            func_name[a[0]] = dict(
+                [('name', a[0]), ('java_name', java_name),
+                 ('args', get_args(a[1:], is_response_field)), ('full_args', get_args(a[1:], lambda x: True)),
+                 ('types', types), ('c_types', c_types)])
+        # For requests skip message_id, client_id and context
+        else:
+            types, c_types = get_types(a[1:], is_request_field)
+            func_name[a[0]] = dict(
+                [('name', a[0]), ('java_name', java_name),
+                 ('args', get_args(a[1:], is_request_field)), ('full_args', get_args(a[1:], lambda x: True)),
+                 ('types', types), ('c_types', c_types)])
+
+        # Indexed by name
+        func_list.append(func_name[a[0]])
+    return func_list, func_name
+
+
+func_list, func_name = get_definitions()
+
+base_package = 'org.openvpp.jvpp'
+dto_package = 'dto'
+callback_package = 'callback'
+future_package = 'future'
+# TODO find better package name
+callback_facade_package = 'callfacade'
+
+dto_gen.generate_dtos(func_list, base_package, dto_package, args.inputfile)
+jvpp_impl_gen.generate_jvpp(func_list, base_package, dto_package, args.inputfile)
+callback_gen.generate_callbacks(func_list, base_package, callback_package, dto_package, args.inputfile)
+jvpp_c_gen.generate_jvpp(func_list, args.inputfile)
+jvpp_future_facade_gen.generate_jvpp(func_list, base_package, dto_package, callback_package, future_package, args.inputfile)
+jvpp_callback_facade_gen.generate_jvpp(func_list, base_package, dto_package, callback_package, callback_facade_package, args.inputfile)
diff --git a/vpp-api/java/jvpp/gen/jvpp_impl_gen.py b/vpp-api/java/jvpp/gen/jvpp_impl_gen.py
index 5446a69..08ebddf 100644
--- a/vpp-api/java/jvpp/gen/jvpp_impl_gen.py
+++ b/vpp-api/java/jvpp/gen/jvpp_impl_gen.py
@@ -19,6 +19,12 @@
 jvpp_ifc_template = Template("""
 package $base_package;
 
+
+/**
+ * <p>Java representation of vpe.api.
+ * <br>It was generated by jvpp_impl_gen.py based on $inputfile
+ * <br>(python representation of vpe.api generated by vppapigen).
+ */
 public interface JVpp extends java.lang.AutoCloseable {
 
     /**
@@ -36,6 +42,11 @@
 jvpp_impl_template = Template("""
 package $base_package;
 
+/**
+ * <p>Default implementation of JVpp interface.
+ * <br>It was generated by jvpp_impl_gen.py based on $inputfile
+ * <br>(python representation of vpe.api generated by vppapigen).
+ */
 public final class JVppImpl implements $base_package.JVpp {
 
     private final $base_package.VppConnection connection;
@@ -82,7 +93,7 @@
 """)
 
 
-def generate_jvpp(func_list, base_package, dto_package):
+def generate_jvpp(func_list, base_package, dto_package, inputfile):
     """ Generates JVpp interface and JNI implementation """
     print "Generating JVpp"
 
@@ -126,14 +137,16 @@
 
     jvpp_file = open("JVpp.java", 'w')
     jvpp_file.write(
-        jvpp_ifc_template.substitute(methods="\n".join(methods),
+        jvpp_ifc_template.substitute(inputfile=inputfile,
+                                     methods="\n".join(methods),
                                      base_package=base_package,
                                      dto_package=dto_package))
     jvpp_file.flush()
     jvpp_file.close()
 
     jvpp_file = open("JVppImpl.java", 'w')
-    jvpp_file.write(jvpp_impl_template.substitute(methods="\n".join(methods_impl),
+    jvpp_file.write(jvpp_impl_template.substitute(inputfile=inputfile,
+                                                  methods="\n".join(methods_impl),
                                                   base_package=base_package,
                                                   dto_package=dto_package))
     jvpp_file.flush()
diff --git a/vpp-api/java/jvpp/gen/util.py b/vpp-api/java/jvpp/gen/util.py
index 17dc2ed..f951bf8 100644
--- a/vpp-api/java/jvpp/gen/util.py
+++ b/vpp-api/java/jvpp/gen/util.py
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import os
+import os, pprint
 from os import removedirs
 
 
@@ -171,3 +171,8 @@
 
 def is_control_ping(camel_case_name_with_suffix):
     return "controlping" in camel_case_name_with_suffix.lower()
+
+def api_message_to_javadoc(api_message):
+    """ Converts vpe.api message description to javadoc """
+    str = pprint.pformat(api_message, indent=4, width=120, depth=None)
+    return " * " + str.replace("\n", "\n * ")
\ No newline at end of file
diff --git a/vpp-api/java/jvpp/jvpp.c b/vpp-api/java/jvpp/jvpp.c
new file mode 100644
index 0000000..f1e23dc
--- /dev/null
+++ b/vpp-api/java/jvpp/jvpp.c
@@ -0,0 +1,275 @@
+/*
+ * Copyright (c) 2016 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#define _GNU_SOURCE /* for strcasestr(3) */
+#include <vnet/vnet.h>
+
+#define vl_api_version(n,v) static u32 vpe_api_version = (v);
+#include <api/vpe.api.h>
+#undef vl_api_version
+
+#include <jni.h>
+#include <jvpp/jvpp.h>
+#include <jvpp/org_openvpp_jvpp_VppJNIConnection.h>
+#include <jvpp/org_openvpp_jvpp_JVppImpl.h>
+
+#include <api/vpe_msg_enum.h>
+#define vl_typedefs             /* define message structures */
+#include <api/vpe_all_api_h.h>
+#undef vl_typedefs
+
+#define vl_endianfun
+#include <api/vpe_all_api_h.h>
+#undef vl_endianfun
+
+/* instantiate all the print functions we know about */
+#define vl_print(handle, ...)
+#define vl_printfun
+#include <api/vpe_all_api_h.h>
+#undef vl_printfun
+
+#define VPPJNI_DEBUG 0
+
+#if VPPJNI_DEBUG == 1
+  #define DEBUG_LOG(...) clib_warning(__VA_ARGS__)
+#else
+  #define DEBUG_LOG(...)
+#endif
+
+#include "gen/target/jvpp_gen.h"
+
+static int connect_to_vpe(char *name);
+
+/*
+ * The Java runtime isn't compile w/ -fstack-protector,
+ * so we have to supply missing external references for the
+ * regular vpp libraries. Weak reference in case folks get religion
+ * at a later date...
+ */
+void __stack_chk_guard (void) __attribute__((weak));
+void __stack_chk_guard (void) {  }
+
+void vl_client_add_api_signatures (vl_api_memclnt_create_t *mp)
+{
+    /*
+     * Send the main API signature in slot 0. This bit of code must
+     * match the checks in ../vpe/api/api.c: vl_msg_api_version_check().
+     */
+    mp->api_versions[0] = clib_host_to_net_u32 (vpe_api_version);
+}
+
+/* cleanup handler for RX thread */
+static void cleanup_rx_thread(void *arg)
+{
+    vppjni_main_t * jm = &vppjni_main;
+
+    vppjni_lock (jm, 99);
+
+    int getEnvStat = (*jm->jvm)->GetEnv(jm->jvm, (void **)&(jm->jenv), JNI_VERSION_1_6);
+    if (getEnvStat == JNI_EVERSION) {
+        clib_warning ("Unsupported JNI version\n");
+        jm->retval = VNET_API_ERROR_UNSUPPORTED_JNI_VERSION;
+        goto out;
+    } else if (getEnvStat != JNI_EDETACHED) {
+        (*jm->jvm)->DetachCurrentThread(jm->jvm);
+    }
+out:
+    vppjni_unlock (jm);
+}
+
+JNIEXPORT jint JNICALL Java_org_openvpp_jvpp_VppJNIConnection_clientConnect
+  (JNIEnv *env, jclass obj, jstring clientName, jobject callback)
+{
+    int rv;
+    const char *client_name;
+    void vl_msg_reply_handler_hookup(void);
+    vppjni_main_t * jm = &vppjni_main;
+
+    /*
+     * Bail out now if we're not running as root
+     */
+    if (geteuid() != 0)
+        return VNET_API_ERROR_NOT_RUNNING_AS_ROOT;
+
+    if (jm->is_connected)
+        return VNET_API_ERROR_ALREADY_CONNECTED;
+
+    client_name = (*env)->GetStringUTFChars(env, clientName, 0);
+    if (!client_name)
+        return VNET_API_ERROR_INVALID_VALUE;
+
+    rv = connect_to_vpe ((char *) client_name);
+
+    if (rv < 0)
+        clib_warning ("connection failed, rv %d", rv);
+
+    (*env)->ReleaseStringUTFChars (env, clientName, client_name);
+
+    if (rv == 0) {
+        f64 timeout;
+        clib_time_t clib_time;
+        clib_time_init (&clib_time);
+
+        /* vl_msg_reply_handler_hookup (); */
+        jm->is_connected = 1;
+
+        jm->callback = (*env)->NewGlobalRef(env, callback);
+        jm->callbackClass = (jclass)(*env)->NewGlobalRef(env, (*env)->GetObjectClass(env, callback));
+
+        {
+            // call control ping first to attach rx thread to java thread
+            vl_api_control_ping_t * mp;
+            M(CONTROL_PING, control_ping);
+            S;
+
+            // wait for results:
+            timeout = clib_time_now (&clib_time) + 1.0;
+            rv = VNET_API_ERROR_RESPONSE_NOT_READY;
+            while (clib_time_now (&clib_time) < timeout) {
+              if (jm->result_ready == 1) {
+                rv = (jm->retval);
+                break;
+              }
+            }
+
+            if (rv != 0) {
+                clib_warning ("first control ping failed: %d", rv);
+            }
+        }
+    }
+    DEBUG_LOG ("clientConnect result: %d", rv);
+    return rv;
+}
+
+JNIEXPORT void JNICALL Java_org_openvpp_jvpp_VppJNIConnection_clientDisconnect
+  (JNIEnv *env, jclass clazz)
+{
+    vppjni_main_t * jm = &vppjni_main;
+    jm->is_connected = 0; // TODO make thread safe
+    vl_client_disconnect_from_vlib();
+}
+
+// control ping needs to be very first thing called
+// to attach rx thread to java thread
+static void vl_api_control_ping_reply_t_handler
+(vl_api_control_ping_reply_t * mp)
+{
+    vppjni_main_t * jm = &vppjni_main;
+
+    char was_thread_connected = 0;
+
+    // attach to java thread if not attached
+    int getEnvStat = (*jm->jvm)->GetEnv(jm->jvm, (void **)&(jm->jenv), JNI_VERSION_1_6);
+    if (getEnvStat == JNI_EDETACHED) {
+        if ((*jm->jvm)->AttachCurrentThread(jm->jvm, (void **)&(jm->jenv), NULL) != 0) {
+            clib_warning("Failed to attach thread\n");
+            jm->retval = VNET_API_ERROR_FAILED_TO_ATTACH_TO_JAVA_THREAD;
+            goto out;
+        }
+
+        // workaround as we can't use pthread_cleanup_push
+        pthread_key_create(&jm->cleanup_rx_thread_key, cleanup_rx_thread);
+        // destructor is only called if the value of key is non null
+        pthread_setspecific(jm->cleanup_rx_thread_key, (void *)1);
+        was_thread_connected = 1;
+    } else if (getEnvStat == JNI_EVERSION) {
+        clib_warning ("Unsupported JNI version\n");
+        jm->retval = VNET_API_ERROR_UNSUPPORTED_JNI_VERSION;
+        goto out;
+    }
+
+    if (was_thread_connected == 0) {
+        JNIEnv *env = jm->jenv;
+
+        jclass dtoClass = (*env)->FindClass(env, "org/openvpp/jvpp/dto/ControlPingReply");
+
+        jmethodID constructor = (*env)->GetMethodID(env, dtoClass, "<init>", "()V");
+        jmethodID callbackMethod = (*env)->GetMethodID(env, jm->callbackClass, "onControlPingReply", "(Lorg/openvpp/jvpp/dto/ControlPingReply;)V");
+
+        jobject dto = (*env)->NewObject(env, dtoClass, constructor);
+
+
+        printf("vl_api_control_ping_reply_t_handler ctx=%d\n", clib_net_to_host_u32(mp->context));
+
+        jfieldID contextFieldId = (*env)->GetFieldID(env, dtoClass, "context", "I");
+        (*env)->SetIntField(env, dto, contextFieldId, clib_net_to_host_u32(mp->context));
+
+        jfieldID retvalFieldId = (*env)->GetFieldID(env, dtoClass, "retval", "I");
+        (*env)->SetIntField(env, dto, retvalFieldId, clib_net_to_host_u32(mp->retval));
+
+        jfieldID clientIndexFieldId = (*env)->GetFieldID(env, dtoClass, "clientIndex", "I");
+        (*env)->SetIntField(env, dto, clientIndexFieldId, clib_net_to_host_u32(mp->client_index));
+
+        jfieldID vpePidFieldId = (*env)->GetFieldID(env, dtoClass, "vpePid", "I");
+        (*env)->SetIntField(env, dto, vpePidFieldId, clib_net_to_host_u32(mp->vpe_pid));
+
+        (*env)->CallVoidMethod(env, jm->callback, callbackMethod, dto);
+    }
+
+    out:
+        jm->result_ready = 1;
+}
+
+
+jint JNI_OnLoad(JavaVM *vm, void *reserved) {
+    vppjni_main_t * jm = &vppjni_main;
+    JNIEnv* env;
+    if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_6) != JNI_OK) {
+        return JNI_ERR;
+    }
+
+    jm->jvm = vm;
+    return JNI_VERSION_1_6;
+}
+
+void JNI_OnUnload(JavaVM *vm, void *reserved) {
+    vppjni_main_t * jm = &vppjni_main;
+    JNIEnv* env;
+    if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_6) != JNI_OK) {
+        return;
+    }
+
+    // cleanup:
+    (*env)->DeleteGlobalRef(env, jm->callbackClass);
+    (*env)->DeleteGlobalRef(env, jm->callback);
+
+    jm->callbackClass = NULL;
+    jm->callback = NULL;
+    jm->jenv = NULL;
+    jm->jvm = NULL;
+}
+
+static int connect_to_vpe(char *name)
+{
+    vppjni_main_t * jm = &vppjni_main;
+    api_main_t * am = &api_main;
+
+    if (vl_client_connect_to_vlib("/vpe-api", name, 32) < 0)
+        return -1;
+
+    jm->my_client_index = am->my_client_index;
+    jm->vl_input_queue = am->shmem_hdr->vl_input_queue;
+
+#define _(N,n)                                  \
+    vl_msg_api_set_handlers(VL_API_##N, #n,     \
+            vl_api_##n##_t_handler,	            \
+            vl_noop_handler,                    \
+            vl_api_##n##_t_endian,              \
+            vl_api_##n##_t_print,               \
+            sizeof(vl_api_##n##_t), 1);
+    foreach_vpe_api_msg;
+#undef _
+
+    return 0;
+}
diff --git a/vpp-api/java/jvpp/jvpp.h b/vpp-api/java/jvpp/jvpp.h
new file mode 100644
index 0000000..15f9057
--- /dev/null
+++ b/vpp-api/java/jvpp/jvpp.h
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2016 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __included_vppjni_h__
+#define __included_vppjni_h__
+
+#include <vnet/vnet.h>
+#include <vnet/ip/ip.h>
+#include <vnet/api_errno.h>
+#include <vlibapi/api.h>
+#include <vlibmemory/api.h>
+#include <jni.h>
+
+typedef struct {
+    /* Unique identifier used for matching replays with requests  */
+    volatile u32 context_id;
+
+    /* Spinlock */
+    volatile u32 lock;
+    u32 tag;
+
+    /* Used for first control ping */
+    // TODO better names?
+    volatile u32 result_ready;
+    volatile i32 retval;
+
+    /* JNI Native Method Interface pointer for message handlers */
+    JNIEnv *jenv;
+
+    /* thread cleanup */
+    pthread_key_t cleanup_rx_thread_key;
+
+    /* JNI Invoke Interface pointer for attachment of rx thread to java thread */
+    JavaVM *jvm;
+
+    /* Callback object and class references enabling asynchronous Java calls */
+    jobject callback;
+    jclass callbackClass;
+
+    /* Connected indication */
+    volatile u8 is_connected;
+
+    /* Convenience */
+    unix_shared_memory_queue_t * vl_input_queue;
+    u32 my_client_index;
+
+} vppjni_main_t;
+
+vppjni_main_t vppjni_main __attribute__((aligned (64)));
+
+static inline u32 vppjni_get_context_id (vppjni_main_t * jm)
+{
+    return __sync_add_and_fetch (&jm->context_id, 1);
+}
+
+static inline void vppjni_lock (vppjni_main_t * jm, u32 tag)
+{
+    while (__sync_lock_test_and_set (&jm->lock, 1))
+        ;
+    jm->tag = tag;
+}
+
+static inline void vppjni_unlock (vppjni_main_t * jm)
+{
+    jm->tag = 0;
+    CLIB_MEMORY_BARRIER();
+    jm->lock = 0;
+}
+
+static inline int vppjni_sanity_check (vppjni_main_t * jm)
+{
+    if (!jm->is_connected)
+        return VNET_API_ERROR_NOT_CONNECTED;
+    return 0;
+}
+
+// TODO remove macros (code is now fully autogenerated)
+
+/* M: construct, but don't yet send a message */
+#define M(T,t)                                  \
+do {                                            \
+    jm->result_ready = 0;                         \
+    mp = vl_msg_api_alloc(sizeof(*mp));           \
+    memset (mp, 0, sizeof (*mp));                 \
+    mp->_vl_msg_id = ntohs (VL_API_##T);          \
+    mp->client_index = jm->my_client_index;       \
+ } while(0);
+
+#define M2(T,t,n)                               \
+do {                                            \
+    jm->result_ready = 0;                         \
+    mp = vl_msg_api_alloc(sizeof(*mp)+(n));       \
+    memset (mp, 0, sizeof (*mp));                 \
+    mp->_vl_msg_id = ntohs (VL_API_##T);          \
+    mp->client_index = jm->my_client_index;       \
+ } while(0);
+
+/* S: send a message */
+#define S (vl_msg_api_send_shmem (jm->vl_input_queue, (u8 *)&mp))
+
+#endif /* __included_vppjni_h__ */
