aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-api/java/jvpp/org/openvpp/jvpp/test/NotificationUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'vpp-api/java/jvpp/org/openvpp/jvpp/test/NotificationUtils.java')
-rw-r--r--vpp-api/java/jvpp/org/openvpp/jvpp/test/NotificationUtils.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/vpp-api/java/jvpp/org/openvpp/jvpp/test/NotificationUtils.java b/vpp-api/java/jvpp/org/openvpp/jvpp/test/NotificationUtils.java
new file mode 100644
index 00000000000..9c24d572cbc
--- /dev/null
+++ b/vpp-api/java/jvpp/org/openvpp/jvpp/test/NotificationUtils.java
@@ -0,0 +1,38 @@
+package org.openvpp.jvpp.test;
+
+import java.io.PrintStream;
+import org.openvpp.jvpp.dto.SwInterfaceSetFlags;
+import org.openvpp.jvpp.dto.SwInterfaceSetFlagsNotification;
+import org.openvpp.jvpp.dto.WantInterfaceEvents;
+
+final class NotificationUtils {
+
+ private NotificationUtils() {}
+
+ static PrintStream printNotification(final SwInterfaceSetFlagsNotification msg) {
+ return System.out.printf("Received interface notification: ifc: %d, admin: %d, link: %d, deleted: %d\n",
+ msg.swIfIndex, msg.adminUpDown, msg.linkUpDown, msg.deleted);
+ }
+
+ static SwInterfaceSetFlags getChangeInterfaceState() {
+ final SwInterfaceSetFlags swInterfaceSetFlags = new SwInterfaceSetFlags();
+ swInterfaceSetFlags.swIfIndex = 0;
+ swInterfaceSetFlags.adminUpDown = 1;
+ swInterfaceSetFlags.deleted = 0;
+ return swInterfaceSetFlags;
+ }
+
+ static WantInterfaceEvents getEnableInterfaceNotificationsReq() {
+ WantInterfaceEvents wantInterfaceEvents = new WantInterfaceEvents();
+ wantInterfaceEvents.pid = 1;
+ wantInterfaceEvents.enableDisable = 1;
+ return wantInterfaceEvents;
+ }
+
+ static WantInterfaceEvents getDisableInterfaceNotificationsReq() {
+ WantInterfaceEvents wantInterfaceEvents = new WantInterfaceEvents();
+ wantInterfaceEvents.pid = 1;
+ wantInterfaceEvents.enableDisable = 0;
+ return wantInterfaceEvents;
+ }
+}