EXTRA_libjvpp_registry_la_DEPENDENCIES=libjvpp_common.la
jarfile_jvpp_registry = jvpp-registry-$(PACKAGE_VERSION).jar
-packagedir_jvpp_registry = org/openvpp/jvpp
+packagedir_jvpp_registry = io/fd/vpp/jvpp
-BUILT_SOURCES += jvpp-registry/org_openvpp_jvpp_VppJNIConnection.h
+BUILT_SOURCES += jvpp-registry/io_fd_vpp_jvpp_VppJNIConnection.h
-jvpp-registry/org_openvpp_jvpp_VppJNIConnection.h:
+jvpp-registry/io_fd_vpp_jvpp_VppJNIConnection.h:
@echo " jvpp-registry.jar generation "; \
mkdir -p jvpp-registry/target; \
cp -rf @srcdir@/jvpp-registry/* -t jvpp-registry/;
jvpp-registry/$(packagedir_jvpp_registry)/future/*.java \
jvpp-registry/$(packagedir_jvpp_registry)/test/*.java \
|| (echo "jvpp-registry compilation failed: $$?"; exit 1); \
- $(JAVAH) -classpath jvpp-registry/target -d jvpp-registry org.openvpp.jvpp.VppJNIConnection ;
- $(JAVAH) -classpath jvpp-registry/target -d jvpp-registry org.openvpp.jvpp.JVppRegistryImpl ;
+ $(JAVAH) -classpath jvpp-registry/target -d jvpp-registry io.fd.vpp.jvpp.VppJNIConnection ;
+ $(JAVAH) -classpath jvpp-registry/target -d jvpp-registry io.fd.vpp.jvpp.JVppRegistryImpl ;
$(jarfile_jvpp_registry): libjvpp_registry.la
cp .libs/libjvpp_registry.so.0.0.0 jvpp-registry/target; \
EXTRA_libjvpp_core_la_DEPENDENCIES=libjvpp_registry.la
jarfile_jvpp_core = jvpp-core-$(PACKAGE_VERSION).jar
-packagedir_jvpp_core = org/openvpp/jvpp/core
+packagedir_jvpp_core = io/fd/vpp/jvpp/core
api_file = $(prefix)/../vpp/vpp-api/vpe.api
-BUILT_SOURCES += jvpp-core/org_openvpp_jvpp_core_JVppCoreImpl.h
+BUILT_SOURCES += jvpp-core/io_fd_vpp_jvpp_core_JVppCoreImpl.h
defs_vpp_papi.py:
@echo "jVpp API"; \
vppapigen --input $(api_file) --python jvpp-core/defs_vpp_papi.py;
-jvpp-core/org_openvpp_jvpp_core_JVppCoreImpl.h: jvpp-registry/org_openvpp_jvpp_VppJNIConnection.h defs_vpp_papi.py
+jvpp-core/io_fd_vpp_jvpp_core_JVppCoreImpl.h: jvpp-registry/io_fd_vpp_jvpp_VppJNIConnection.h defs_vpp_papi.py
cp -rf @srcdir@/jvpp-core/* -t jvpp-core/; \
mkdir -p jvpp-core/target; \
cd jvpp-core; \
jvpp-core/$(packagedir_jvpp_core)/callfacade/*.java \
jvpp-core/$(packagedir_jvpp_core)/test/*.java \
|| (echo "jvpp-core compilation failed: $$?"; exit 1); \
- $(JAVAH) -classpath jvpp-registry/target:jvpp-core/target -d jvpp-core org.openvpp.jvpp.core.JVppCoreImpl ;
+ $(JAVAH) -classpath jvpp-registry/target:jvpp-core/target -d jvpp-core io.fd.vpp.jvpp.core.JVppCoreImpl ;
$(jarfile_jvpp_core): libjvpp_core.la
cp .libs/libjvpp_core.so.0.0.0 jvpp-core/target; \
== Package structure
-* *org.openvpp.jvpp* - top level package for generated JVpp interface+ implementation and hand-crafted
+* *io.fd.vpp.jvpp* - top level package for generated JVpp interface+ implementation and hand-crafted
VppConnection interface + implementation - packaged as jvpp-registry-version.jar
-* *org.openvpp.jvpp.[plugin]* - top level package for generated JVpp interface + implementation
+* *io.fd.vpp.jvpp.[plugin]* - top level package for generated JVpp interface + implementation
+ plugin's API tests - packaged as jvpp-[plugin]-version.jar
** *dto* - package for DTOs generated from VPP API structures + base/marker hand-crafted interfaces
return;
}
jmethodID callbackExcMethod = (*env)->GetMethodID(env, callbackClass,
- "onError", "(Lorg/openvpp/jvpp/VppCallbackException;)V");
+ "onError", "(Lio/fd/vpp/jvpp/VppCallbackException;)V");
if (!callbackExcMethod) {
DEBUG_LOG("CallOnError : callbackExcMethod is null!\n");
return;
* limitations under the License.
*/
-package org.openvpp.jvpp.core.test;
-
-import org.openvpp.jvpp.JVpp;
-import org.openvpp.jvpp.JVppRegistry;
-import org.openvpp.jvpp.JVppRegistryImpl;
-import org.openvpp.jvpp.VppCallbackException;
-import org.openvpp.jvpp.core.JVppCoreImpl;
-import org.openvpp.jvpp.core.callback.GetNodeIndexCallback;
-import org.openvpp.jvpp.core.callback.ShowVersionCallback;
-import org.openvpp.jvpp.core.callback.SwInterfaceCallback;
-import org.openvpp.jvpp.core.dto.GetNodeIndex;
-import org.openvpp.jvpp.core.dto.GetNodeIndexReply;
-import org.openvpp.jvpp.core.dto.ShowVersion;
-import org.openvpp.jvpp.core.dto.ShowVersionReply;
-import org.openvpp.jvpp.core.dto.SwInterfaceDetails;
-import org.openvpp.jvpp.core.dto.SwInterfaceDump;
+package io.fd.vpp.jvpp.core.test;
+
+import io.fd.vpp.jvpp.JVpp;
+import io.fd.vpp.jvpp.JVppRegistry;
+import io.fd.vpp.jvpp.JVppRegistryImpl;
+import io.fd.vpp.jvpp.VppCallbackException;
+import io.fd.vpp.jvpp.core.JVppCoreImpl;
+import io.fd.vpp.jvpp.core.callback.GetNodeIndexCallback;
+import io.fd.vpp.jvpp.core.callback.ShowVersionCallback;
+import io.fd.vpp.jvpp.core.callback.SwInterfaceCallback;
+import io.fd.vpp.jvpp.core.dto.GetNodeIndex;
+import io.fd.vpp.jvpp.core.dto.GetNodeIndexReply;
+import io.fd.vpp.jvpp.core.dto.ShowVersion;
+import io.fd.vpp.jvpp.core.dto.ShowVersionReply;
+import io.fd.vpp.jvpp.core.dto.SwInterfaceDetails;
+import io.fd.vpp.jvpp.core.dto.SwInterfaceDump;
public class CallbackApiTest {
* limitations under the License.
*/
-package org.openvpp.jvpp.core.test;
-
-import org.openvpp.jvpp.JVppRegistry;
-import org.openvpp.jvpp.JVppRegistryImpl;
-import org.openvpp.jvpp.VppCallbackException;
-import org.openvpp.jvpp.core.JVppCore;
-import org.openvpp.jvpp.core.JVppCoreImpl;
-import org.openvpp.jvpp.core.callback.WantInterfaceEventsCallback;
-import org.openvpp.jvpp.core.callfacade.CallbackJVppCoreFacade;
-import org.openvpp.jvpp.core.dto.WantInterfaceEventsReply;
+package io.fd.vpp.jvpp.core.test;
+
+import io.fd.vpp.jvpp.JVppRegistry;
+import io.fd.vpp.jvpp.JVppRegistryImpl;
+import io.fd.vpp.jvpp.VppCallbackException;
+import io.fd.vpp.jvpp.core.JVppCore;
+import io.fd.vpp.jvpp.core.JVppCoreImpl;
+import io.fd.vpp.jvpp.core.callback.WantInterfaceEventsCallback;
+import io.fd.vpp.jvpp.core.callfacade.CallbackJVppCoreFacade;
+import io.fd.vpp.jvpp.core.dto.WantInterfaceEventsReply;
public class CallbackJVppFacadeNotificationTest {
* limitations under the License.
*/
-package org.openvpp.jvpp.core.test;
-
-import org.openvpp.jvpp.JVppRegistry;
-import org.openvpp.jvpp.JVppRegistryImpl;
-import org.openvpp.jvpp.VppCallbackException;
-import org.openvpp.jvpp.core.JVppCore;
-import org.openvpp.jvpp.core.JVppCoreImpl;
-import org.openvpp.jvpp.core.callback.GetNodeIndexCallback;
-import org.openvpp.jvpp.core.callback.ShowVersionCallback;
-import org.openvpp.jvpp.core.callfacade.CallbackJVppCoreFacade;
-import org.openvpp.jvpp.core.dto.GetNodeIndex;
-import org.openvpp.jvpp.core.dto.GetNodeIndexReply;
-import org.openvpp.jvpp.core.dto.ShowVersionReply;
+package io.fd.vpp.jvpp.core.test;
+
+import io.fd.vpp.jvpp.JVppRegistry;
+import io.fd.vpp.jvpp.JVppRegistryImpl;
+import io.fd.vpp.jvpp.VppCallbackException;
+import io.fd.vpp.jvpp.core.JVppCore;
+import io.fd.vpp.jvpp.core.JVppCoreImpl;
+import io.fd.vpp.jvpp.core.callback.GetNodeIndexCallback;
+import io.fd.vpp.jvpp.core.callback.ShowVersionCallback;
+import io.fd.vpp.jvpp.core.callfacade.CallbackJVppCoreFacade;
+import io.fd.vpp.jvpp.core.dto.GetNodeIndex;
+import io.fd.vpp.jvpp.core.dto.GetNodeIndexReply;
+import io.fd.vpp.jvpp.core.dto.ShowVersionReply;
/**
* CallbackJVppFacade together with CallbackJVppFacadeCallback allow for setting different callback for each request.
* limitations under the License.
*/
-package org.openvpp.jvpp.core.test;
-
-import static org.openvpp.jvpp.core.test.NotificationUtils.getChangeInterfaceState;
-import static org.openvpp.jvpp.core.test.NotificationUtils.getDisableInterfaceNotificationsReq;
-import static org.openvpp.jvpp.core.test.NotificationUtils.getEnableInterfaceNotificationsReq;
-import static org.openvpp.jvpp.core.test.NotificationUtils.printNotification;
-
-import org.openvpp.jvpp.JVpp;
-import org.openvpp.jvpp.JVppRegistry;
-import org.openvpp.jvpp.JVppRegistryImpl;
-import org.openvpp.jvpp.VppCallbackException;
-import org.openvpp.jvpp.core.JVppCoreImpl;
-import org.openvpp.jvpp.core.callback.SwInterfaceSetFlagsCallback;
-import org.openvpp.jvpp.core.callback.SwInterfaceSetFlagsNotificationCallback;
-import org.openvpp.jvpp.core.callback.WantInterfaceEventsCallback;
-import org.openvpp.jvpp.core.dto.SwInterfaceSetFlagsNotification;
-import org.openvpp.jvpp.core.dto.SwInterfaceSetFlagsReply;
-import org.openvpp.jvpp.core.dto.WantInterfaceEventsReply;
+package io.fd.vpp.jvpp.core.test;
+
+import static io.fd.vpp.jvpp.core.test.NotificationUtils.getChangeInterfaceState;
+import static io.fd.vpp.jvpp.core.test.NotificationUtils.getDisableInterfaceNotificationsReq;
+import static io.fd.vpp.jvpp.core.test.NotificationUtils.getEnableInterfaceNotificationsReq;
+import static io.fd.vpp.jvpp.core.test.NotificationUtils.printNotification;
+
+import io.fd.vpp.jvpp.JVpp;
+import io.fd.vpp.jvpp.JVppRegistry;
+import io.fd.vpp.jvpp.JVppRegistryImpl;
+import io.fd.vpp.jvpp.VppCallbackException;
+import io.fd.vpp.jvpp.core.JVppCoreImpl;
+import io.fd.vpp.jvpp.core.callback.SwInterfaceSetFlagsCallback;
+import io.fd.vpp.jvpp.core.callback.SwInterfaceSetFlagsNotificationCallback;
+import io.fd.vpp.jvpp.core.callback.WantInterfaceEventsCallback;
+import io.fd.vpp.jvpp.core.dto.SwInterfaceSetFlagsNotification;
+import io.fd.vpp.jvpp.core.dto.SwInterfaceSetFlagsReply;
+import io.fd.vpp.jvpp.core.dto.WantInterfaceEventsReply;
public class CallbackNotificationApiTest {
* limitations under the License.
*/
-package org.openvpp.jvpp.core.test;
+package io.fd.vpp.jvpp.core.test;
-import org.openvpp.jvpp.JVpp;
-import org.openvpp.jvpp.JVppRegistry;
-import org.openvpp.jvpp.JVppRegistryImpl;
-import org.openvpp.jvpp.VppCallbackException;
-import org.openvpp.jvpp.core.JVppCoreImpl;
-import org.openvpp.jvpp.callback.ControlPingCallback;
-import org.openvpp.jvpp.dto.ControlPing;
-import org.openvpp.jvpp.dto.ControlPingReply;
+import io.fd.vpp.jvpp.JVpp;
+import io.fd.vpp.jvpp.JVppRegistry;
+import io.fd.vpp.jvpp.JVppRegistryImpl;
+import io.fd.vpp.jvpp.VppCallbackException;
+import io.fd.vpp.jvpp.core.JVppCoreImpl;
+import io.fd.vpp.jvpp.callback.ControlPingCallback;
+import io.fd.vpp.jvpp.dto.ControlPing;
+import io.fd.vpp.jvpp.dto.ControlPingReply;
public class ControlPingTest {
* limitations under the License.
*/
-package org.openvpp.jvpp.core.test;
+package io.fd.vpp.jvpp.core.test;
import static java.util.Objects.requireNonNull;
-import org.openvpp.jvpp.JVpp;
-import org.openvpp.jvpp.JVppRegistry;
-import org.openvpp.jvpp.JVppRegistryImpl;
-import org.openvpp.jvpp.core.JVppCoreImpl;
-import org.openvpp.jvpp.core.dto.CreateSubif;
-import org.openvpp.jvpp.core.dto.CreateSubifReply;
-import org.openvpp.jvpp.core.dto.SwInterfaceDetailsReplyDump;
-import org.openvpp.jvpp.core.dto.SwInterfaceDump;
-import org.openvpp.jvpp.core.future.FutureJVppCoreFacade;
+import io.fd.vpp.jvpp.JVpp;
+import io.fd.vpp.jvpp.JVppRegistry;
+import io.fd.vpp.jvpp.JVppRegistryImpl;
+import io.fd.vpp.jvpp.core.JVppCoreImpl;
+import io.fd.vpp.jvpp.core.dto.CreateSubif;
+import io.fd.vpp.jvpp.core.dto.CreateSubifReply;
+import io.fd.vpp.jvpp.core.dto.SwInterfaceDetailsReplyDump;
+import io.fd.vpp.jvpp.core.dto.SwInterfaceDump;
+import io.fd.vpp.jvpp.core.future.FutureJVppCoreFacade;
/**
* <p>Tests sub-interface creation.<br> Equivalent to:<br>
* limitations under the License.
*/
-package org.openvpp.jvpp.core.test;
+package io.fd.vpp.jvpp.core.test;
-import static org.openvpp.jvpp.core.test.NotificationUtils.getChangeInterfaceState;
-import static org.openvpp.jvpp.core.test.NotificationUtils.getDisableInterfaceNotificationsReq;
-import static org.openvpp.jvpp.core.test.NotificationUtils.getEnableInterfaceNotificationsReq;
+import static io.fd.vpp.jvpp.core.test.NotificationUtils.getChangeInterfaceState;
+import static io.fd.vpp.jvpp.core.test.NotificationUtils.getDisableInterfaceNotificationsReq;
+import static io.fd.vpp.jvpp.core.test.NotificationUtils.getEnableInterfaceNotificationsReq;
-import org.openvpp.jvpp.JVpp;
-import org.openvpp.jvpp.JVppRegistry;
-import org.openvpp.jvpp.JVppRegistryImpl;
-import org.openvpp.jvpp.core.JVppCoreImpl;
-import org.openvpp.jvpp.core.future.FutureJVppCoreFacade;
+import io.fd.vpp.jvpp.JVpp;
+import io.fd.vpp.jvpp.JVppRegistry;
+import io.fd.vpp.jvpp.JVppRegistryImpl;
+import io.fd.vpp.jvpp.core.JVppCoreImpl;
+import io.fd.vpp.jvpp.core.future.FutureJVppCoreFacade;
public class FutureApiNotificationTest {
* limitations under the License.
*/
-package org.openvpp.jvpp.core.test;
+package io.fd.vpp.jvpp.core.test;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Future;
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.openvpp.jvpp.JVpp;
-import org.openvpp.jvpp.JVppRegistry;
-import org.openvpp.jvpp.JVppRegistryImpl;
-import org.openvpp.jvpp.core.JVppCoreImpl;
-import org.openvpp.jvpp.core.dto.BridgeDomainDetailsReplyDump;
-import org.openvpp.jvpp.core.dto.BridgeDomainDump;
-import org.openvpp.jvpp.core.dto.GetNodeIndex;
-import org.openvpp.jvpp.core.dto.GetNodeIndexReply;
-import org.openvpp.jvpp.core.dto.ShowVersion;
-import org.openvpp.jvpp.core.dto.ShowVersionReply;
-import org.openvpp.jvpp.core.dto.SwInterfaceDetails;
-import org.openvpp.jvpp.core.dto.SwInterfaceDetailsReplyDump;
-import org.openvpp.jvpp.core.dto.SwInterfaceDump;
-import org.openvpp.jvpp.core.future.FutureJVppCoreFacade;
+import io.fd.vpp.jvpp.JVpp;
+import io.fd.vpp.jvpp.JVppRegistry;
+import io.fd.vpp.jvpp.JVppRegistryImpl;
+import io.fd.vpp.jvpp.core.JVppCoreImpl;
+import io.fd.vpp.jvpp.core.dto.BridgeDomainDetailsReplyDump;
+import io.fd.vpp.jvpp.core.dto.BridgeDomainDump;
+import io.fd.vpp.jvpp.core.dto.GetNodeIndex;
+import io.fd.vpp.jvpp.core.dto.GetNodeIndexReply;
+import io.fd.vpp.jvpp.core.dto.ShowVersion;
+import io.fd.vpp.jvpp.core.dto.ShowVersionReply;
+import io.fd.vpp.jvpp.core.dto.SwInterfaceDetails;
+import io.fd.vpp.jvpp.core.dto.SwInterfaceDetailsReplyDump;
+import io.fd.vpp.jvpp.core.dto.SwInterfaceDump;
+import io.fd.vpp.jvpp.core.future.FutureJVppCoreFacade;
public class FutureApiTest {
* limitations under the License.
*/
-package org.openvpp.jvpp.core.test;
+package io.fd.vpp.jvpp.core.test;
import javax.xml.bind.DatatypeConverter;
-import org.openvpp.jvpp.JVpp;
-import org.openvpp.jvpp.JVppRegistry;
-import org.openvpp.jvpp.JVppRegistryImpl;
-import org.openvpp.jvpp.core.JVppCoreImpl;
-import org.openvpp.jvpp.core.dto.ClassifyAddDelSession;
-import org.openvpp.jvpp.core.dto.ClassifyAddDelSessionReply;
-import org.openvpp.jvpp.core.dto.ClassifyAddDelTable;
-import org.openvpp.jvpp.core.dto.ClassifyAddDelTableReply;
-import org.openvpp.jvpp.core.dto.ClassifySessionDetailsReplyDump;
-import org.openvpp.jvpp.core.dto.ClassifySessionDump;
-import org.openvpp.jvpp.core.dto.ClassifyTableByInterface;
-import org.openvpp.jvpp.core.dto.ClassifyTableByInterfaceReply;
-import org.openvpp.jvpp.core.dto.ClassifyTableIds;
-import org.openvpp.jvpp.core.dto.ClassifyTableIdsReply;
-import org.openvpp.jvpp.core.dto.ClassifyTableInfo;
-import org.openvpp.jvpp.core.dto.ClassifyTableInfoReply;
-import org.openvpp.jvpp.core.dto.InputAclSetInterface;
-import org.openvpp.jvpp.core.dto.InputAclSetInterfaceReply;
-import org.openvpp.jvpp.core.future.FutureJVppCoreFacade;
+import io.fd.vpp.jvpp.JVpp;
+import io.fd.vpp.jvpp.JVppRegistry;
+import io.fd.vpp.jvpp.JVppRegistryImpl;
+import io.fd.vpp.jvpp.core.JVppCoreImpl;
+import io.fd.vpp.jvpp.core.dto.ClassifyAddDelSession;
+import io.fd.vpp.jvpp.core.dto.ClassifyAddDelSessionReply;
+import io.fd.vpp.jvpp.core.dto.ClassifyAddDelTable;
+import io.fd.vpp.jvpp.core.dto.ClassifyAddDelTableReply;
+import io.fd.vpp.jvpp.core.dto.ClassifySessionDetailsReplyDump;
+import io.fd.vpp.jvpp.core.dto.ClassifySessionDump;
+import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterface;
+import io.fd.vpp.jvpp.core.dto.ClassifyTableByInterfaceReply;
+import io.fd.vpp.jvpp.core.dto.ClassifyTableIds;
+import io.fd.vpp.jvpp.core.dto.ClassifyTableIdsReply;
+import io.fd.vpp.jvpp.core.dto.ClassifyTableInfo;
+import io.fd.vpp.jvpp.core.dto.ClassifyTableInfoReply;
+import io.fd.vpp.jvpp.core.dto.InputAclSetInterface;
+import io.fd.vpp.jvpp.core.dto.InputAclSetInterfaceReply;
+import io.fd.vpp.jvpp.core.future.FutureJVppCoreFacade;
/**
* <p>Tests L2 ACL creation and read.<br> Equivalent to the following vppctl commands:<br>
* limitations under the License.
*/
-package org.openvpp.jvpp.core.test;
+package io.fd.vpp.jvpp.core.test;
import java.io.PrintStream;
-import org.openvpp.jvpp.core.dto.SwInterfaceSetFlags;
-import org.openvpp.jvpp.core.dto.SwInterfaceSetFlagsNotification;
-import org.openvpp.jvpp.core.dto.WantInterfaceEvents;
+import io.fd.vpp.jvpp.core.dto.SwInterfaceSetFlags;
+import io.fd.vpp.jvpp.core.dto.SwInterfaceSetFlagsNotification;
+import io.fd.vpp.jvpp.core.dto.WantInterfaceEvents;
final class NotificationUtils {
- Make sure VPP is running
- From VPP's build-root/ folder execute:
- - sudo java -cp build-vpp_debug-native/vpp-api/java/jvpp-registry-16.12.jar:build-vpp_debug-native/vpp-api/java/jvpp-core-16.12.jar org.openvpp.jvpp.core.test.[test name]
+ - sudo java -cp build-vpp_debug-native/vpp-api/java/jvpp-registry-16.12.jar:build-vpp_debug-native/vpp-api/java/jvpp-core-16.12.jar io.fd.vpp.jvpp.core.test.[test name]
Available tests:
CallbackApiTest - Similar to ControlPingTest, invokes more complex calls (e.g. interface dump) using low level JVpp APIs
core_main_t core_main __attribute__((aligned (64)));
-#include "org_openvpp_jvpp_core_JVppCoreImpl.h"
+#include "io_fd_vpp_jvpp_core_JVppCoreImpl.h"
#include "jvpp_core_gen.h"
-JNIEXPORT void JNICALL Java_org_openvpp_jvpp_core_JVppCoreImpl_init0
+JNIEXPORT void JNICALL Java_io_fd_vpp_jvpp_core_JVppCoreImpl_init0
(JNIEnv * env, jclass clazz, jobject callback, jlong queue_address, jint my_client_index) {
core_main_t * plugin_main = &core_main;
plugin_main->my_client_index = my_client_index;
#undef _
}
-JNIEXPORT void JNICALL Java_org_openvpp_jvpp_core_JVppCoreImpl_close0
+JNIEXPORT void JNICALL Java_io_fd_vpp_jvpp_core_JVppCoreImpl_close0
(JNIEnv *env, jclass clazz) {
core_main_t * plugin_main = &core_main;
* limitations under the License.
*/
-package org.openvpp.jvpp;
+package io.fd.vpp.jvpp;
-import org.openvpp.jvpp.callback.JVppCallback;
-import org.openvpp.jvpp.dto.ControlPing;
-import org.openvpp.jvpp.dto.JVppRequest;
+import io.fd.vpp.jvpp.callback.JVppCallback;
+import io.fd.vpp.jvpp.dto.ControlPing;
+import io.fd.vpp.jvpp.dto.JVppRequest;
/**
* Base interface for plugin's Java API.
* limitations under the License.
*/
-package org.openvpp.jvpp;
+package io.fd.vpp.jvpp;
-import org.openvpp.jvpp.callback.JVppCallback;
+import io.fd.vpp.jvpp.callback.JVppCallback;
/**
* Manages VPP connection and stores plugin callbacks.
* limitations under the License.
*/
-package org.openvpp.jvpp;
+package io.fd.vpp.jvpp;
import static java.util.Objects.requireNonNull;
import java.util.concurrent.ConcurrentMap;
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.openvpp.jvpp.callback.ControlPingCallback;
-import org.openvpp.jvpp.callback.JVppCallback;
-import org.openvpp.jvpp.dto.ControlPingReply;
+import io.fd.vpp.jvpp.callback.ControlPingCallback;
+import io.fd.vpp.jvpp.callback.JVppCallback;
+import io.fd.vpp.jvpp.dto.ControlPingReply;
/**
* Default implementation of JVppRegistry.
* limitations under the License.
*/
-package org.openvpp.jvpp;
+package io.fd.vpp.jvpp;
import java.io.IOException;
import java.io.InputStream;
* limitations under the License.
*/
-package org.openvpp.jvpp;
+package io.fd.vpp.jvpp;
/**
* Base exception representing failed operation of JVpp request call
* limitations under the License.
*/
-package org.openvpp.jvpp;
+package io.fd.vpp.jvpp;
/**
* Callback Exception representing failed operation of JVpp request call
* limitations under the License.
*/
-package org.openvpp.jvpp;
+package io.fd.vpp.jvpp;
import java.io.IOException;
* limitations under the License.
*/
-package org.openvpp.jvpp;
+package io.fd.vpp.jvpp;
/**
* Exception thrown when Vpp jAPI method invocation failed.
* limitations under the License.
*/
-package org.openvpp.jvpp;
+package io.fd.vpp.jvpp;
-import static org.openvpp.jvpp.NativeLibraryLoader.loadLibrary;
+import static io.fd.vpp.jvpp.NativeLibraryLoader.loadLibrary;
import java.io.IOException;
import java.util.HashMap;
* limitations under the License.
*/
-package org.openvpp.jvpp.callback;
+package io.fd.vpp.jvpp.callback;
-import org.openvpp.jvpp.dto.ControlPingReply;
+import io.fd.vpp.jvpp.dto.ControlPingReply;
/**
* Represents callback for control_ping message.
* limitations under the License.
*/
-package org.openvpp.jvpp.callback;
-import org.openvpp.jvpp.VppCallbackException;
+package io.fd.vpp.jvpp.callback;
+import io.fd.vpp.jvpp.VppCallbackException;
/**
* Base JVppCallback interface
* limitations under the License.
*/
-package org.openvpp.jvpp.callback;
+package io.fd.vpp.jvpp.callback;
/**
* Notification callback
* limitations under the License.
*/
-package org.openvpp.jvpp.dto;
+package io.fd.vpp.jvpp.dto;
-import org.openvpp.jvpp.JVpp;
-import org.openvpp.jvpp.VppInvocationException;
+import io.fd.vpp.jvpp.JVpp;
+import io.fd.vpp.jvpp.VppInvocationException;
/**
* Represents request DTO for control_ping message.
* limitations under the License.
*/
-package org.openvpp.jvpp.dto;
+package io.fd.vpp.jvpp.dto;
import java.util.Objects;
* limitations under the License.
*/
-package org.openvpp.jvpp.dto;
+package io.fd.vpp.jvpp.dto;
/**
* Base interface for all dump requests
* limitations under the License.
*/
-package org.openvpp.jvpp.dto;
+package io.fd.vpp.jvpp.dto;
/**
* Base interface for all notification DTOs
* limitations under the License.
*/
-package org.openvpp.jvpp.dto;
+package io.fd.vpp.jvpp.dto;
/**
* Base interface for all reply DTOs
* limitations under the License.
*/
-package org.openvpp.jvpp.dto;
+package io.fd.vpp.jvpp.dto;
/**
* Base interface for all dump replies
* limitations under the License.
*/
-package org.openvpp.jvpp.dto;
+package io.fd.vpp.jvpp.dto;
-import org.openvpp.jvpp.JVpp;
-import org.openvpp.jvpp.VppInvocationException;
+import io.fd.vpp.jvpp.JVpp;
+import io.fd.vpp.jvpp.VppInvocationException;
/**
* Base interface for all request DTOs
* limitations under the License.
*/
-package org.openvpp.jvpp.future;
+package io.fd.vpp.jvpp.future;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
-import org.openvpp.jvpp.JVpp;
-import org.openvpp.jvpp.JVppRegistry;
-import org.openvpp.jvpp.VppInvocationException;
-import org.openvpp.jvpp.dto.JVppDump;
-import org.openvpp.jvpp.dto.JVppReply;
-import org.openvpp.jvpp.dto.JVppReplyDump;
-import org.openvpp.jvpp.dto.JVppRequest;
+import io.fd.vpp.jvpp.JVpp;
+import io.fd.vpp.jvpp.JVppRegistry;
+import io.fd.vpp.jvpp.VppInvocationException;
+import io.fd.vpp.jvpp.dto.JVppDump;
+import io.fd.vpp.jvpp.dto.JVppReply;
+import io.fd.vpp.jvpp.dto.JVppReplyDump;
+import io.fd.vpp.jvpp.dto.JVppRequest;
/**
* Future facade on top of JVpp
* limitations under the License.
*/
-package org.openvpp.jvpp.future;
+package io.fd.vpp.jvpp.future;
-import org.openvpp.jvpp.dto.JVppReply;
-import org.openvpp.jvpp.dto.JVppReplyDump;
-import org.openvpp.jvpp.dto.JVppRequest;
+import io.fd.vpp.jvpp.dto.JVppReply;
+import io.fd.vpp.jvpp.dto.JVppReplyDump;
+import io.fd.vpp.jvpp.dto.JVppRequest;
import java.util.concurrent.CompletionStage;
-import org.openvpp.jvpp.notification.NotificationRegistryProvider;
+import io.fd.vpp.jvpp.notification.NotificationRegistryProvider;
/**
* Future facade on top of JVpp
* Invoke asynchronous operation on VPP
*
* @return CompletionStage with future result of an async VPP call
- * @throws org.openvpp.jvpp.VppInvocationException when send request failed with details
+ * @throws io.fd.vpp.jvpp.VppInvocationException when send request failed with details
*/
<REQ extends JVppRequest, REPLY extends JVppReply<REQ>> CompletionStage<REPLY> send(REQ req);
* Invoke asynchronous dump operation on VPP
*
* @return CompletionStage with aggregated future result of an async VPP dump call
- * @throws org.openvpp.jvpp.VppInvocationException when send request failed with details
+ * @throws io.fd.vpp.jvpp.VppInvocationException when send request failed with details
*/
<REQ extends JVppRequest, REPLY extends JVppReply<REQ>, DUMP extends JVppReplyDump<REQ, REPLY>> CompletionStage<DUMP> send(
REQ req, DUMP emptyReplyDump);
* limitations under the License.
*/
-package org.openvpp.jvpp.notification;
+package io.fd.vpp.jvpp.notification;
/**
* Base registry for notification callbacks.
* limitations under the License.
*/
-package org.openvpp.jvpp.notification;
+package io.fd.vpp.jvpp.notification;
/**
* Provides notification registry
* limitations under the License.
*/
-package org.openvpp.jvpp.test;
+package io.fd.vpp.jvpp.test;
-import org.openvpp.jvpp.JVppRegistry;
-import org.openvpp.jvpp.JVppRegistryImpl;
+import io.fd.vpp.jvpp.JVppRegistry;
+import io.fd.vpp.jvpp.JVppRegistryImpl;
/**
* Run using:
- * sudo java -cp build-vpp-native/vpp-api/java/jvpp-registry-16.09.jar org.openvpp.jvpp.test.ConnectionTest
+ * sudo java -cp build-vpp-native/vpp-api/java/jvpp-registry-16.09.jar io.fd.vpp.jvpp.test.ConnectionTest
*/
public class ConnectionTest {
#include <jni.h>
#include <jvpp-common/jvpp_common.h>
-#include "org_openvpp_jvpp_VppJNIConnection.h"
-#include "org_openvpp_jvpp_JVppRegistryImpl.h"
+#include "io_fd_vpp_jvpp_VppJNIConnection.h"
+#include "io_fd_vpp_jvpp_JVppRegistryImpl.h"
#include <vpp-api/vpe_msg_enum.h>
#define vl_typedefs /* define message structures */
rm->controlPingReplyClass, "<init>", "()V");
jmethodID callbackMethod = (*env)->GetMethodID(env,
rm->registryClass, "onControlPingReply",
- "(Lorg/openvpp/jvpp/dto/ControlPingReply;)V");
+ "(Lio/fd/vpp/jvpp/dto/ControlPingReply;)V");
jobject dto = (*env)->NewObject(env, rm->controlPingReplyClass,
constructor);
return 0;
}
-JNIEXPORT jobject JNICALL Java_org_openvpp_jvpp_VppJNIConnection_clientConnect(
+JNIEXPORT jobject JNICALL Java_io_fd_vpp_jvpp_VppJNIConnection_clientConnect(
JNIEnv *env, jclass obj, jstring clientName) {
int rv;
const char *client_name;
jvpp_registry_main_t * rm = &jvpp_registry_main;
jclass connectionInfoClass = (*env)->FindClass(env,
- "org/openvpp/jvpp/VppJNIConnection$ConnectionInfo");
+ "io/fd/vpp/jvpp/VppJNIConnection$ConnectionInfo");
jmethodID connectionInfoConstructor = (*env)->GetMethodID(env,
connectionInfoClass, "<init>", "(JII)V");
(jint) jm->my_client_index, (jint) rv);
}
-JNIEXPORT jint JNICALL Java_org_openvpp_jvpp_JVppRegistryImpl_controlPing0(
+JNIEXPORT jint JNICALL Java_io_fd_vpp_jvpp_JVppRegistryImpl_controlPing0(
JNIEnv *env, jobject regstryObject) {
jvpp_main_t * jm = &jvpp_main;
vl_api_control_ping_t * mp;
return my_context_id;
}
-JNIEXPORT void JNICALL Java_org_openvpp_jvpp_VppJNIConnection_clientDisconnect(
+JNIEXPORT void JNICALL Java_io_fd_vpp_jvpp_VppJNIConnection_clientDisconnect(
JNIEnv *env, jclass clazz) {
jvpp_registry_main_t * rm = &jvpp_registry_main;
rm->is_connected = 0; // TODO make thread safe
}
rm->controlPingReplyClass = (jclass) (*env)->NewGlobalRef(env,
- (*env)->FindClass(env, "org/openvpp/jvpp/dto/ControlPingReply"));
+ (*env)->FindClass(env, "io/fd/vpp/jvpp/dto/ControlPingReply"));
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
clib_warning("Failed to cache class references\n");
}
rm->callbackExceptionClass = (jclass) (*env)->NewGlobalRef(env,
- (*env)->FindClass(env, "org/openvpp/jvpp/VppCallbackException"));
+ (*env)->FindClass(env, "io/fd/vpp/jvpp/VppCallbackException"));
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
return JNI_ERR;
from jvppgen 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
+# ~/Projects/vpp/vpp-api/jvpp/gen$ mkdir -p java/io/fd/vpp/jvpp && cd java/io/fd/vpp/jvpp
+# ~/Projects/vpp/vpp-api/jvpp/gen/java/io/fd/vpp/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
+# ~/Projects/vpp/vpp-api/jvpp/gen/java/io/fd/vpp/jvpp$ javac *.java dto/*.java callback/*.java
#
# where
# defs_api_vpp_papi.py - vpe.api in python format (generated by vppapigen)
func_list, func_name = get_definitions()
-base_package = 'org.openvpp.jvpp'
+base_package = 'io.fd.vpp.jvpp'
plugin_package = base_package + '.' + plugin_name
dto_package = 'dto'
callback_package = 'callback'
field_template = Template(""" public $type $name;\n""")
send_template = Template(""" @Override
- public int send(final $base_package.JVpp jvpp) throws org.openvpp.jvpp.VppInvocationException {
+ public int send(final $base_package.JVpp jvpp) throws io.fd.vpp.jvpp.VppInvocationException {
return (($plugin_package.JVpp${plugin_name})jvpp).$method_name($args);
}""")
""")
find_class_invocation_template = Template("""
- ${ref_name}Class = (jclass)(*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/openvpp/jvpp/${plugin_name}/dto/${class_name}"));
+ ${ref_name}Class = (jclass)(*env)->NewGlobalRef(env, (*env)->FindClass(env, "io/fd/vpp/jvpp/${plugin_name}/dto/${class_name}"));
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
return JNI_ERR;
# add exception class to class cache
ref_name = 'callbackException'
- class_name = 'org/openvpp/jvpp/VppCallbackException'
+ class_name = 'io/fd/vpp/jvpp/VppCallbackException'
class_references.append(class_reference_template.substitute(
ref_name=ref_name))
find_class_invocations.append(find_class_template.substitute(
# TODO: cache method and 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/${plugin_name}/dto/${java_name_upper}");""")
+ jclass requestClass = (*env)->FindClass(env, "io/fd/vpp/jvpp/${plugin_name}/dto/${java_name_upper}");""")
request_field_identifier_template = Template("""
jfieldID ${java_name}FieldId = (*env)->GetFieldID(env, requestClass, "${java_name}", "${jni_signature}");
* Generated based on $inputfile preparsed data:
$api_data
*/
-JNIEXPORT jint JNICALL Java_org_openvpp_jvpp_${plugin_name}_JVpp${java_plugin_name}Impl_${java_name}0
+JNIEXPORT jint JNICALL Java_io_fd_vpp_jvpp_${plugin_name}_JVpp${java_plugin_name}Impl_${java_name}0
(JNIEnv * env, jclass clazz$args) {
${plugin_name}_main_t *plugin_main = &${plugin_name}_main;
vl_api_${c_name}_t * mp;
$err_handler
jmethodID constructor = (*env)->GetMethodID(env, ${class_ref_name}Class, "<init>", "()V");
- jmethodID callbackMethod = (*env)->GetMethodID(env, plugin_main->callbackClass, "on${dto_name}", "(Lorg/openvpp/jvpp/${plugin_name}/dto/${dto_name};)V");
+ jmethodID callbackMethod = (*env)->GetMethodID(env, plugin_main->callbackClass, "on${dto_name}", "(Lio/fd/vpp/jvpp/${plugin_name}/dto/${dto_name};)V");
jobject dto = (*env)->NewObject(env, ${class_ref_name}Class, constructor);
$dto_setters
/**
* Generic dispatch method for sending requests to VPP
*
- * @throws org.openvpp.jvpp.VppInvocationException if send request had failed
+ * @throws io.fd.vpp.jvpp.VppInvocationException if send request had failed
*/
- int send($base_package.$dto_package.JVppRequest request) throws org.openvpp.jvpp.VppInvocationException;
+ int send($base_package.$dto_package.JVppRequest request) throws io.fd.vpp.jvpp.VppInvocationException;
$methods
}
}
@Override
- public int send($base_package.$dto_package.JVppRequest request) throws org.openvpp.jvpp.VppInvocationException {
+ public int send($base_package.$dto_package.JVppRequest request) throws io.fd.vpp.jvpp.VppInvocationException {
return request.send(this);
}
@Override
- public final int controlPing(final org.openvpp.jvpp.dto.ControlPing controlPing) throws org.openvpp.jvpp.VppInvocationException {
+ public final int controlPing(final io.fd.vpp.jvpp.dto.ControlPing controlPing) throws io.fd.vpp.jvpp.VppInvocationException {
return registry.controlPing(JVpp${plugin_name}Impl.class);
}
}
""")
-method_template = Template(""" int $name($plugin_package.$dto_package.$request request) throws org.openvpp.jvpp.VppInvocationException;""")
+method_template = Template(""" int $name($plugin_package.$dto_package.$request request) throws io.fd.vpp.jvpp.VppInvocationException;""")
method_native_template = Template(
""" private static native int ${name}0($plugin_package.$dto_package.$request request);""")
-method_impl_template = Template(""" public final int $name($plugin_package.$dto_package.$request request) throws org.openvpp.jvpp.VppInvocationException {
+method_impl_template = Template(""" public final int $name($plugin_package.$dto_package.$request request) throws io.fd.vpp.jvpp.VppInvocationException {
java.util.Objects.requireNonNull(request,"Null request object");
connection.checkActive();
int result=${name}0(request);
if(result<0){
- throw new org.openvpp.jvpp.VppInvocationException("${name}",result);
+ throw new io.fd.vpp.jvpp.VppInvocationException("${name}",result);
}
return result;
}
""")
-no_arg_method_template = Template(""" int $name() throws org.openvpp.jvpp.VppInvocationException;""")
-no_arg_method_native_template = Template(""" private static native int ${name}0() throws org.openvpp.jvpp.VppInvocationException;""")
-no_arg_method_impl_template = Template(""" public final int $name() throws org.openvpp.jvpp.VppInvocationException {
+no_arg_method_template = Template(""" int $name() throws io.fd.vpp.jvpp.VppInvocationException;""")
+no_arg_method_native_template = Template(""" private static native int ${name}0() throws io.fd.vpp.jvpp.VppInvocationException;""")
+no_arg_method_impl_template = Template(""" public final int $name() throws io.fd.vpp.jvpp.VppInvocationException {
connection.checkActive();
int result=${name}0();
if(result<0){
- throw new org.openvpp.jvpp.VppInvocationException("${name}",result);
+ throw new io.fd.vpp.jvpp.VppInvocationException("${name}",result);
}
return result;
}