diff options
author | Damjan Marion <damarion@cisco.com> | 2020-12-13 21:47:40 +0100 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-12-14 12:14:21 +0000 |
commit | b2c31b685fd2cf28436ca32bc93e23eb24c74878 (patch) | |
tree | dc0a1b1ff784445b2cbb0f9b2c07b5bcb4f5a5d0 /src/plugins/acl | |
parent | 62c25abaa3e93be5815172d391295a6ab0390122 (diff) |
misc: move to new pool_foreach macros
Type: refactor
Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/acl')
-rw-r--r-- | src/plugins/acl/acl.c | 30 | ||||
-rw-r--r-- | src/plugins/acl/hash_lookup.c | 12 | ||||
-rw-r--r-- | src/plugins/acl/lookup_context.c | 18 |
3 files changed, 30 insertions, 30 deletions
diff --git a/src/plugins/acl/acl.c b/src/plugins/acl/acl.c index b18e8515cde..05251c6fcd8 100644 --- a/src/plugins/acl/acl.c +++ b/src/plugins/acl/acl.c @@ -1965,10 +1965,10 @@ vl_api_acl_dump_t_handler (vl_api_acl_dump_t * mp) { /* *INDENT-OFF* */ /* Just dump all ACLs */ - pool_foreach (acl, am->acls, - ({ + pool_foreach (acl, am->acls) + { send_acl_details(am, reg, acl, mp->context); - })); + } /* *INDENT-ON* */ } else @@ -2050,10 +2050,10 @@ vl_api_acl_interface_list_dump_t_handler (vl_api_acl_interface_list_dump_t * if (mp->sw_if_index == ~0) { /* *INDENT-OFF* */ - pool_foreach (swif, im->sw_interfaces, - ({ + pool_foreach (swif, im->sw_interfaces) + { send_acl_interface_list_details(am, reg, swif->sw_if_index, mp->context); - })); + } /* *INDENT-ON* */ } else @@ -2215,10 +2215,10 @@ vl_api_macip_acl_dump_t_handler (vl_api_macip_acl_dump_t * mp) { /* Just dump all ACLs for now, with sw_if_index = ~0 */ /* *INDENT-OFF* */ - pool_foreach (acl, am->macip_acls, - ({ + pool_foreach (acl, am->macip_acls) + { send_macip_acl_details (am, reg, acl, mp->context); - })); + } /* *INDENT-ON* */ } else @@ -2424,10 +2424,10 @@ static void if (mp->sw_if_index == ~0) { /* *INDENT-OFF* */ - pool_foreach (swif, im->sw_interfaces, - ({ + pool_foreach (swif, im->sw_interfaces) + { send_acl_interface_etype_whitelist_details(am, reg, swif->sw_if_index, mp->context); - })); + } /* *INDENT-ON* */ } else @@ -3268,8 +3268,8 @@ acl_plugin_show_sessions (acl_main_t * am, } vlib_cli_output (vm, " connection add/del stats:", wk); /* *INDENT-OFF* */ - pool_foreach (swif, im->sw_interfaces, - ({ + pool_foreach (swif, im->sw_interfaces) + { u32 sw_if_index = swif->sw_if_index; u64 n_adds = (sw_if_index < vec_len (pw->fa_session_adds_by_sw_if_index) ? @@ -3291,7 +3291,7 @@ acl_plugin_show_sessions (acl_main_t * am, n_adds - n_dels, n_epoch_changes); - })); + } /* *INDENT-ON* */ vlib_cli_output (vm, " connection timeout type lists:", wk); diff --git a/src/plugins/acl/hash_lookup.c b/src/plugins/acl/hash_lookup.c index 26ee5cb1785..85b54b3e8ac 100644 --- a/src/plugins/acl/hash_lookup.c +++ b/src/plugins/acl/hash_lookup.c @@ -262,11 +262,11 @@ find_mask_type_index(acl_main_t *am, fa_5tuple_t *mask) { ace_mask_type_entry_t *mte; /* *INDENT-OFF* */ - pool_foreach(mte, am->ace_mask_type_pool, - ({ + pool_foreach (mte, am->ace_mask_type_pool) + { if(memcmp(&mte->mask, mask, sizeof(*mask)) == 0) return (mte - am->ace_mask_type_pool); - })); + } /* *INDENT-ON* */ return ~0; } @@ -1160,13 +1160,13 @@ acl_plugin_show_tables_mask_type (void) vlib_cli_output (vm, "Mask-type entries:"); /* *INDENT-OFF* */ - pool_foreach(mte, am->ace_mask_type_pool, - ({ + pool_foreach (mte, am->ace_mask_type_pool) + { vlib_cli_output(vm, " %3d: %016llx %016llx %016llx %016llx %016llx %016llx refcount %d", mte - am->ace_mask_type_pool, mte->mask.kv_40_8.key[0], mte->mask.kv_40_8.key[1], mte->mask.kv_40_8.key[2], mte->mask.kv_40_8.key[3], mte->mask.kv_40_8.key[4], mte->mask.kv_40_8.value, mte->refcount); - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/acl/lookup_context.c b/src/plugins/acl/lookup_context.c index ed9b2c7da21..8d1f3f20f3d 100644 --- a/src/plugins/acl/lookup_context.c +++ b/src/plugins/acl/lookup_context.c @@ -37,12 +37,12 @@ static u32 get_acl_user_id(acl_main_t *am, char *user_module_name, char *val1_la { acl_lookup_context_user_t *auser; - pool_foreach (auser, am->acl_users, - ({ + pool_foreach (auser, am->acl_users) + { if (0 == strcmp(auser->user_module_name, user_module_name)) { return (auser - am->acl_users); } - })); + } pool_get(am->acl_users, auser); auser->user_module_name = user_module_name; @@ -310,13 +310,13 @@ acl_plugin_show_lookup_user (u32 user_index) vlib_main_t *vm = am->vlib_main; acl_lookup_context_user_t *auser; - pool_foreach (auser, am->acl_users, - ({ + pool_foreach (auser, am->acl_users) + { u32 curr_user_index = (auser - am->acl_users); if (user_index == ~0 || (curr_user_index == user_index)) { vlib_cli_output (vm, "index %d:%s:%s:%s", curr_user_index, auser->user_module_name, auser->val1_label, auser->val2_label); } - })); + } } @@ -333,8 +333,8 @@ acl_plugin_show_lookup_context (u32 lc_index) return; } - pool_foreach (acontext, am->acl_lookup_contexts, - ({ + pool_foreach (acontext, am->acl_lookup_contexts) + { u32 curr_lc_index = (acontext - am->acl_lookup_contexts); if ((lc_index == ~0) || (curr_lc_index == lc_index)) { if (acl_user_id_valid(am, acontext->context_user_id)) { @@ -350,7 +350,7 @@ acl_plugin_show_lookup_context (u32 lc_index) format_vec32, acontext->acl_indices, "%d"); } } - })); + } } void * |