diff options
author | Michal Cmarada <mcmarada@cisco.com> | 2019-05-03 08:51:53 +0200 |
---|---|---|
committer | Michal Cmarada <mcmarada@cisco.com> | 2019-05-03 08:51:53 +0200 |
commit | a1d128196d082b5833194a3fdc0a24ac7bdd184f (patch) | |
tree | 265aad1857c8dbc48346ab90ac766303bf32c88a | |
parent | 84e13a8718f480485123999539997dd22702a349 (diff) |
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 <mcmarada@cisco.com>
-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> |