summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat64
diff options
context:
space:
mode:
authorFilip Varga <fivarga@cisco.com>2020-09-29 16:53:20 +0200
committerFilip Varga <fivarga@cisco.com>2020-10-09 10:20:21 +0000
commitdd9eae5c29a4379943e60ddf6b7ab96b8e154040 (patch)
tree5e915d1377ffaf452e9dfa1945516d44c1ac8355 /src/plugins/nat/nat64
parentaa04395573f26fe420d7eb9ca329732b7197fe52 (diff)
nat: ipfix logging separation & refactor
Type: refactor Change-Id: I8785e4987e4f60361072440d0c3c6954c9c12394 Signed-off-by: Filip Varga <fivarga@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat64')
-rw-r--r--src/plugins/nat/nat64/nat64.c6
-rw-r--r--src/plugins/nat/nat64/nat64_db.c44
2 files changed, 25 insertions, 25 deletions
diff --git a/src/plugins/nat/nat64/nat64.c b/src/plugins/nat/nat64/nat64.c
index 5da498670f6..30142a70048 100644
--- a/src/plugins/nat/nat64/nat64.c
+++ b/src/plugins/nat/nat64/nat64.c
@@ -21,6 +21,7 @@
#include <vnet/plugin/plugin.h>
#include <vpp/app/version.h>
+#include <nat/lib/ipfix_logging.h>
#include <nat/nat64/nat64.h>
nat64_main_t nat64_main;
@@ -293,9 +294,8 @@ nat64_init (vlib_main_t * vm)
nm->port_per_thread = (0xffff - 1024) / _vec_len (nm->workers);
}
- // TODO: ipfix needs to be separated from NAT base plugin
/* Init IPFIX logging */
- //snat_ipfix_logging_init (vm);
+ nat_ipfix_logging_init (vm);
#define _(x) \
nm->counters.in2out.x.name = #x; \
@@ -749,7 +749,7 @@ nat64_alloc_addr_and_port_default (nat64_address_t * addresses,
}
/* Totally out of translations to use... */
- //snat_ipfix_logging_addresses_exhausted (thread_index, 0);
+ nat_ipfix_logging_addresses_exhausted (thread_index, 0);
return 1;
}
diff --git a/src/plugins/nat/nat64/nat64_db.c b/src/plugins/nat/nat64/nat64_db.c
index ffc5e7e7e84..2c52d3b6ca2 100644
--- a/src/plugins/nat/nat64/nat64_db.c
+++ b/src/plugins/nat/nat64/nat64_db.c
@@ -14,7 +14,7 @@
*/
#include <vnet/fib/fib_table.h>
-//#include <nat/nat_ipfix_logging.h>
+#include <nat/lib/ipfix_logging.h>
#include <nat/nat_syslog.h>
#include <nat/lib/inlines.h>
#include <nat/nat64/nat64_db.h>
@@ -137,9 +137,9 @@ nat64_db_bib_entry_create (u32 thread_index, nat64_db_t * db,
kv.key[2] = bibe_key.as_u64[2];
clib_bihash_add_del_24_8 (&db->bib.out2in, &kv, 1);
- /*fib_table_t *fib = fib_table_get (bibe->fib_index, FIB_PROTOCOL_IP6);
- nat_ipfix_logging_nat64_bib (thread_index, in_addr, out_addr, proto,
- in_port, out_port, fib->ft_table_id, 1); */
+ fib_table_t *fib = fib_table_get (bibe->fib_index, FIB_PROTOCOL_IP6);
+ nat_ipfix_logging_nat64_bib (thread_index, in_addr, out_addr, proto,
+ in_port, out_port, fib->ft_table_id, 1);
return bibe;
}
@@ -212,10 +212,10 @@ nat64_db_bib_entry_free (u32 thread_index, nat64_db_t * db,
if (!db->addr_free)
db->free_addr_port_cb (db, &bibe->out_addr, bibe->out_port, bibe->proto);
- /*fib_table_t *fib = fib_table_get (bibe->fib_index, FIB_PROTOCOL_IP6);
- nat_ipfix_logging_nat64_bib (thread_index, &bibe->in_addr, &bibe->out_addr,
- bibe->proto, bibe->in_port, bibe->out_port,
- fib->ft_table_id, 0); */
+ fib_table_t *fib = fib_table_get (bibe->fib_index, FIB_PROTOCOL_IP6);
+ nat_ipfix_logging_nat64_bib (thread_index, &bibe->in_addr, &bibe->out_addr,
+ bibe->proto, bibe->in_port, bibe->out_port,
+ fib->ft_table_id, 0);
/* delete from pool */
pool_put (bib, bibe);
@@ -470,13 +470,13 @@ nat64_db_st_entry_create (u32 thread_index, nat64_db_t * db,
kv.key[5] = ste_key.as_u64[5];
clib_bihash_add_del_48_8 (&db->st.out2in, &kv, 1);
- /*fib_table_t *fib = fib_table_get (bibe->fib_index, FIB_PROTOCOL_IP6);
- nat_ipfix_logging_nat64_session (thread_index, &bibe->in_addr,
- &bibe->out_addr, bibe->proto,
- bibe->in_port, bibe->out_port,
- &ste->in_r_addr, &ste->out_r_addr,
- ste->r_port, ste->r_port, fib->ft_table_id,
- 1); */
+ fib_table_t *fib = fib_table_get (bibe->fib_index, FIB_PROTOCOL_IP6);
+ nat_ipfix_logging_nat64_session (thread_index, &bibe->in_addr,
+ &bibe->out_addr, bibe->proto,
+ bibe->in_port, bibe->out_port,
+ &ste->in_r_addr, &ste->out_r_addr,
+ ste->r_port, ste->r_port, fib->ft_table_id,
+ 1);
nat_syslog_nat64_sadd (bibe->fib_index, &bibe->in_addr, bibe->in_port,
&bibe->out_addr, bibe->out_port, &ste->out_r_addr,
ste->r_port, bibe->proto);
@@ -545,13 +545,13 @@ nat64_db_st_entry_free (u32 thread_index,
kv.key[5] = ste_key.as_u64[5];
clib_bihash_add_del_48_8 (&db->st.out2in, &kv, 0);
- /*fib_table_t *fib = fib_table_get (bibe->fib_index, FIB_PROTOCOL_IP6);
- nat_ipfix_logging_nat64_session (thread_index, &bibe->in_addr,
- &bibe->out_addr, bibe->proto,
- bibe->in_port, bibe->out_port,
- &ste->in_r_addr, &ste->out_r_addr,
- ste->r_port, ste->r_port, fib->ft_table_id,
- 0); */
+ fib_table_t *fib = fib_table_get (bibe->fib_index, FIB_PROTOCOL_IP6);
+ nat_ipfix_logging_nat64_session (thread_index, &bibe->in_addr,
+ &bibe->out_addr, bibe->proto,
+ bibe->in_port, bibe->out_port,
+ &ste->in_r_addr, &ste->out_r_addr,
+ ste->r_port, ste->r_port, fib->ft_table_id,
+ 0);
nat_syslog_nat64_sdel (bibe->fib_index, &bibe->in_addr, bibe->in_port,
&bibe->out_addr, bibe->out_port, &ste->out_r_addr,
ste->r_port, bibe->proto);