From a1d128196d082b5833194a3fdc0a24ac7bdd184f Mon Sep 17 00:00:00 2001 From: Michal Cmarada Date: Fri, 3 May 2019 08:51:53 +0200 Subject: Fix Nat API implementation - new types introduced to Nat API: bool, string - fixed imports for introduced types - fixed java callback example Change-Id: I216a77f15bfcc70f70cbf13c63737082d377e8c3 Signed-off-by: Michal Cmarada --- java/jvpp-nat/io/fd/jvpp/nat/examples/CallbackApiExample.java | 9 ++++++--- java/jvpp-nat/jvpp_nat.c | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/java/jvpp-nat/io/fd/jvpp/nat/examples/CallbackApiExample.java b/java/jvpp-nat/io/fd/jvpp/nat/examples/CallbackApiExample.java index 93fd308..ef5cccf 100644 --- a/java/jvpp-nat/io/fd/jvpp/nat/examples/CallbackApiExample.java +++ b/java/jvpp-nat/io/fd/jvpp/nat/examples/CallbackApiExample.java @@ -24,6 +24,7 @@ import io.fd.jvpp.nat.JVppNatImpl; import io.fd.jvpp.nat.callback.Nat44InterfaceAddDelFeatureReplyCallback; import io.fd.jvpp.nat.dto.Nat44InterfaceAddDelFeature; import io.fd.jvpp.nat.dto.Nat44InterfaceAddDelFeatureReply; +import io.fd.jvpp.nat.types.NatConfigFlags; public class CallbackApiExample { @@ -54,9 +55,11 @@ public class CallbackApiExample { System.out.println("Sending Nat44InterfaceAddDelFeature request..."); Nat44InterfaceAddDelFeature request = new Nat44InterfaceAddDelFeature(); - request.isAdd = 1; - request.isInside = 1; - request.swIfIndex = 1; + request.isAdd = true; + request.swIfIndex = new io.fd.jvpp.nat.types.InterfaceIndex(); + request.swIfIndex.interfaceindex = 1; + request.flags = new NatConfigFlags(); + request.flags.add(NatConfigFlags.NatConfigFlagsOptions.NAT_IS_INSIDE); final int result = jvpp.send(request); System.out.printf("Nat44InterfaceAddDelFeature send result = %d%n", result); diff --git a/java/jvpp-nat/jvpp_nat.c b/java/jvpp-nat/jvpp_nat.c index 20e4244..e1f0d7c 100644 --- a/java/jvpp-nat/jvpp_nat.c +++ b/java/jvpp-nat/jvpp_nat.c @@ -14,7 +14,9 @@ */ #include - +#include +#include +#include #include #define vl_typedefs /* define message structures */ #include -- cgit 1.2.3-korg