API: Change ip4_address and ip6_address to use type alias.
[vpp.git] / src / plugins / nat / out2in.c
index 9cace08..74d2088 100755 (executable)
@@ -29,6 +29,7 @@
 #include <nat/nat_ipfix_logging.h>
 #include <nat/nat_reass.h>
 #include <nat/nat_inlines.h>
+#include <nat/nat_syslog.h>
 
 #include <vppinfra/hash.h>
 #include <vppinfra/error.h>
@@ -132,6 +133,11 @@ nat44_o2i_is_idle_session_cb (clib_bihash_kv_8_8_t * kv, void *arg)
                                           s->out2in.port,
                                           s->in2out.fib_index);
 
+      nat_syslog_nat44_apmdel (s->user_index, s->in2out.fib_index,
+                              &s->in2out.addr, s->in2out.port,
+                              &s->out2in.addr, s->out2in.port,
+                              s->in2out.protocol);
+
       if (!snat_is_session_static (s))
        snat_free_outside_address_and_port (sm->addresses, ctx->thread_index,
                                            &s->out2in);
@@ -229,6 +235,11 @@ create_session_for_static_mapping (snat_main_t * sm,
                                       s->in2out.protocol,
                                       s->in2out.port,
                                       s->out2in.port, s->in2out.fib_index);
+
+  nat_syslog_nat44_apmadd (s->user_index, s->in2out.fib_index,
+                          &s->in2out.addr, s->in2out.port, &s->out2in.addr,
+                          s->out2in.port, s->in2out.protocol);
+
   return s;
 }
 
@@ -1443,6 +1454,12 @@ nat44_out2in_reass_node_fn (vlib_main_t * vm,
                            node->errors[SNAT_OUT2IN_ERROR_NO_TRANSLATION];
                          next0 = SNAT_OUT2IN_NEXT_DROP;
                        }
+                     else
+                       {
+                         reass0->flags |= NAT_REASS_FLAG_ED_DONT_TRANSLATE;
+                         nat_ip4_reass_get_frags (reass0,
+                                                  &fragments_to_loopback);
+                       }
                      goto trace0;
                    }
 
@@ -1474,6 +1491,8 @@ nat44_out2in_reass_node_fn (vlib_main_t * vm,
            }
          else
            {
+             if (reass0->flags & NAT_REASS_FLAG_ED_DONT_TRANSLATE)
+               goto trace0;
              if (PREDICT_FALSE (reass0->sess_index == (u32) ~ 0))
                {
                  if (nat_ip4_reass_add_fragment