diff options
-rw-r--r-- | java/jvpp-nat/io/fd/jvpp/nat/examples/CallbackApiExample.java | 9 | ||||
-rw-r--r-- | 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 <vnet/vnet.h> - +#include <jvpp-common/string_t.h> +#include <vlibapi/api_types.h> +#include <stdbool.h> #include <nat/nat_msg_enum.h> #define vl_typedefs /* define message structures */ #include <nat/nat_all_api_h.h> |