*/
#include <vnet/fib/fib_table.h>
-//#include <nat/nat_ipfix_logging.h>
-#include <nat/nat_syslog.h>
+#include <nat/lib/ipfix_logging.h>
+#include <nat/lib/nat_syslog.h>
#include <nat/lib/inlines.h>
#include <nat/nat64/nat64_db.h>
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;
}
/* delete ST entries for static BIB entry */
if (bibe->is_static)
{
- pool_foreach (ste, st, (
- {
- if (ste->bibe_index == bibe_index)
- vec_add1 (ste_to_be_free, ste - st);}
- ));
+ pool_foreach (ste, st)
+ {
+ if (ste->bibe_index == bibe_index)
+ vec_add1 (ste_to_be_free, ste - st);
+ }
vec_foreach (ste_index, ste_to_be_free)
nat64_db_st_entry_free (thread_index, db,
pool_elt_at_index (st, ste_index[0]));
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);
/* *INDENT-OFF* */
#define _(N, i, n, s) \
bib = db->bib._##n##_bib; \
- pool_foreach (bibe, bib, ({ \
+ pool_foreach (bibe, bib) { \
if (fn (bibe, ctx)) \
return; \
- }));
+ }
foreach_nat_protocol
#undef _
bib = db->bib._unk_proto_bib;
- pool_foreach (bibe, bib, ({
+ pool_foreach (bibe, bib) {
if (fn (bibe, ctx))
return;
- }));
+ }
/* *INDENT-ON* */
}
else
}
/* *INDENT-OFF* */
- pool_foreach (bibe, bib,
- ({
+ pool_foreach (bibe, bib)
+ {
if (fn (bibe, ctx))
return;
- }));
+ }
/* *INDENT-ON* */
}
}
/* *INDENT-OFF* */
#define _(N, i, n, s) \
st = db->st._##n##_st; \
- pool_foreach (ste, st, ({ \
+ pool_foreach (ste, st) { \
if (fn (ste, ctx)) \
return; \
- }));
+ }
foreach_nat_protocol
#undef _
st = db->st._unk_proto_st;
- pool_foreach (ste, st, ({
+ pool_foreach (ste, st) {
if (fn (ste, ctx))
return;
- }));
+ }
/* *INDENT-ON* */
}
else
}
/* *INDENT-OFF* */
- pool_foreach (ste, st,
- ({
+ pool_foreach (ste, st)
+ {
if (fn (ste, ctx))
return;
- }));
+ }
/* *INDENT-ON* */
}
}
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);
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);
/* *INDENT-OFF* */
#define _(N, i, n, s) \
st = db->st._##n##_st; \
- pool_foreach (ste, st, ({\
+ pool_foreach (ste, st) {\
if (i == NAT_PROTOCOL_TCP && !ste->tcp_state) \
continue; \
if (ste->expire < now) \
vec_add1 (ste_to_be_free, ste - st); \
- })); \
+ } \
vec_foreach (ste_index, ste_to_be_free) \
nat64_db_st_entry_free (thread_index, db, \
pool_elt_at_index(st, ste_index[0])); \
foreach_nat_protocol
#undef _
st = db->st._unk_proto_st;
- pool_foreach (ste, st, ({
+ pool_foreach (ste, st) {
if (ste->expire < now)
vec_add1 (ste_to_be_free, ste - st);
- }));
+ }
vec_foreach (ste_index, ste_to_be_free)
nat64_db_st_entry_free (thread_index, db,
pool_elt_at_index(st, ste_index[0]));
/* *INDENT-OFF* */
#define _(N, i, n, s) \
st = db->st._##n##_st; \
- pool_foreach (ste, st, ({ \
+ pool_foreach (ste, st) { \
bibe = pool_elt_at_index (db->bib._##n##_bib, ste->bibe_index); \
if (bibe->out_addr.as_u32 == out_addr->as_u32) \
vec_add1 (ste_to_be_free, ste - st); \
- })); \
+ } \
vec_foreach (ste_index, ste_to_be_free) \
nat64_db_st_entry_free (thread_index, db, \
pool_elt_at_index(st, ste_index[0])); \
foreach_nat_protocol
#undef _
st = db->st._unk_proto_st;
- pool_foreach (ste, st, ({
+ pool_foreach (ste, st) {
bibe = pool_elt_at_index (db->bib._unk_proto_bib, ste->bibe_index);
if (bibe->out_addr.as_u32 == out_addr->as_u32)
vec_add1 (ste_to_be_free, ste - st);
- }));
+ }
vec_foreach (ste_index, ste_to_be_free)
nat64_db_st_entry_free (thread_index, db,
pool_elt_at_index(st, ste_index[0]));