summaryrefslogtreecommitdiffstats
path: root/src/plugins/acl
AgeCommit message (Expand)AuthorFilesLines
2018-09-06acl-plugin: VPP-1400: fix crash when removing a session entryAndrew Yourtchenko1-0/+2
2018-09-05acl-plugin: VPP-1400: VPP may crash when performing ACL modifications on appl...Andrew Yourtchenko2-61/+91
2018-09-03acl-plugin: fix the memory leak with colliding entries storageAndrew Yourtchenko1-4/+73
2018-08-27cmake: Fix plugins .h includesMohsin Kazmi1-0/+5
2018-08-27cmake: add missing vat pluginsDamjan Marion1-0/+3
2018-08-25cmake: improve add_vpp_plugin macroDamjan Marion1-2/+5
2018-08-17CMake as an alternative to autotools (experimental)Damjan Marion1-0/+21
2018-08-13Multiarch handling in different constructor macrosDamjan Marion1-4/+3
2018-08-09acl-plugin: fix failures in some of IPv4 test-debug testcasesAndrew Yourtchenko1-4/+4
2018-08-03acl-plugin: fill in the 5tuple structure all at once, avoid short writesAndrew Yourtchenko1-5/+3
2018-07-31acl-plugin: move the acl epoch calculation into inline functionAndrew Yourtchenko1-7/+15
2018-07-23fix vector index range checksEyal Bari2-10/+5
2018-07-19Remove unused argument to vlib_feature_nextDamjan Marion1-1/+1
2018-07-18Add config option to use dlmalloc instead of mheapDave Barach2-7/+17
2018-07-16acl-plugin: fix coverity errors 186574,186575,186576,186577,183451Andrew Yourtchenko1-20/+1
2018-06-27acl: fix for loop initial declarationFlorin Coras1-1/+2
2018-06-27acl-plugin: tm: avoid hash calculation dependency on a memory store operationAndrew Yourtchenko1-1/+9
2018-06-27acl-plugin: tm: add tuplemerge algorithm for relaxing the hashtable masksAndrew Yourtchenko3-5/+625
2018-06-26acl-plugin: tm: optimize multi-lookups and prepare to add tuplemergeAndrew Yourtchenko6-252/+456
2018-06-25acl-plugin: remove the noisy debug outputAndrew Yourtchenko1-1/+1
2018-06-21acl-plugin: fallback to linear ACL search for fragmentsAndrew Yourtchenko2-38/+34
2018-06-20acl-plugin: acl-as-a-service: VPP-1248: fix the error if exports.h included i...Andrew Yourtchenko8-194/+198
2018-06-17acl-plugin: fix the high cpu usage caused by the connection cleanerAndrew Yourtchenko1-1/+2
2018-06-17acl-plugin: split (L3) and (L4/pkt) logic of creation of 5tuple structure, op...Andrew Yourtchenko1-46/+70
2018-06-14acl-plugin: VAT: add an option to load entire ACL from a ClassBench ruleset f...Andrew Yourtchenko1-0/+190
2018-06-14acl-plugin: use 16_8 bihash for IPv4 sessions and 40_8 bihash for IPv6 sessionsAndrew Yourtchenko7-84/+165
2018-06-13acl-plugin: change the src/dst L3 info in 5tuple struct to be always contiguo...Andrew Yourtchenko6-97/+156
2018-06-02acl-plugin: multicore: session management fixesAndrew Yourtchenko6-151/+332
2018-05-29Add VLIB_NODE_FN() macro to simplify multiversioning of node functionsDamjan Marion1-117/+25
2018-05-28acl-plugin: move to per-frame buffer pointer calculations and enqueue to next...Andrew Yourtchenko1-208/+191
2018-05-27acl-plugin: use clib_bihash_search_inline_2_40_8 rather than clib_bihash_sear...Andrew Yourtchenko2-5/+3
2018-05-26acl-plugin: create forward and return sessions in lieu of making a special pe...Andrew Yourtchenko5-121/+156
2018-05-22acl-plugin: refactor to introduce multiarch dataplane functionsAndrew Yourtchenko5-1614/+1997
2018-05-04Harmonize vec/pool_get_aligned object sizes and alignment requestsDave Barach1-0/+6
2018-04-17acl-plugin: VPP-1241: fix the "show acl-plugin tables applied" outputAndrew Yourtchenko2-45/+20
2018-04-13acl-plugin: VPP-1239: acl-as-a-service does not match IPv6 packets, works onl...Andrew Yourtchenko2-4/+5
2018-04-12Fixes for 'make UNATTENDED=yes CC=clang CXX=clang verify'Neale Ranns1-1/+0
2018-04-11acl-plugin: VPP-1231: add error checking to acl_plugin_set_acl_vec_for_contextAndrew Yourtchenko1-1/+26
2018-04-11acl-plugin: VPP-1230: fix the "undefined symbol" error for acl_main when usin...Andrew Yourtchenko3-9/+31
2018-03-30acl-plugin: implement an optional session reclassification when ACL is (re-)a...Andrew Yourtchenko4-10/+128
2018-03-30Add missing stdint.hChris Luke1-0/+1
2018-03-27acl-plugin: autosize the ACL plugin heap and fix the heap size types and parsingAndrew Yourtchenko3-9/+43
2018-03-26acl-plugin: defer the ACL plugin user module registration with ACL lookup unt...Andrew Yourtchenko1-3/+5
2018-03-23acl-plugin: improvements in 'show acl-plugin macip acl' CLIAndrew Yourtchenko2-11/+47
2018-03-23acl-plugin: set ACL heap within the exported functions that might alloc memoryAndrew Yourtchenko3-0/+23
2018-03-22Revert "acl-plugin: improvement on 'show acl-plugin' CLI"Damjan Marion2-37/+9
2018-03-22acl-plugin: implement ACL lookup contexts for "ACL as a service" use by other...Andrew Yourtchenko13-1148/+2117
2018-03-21acl-plugin: improvement on 'show acl-plugin' CLISteve Shin2-9/+37
2018-03-20Fix Allow ARP packets for dot1q interface with MACIP enabledSteve Shin1-50/+169
2018-03-09ACL: Fix the detail for ethertype whitelistMohsin Kazmi2-3/+3
pan class="s">"bib-in2out", bib_buckets, bib_memory_size); clib_bihash_init_24_8 (&db->bib.out2in, "bib-out2in", bib_buckets, bib_memory_size); clib_bihash_init_48_8 (&db->st.in2out, "st-in2out", st_buckets, st_memory_size); clib_bihash_init_48_8 (&db->st.out2in, "st-out2in", st_buckets, st_memory_size); return 0; } nat64_db_bib_entry_t * nat64_db_bib_entry_create (nat64_db_t * db, ip6_address_t * in_addr, ip4_address_t * out_addr, u16 in_port, u16 out_port, u32 fib_index, u8 proto, u8 is_static) { nat64_db_bib_entry_t *bibe; nat64_db_bib_entry_key_t bibe_key; clib_bihash_kv_24_8_t kv; /* create pool entry */ switch (ip_proto_to_snat_proto (proto)) { /* *INDENT-OFF* */ #define _(N, i, n, s) \ case SNAT_PROTOCOL_##N: \ pool_get (db->bib._##n##_bib, bibe); \ kv.value = bibe - db->bib._##n##_bib; \ break; foreach_snat_protocol #undef _ /* *INDENT-ON* */ default: pool_get (db->bib._unk_proto_bib, bibe); kv.value = bibe - db->bib._unk_proto_bib; break; } memset (bibe, 0, sizeof (*bibe)); bibe->in_addr.as_u64[0] = in_addr->as_u64[0]; bibe->in_addr.as_u64[1] = in_addr->as_u64[1]; bibe->in_port = in_port; bibe->out_addr.as_u32 = out_addr->as_u32; bibe->out_port = out_port; bibe->fib_index = fib_index; bibe->proto = proto; bibe->is_static = is_static; /* create hash lookup */ bibe_key.addr.as_u64[0] = bibe->in_addr.as_u64[0]; bibe_key.addr.as_u64[1] = bibe->in_addr.as_u64[1]; bibe_key.fib_index = bibe->fib_index; bibe_key.port = bibe->in_port; bibe_key.proto = bibe->proto; bibe_key.rsvd = 0; kv.key[0] = bibe_key.as_u64[0]; kv.key[1] = bibe_key.as_u64[1]; kv.key[2] = bibe_key.as_u64[2]; clib_bihash_add_del_24_8 (&db->bib.in2out, &kv, 1); memset (&bibe_key.addr, 0, sizeof (bibe_key.addr)); bibe_key.addr.ip4.as_u32 = bibe->out_addr.as_u32; bibe_key.fib_index = 0; bibe_key.port = bibe->out_port; kv.key[0] = bibe_key.as_u64[0]; kv.key[1] = bibe_key.as_u64[1]; kv.key[2] = bibe_key.as_u64[2]; clib_bihash_add_del_24_8 (&db->bib.out2in, &kv, 1); return bibe; } void nat64_db_bib_entry_free (nat64_db_t * db, nat64_db_bib_entry_t * bibe) { nat64_db_bib_entry_key_t bibe_key; clib_bihash_kv_24_8_t kv; nat64_db_bib_entry_t *bib; u32 *ste_to_be_free = 0, *ste_index, bibe_index; nat64_db_st_entry_t *st, *ste; switch (ip_proto_to_snat_proto (bibe->proto)) { /* *INDENT-OFF* */ #define _(N, i, n, s) \ case SNAT_PROTOCOL_##N: \ bib = db->bib._##n##_bib; \ st = db->st._##n##_st; \ break; foreach_snat_protocol #undef _ /* *INDENT-ON* */ default: bib = db->bib._unk_proto_bib; st = db->st._unk_proto_st; break; } bibe_index = bibe - bib; /* 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);} )); vec_foreach (ste_index, ste_to_be_free) nat64_db_st_entry_free (db, pool_elt_at_index (st, ste_index[0])); vec_free (ste_to_be_free); } /* delete hash lookup */ bibe_key.addr.as_u64[0] = bibe->in_addr.as_u64[0]; bibe_key.addr.as_u64[1] = bibe->in_addr.as_u64[1]; bibe_key.fib_index = bibe->fib_index; bibe_key.port = bibe->in_port; bibe_key.proto = bibe->proto; bibe_key.rsvd = 0; kv.key[0] = bibe_key.as_u64[0]; kv.key[1] = bibe_key.as_u64[1]; kv.key[2] = bibe_key.as_u64[2]; clib_bihash_add_del_24_8 (&db->bib.in2out, &kv, 0); memset (&bibe_key.addr, 0, sizeof (bibe_key.addr)); bibe_key.addr.ip4.as_u32 = bibe->out_addr.as_u32; bibe_key.fib_index = 0; bibe_key.port = bibe->out_port; kv.key[0] = bibe_key.as_u64[0]; kv.key[1] = bibe_key.as_u64[1]; kv.key[2] = bibe_key.as_u64[2]; clib_bihash_add_del_24_8 (&db->bib.out2in, &kv, 0); /* delete from pool */ pool_put (bib, bibe); } nat64_db_bib_entry_t * nat64_db_bib_entry_find (nat64_db_t * db, ip46_address_t * addr, u16 port, u8 proto, u32 fib_index, u8 is_ip6) { nat64_db_bib_entry_t *bibe = 0; nat64_db_bib_entry_key_t bibe_key; clib_bihash_kv_24_8_t kv, value; nat64_db_bib_entry_t *bib; switch (ip_proto_to_snat_proto (proto)) { /* *INDENT-OFF* */ #define _(N, i, n, s) \ case SNAT_PROTOCOL_##N: \ bib = db->bib._##n##_bib; \ break; foreach_snat_protocol #undef _ /* *INDENT-ON* */ default: bib = db->bib._unk_proto_bib; break; } bibe_key.addr.as_u64[0] = addr->as_u64[0]; bibe_key.addr.as_u64[1] = addr->as_u64[1]; bibe_key.fib_index = fib_index; bibe_key.port = port; bibe_key.proto = proto; bibe_key.rsvd = 0; kv.key[0] = bibe_key.as_u64[0]; kv.key[1] = bibe_key.as_u64[1]; kv.key[2] = bibe_key.as_u64[2]; if (!clib_bihash_search_24_8 (is_ip6 ? &db->bib.in2out : &db->bib.out2in, &kv, &value)) bibe = pool_elt_at_index (bib, value.value); return bibe; } void nat64_db_bib_walk (nat64_db_t * db, u8 proto, nat64_db_bib_walk_fn_t fn, void *ctx) { nat64_db_bib_entry_t *bib, *bibe; if (proto == 255) { /* *INDENT-OFF* */ #define _(N, i, n, s) \ bib = db->bib._##n##_bib; \ pool_foreach (bibe, bib, ({ \ if (fn (bibe, ctx)) \ return; \ })); foreach_snat_protocol #undef _ bib = db->bib._unk_proto_bib; pool_foreach (bibe, bib, ({ if (fn (bibe, ctx)) return; })); /* *INDENT-ON* */ } else { switch (ip_proto_to_snat_proto (proto)) { /* *INDENT-OFF* */ #define _(N, i, n, s) \ case SNAT_PROTOCOL_##N: \ bib = db->bib._##n##_bib; \ break; foreach_snat_protocol #undef _ /* *INDENT-ON* */ default: bib = db->bib._unk_proto_bib; break; } /* *INDENT-OFF* */ pool_foreach (bibe, bib, ({ if (fn (bibe, ctx)) return; })); /* *INDENT-ON* */ } } nat64_db_bib_entry_t * nat64_db_bib_entry_by_index (nat64_db_t * db, u8 proto, u32 bibe_index) { nat64_db_bib_entry_t *bib; switch (ip_proto_to_snat_proto (proto)) { /* *INDENT-OFF* */ #define _(N, i, n, s) \ case SNAT_PROTOCOL_##N: \ bib = db->bib._##n##_bib; \ break; foreach_snat_protocol #undef _ /* *INDENT-ON* */ default: bib = db->bib._unk_proto_bib; break; } return pool_elt_at_index (bib, bibe_index); } void nat64_db_st_walk (nat64_db_t * db, u8 proto, nat64_db_st_walk_fn_t fn, void *ctx) { nat64_db_st_entry_t *st, *ste; if (proto == 255) { /* *INDENT-OFF* */ #define _(N, i, n, s) \ st = db->st._##n##_st; \ pool_foreach (ste, st, ({ \ if (fn (ste, ctx)) \ return; \ })); foreach_snat_protocol #undef _ st = db->st._unk_proto_st; pool_foreach (ste, st, ({ if (fn (ste, ctx)) return; })); /* *INDENT-ON* */ } else { switch (ip_proto_to_snat_proto (proto)) { /* *INDENT-OFF* */ #define _(N, i, n, s) \ case SNAT_PROTOCOL_##N: \ st = db->st._##n##_st; \ break; foreach_snat_protocol #undef _ /* *INDENT-ON* */ default: st = db->st._unk_proto_st; break; } /* *INDENT-OFF* */ pool_foreach (ste, st, ({ if (fn (ste, ctx)) return; })); /* *INDENT-ON* */ } } nat64_db_st_entry_t * nat64_db_st_entry_create (nat64_db_t * db, nat64_db_bib_entry_t * bibe, ip6_address_t * in_r_addr, ip4_address_t * out_r_addr, u16 r_port) { nat64_db_st_entry_t *ste; nat64_db_bib_entry_t *bib; nat64_db_st_entry_key_t ste_key; clib_bihash_kv_48_8_t kv; /* create pool entry */ switch (ip_proto_to_snat_proto (bibe->proto)) { /* *INDENT-OFF* */ #define _(N, i, n, s) \ case SNAT_PROTOCOL_##N: \ pool_get (db->st._##n##_st, ste); \ kv.value = ste - db->st._##n##_st; \ bib = db->bib._##n##_bib; \ break; foreach_snat_protocol #undef _ /* *INDENT-ON* */ default: pool_get (db->st._unk_proto_st, ste); kv.value = ste - db->st._unk_proto_st; bib = db->bib._unk_proto_bib; break; } memset (ste, 0, sizeof (*ste)); ste->in_r_addr.as_u64[0] = in_r_addr->as_u64[0]; ste->in_r_addr.as_u64[1] = in_r_addr->as_u64[1]; ste->out_r_addr.as_u32 = out_r_addr->as_u32; ste->r_port = r_port; ste->bibe_index = bibe - bib; ste->proto = bibe->proto; /* increment session number for BIB entry */ bibe->ses_num++; /* create hash lookup */ memset (&ste_key, 0, sizeof (ste_key)); ste_key.l_addr.as_u64[0] = bibe->in_addr.as_u64[0]; ste_key.l_addr.as_u64[1] = bibe->in_addr.as_u64[1]; ste_key.r_addr.as_u64[0] = ste->in_r_addr.as_u64[0]; ste_key.r_addr.as_u64[1] = ste->in_r_addr.as_u64[1]; ste_key.fib_index = bibe->fib_index; ste_key.l_port = bibe->in_port; ste_key.r_port = ste->r_port; ste_key.proto = ste->proto; kv.key[0] = ste_key.as_u64[0]; kv.key[1] = ste_key.as_u64[1]; kv.key[2] = ste_key.as_u64[2]; kv.key[3] = ste_key.as_u64[3]; kv.key[4] = ste_key.as_u64[4]; kv.key[5] = ste_key.as_u64[5]; clib_bihash_add_del_48_8 (&db->st.in2out, &kv, 1); memset (&ste_key, 0, sizeof (ste_key)); ste_key.l_addr.ip4.as_u32 = bibe->out_addr.as_u32; ste_key.r_addr.ip4.as_u32 = ste->out_r_addr.as_u32; ste_key.l_port = bibe->out_port; ste_key.r_port = ste->r_port; ste_key.proto = ste->proto; kv.key[0] = ste_key.as_u64[0]; kv.key[1] = ste_key.as_u64[1]; kv.key[2] = ste_key.as_u64[2]; kv.key[3] = ste_key.as_u64[3]; kv.key[4] = ste_key.as_u64[4]; kv.key[5] = ste_key.as_u64[5]; clib_bihash_add_del_48_8 (&db->st.out2in, &kv, 1); return ste; } void nat64_db_st_entry_free (nat64_db_t * db, nat64_db_st_entry_t * ste) { nat64_db_st_entry_t *st; nat64_db_bib_entry_t *bib, *bibe; nat64_db_st_entry_key_t ste_key; clib_bihash_kv_48_8_t kv; switch (ip_proto_to_snat_proto (ste->proto)) { /* *INDENT-OFF* */ #define _(N, i, n, s) \ case SNAT_PROTOCOL_##N: \ st = db->st._##n##_st; \ bib = db->bib._##n##_bib; \ break; foreach_snat_protocol #undef _ /* *INDENT-ON* */ default: st = db->st._unk_proto_st; bib = db->bib._unk_proto_bib; break; } bibe = pool_elt_at_index (bib, ste->bibe_index); /* delete hash lookup */ memset (&ste_key, 0, sizeof (ste_key)); ste_key.l_addr.as_u64[0] = bibe->in_addr.as_u64[0]; ste_key.l_addr.as_u64[1] = bibe->in_addr.as_u64[1]; ste_key.r_addr.as_u64[0] = ste->in_r_addr.as_u64[0]; ste_key.r_addr.as_u64[1] = ste->in_r_addr.as_u64[1]; ste_key.fib_index = bibe->fib_index; ste_key.l_port = bibe->in_port; ste_key.r_port = ste->r_port; ste_key.proto = ste->proto; kv.key[0] = ste_key.as_u64[0]; kv.key[1] = ste_key.as_u64[1]; kv.key[2] = ste_key.as_u64[2]; kv.key[3] = ste_key.as_u64[3]; kv.key[4] = ste_key.as_u64[4]; kv.key[5] = ste_key.as_u64[5]; clib_bihash_add_del_48_8 (&db->st.in2out, &kv, 0); memset (&ste_key, 0, sizeof (ste_key)); ste_key.l_addr.ip4.as_u32 = bibe->out_addr.as_u32; ste_key.r_addr.ip4.as_u32 = ste->out_r_addr.as_u32; ste_key.l_port = bibe->out_port; ste_key.r_port = ste->r_port; ste_key.proto = ste->proto; kv.key[0] = ste_key.as_u64[0]; kv.key[1] = ste_key.as_u64[1]; kv.key[2] = ste_key.as_u64[2]; kv.key[3] = ste_key.as_u64[3]; kv.key[4] = ste_key.as_u64[4]; kv.key[5] = ste_key.as_u64[5]; clib_bihash_add_del_48_8 (&db->st.out2in, &kv, 0); /* delete from pool */ pool_put (st, ste); /* decrement session number for BIB entry */ bibe->ses_num--; /* delete BIB entry if last session and dynamic */ if (!bibe->is_static && !bibe->ses_num) nat64_db_bib_entry_free (db, bibe); } nat64_db_st_entry_t * nat64_db_st_entry_find (nat64_db_t * db, ip46_address_t * l_addr, ip46_address_t * r_addr, u16 l_port, u16 r_port, u8 proto, u32 fib_index, u8 is_ip6) { nat64_db_st_entry_t *ste = 0; nat64_db_st_entry_t *st; nat64_db_st_entry_key_t ste_key; clib_bihash_kv_48_8_t kv, value; switch (ip_proto_to_snat_proto (proto)) { /* *INDENT-OFF* */ #define _(N, i, n, s) \ case SNAT_PROTOCOL_##N: \ st = db->st._##n##_st; \ break; foreach_snat_protocol #undef _ /* *INDENT-ON* */ default: st = db->st._unk_proto_st; break; } memset (&ste_key, 0, sizeof (ste_key)); ste_key.l_addr.as_u64[0] = l_addr->as_u64[0]; ste_key.l_addr.as_u64[1] = l_addr->as_u64[1]; ste_key.r_addr.as_u64[0] = r_addr->as_u64[0]; ste_key.r_addr.as_u64[1] = r_addr->as_u64[1]; ste_key.fib_index = fib_index; ste_key.l_port = l_port; ste_key.r_port = r_port; ste_key.proto = proto; kv.key[0] = ste_key.as_u64[0]; kv.key[1] = ste_key.as_u64[1]; kv.key[2] = ste_key.as_u64[2]; kv.key[3] = ste_key.as_u64[3]; kv.key[4] = ste_key.as_u64[4]; kv.key[5] = ste_key.as_u64[5]; if (!clib_bihash_search_48_8 (is_ip6 ? &db->st.in2out : &db->st.out2in, &kv, &value)) ste = pool_elt_at_index (st, value.value); return ste; } u32 nat64_db_st_entry_get_index (nat64_db_t * db, nat64_db_st_entry_t * ste) { nat64_db_st_entry_t *st; switch (ip_proto_to_snat_proto (ste->proto)) { /* *INDENT-OFF* */ #define _(N, i, n, s) \ case SNAT_PROTOCOL_##N: \ st = db->st._##n##_st; \ break; foreach_snat_protocol #undef _ /* *INDENT-ON* */ default: st = db->st._unk_proto_st; return (u32) ~ 0; } return ste - st; } nat64_db_st_entry_t * nat64_db_st_entry_by_index (nat64_db_t * db, u8 proto, u32 ste_index) { nat64_db_st_entry_t *st; switch (ip_proto_to_snat_proto (proto)) { /* *INDENT-OFF* */ #define _(N, i, n, s) \ case SNAT_PROTOCOL_##N: \ st = db->st._##n##_st; \ break; foreach_snat_protocol #undef _ /* *INDENT-ON* */ default: st = db->st._unk_proto_st; break; } return pool_elt_at_index (st, ste_index); } void nad64_db_st_free_expired (nat64_db_t * db, u32 now) { u32 *ste_to_be_free = 0, *ste_index; nat64_db_st_entry_t *st, *ste; /* *INDENT-OFF* */ #define _(N, i, n, s) \ st = db->st._##n##_st; \ pool_foreach (ste, st, ({\ if (i == SNAT_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 (db, pool_elt_at_index(st, ste_index[0])); \ vec_free (ste_to_be_free); \ ste_to_be_free = 0; foreach_snat_protocol #undef _ st = db->st._unk_proto_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 (db, pool_elt_at_index(st, ste_index[0])); vec_free (ste_to_be_free); /* *INDENT-ON* */ } void nat64_db_free_out_addr (nat64_db_t * db, ip4_address_t * out_addr) { u32 *ste_to_be_free = 0, *ste_index; nat64_db_st_entry_t *st, *ste; nat64_db_bib_entry_t *bibe; /* *INDENT-OFF* */ #define _(N, i, n, s) \ st = db->st._##n##_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 (db, pool_elt_at_index(st, ste_index[0])); \ vec_free (ste_to_be_free); \ ste_to_be_free = 0; foreach_snat_protocol #undef _ st = db->st._unk_proto_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 (db, pool_elt_at_index(st, ste_index[0])); vec_free (ste_to_be_free); /* *INDENT-ON* */ } /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */