From b2c31b685fd2cf28436ca32bc93e23eb24c74878 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Sun, 13 Dec 2020 21:47:40 +0100 Subject: misc: move to new pool_foreach macros Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion --- src/plugins/abf/abf_itf_attach.c | 6 +- src/plugins/abf/abf_policy.c | 12 +- src/plugins/acl/acl.c | 30 ++-- src/plugins/acl/hash_lookup.c | 12 +- src/plugins/acl/lookup_context.c | 18 +-- src/plugins/avf/device.c | 8 +- src/plugins/builtinurl/builtins.c | 12 +- src/plugins/cdp/cdp_input.c | 6 +- src/plugins/cdp/cdp_periodic.c | 6 +- src/plugins/cnat/cnat_client.c | 7 +- src/plugins/cnat/cnat_session.c | 4 +- src/plugins/cnat/cnat_translation.c | 26 ++-- src/plugins/ct6/ct6.c | 18 +-- src/plugins/dhcp/client.c | 18 +-- src/plugins/dhcp/dhcp6_client_common_dp.c | 6 +- src/plugins/dhcp/dhcp6_ia_na_client_cp.c | 30 ++-- src/plugins/dhcp/dhcp6_pd_client_cp.c | 36 ++--- src/plugins/dhcp/dhcp_api.c | 12 +- src/plugins/dns/dns.c | 12 +- src/plugins/dpdk/device/init.c | 4 +- src/plugins/flowprobe/flowprobe.c | 4 +- src/plugins/gbp/gbp_bridge_domain.c | 4 +- src/plugins/gbp/gbp_contract.c | 12 +- src/plugins/gbp/gbp_endpoint.c | 4 +- src/plugins/gbp/gbp_endpoint_group.c | 4 +- src/plugins/gbp/gbp_ext_itf.c | 4 +- src/plugins/gbp/gbp_itf.c | 6 +- src/plugins/gbp/gbp_recirc.c | 4 +- src/plugins/gbp/gbp_route_domain.c | 4 +- src/plugins/gbp/gbp_subnet.c | 12 +- src/plugins/gbp/gbp_vxlan.c | 6 +- src/plugins/geneve/geneve.c | 10 +- src/plugins/geneve/geneve_api.c | 6 +- src/plugins/gtpu/gtpu.c | 10 +- src/plugins/gtpu/gtpu_api.c | 6 +- src/plugins/hs_apps/sapi/vpp_echo.c | 8 +- src/plugins/hs_apps/sapi/vpp_echo_proto_quic.c | 6 +- src/plugins/http_static/static_server.c | 6 +- src/plugins/igmp/igmp_api.c | 12 +- src/plugins/igmp/igmp_cli.c | 6 +- src/plugins/ikev2/ikev2.c | 60 ++++---- src/plugins/ikev2/ikev2_api.c | 12 +- src/plugins/ikev2/ikev2_cli.c | 8 +- src/plugins/ila/ila.c | 6 +- src/plugins/ioam/ip6/ioam_cache.c | 25 ++-- src/plugins/ioam/ip6/ioam_cache.h | 19 ++- src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_ioam.c | 44 +++--- src/plugins/l2tp/l2tp.c | 18 +-- src/plugins/l2tp/l2tp_api.c | 6 +- src/plugins/l3xc/l3xc.c | 12 +- src/plugins/lacp/cli.c | 9 +- src/plugins/lacp/lacp.c | 6 +- src/plugins/lacp/rx_machine.c | 4 +- src/plugins/lb/api.c | 14 +- src/plugins/lb/cli.c | 4 +- src/plugins/lb/lb.c | 32 ++--- src/plugins/lisp/lisp-cp/control.c | 58 ++++---- src/plugins/lisp/lisp-cp/lisp_api.c | 12 +- src/plugins/lisp/lisp-cp/lisp_cli.c | 12 +- src/plugins/lisp/lisp-cp/one_api.c | 12 +- src/plugins/lisp/lisp-cp/one_cli.c | 12 +- src/plugins/lisp/lisp-gpe/lisp_gpe_adjacency.c | 6 +- src/plugins/lisp/lisp-gpe/lisp_gpe_fwd_entry.c | 24 ++-- src/plugins/lisp/lisp-gpe/lisp_gpe_sub_interface.c | 6 +- src/plugins/lisp/lisp-gpe/lisp_gpe_tenant.c | 12 +- src/plugins/lisp/lisp-gpe/lisp_gpe_tunnel.c | 6 +- src/plugins/lldp/lldp_cli.c | 12 +- src/plugins/mactime/builtins.c | 6 +- src/plugins/mactime/mactime.c | 12 +- src/plugins/mactime/mactime_test.c | 6 +- src/plugins/mactime/mactime_top.c | 12 +- src/plugins/map/map.c | 12 +- src/plugins/map/map_api.c | 6 +- src/plugins/memif/cli.c | 3 +- src/plugins/memif/memif.c | 6 +- src/plugins/memif/memif_api.c | 6 +- src/plugins/nat/det44/det44.c | 28 ++-- src/plugins/nat/det44/det44.h | 12 +- src/plugins/nat/det44/det44_api.c | 6 +- src/plugins/nat/det44/det44_cli.c | 18 +-- src/plugins/nat/det44/det44_inlines.h | 4 +- src/plugins/nat/dslite/dslite_cli.c | 6 +- src/plugins/nat/in2out.c | 6 +- src/plugins/nat/in2out_ed.c | 10 +- src/plugins/nat/nat.c | 154 ++++++++++----------- src/plugins/nat/nat44_api.c | 60 ++++---- src/plugins/nat/nat44_cli.c | 42 +++--- src/plugins/nat/nat44_hairpinning.c | 6 +- src/plugins/nat/nat64/nat64.c | 36 ++--- src/plugins/nat/nat64/nat64_db.c | 54 ++++---- src/plugins/nat/nat66/nat66.c | 18 +-- src/plugins/nat/nat66/nat66_in2out.c | 6 +- src/plugins/nat/nat_format.c | 12 +- src/plugins/nat/nat_inlines.h | 4 +- src/plugins/nsh/nsh-md2-ioam/nsh_md2_ioam.c | 10 +- src/plugins/nsh/nsh_api.c | 20 ++- src/plugins/nsh/nsh_cli.c | 32 ++--- src/plugins/perfmon/perfmon.c | 6 +- src/plugins/pppoe/pppoe.c | 6 +- src/plugins/pppoe/pppoe_api.c | 6 +- src/plugins/quic/quic.c | 20 +-- src/plugins/stn/stn.c | 4 +- src/plugins/stn/stn_api.c | 4 +- src/plugins/tracedump/tracedump.c | 6 +- src/plugins/vmxnet3/cli.c | 5 +- src/plugins/vmxnet3/vmxnet3.c | 4 +- src/plugins/vmxnet3/vmxnet3_api.c | 12 +- src/plugins/vrrp/vrrp.c | 6 +- src/plugins/vrrp/vrrp_api.c | 18 +-- src/plugins/vrrp/vrrp_cli.c | 17 ++- src/plugins/wireguard/wireguard_if.c | 4 +- src/plugins/wireguard/wireguard_peer.c | 10 +- 112 files changed, 784 insertions(+), 825 deletions(-) mode change 100755 => 100644 src/plugins/wireguard/wireguard_peer.c (limited to 'src/plugins') diff --git a/src/plugins/abf/abf_itf_attach.c b/src/plugins/abf/abf_itf_attach.c index 337eed8697d..4f17f720f3b 100644 --- a/src/plugins/abf/abf_itf_attach.c +++ b/src/plugins/abf/abf_itf_attach.c @@ -472,11 +472,11 @@ abf_itf_attach_walk (abf_itf_attach_walk_cb_t cb, void *ctx) u32 aii; /* *INDENT-OFF* */ - pool_foreach_index(aii, abf_itf_attach_pool, - ({ + pool_foreach_index (aii, abf_itf_attach_pool) + { if (!cb(aii, ctx)) break; - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/abf/abf_policy.c b/src/plugins/abf/abf_policy.c index 8defa752ec8..945434bca27 100644 --- a/src/plugins/abf/abf_policy.c +++ b/src/plugins/abf/abf_policy.c @@ -346,11 +346,11 @@ abf_policy_walk (abf_policy_walk_cb_t cb, void *ctx) u32 api; /* *INDENT-OFF* */ - pool_foreach_index(api, abf_policy_pool, - ({ + pool_foreach_index (api, abf_policy_pool) + { if (!cb(api, ctx)) break; - })); + } /* *INDENT-ON* */ } @@ -375,10 +375,10 @@ abf_show_policy_cmd (vlib_main_t * vm, if (INDEX_INVALID == policy_id) { /* *INDENT-OFF* */ - pool_foreach(ap, abf_policy_pool, - ({ + pool_foreach (ap, abf_policy_pool) + { vlib_cli_output(vm, "%U", format_abf, ap); - })); + } /* *INDENT-ON* */ } else 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 * diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c index c6bf2df4443..ffd372d7a56 100644 --- a/src/plugins/avf/device.c +++ b/src/plugins/avf/device.c @@ -1307,10 +1307,10 @@ avf_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) * during suspend */ vec_reset_length (dev_pointers); /* *INDENT-OFF* */ - pool_foreach_index (i, am->devices, + pool_foreach_index (i, am->devices) { vec_add1 (dev_pointers, avf_get_device (i)); - }); + } vec_foreach_index (i, dev_pointers) { @@ -1519,7 +1519,7 @@ avf_create_if (vlib_main_t * vm, avf_create_if_args_t * args) return; /* *INDENT-OFF* */ - pool_foreach (adp, am->devices, ({ + pool_foreach (adp, am->devices) { if ((*adp)->pci_addr.as_u32 == args->addr.as_u32) { args->rv = VNET_API_ERROR_ADDRESS_IN_USE; @@ -1528,7 +1528,7 @@ avf_create_if (vlib_main_t * vm, avf_create_if_args_t * args) &args->addr, "pci address in use"); return; } - })); + } /* *INDENT-ON* */ pool_get (am->devices, adp); diff --git a/src/plugins/builtinurl/builtins.c b/src/plugins/builtinurl/builtins.c index 6b2b57bce7f..04567c0f8c5 100644 --- a/src/plugins/builtinurl/builtins.c +++ b/src/plugins/builtinurl/builtins.c @@ -101,10 +101,10 @@ handle_get_interface_stats (http_builtin_method_type_t reqtype, else /* default, HTTP_BUILTIN_METHOD_GET */ { /* *INDENT-OFF* */ - pool_foreach (hi, im->hw_interfaces, - ({ + pool_foreach (hi, im->hw_interfaces) + { vec_add1 (sw_if_indices, hi->sw_if_index); - })); + } /* *INDENT-ON* */ } @@ -156,12 +156,12 @@ handle_get_interface_list (http_builtin_method_type_t reqtype, /* Construct vector of active hw_if_indexes ... */ /* *INDENT-OFF* */ - pool_foreach (hi, im->hw_interfaces, - ({ + pool_foreach (hi, im->hw_interfaces) + { /* No point in mentioning "local0"... */ if (hi - im->hw_interfaces) vec_add1 (hw_if_indices, hi - im->hw_interfaces); - })); + } /* *INDENT-ON* */ /* Build answer */ diff --git a/src/plugins/cdp/cdp_input.c b/src/plugins/cdp/cdp_input.c index e52361b0267..76a3d70a292 100644 --- a/src/plugins/cdp/cdp_input.c +++ b/src/plugins/cdp/cdp_input.c @@ -439,15 +439,15 @@ format_cdp_neighbors (u8 * s, va_list * va) "Our Port", "Peer System", "Peer Port", "Last Heard"); /* *INDENT-OFF* */ - pool_foreach (n, cm->neighbors, - ({ + pool_foreach (n, cm->neighbors) + { hw = vnet_get_sup_hw_interface (vnm, n->sw_if_index); if (n->disabled == 0) s = format (s, "%=25v %=25s %=25s %=10.1f\n", hw->name, n->device_name, n->port_id, n->last_heard); - })); + } /* *INDENT-ON* */ return s; } diff --git a/src/plugins/cdp/cdp_periodic.c b/src/plugins/cdp/cdp_periodic.c index b0b33cf9d41..c73d86be316 100644 --- a/src/plugins/cdp/cdp_periodic.c +++ b/src/plugins/cdp/cdp_periodic.c @@ -358,10 +358,10 @@ cdp_periodic (vlib_main_t * vm) static cdp_neighbor_t **n_list = 0; /* *INDENT-OFF* */ - pool_foreach (n, cm->neighbors, - ({ + pool_foreach (n, cm->neighbors) + { vec_add1 (n_list, n); - })); + } /* *INDENT-ON* */ /* Across all cdp neighbors known to the system */ diff --git a/src/plugins/cnat/cnat_client.c b/src/plugins/cnat/cnat_client.c index 1074fccc97f..534813c1564 100644 --- a/src/plugins/cnat/cnat_client.c +++ b/src/plugins/cnat/cnat_client.c @@ -84,7 +84,7 @@ cnat_client_throttle_pool_process () vec_reset_length (del_vec); clib_spinlock_lock (&cnat_client_db.throttle_pool_lock[i]); /* *INDENT-OFF* */ - pool_foreach(addr, cnat_client_db.throttle_pool[i], ({ + pool_foreach (addr, cnat_client_db.throttle_pool[i]) { cc = (AF_IP4 == addr->version ? cnat_client_ip4_find (&ip_addr_v4(addr)) : cnat_client_ip6_find (&ip_addr_v6(addr))); @@ -94,7 +94,7 @@ cnat_client_throttle_pool_process () cnat_client_cnt_session (cc); vec_add1(del_vec, addr - cnat_client_db.throttle_pool[i]); } - })); + } /* *INDENT-ON* */ vec_foreach (ai, del_vec) { @@ -301,9 +301,8 @@ cnat_client_show (vlib_main_t * vm, if (INDEX_INVALID == cci) { /* *INDENT-OFF* */ - pool_foreach_index(cci, cnat_client_pool, ({ + pool_foreach_index (cci, cnat_client_pool) vlib_cli_output(vm, "%U", format_cnat_client, cci, 0); - })) /* *INDENT-ON* */ vlib_cli_output (vm, "%d clients", pool_elts (cnat_client_pool)); diff --git a/src/plugins/cnat/cnat_session.c b/src/plugins/cnat/cnat_session.c index 54554cedc8c..c3d8aa7eb3d 100644 --- a/src/plugins/cnat/cnat_session.c +++ b/src/plugins/cnat/cnat_session.c @@ -243,11 +243,11 @@ cnat_timestamp_show (vlib_main_t * vm, cnat_timestamp_t *ts; clib_rwlock_reader_lock (&cnat_main.ts_lock); /* *INDENT-OFF* */ - pool_foreach (ts, cnat_timestamps, ({ + pool_foreach (ts, cnat_timestamps) { vlib_cli_output (vm, "[%d] last_seen:%f lifetime:%u ref:%u", ts - cnat_timestamps, ts->last_seen, ts->lifetime, ts->refcnt); - })); + } /* *INDENT-ON* */ clib_rwlock_reader_unlock (&cnat_main.ts_lock); return (NULL); diff --git a/src/plugins/cnat/cnat_translation.c b/src/plugins/cnat/cnat_translation.c index d519cd59171..9a1cc8bbc0b 100644 --- a/src/plugins/cnat/cnat_translation.c +++ b/src/plugins/cnat/cnat_translation.c @@ -69,11 +69,11 @@ cnat_translation_unwatch_addr (u32 cti, cnat_addr_resol_type_t type) addr_resolution_t *ar; index_t *indexes = 0, *ari; /* *INDENT-OFF* */ - pool_foreach (ar, tr_resolutions, ({ + pool_foreach (ar, tr_resolutions) { if ((cti == INDEX_INVALID || ar->cti == cti) && (ar->type == type || CNAT_RESOLV_ADDR_ANY == type)) vec_add1(indexes, ar - tr_resolutions); - })); + } /* *INDENT-ON* */ vec_foreach (ari, indexes) pool_put_index (tr_resolutions, *ari); @@ -313,11 +313,11 @@ cnat_translation_walk (cnat_translation_walk_cb_t cb, void *ctx) u32 api; /* *INDENT-OFF* */ - pool_foreach_index(api, cnat_translation_pool, - ({ + pool_foreach_index (api, cnat_translation_pool) + { if (!cb(api, ctx)) break; - })); + } /* *INDENT-ON* */ } @@ -381,11 +381,11 @@ cnat_translation_show (vlib_main_t * vm, if (INDEX_INVALID == cti) { /* *INDENT-OFF* */ - pool_foreach_index(cti, cnat_translation_pool, - ({ + pool_foreach_index (cti, cnat_translation_pool) + { ct = pool_elt_at_index (cnat_translation_pool, cti); vlib_cli_output(vm, "%U", format_cnat_translation, ct); - })); + } /* *INDENT-ON* */ } else @@ -403,10 +403,10 @@ cnat_translation_purge (void) index_t tri, *trp, *trs = NULL; /* *INDENT-OFF* */ - pool_foreach_index(tri, cnat_translation_pool, - ({ + pool_foreach_index (tri, cnat_translation_pool) + { vec_add1(trs, tri); - })); + } /* *INDENT-ON* */ vec_foreach (trp, trs) cnat_translation_delete (*trp); @@ -649,13 +649,13 @@ cnat_if_addr_add_del_callback (u32 sw_if_index, ip_address_t * address, { addr_resolution_t *ar; /* *INDENT-OFF* */ - pool_foreach (ar, tr_resolutions, ({ + pool_foreach (ar, tr_resolutions) { if (ar->sw_if_index != sw_if_index) continue; if (ar->af != ip_addr_version (address)) continue; cnat_if_addr_add_cbs[ar->type] (ar, address, is_del); - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/ct6/ct6.c b/src/plugins/ct6/ct6.c index 15fa44a5d45..d569a7c3f5b 100644 --- a/src/plugins/ct6/ct6.c +++ b/src/plugins/ct6/ct6.c @@ -322,10 +322,10 @@ show_ct6_command_fn_command_fn (vlib_main_t * vm, 0 /* pool */ , 0 /* header */ , verbose); /* *INDENT-OFF* */ - pool_foreach (s0, cmp->sessions[i], - ({ + pool_foreach (s0, cmp->sessions[i]) + { s = format (s, "%U", format_ct6_session, cmp, i, s0, verbose); - })); + } /* *INDENT-ON* */ } vlib_cli_output (cmp->vlib_main, "%v", s); @@ -431,10 +431,10 @@ test_ct6_command_fn_command_fn (vlib_main_t * vm, } /* *INDENT-OFF* */ - pool_foreach (s0, cmp->sessions[0], - ({ + pool_foreach (s0, cmp->sessions[0]) + { s = format (s, "%U", format_ct6_session, cmp, 0, s0, 1 /* verbose */); - })); + } /* *INDENT-ON* */ vlib_cli_output (vm, "\nEnd state: first index %d last index %d\n%v", @@ -451,10 +451,10 @@ test_ct6_command_fn_command_fn (vlib_main_t * vm, ct6_update_session_hit (cmp, s0, 234.0); /* *INDENT-OFF* */ - pool_foreach (s0, cmp->sessions[0], - ({ + pool_foreach (s0, cmp->sessions[0]) + { s = format (s, "%U", format_ct6_session, cmp, 0, s0, 1 /* verbose */); - })); + } /* *INDENT-ON* */ vlib_cli_output (vm, "\nEnd state: first index %d last index %d\n%v", diff --git a/src/plugins/dhcp/client.c b/src/plugins/dhcp/client.c index 575f8b82625..e15b6cb69f8 100644 --- a/src/plugins/dhcp/client.c +++ b/src/plugins/dhcp/client.c @@ -867,13 +867,13 @@ dhcp_client_process (vlib_main_t * vm, { /* *INDENT-OFF* */ next_expire_time = 1e70; - pool_foreach (c, dcm->clients, - ({ + pool_foreach (c, dcm->clients) + { this_next_expire_time = dhcp_client_sm (now, timeout, (uword) (c - dcm->clients)); next_expire_time = this_next_expire_time < next_expire_time ? this_next_expire_time : next_expire_time; - })); + } if (next_expire_time > now) timeout = next_expire_time - now; else @@ -939,12 +939,12 @@ show_dhcp_client_command_fn (vlib_main_t * vm, } /* *INDENT-OFF* */ - pool_foreach (c, dcm->clients, - ({ + pool_foreach (c, dcm->clients) + { vlib_cli_output (vm, "%U", format_dhcp_client, dcm, c, verbose); - })); + } /* *INDENT-ON* */ return 0; @@ -1114,11 +1114,11 @@ dhcp_client_walk (dhcp_client_walk_cb_t cb, void *ctx) dhcp_client_t *c; /* *INDENT-OFF* */ - pool_foreach (c, dcm->clients, - ({ + pool_foreach (c, dcm->clients) + { if (!cb(c, ctx)) break; - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/dhcp/dhcp6_client_common_dp.c b/src/plugins/dhcp/dhcp6_client_common_dp.c index 2acd2f6ab90..da6f61aa2d5 100644 --- a/src/plugins/dhcp/dhcp6_client_common_dp.c +++ b/src/plugins/dhcp/dhcp6_client_common_dp.c @@ -62,12 +62,12 @@ generate_client_duid (void) ethernet_interface_t *eth_if = 0; /* *INDENT-OFF* */ - pool_foreach (hi, im->hw_interfaces, - ({ + pool_foreach (hi, im->hw_interfaces) + { eth_if = ethernet_get_interface (ðernet_main, hi->hw_if_index); if (eth_if) break; - })); + } /* *INDENT-ON* */ if (eth_if) diff --git a/src/plugins/dhcp/dhcp6_ia_na_client_cp.c b/src/plugins/dhcp/dhcp6_ia_na_client_cp.c index 975a7e09eed..edc6f49768e 100644 --- a/src/plugins/dhcp/dhcp6_ia_na_client_cp.c +++ b/src/plugins/dhcp/dhcp6_ia_na_client_cp.c @@ -273,8 +273,8 @@ dhcp6_reply_event_handler (vl_api_dhcp6_reply_event_t * mp) u8 address_already_present = 0; /* *INDENT-OFF* */ - pool_foreach (address_info, rm->address_pool, - ({ + pool_foreach (address_info, rm->address_pool) + { if (address_info->sw_if_index != sw_if_index) ; else if (!ip6_addresses_equal (&address_info->address, address)) @@ -284,7 +284,7 @@ dhcp6_reply_event_handler (vl_api_dhcp6_reply_event_t * mp) address_already_present = 1; goto address_pool_foreach_out; } - })); + } /* *INDENT-ON* */ address_pool_foreach_out: @@ -346,15 +346,15 @@ create_address_list (u32 sw_if_index) address_info_t *address_info, *address_list = 0;; /* *INDENT-OFF* */ - pool_foreach (address_info, rm->address_pool, - ({ + pool_foreach (address_info, rm->address_pool) + { if (address_info->sw_if_index == sw_if_index) { u32 pos = vec_len (address_list); vec_validate (address_list, pos); clib_memcpy (&address_list[pos], address_info, sizeof (*address_info)); } - })); + } /* *INDENT-ON* */ return address_list; @@ -395,8 +395,8 @@ dhcp6_client_cp_process (vlib_main_t * vm, vlib_node_runtime_t * rt, { due_time = current_time + 1e9; /* *INDENT-OFF* */ - pool_foreach (address_info, rm->address_pool, - ({ + pool_foreach (address_info, rm->address_pool) + { if (address_info->due_time > current_time) { if (address_info->due_time < due_time) @@ -423,7 +423,7 @@ dhcp6_client_cp_process (vlib_main_t * vm, vlib_node_runtime_t * rt, 0, 1); } } - })); + } /* *INDENT-ON* */ for (i = 0; i < vec_len (rm->client_state_by_sw_if_index); i++) { @@ -526,15 +526,15 @@ dhcp6_addresses_show_command_function (vlib_main_t * vm, f64 current_time = vlib_time_now (vm); /* *INDENT-OFF* */ - pool_foreach (address_info, dm->address_pool, - ({ + pool_foreach (address_info, dm->address_pool) + { vlib_cli_output (vm, "address: %U, " "preferred lifetime: %u, valid lifetime: %u " "(%f remaining)", format_ip6_address, &address_info->address, address_info->preferred_lt, address_info->valid_lt, address_info->due_time - current_time); - })); + } /* *INDENT-ON* */ return error; @@ -661,8 +661,8 @@ dhcp6_client_enable_disable (u32 sw_if_index, u8 enable) } /* *INDENT-OFF* */ - pool_foreach (address_info, rm->address_pool, - ({ + pool_foreach (address_info, rm->address_pool) + { if (address_info->sw_if_index == sw_if_index) { ASSERT (sw_if_index < vec_len (rm->client_state_by_sw_if_index) && @@ -680,7 +680,7 @@ dhcp6_client_enable_disable (u32 sw_if_index, u8 enable) clib_warning ("Failed to delete interface address"); pool_put (rm->address_pool, address_info); } - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/dhcp/dhcp6_pd_client_cp.c b/src/plugins/dhcp/dhcp6_pd_client_cp.c index 2328dfda3f5..f6d30fa0c7d 100644 --- a/src/plugins/dhcp/dhcp6_pd_client_cp.c +++ b/src/plugins/dhcp/dhcp6_pd_client_cp.c @@ -372,10 +372,10 @@ dhcp6_pd_reply_event_handler (vl_api_dhcp6_pd_reply_event_t * mp) * so collect active indices. */ /* *INDENT-OFF* */ - pool_foreach (prefix_info, pm->prefix_pool, - ({ + pool_foreach (prefix_info, pm->prefix_pool) + { vec_add1 (pm->indices, prefix_info - pm->prefix_pool); - })); + } /* *INDENT-ON* */ for (i = 0; i < n_prefixes; i++) @@ -481,8 +481,8 @@ create_prefix_list (u32 sw_if_index) prefix_info_t *prefix_info, *prefix_list = 0;; /* *INDENT-OFF* */ - pool_foreach (prefix_info, pm->prefix_pool, - ({ + pool_foreach (prefix_info, pm->prefix_pool) + { if (is_dhcpv6_pd_prefix (prefix_info) && prefix_info->opaque_data == sw_if_index) { @@ -490,7 +490,7 @@ create_prefix_list (u32 sw_if_index) vec_validate (prefix_list, pos); clib_memcpy (&prefix_list[pos], prefix_info, sizeof (*prefix_info)); } - })); + } /* *INDENT-ON* */ return prefix_list; @@ -531,8 +531,8 @@ dhcp6_pd_client_cp_process (vlib_main_t * vm, vlib_node_runtime_t * rt, { due_time = current_time + 1e9; /* *INDENT-OFF* */ - pool_foreach (prefix_info, pm->prefix_pool, - ({ + pool_foreach (prefix_info, pm->prefix_pool) + { if (is_dhcpv6_pd_prefix (prefix_info)) { if (prefix_info->due_time > current_time) @@ -558,7 +558,7 @@ dhcp6_pd_client_cp_process (vlib_main_t * vm, vlib_node_runtime_t * rt, } } } - })); + } /* *INDENT-ON* */ for (i = 0; i < vec_len (rm->client_state_by_sw_if_index); i++) { @@ -788,12 +788,12 @@ cp_ip6_address_find_new_active_prefix (u32 prefix_group_index, prefix_info_t *prefix_info; /* *INDENT-OFF* */ - pool_foreach (prefix_info, pm->prefix_pool, - ({ + pool_foreach (prefix_info, pm->prefix_pool) + { if (prefix_info->prefix_group_index == prefix_group_index && prefix_info - pm->prefix_pool != ignore_prefix_index) return prefix_info - pm->prefix_pool; - })); + } /* *INDENT-ON* */ return ~0; } @@ -1139,8 +1139,8 @@ cp_ip6_prefixes_show_command_function (vlib_main_t * vm, f64 current_time = vlib_time_now (vm); /* *INDENT-OFF* */ - pool_foreach (prefix_info, pm->prefix_pool, - ({ + pool_foreach (prefix_info, pm->prefix_pool) + { prefix_group = pm->prefix_group_name_by_index[prefix_info->prefix_group_index]; vlib_cli_output (vm, "opaque_data: %lu, prefix: %U/%d, prefix group: %s, " @@ -1151,7 +1151,7 @@ cp_ip6_prefixes_show_command_function (vlib_main_t * vm, prefix_group, prefix_info->preferred_lt, prefix_info->valid_lt, prefix_info->due_time - current_time); - })); + } /* *INDENT-ON* */ return error; @@ -1305,8 +1305,8 @@ dhcp6_pd_client_enable_disable (u32 sw_if_index, vec_validate (prefix_list, 0); /* *INDENT-OFF* */ - pool_foreach (prefix_info, pm->prefix_pool, - ({ + pool_foreach (prefix_info, pm->prefix_pool) + { if (is_dhcpv6_pd_prefix (prefix_info) && prefix_info->opaque_data == sw_if_index) { @@ -1324,7 +1324,7 @@ dhcp6_pd_client_enable_disable (u32 sw_if_index, set_is_dhcpv6_pd_prefix (prefix_info, 0); pool_put (pm->prefix_pool, prefix_info); } - })); + } /* *INDENT-ON* */ vec_free (prefix_list); diff --git a/src/plugins/dhcp/dhcp_api.c b/src/plugins/dhcp/dhcp_api.c index c5c7a82f3c3..2b8d41a10c1 100644 --- a/src/plugins/dhcp/dhcp_api.c +++ b/src/plugins/dhcp/dhcp_api.c @@ -700,8 +700,8 @@ dhcp6_reply_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vpe_client_registration_t *reg; /* *INDENT-OFF* */ - pool_foreach(reg, vpe_api_main.dhcp6_reply_events_registrations, - ({ + pool_foreach (reg, vpe_api_main.dhcp6_reply_events_registrations) + { vl_api_registration_t *vl_reg; vl_reg = vl_api_client_index_to_registration (reg->client_index); @@ -715,7 +715,7 @@ dhcp6_reply_process (vlib_main_t * vm, vlib_node_runtime_t * rt, msg->pid = reg->client_pid; vl_api_send_msg (vl_reg, (u8 *) msg); } - })); + } /* *INDENT-ON* */ clib_mem_free (event); @@ -812,8 +812,8 @@ dhcp6_pd_reply_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vpe_client_registration_t *reg; /* *INDENT-OFF* */ - pool_foreach(reg, vpe_api_main.dhcp6_pd_reply_events_registrations, - ({ + pool_foreach (reg, vpe_api_main.dhcp6_pd_reply_events_registrations) + { vl_api_registration_t *vl_reg; vl_reg = vl_api_client_index_to_registration (reg->client_index); @@ -827,7 +827,7 @@ dhcp6_pd_reply_process (vlib_main_t * vm, vlib_node_runtime_t * rt, msg->pid = reg->client_pid; vl_api_send_msg (vl_reg, (u8 *) msg); } - })); + } /* *INDENT-ON* */ clib_mem_free (event); diff --git a/src/plugins/dns/dns.c b/src/plugins/dns/dns.c index d045ca0bee0..b4830e422c7 100644 --- a/src/plugins/dns/dns.c +++ b/src/plugins/dns/dns.c @@ -52,11 +52,11 @@ dns_cache_clear (dns_main_t * dm) dns_cache_lock (dm, 1); /* *INDENT-OFF* */ - pool_foreach (ep, dm->entries, - ({ + pool_foreach (ep, dm->entries) + { vec_free (ep->name); vec_free (ep->pending_requests); - })); + } /* *INDENT-ON* */ pool_free (dm->entries); @@ -2157,8 +2157,8 @@ format_dns_cache (u8 * s, va_list * args) if (verbose > 0) { /* *INDENT-OFF* */ - pool_foreach (ep, dm->entries, - ({ + pool_foreach (ep, dm->entries) + { if (ep->flags & DNS_CACHE_ENTRY_FLAG_VALID) { ASSERT (ep->dns_response); @@ -2194,7 +2194,7 @@ format_dns_cache (u8 * s, va_list * args) verbose); } vec_add1 (s, '\n'); - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index 51adbc23c80..bd8d435975c 100644 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -1429,7 +1429,7 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input) devconf->x = conf->default_devconf.x ; /* *INDENT-OFF* */ - pool_foreach (devconf, conf->dev_confs, ({ + pool_foreach (devconf, conf->dev_confs) { /* default per-device config items */ foreach_dpdk_device_config_item @@ -1471,7 +1471,7 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input) tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0); vec_add1 (conf->eal_init_args, tmp); } - })); + } /* *INDENT-ON* */ #undef _ diff --git a/src/plugins/flowprobe/flowprobe.c b/src/plugins/flowprobe/flowprobe.c index 3df877aa4a1..37abcfc5ce0 100644 --- a/src/plugins/flowprobe/flowprobe.c +++ b/src/plugins/flowprobe/flowprobe.c @@ -791,12 +791,12 @@ flowprobe_show_table_fn (vlib_main_t * vm, for (i = 0; i < vec_len (fm->pool_per_worker); i++) { /* *INDENT-OFF* */ - pool_foreach (e, fm->pool_per_worker[i], ( + pool_foreach (e, fm->pool_per_worker[i]) { vlib_cli_output (vm, "%U", format_flowprobe_entry, e); - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/gbp/gbp_bridge_domain.c b/src/plugins/gbp/gbp_bridge_domain.c index f2a56d770b9..279169abb1d 100644 --- a/src/plugins/gbp/gbp_bridge_domain.c +++ b/src/plugins/gbp/gbp_bridge_domain.c @@ -364,11 +364,11 @@ gbp_bridge_domain_walk (gbp_bridge_domain_cb_t cb, void *ctx) gbp_bridge_domain_t *gbpe; /* *INDENT-OFF* */ - pool_foreach(gbpe, gbp_bridge_domain_pool, + pool_foreach (gbpe, gbp_bridge_domain_pool) { if (!cb(gbpe, ctx)) break; - }); + } /* *INDENT-ON* */ } diff --git a/src/plugins/gbp/gbp_contract.c b/src/plugins/gbp/gbp_contract.c index e12b33145ce..dd433f28a84 100644 --- a/src/plugins/gbp/gbp_contract.c +++ b/src/plugins/gbp/gbp_contract.c @@ -567,11 +567,11 @@ gbp_contract_walk (gbp_contract_cb_t cb, void *ctx) gbp_contract_t *gc; /* *INDENT-OFF* */ - pool_foreach(gc, gbp_contract_pool, - ({ + pool_foreach (gc, gbp_contract_pool) + { if (!cb(gc, ctx)) break; - })); + } /* *INDENT-ON* */ } @@ -710,8 +710,8 @@ gbp_contract_show (vlib_main_t * vm, vlib_cli_output (vm, "Contracts:"); /* *INDENT-OFF* */ - pool_foreach (gc, gbp_contract_pool, - ({ + pool_foreach (gc, gbp_contract_pool) + { gci = gc - gbp_contract_pool; if (SCLASS_INVALID != src && SCLASS_INVALID != dst) @@ -732,7 +732,7 @@ gbp_contract_show (vlib_main_t * vm, } else vlib_cli_output (vm, " %U", format_gbp_contract, gci); - })); + } /* *INDENT-ON* */ return (NULL); diff --git a/src/plugins/gbp/gbp_endpoint.c b/src/plugins/gbp/gbp_endpoint.c index 9cc69d01277..b0cf64ced2d 100644 --- a/src/plugins/gbp/gbp_endpoint.c +++ b/src/plugins/gbp/gbp_endpoint.c @@ -1063,11 +1063,11 @@ gbp_endpoint_walk (gbp_endpoint_cb_t cb, void *ctx) u32 index; /* *INDENT-OFF* */ - pool_foreach_index(index, gbp_endpoint_pool, + pool_foreach_index (index, gbp_endpoint_pool) { if (!cb(index, ctx)) break; - }); + } /* *INDENT-ON* */ } diff --git a/src/plugins/gbp/gbp_endpoint_group.c b/src/plugins/gbp/gbp_endpoint_group.c index 92bad373c32..b9044378e3b 100644 --- a/src/plugins/gbp/gbp_endpoint_group.c +++ b/src/plugins/gbp/gbp_endpoint_group.c @@ -241,11 +241,11 @@ gbp_endpoint_group_walk (gbp_endpoint_group_cb_t cb, void *ctx) gbp_endpoint_group_t *gbpe; /* *INDENT-OFF* */ - pool_foreach(gbpe, gbp_endpoint_group_pool, + pool_foreach (gbpe, gbp_endpoint_group_pool) { if (!cb(gbpe, ctx)) break; - }); + } /* *INDENT-ON* */ } diff --git a/src/plugins/gbp/gbp_ext_itf.c b/src/plugins/gbp/gbp_ext_itf.c index e18bbe9c39a..c5506661c2d 100644 --- a/src/plugins/gbp/gbp_ext_itf.c +++ b/src/plugins/gbp/gbp_ext_itf.c @@ -233,11 +233,11 @@ gbp_ext_itf_walk (gbp_ext_itf_cb_t cb, void *ctx) gbp_ext_itf_t *ge; /* *INDENT-OFF* */ - pool_foreach(ge, gbp_ext_itf_pool, + pool_foreach (ge, gbp_ext_itf_pool) { if (!cb(ge, ctx)) break; - }); + } /* *INDENT-ON* */ } diff --git a/src/plugins/gbp/gbp_itf.c b/src/plugins/gbp/gbp_itf.c index 6a4a19733df..0c8f6a45a87 100644 --- a/src/plugins/gbp/gbp_itf.c +++ b/src/plugins/gbp/gbp_itf.c @@ -541,10 +541,10 @@ gbp_itf_show (vlib_main_t * vm, vlib_cli_output (vm, "Interfaces:"); /* *INDENT-OFF* */ - pool_foreach_index (gii, gbp_itf_pool, - ({ + pool_foreach_index (gii, gbp_itf_pool) + { vlib_cli_output (vm, " [%d] %U", gii, format_gbp_itf, gii); - })); + } /* *INDENT-ON* */ return (NULL); diff --git a/src/plugins/gbp/gbp_recirc.c b/src/plugins/gbp/gbp_recirc.c index 2b45d484289..8d56f11b4e3 100644 --- a/src/plugins/gbp/gbp_recirc.c +++ b/src/plugins/gbp/gbp_recirc.c @@ -227,11 +227,11 @@ gbp_recirc_walk (gbp_recirc_cb_t cb, void *ctx) gbp_recirc_t *ge; /* *INDENT-OFF* */ - pool_foreach(ge, gbp_recirc_pool, + pool_foreach (ge, gbp_recirc_pool) { if (!cb(ge, ctx)) break; - }); + } /* *INDENT-ON* */ } diff --git a/src/plugins/gbp/gbp_route_domain.c b/src/plugins/gbp/gbp_route_domain.c index 99c6e168a53..6cc595d0fa9 100644 --- a/src/plugins/gbp/gbp_route_domain.c +++ b/src/plugins/gbp/gbp_route_domain.c @@ -290,11 +290,11 @@ gbp_route_domain_walk (gbp_route_domain_cb_t cb, void *ctx) gbp_route_domain_t *gbpe; /* *INDENT-OFF* */ - pool_foreach(gbpe, gbp_route_domain_pool, + pool_foreach (gbpe, gbp_route_domain_pool) { if (!cb(gbpe, ctx)) break; - }); + } /* *INDENT-ON* */ } diff --git a/src/plugins/gbp/gbp_subnet.c b/src/plugins/gbp/gbp_subnet.c index 2ef3fcfd534..8d3b571657c 100644 --- a/src/plugins/gbp/gbp_subnet.c +++ b/src/plugins/gbp/gbp_subnet.c @@ -424,8 +424,8 @@ gbp_subnet_walk (gbp_subnet_cb_t cb, void *ctx) sw_if_index = ~0; /* *INDENT-OFF* */ - pool_foreach (gs, gbp_subnet_pool, - ({ + pool_foreach (gs, gbp_subnet_pool) + { grd = gbp_route_domain_get(gs->gs_rd); switch (gs->gs_type) @@ -447,7 +447,7 @@ gbp_subnet_walk (gbp_subnet_cb_t cb, void *ctx) if (WALK_STOP == cb (grd->grd_id, &gs->gs_key->gsk_pfx, gs->gs_type, sw_if_index, sclass, ctx)) break; - })); + } /* *INDENT-ON* */ } @@ -549,11 +549,11 @@ gbp_subnet_show (vlib_main_t * vm, else { /* *INDENT-OFF* */ - pool_foreach_index(gsi, gbp_subnet_pool, - ({ + pool_foreach_index (gsi, gbp_subnet_pool) + { vlib_cli_output (vm, "%U", format_gbp_subnet, gsi, GBP_SUBNET_SHOW_BRIEF); - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/gbp/gbp_vxlan.c b/src/plugins/gbp/gbp_vxlan.c index 643089eeb1b..d3da2b53949 100644 --- a/src/plugins/gbp/gbp_vxlan.c +++ b/src/plugins/gbp/gbp_vxlan.c @@ -306,11 +306,11 @@ gbp_vxlan_walk (gbp_vxlan_cb_t cb, void *ctx) gbp_vxlan_tunnel_t *gt; /* *INDENT-OFF* */ - pool_foreach (gt, gbp_vxlan_tunnel_pool, - ({ + pool_foreach (gt, gbp_vxlan_tunnel_pool) + { if (WALK_CONTINUE != cb(gt, ctx)) break; - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/geneve/geneve.c b/src/plugins/geneve/geneve.c index 2c6f1ffded5..62502ef3fde 100644 --- a/src/plugins/geneve/geneve.c +++ b/src/plugins/geneve/geneve.c @@ -903,12 +903,10 @@ show_geneve_tunnel_command_fn (vlib_main_t * vm, if (pool_elts (vxm->tunnels) == 0) vlib_cli_output (vm, "No geneve tunnels configured..."); - pool_foreach (t, vxm->tunnels, ( - { - vlib_cli_output (vm, "%U", - format_geneve_tunnel, t); - } - )); + pool_foreach (t, vxm->tunnels) + { + vlib_cli_output (vm, "%U", format_geneve_tunnel, t); + } return 0; } diff --git a/src/plugins/geneve/geneve_api.c b/src/plugins/geneve/geneve_api.c index f6b9afda7d5..d35a1bf5dbc 100644 --- a/src/plugins/geneve/geneve_api.c +++ b/src/plugins/geneve/geneve_api.c @@ -202,10 +202,10 @@ static void vl_api_geneve_tunnel_dump_t_handler if (~0 == sw_if_index) { /* *INDENT-OFF* */ - pool_foreach (t, vxm->tunnels, - ({ + pool_foreach (t, vxm->tunnels) + { send_geneve_tunnel_details(t, reg, mp->context); - })); + } /* *INDENT-ON* */ } else diff --git a/src/plugins/gtpu/gtpu.c b/src/plugins/gtpu/gtpu.c index 65c3053cd01..531e45a1d5a 100644 --- a/src/plugins/gtpu/gtpu.c +++ b/src/plugins/gtpu/gtpu.c @@ -914,12 +914,10 @@ show_gtpu_tunnel_command_fn (vlib_main_t * vm, if (pool_elts (gtm->tunnels) == 0) vlib_cli_output (vm, "No gtpu tunnels configured..."); - pool_foreach (t, gtm->tunnels, ( - { - vlib_cli_output (vm, "%U", - format_gtpu_tunnel, t); - } - )); + pool_foreach (t, gtm->tunnels) + { + vlib_cli_output (vm, "%U", format_gtpu_tunnel, t); + } return 0; } diff --git a/src/plugins/gtpu/gtpu_api.c b/src/plugins/gtpu/gtpu_api.c index 1100a7f90c1..77432bae4fa 100644 --- a/src/plugins/gtpu/gtpu_api.c +++ b/src/plugins/gtpu/gtpu_api.c @@ -239,10 +239,10 @@ vl_api_gtpu_tunnel_dump_t_handler (vl_api_gtpu_tunnel_dump_t * mp) if (~0 == sw_if_index) { /* *INDENT-OFF* */ - pool_foreach (t, gtm->tunnels, - ({ + pool_foreach (t, gtm->tunnels) + { send_gtpu_tunnel_details(t, reg, mp->context); - })); + } /* *INDENT-ON* */ } else diff --git a/src/plugins/hs_apps/sapi/vpp_echo.c b/src/plugins/hs_apps/sapi/vpp_echo.c index d6f0b28cc18..03a3577103e 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo.c +++ b/src/plugins/hs_apps/sapi/vpp_echo.c @@ -263,11 +263,11 @@ echo_free_sessions (echo_main_t * em) u32 *session_indexes = 0, *session_index; /* *INDENT-OFF* */ - pool_foreach (s, em->sessions, - ({ + pool_foreach (s, em->sessions) + { if (s->session_state == ECHO_SESSION_STATE_CLOSED) - vec_add1 (session_indexes, s->session_index);} - )); + vec_add1 (session_indexes, s->session_index); + } /* *INDENT-ON* */ vec_foreach (session_index, session_indexes) { diff --git a/src/plugins/hs_apps/sapi/vpp_echo_proto_quic.c b/src/plugins/hs_apps/sapi/vpp_echo_proto_quic.c index 95a468c0ef2..c67b35fd8e6 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo_proto_quic.c +++ b/src/plugins/hs_apps/sapi/vpp_echo_proto_quic.c @@ -240,8 +240,8 @@ quic_echo_initiate_qsession_close_no_stream (echo_main_t * em) echo_session_t *s; /* *INDENT-OFF* */ - pool_foreach (s, em->sessions, - ({ + pool_foreach (s, em->sessions) + { if (s->session_type == ECHO_SESSION_TYPE_QUIC) { if (eqm->send_quic_disconnects == ECHO_CLOSE_F_ACTIVE) @@ -260,7 +260,7 @@ quic_echo_initiate_qsession_close_no_stream (echo_main_t * em) else ECHO_LOG (2,"%U: PASSIVE close", echo_format_session, s); } - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/http_static/static_server.c b/src/plugins/http_static/static_server.c index b61243ab19e..0ae67412016 100644 --- a/src/plugins/http_static/static_server.c +++ b/src/plugins/http_static/static_server.c @@ -1610,10 +1610,10 @@ http_show_static_server_command_fn (vlib_main_t * vm, for (i = 0; i < vec_len (hsm->sessions); i++) { /* *INDENT-OFF* */ - pool_foreach (hs, hsm->sessions[i], - ({ + pool_foreach (hs, hsm->sessions[i]) + { vec_add1 (session_indices, hs - hsm->sessions[i]); - })); + } /* *INDENT-ON* */ for (j = 0; j < vec_len (session_indices); j++) diff --git a/src/plugins/igmp/igmp_api.c b/src/plugins/igmp/igmp_api.c index a298ff1a8cc..72c1b0394a8 100644 --- a/src/plugins/igmp/igmp_api.c +++ b/src/plugins/igmp/igmp_api.c @@ -182,10 +182,10 @@ vl_api_igmp_dump_t_handler (vl_api_igmp_dump_t * mp) if (~0 == sw_if_index) { /* *INDENT-OFF* */ - pool_foreach (config, im->configs, - ({ + pool_foreach (config, im->configs) + { igmp_config_dump(im, rp, mp->context, config); - })); + } /* *INDENT-ON* */ } else @@ -403,12 +403,12 @@ igmp_event (igmp_filter_mode_t filter, /* *INDENT-OFF* */ - pool_foreach (api_client, im->api_clients, - ({ + pool_foreach (api_client, im->api_clients) + { rp = vl_api_client_index_to_registration (api_client->client_index); if (rp) send_igmp_event (rp, filter, sw_if_index, saddr, gaddr); - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/igmp/igmp_cli.c b/src/plugins/igmp/igmp_cli.c index 5eceb685dbe..f84cdaf50f7 100644 --- a/src/plugins/igmp/igmp_cli.c +++ b/src/plugins/igmp/igmp_cli.c @@ -356,10 +356,10 @@ igmp_show_command_fn (vlib_main_t * vm, unformat_input_t * input, igmp_config_t *config; /* *INDENT-OFF* */ - pool_foreach (config, im->configs, - ({ + pool_foreach (config, im->configs) + { vlib_cli_output (vm, "%U", format_igmp_config, config); - })); + } /* *INDENT-ON* */ return error; diff --git a/src/plugins/ikev2/ikev2.c b/src/plugins/ikev2/ikev2.c index 745943bd46b..258087fe1d5 100644 --- a/src/plugins/ikev2/ikev2.c +++ b/src/plugins/ikev2/ikev2.c @@ -1070,14 +1070,14 @@ ikev2_initial_contact_cleanup_internal (ikev2_main_per_thread_data_t * ptd, /* find old IKE SAs with the same authenticated identity */ /* *INDENT-OFF* */ - pool_foreach (tmp, ptd->sas, ({ + pool_foreach (tmp, ptd->sas) { if (!ikev2_is_id_equal (&tmp->i_id, &sa->i_id) || !ikev2_is_id_equal(&tmp->r_id, &sa->r_id)) continue; if (sa->rspi != tmp->rspi) vec_add1(delete, tmp - ptd->sas); - })); + } /* *INDENT-ON* */ for (i = 0; i < vec_len (delete); i++) @@ -1564,7 +1564,7 @@ ikev2_sa_match_ts (ikev2_sa_t * sa) ikev2_id_t *id_rem, *id_loc; /* *INDENT-OFF* */ - pool_foreach (p, km->profiles, ({ + pool_foreach (p, km->profiles) { if (sa->is_initiator) { @@ -1607,7 +1607,7 @@ ikev2_sa_match_ts (ikev2_sa_t * sa) } break; - })); + } /* *INDENT-ON* */ if (tsi && tsr) @@ -1667,7 +1667,7 @@ ikev2_sa_auth (ikev2_sa_t * sa) } /* *INDENT-OFF* */ - pool_foreach (p, km->profiles, ({ + pool_foreach (p, km->profiles) { /* check id */ if (!ikev2_is_id_equal (&p->rem_id, id_rem) @@ -1707,7 +1707,7 @@ ikev2_sa_auth (ikev2_sa_t * sa) vec_free(auth); vec_free(psk); - })); + } /* *INDENT-ON* */ if (sel_p) @@ -2679,11 +2679,11 @@ ikev2_retransmit_sa_init (ike_header_t * ike, ip_address_t iaddr, ikev2_main_per_thread_data_t *ptd = ikev2_get_per_thread_data (); /* *INDENT-OFF* */ - pool_foreach (sa, ptd->sas, ({ + pool_foreach (sa, ptd->sas) { res = ikev2_retransmit_sa_init_one (sa, ike, iaddr, raddr, rlen); if (res) return res; - })); + } /* *INDENT-ON* */ /* req is not retransmit */ @@ -3750,10 +3750,10 @@ ikev2_cleanup_profile_sessions (ikev2_main_t * km, ikev2_profile_t * p) u32 *del_sai = 0; /* *INDENT-OFF* */ - pool_foreach(sa, km->sais, ({ + pool_foreach (sa, km->sais) { if (pi == sa->profile_index) vec_add1 (del_sai, sa - km->sais); - })); + } /* *INDENT-ON* */ vec_foreach (sai, del_sai) @@ -3768,10 +3768,10 @@ ikev2_cleanup_profile_sessions (ikev2_main_t * km, ikev2_profile_t * p) vec_foreach (tkm, km->per_thread_data) { /* *INDENT-OFF* */ - pool_foreach (sa, tkm->sas, ({ + pool_foreach (sa, tkm->sas) { if (sa->profile_index != ~0 && pi == sa->profile_index) vec_add1 (del_sai, sa - tkm->sas); - })); + } /* *INDENT-ON* */ vec_foreach (sai, del_sai) @@ -4403,14 +4403,14 @@ ikev2_initiate_delete_child_sa (vlib_main_t * vm, u32 ispi) if (fchild) break; /* *INDENT-OFF* */ - pool_foreach (sa, tkm->sas, ({ + pool_foreach (sa, tkm->sas) { fchild = ikev2_sa_get_child(sa, ispi, IKEV2_PROTOCOL_ESP, 1); if (fchild) { fsa = sa; break; } - })); + } /* *INDENT-ON* */ } @@ -4443,14 +4443,14 @@ ikev2_initiate_delete_ike_sa (vlib_main_t * vm, u64 ispi) if (fsa) break; /* *INDENT-OFF* */ - pool_foreach (sa, tkm->sas, ({ + pool_foreach (sa, tkm->sas) { if (sa->ispi == ispi) { fsa = sa; ftkm = tkm; break; } - })); + } /* *INDENT-ON* */ } @@ -4526,14 +4526,14 @@ ikev2_initiate_rekey_child_sa (vlib_main_t * vm, u32 ispi) if (fchild) break; /* *INDENT-OFF* */ - pool_foreach (sa, tkm->sas, ({ + pool_foreach (sa, tkm->sas) { fchild = ikev2_sa_get_child(sa, ispi, IKEV2_PROTOCOL_ESP, 1); if (fchild) { fsa = sa; break; } - })); + } /* *INDENT-ON* */ } @@ -4568,10 +4568,10 @@ ikev2_sa_del (ikev2_profile_t * p, u32 sw_if_index) vec_foreach (tkm, km->per_thread_data) { /* *INDENT-OFF* */ - pool_foreach (sa, tkm->sas, ({ + pool_foreach (sa, tkm->sas) { if (ikev2_sa_sw_if_match (sa, sw_if_index)) vec_add1 (sa_vec, sa); - })); + } /* *INDENT-ON* */ vec_foreach (sap, sa_vec) @@ -4583,10 +4583,10 @@ ikev2_sa_del (ikev2_profile_t * p, u32 sw_if_index) vec_free (sa_vec); /* *INDENT-OFF* */ - pool_foreach (sa, km->sais, ({ + pool_foreach (sa, km->sais) { if (ikev2_sa_sw_if_match (sa, sw_if_index)) vec_add1 (ispi_vec, sa->ispi); - })); + } /* *INDENT-ON* */ vec_foreach (ispi, ispi_vec) @@ -4607,10 +4607,10 @@ ikev2_sw_interface_add_del (vnet_main_t * vnm, u32 sw_if_index, u32 is_add) return 0; /* *INDENT-OFF* */ - pool_foreach (p, km->profiles, ({ + pool_foreach (p, km->profiles) { if (p->responder.sw_if_index == sw_if_index) ikev2_sa_del (p, sw_if_index); - })); + } /* *INDENT-ON* */ return 0; @@ -4839,14 +4839,14 @@ ikev2_mngr_process_ipsec_sa (ipsec_sa_t * ipsec_sa) if (fchild) break; /* *INDENT-OFF* */ - pool_foreach (sa, tkm->sas, ({ + pool_foreach (sa, tkm->sas) { fchild = ikev2_sa_get_child(sa, ipsec_sa->spi, IKEV2_PROTOCOL_ESP, 1); if (fchild) { fsa = sa; break; } - })); + } /* *INDENT-ON* */ } vlib_get_combined_counter (&ipsec_sa_counters, @@ -5029,7 +5029,7 @@ ikev2_mngr_process_fn (vlib_main_t * vm, vlib_node_runtime_t * rt, u32 *to_be_deleted = 0; /* *INDENT-OFF* */ - pool_foreach (sa, tkm->sas, ({ + pool_foreach (sa, tkm->sas) { ikev2_child_sa_t *c; u8 del_old_ids = 0; @@ -5049,7 +5049,7 @@ ikev2_mngr_process_fn (vlib_main_t * vm, vlib_node_runtime_t * rt, if (!km->dpd_disabled && ikev2_mngr_process_responder_sas (sa)) vec_add1 (to_be_deleted, sa - tkm->sas); - })); + } /* *INDENT-ON* */ vec_foreach (sai, to_be_deleted) @@ -5085,9 +5085,9 @@ ikev2_mngr_process_fn (vlib_main_t * vm, vlib_node_runtime_t * rt, /* process ipsec sas */ ipsec_sa_t *sa; /* *INDENT-OFF* */ - pool_foreach (sa, im->sad, ({ + pool_foreach (sa, im->sad) { ikev2_mngr_process_ipsec_sa(sa); - })); + } /* *INDENT-ON* */ ikev2_process_pending_sa_init (km); diff --git a/src/plugins/ikev2/ikev2_api.c b/src/plugins/ikev2/ikev2_api.c index dd4c094c50e..00d71143a5d 100644 --- a/src/plugins/ikev2/ikev2_api.c +++ b/src/plugins/ikev2/ikev2_api.c @@ -187,10 +187,10 @@ vl_api_ikev2_profile_dump_t_handler (vl_api_ikev2_profile_dump_t * mp) return; /* *INDENT-OFF* */ - pool_foreach (profile, im->profiles, - ({ + pool_foreach (profile, im->profiles) + { send_profile (profile, reg, mp->context); - })); + } /* *INDENT-ON* */ } @@ -268,12 +268,12 @@ vl_api_ikev2_sa_dump_t_handler (vl_api_ikev2_sa_dump_t * mp) vec_foreach (tkm, km->per_thread_data) { /* *INDENT-OFF* */ - pool_foreach (sa, tkm->sas, - ({ + pool_foreach (sa, tkm->sas) + { u32 api_sa_index = ikev2_encode_sa_index (sa - tkm->sas, tkm - km->per_thread_data); send_sa (sa, mp, api_sa_index); - })); + } /* *INDENT-ON* */ } } diff --git a/src/plugins/ikev2/ikev2_cli.c b/src/plugins/ikev2/ikev2_cli.c index 72f82b4e135..1bb2dd91a88 100644 --- a/src/plugins/ikev2/ikev2_cli.c +++ b/src/plugins/ikev2/ikev2_cli.c @@ -219,7 +219,7 @@ show_ikev2_sa_command_fn (vlib_main_t * vm, vec_foreach (tkm, km->per_thread_data) { /* *INDENT-OFF* */ - pool_foreach (sa, tkm->sas, ({ + pool_foreach (sa, tkm->sas) { if (show_one) { if (sa->rspi == rspi) @@ -230,7 +230,7 @@ show_ikev2_sa_command_fn (vlib_main_t * vm, } else s = format (s, "%U\n", format_ikev2_sa, sa, details); - })); + } /* *INDENT-ON* */ } @@ -562,7 +562,7 @@ show_ikev2_profile_command_fn (vlib_main_t * vm, ikev2_profile_t *p; /* *INDENT-OFF* */ - pool_foreach (p, km->profiles, ({ + pool_foreach (p, km->profiles) { vlib_cli_output(vm, "profile %v", p->name); if (p->auth.data) @@ -652,7 +652,7 @@ show_ikev2_profile_command_fn (vlib_main_t * vm, vlib_cli_output(vm, " lifetime %d jitter %d handover %d maxdata %d", p->lifetime, p->lifetime_jitter, p->handover, p->lifetime_maxdata); - })); + } /* *INDENT-ON* */ return 0; diff --git a/src/plugins/ila/ila.c b/src/plugins/ila/ila.c index 162d417d772..366abc9831e 100644 --- a/src/plugins/ila/ila.c +++ b/src/plugins/ila/ila.c @@ -1070,10 +1070,10 @@ ila_show_entries_command_fn (vlib_main_t * vm, ila_entry_t *e; vlib_cli_output (vm, " %U\n", format_ila_entry, vnm, NULL); - pool_foreach (e, ilm->entries, - ({ + pool_foreach (e, ilm->entries) + { vlib_cli_output (vm, " %U\n", format_ila_entry, vnm, e); - })); + } return NULL; } diff --git a/src/plugins/ioam/ip6/ioam_cache.c b/src/plugins/ioam/ip6/ioam_cache.c index 74b50c9282e..d9f7029717a 100644 --- a/src/plugins/ioam/ip6/ioam_cache.c +++ b/src/plugins/ioam/ip6/ioam_cache.c @@ -253,12 +253,10 @@ ioam_cache_table_print (vlib_main_t * vm, u8 verbose) int no_of_threads = vec_len (vlib_worker_threads); int i; - pool_foreach (entry, cm->ioam_rewrite_pool, ( - { - vlib_cli_output (vm, "%U", - format_ioam_cache_entry, - entry); - })); + pool_foreach (entry, cm->ioam_rewrite_pool) + { + vlib_cli_output (vm, "%U", format_ioam_cache_entry, entry); + } if (cm->ts_stats) for (i = 0; i < no_of_threads; i++) @@ -269,16 +267,11 @@ ioam_cache_table_print (vlib_main_t * vm, u8 verbose) if (verbose == 1) vlib_worker_thread_barrier_sync (vm); - pool_foreach (ts_entry, cm->ioam_ts_pool[i], ( - { - vlib_cli_output (vm, - "%U", - format_ioam_cache_ts_entry, - ts_entry, - (u32) - i); - } - )); + pool_foreach (ts_entry, cm->ioam_ts_pool[i]) + { + vlib_cli_output (vm, "%U", format_ioam_cache_ts_entry, ts_entry, + (u32) i); + } vlib_worker_thread_barrier_release (vm); } diff --git a/src/plugins/ioam/ip6/ioam_cache.h b/src/plugins/ioam/ip6/ioam_cache.h index dc4ae0053fa..b85172e8ac1 100644 --- a/src/plugins/ioam/ip6/ioam_cache.h +++ b/src/plugins/ioam/ip6/ioam_cache.h @@ -471,10 +471,10 @@ ioam_cache_table_destroy (vlib_main_t * vm) ioam_cache_entry_t *entry = 0; /* free pool and hash table */ clib_bihash_free_8_8 (&cm->ioam_rewrite_cache_table); - pool_foreach (entry, cm->ioam_rewrite_pool, ( - { - ioam_cache_entry_free (entry); - })); + pool_foreach (entry, cm->ioam_rewrite_pool) + { + ioam_cache_entry_free (entry); + } pool_free (cm->ioam_rewrite_pool); cm->ioam_rewrite_pool = 0; vec_free (cm->sr_rewrite_template); @@ -610,13 +610,10 @@ ioam_cache_ts_table_destroy (vlib_main_t * vm) /* free pool and hash table */ for (i = 0; i < no_of_threads; i++) { - pool_foreach (entry, cm->ioam_ts_pool[i], ( - { - ioam_cache_ts_entry_free (i, - entry, - cm->error_node_index); - } - )); + pool_foreach (entry, cm->ioam_ts_pool[i]) + { + ioam_cache_ts_entry_free (i, entry, cm->error_node_index); + } pool_free (cm->ioam_ts_pool[i]); cm->ioam_ts_pool = 0; tw_timer_wheel_free_16t_2w_512sl (&cm->timer_wheels[i]); diff --git a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_ioam.c b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_ioam.c index 5a59e75bf01..108b0c0765b 100644 --- a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_ioam.c +++ b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_ioam.c @@ -187,11 +187,10 @@ vxlan_gpe_clear_output_feature_on_all_intfs (vlib_main_t * vm) vnet_main_t *vnm = vnet_get_main (); vnet_interface_main_t *im = &vnm->interface_main; - pool_foreach (si, im->sw_interfaces, ( - { - vxlan_gpe_set_clear_output_feature_on_intf - (vm, si->sw_if_index, 0); - })); + pool_foreach (si, im->sw_interfaces) + { + vxlan_gpe_set_clear_output_feature_on_intf (vm, si->sw_if_index, 0); + } return; } @@ -377,17 +376,12 @@ vxlan_gpe_refresh_output_feature_on_all_dest (void) i = vec_len (hm->bool_ref_by_sw_if_index); vec_free (hm->bool_ref_by_sw_if_index); vec_validate_init_empty (hm->bool_ref_by_sw_if_index, i, ~0); - pool_foreach (t, hm->dst_tunnels, ( - { - vxlan_gpe_enable_disable_ioam_for_dest - (hm->vlib_main, - t->dst_addr, - t->outer_fib_index, - (t->fp_proto == FIB_PROTOCOL_IP4), 1 - /* is_add */ - ); - } - )); + pool_foreach (t, hm->dst_tunnels) + { + vxlan_gpe_enable_disable_ioam_for_dest + (hm->vlib_main, t->dst_addr, t->outer_fib_index, + (t->fp_proto == FIB_PROTOCOL_IP4), 1 /* is_add */ ); + } return; } @@ -621,16 +615,14 @@ int vxlan_gpe_ioam_disable_for_dest return 0; } - pool_foreach (t, hm->dst_tunnels, ( - { - vxlan_gpe_enable_disable_ioam_for_dest - (hm->vlib_main, - t->dst_addr, - t->outer_fib_index, - (t->fp_proto == - FIB_PROTOCOL_IP4), 1 /* is_add */ ); - } - )); + pool_foreach (t, hm->dst_tunnels) + { + vxlan_gpe_enable_disable_ioam_for_dest + (hm->vlib_main, + t->dst_addr, + t->outer_fib_index, + (t->fp_proto == FIB_PROTOCOL_IP4), 1 /* is_add */ ); + } vxlan_gpe_clear_output_feature_on_select_intfs (); return (0); diff --git a/src/plugins/l2tp/l2tp.c b/src/plugins/l2tp/l2tp.c index 242f4323e37..08fa6d1e60b 100644 --- a/src/plugins/l2tp/l2tp.c +++ b/src/plugins/l2tp/l2tp.c @@ -130,10 +130,10 @@ show_l2tp_command_fn (vlib_main_t * vm, vlib_cli_output (vm, "L2tp session lookup on %s", keystr); /* *INDENT-OFF* */ - pool_foreach (session, lm->sessions, - ({ + pool_foreach (session, lm->sessions) + { vlib_cli_output (vm, "%U", format_l2t_session, session); - })); + } /* *INDENT-ON* */ } @@ -160,8 +160,8 @@ test_counters_command_fn (vlib_main_t * vm, u32 thread_index = vm->thread_index; /* *INDENT-OFF* */ - pool_foreach (session, lm->sessions, - ({ + pool_foreach (session, lm->sessions) + { session_index = session - lm->sessions; counter_index = session_index_to_counter_index (session_index, @@ -176,7 +176,7 @@ test_counters_command_fn (vlib_main_t * vm, 1/*pkt*/, 2222 /*bytes*/); nincr++; - })); + } /* *INDENT-ON* */ vlib_cli_output (vm, "Incremented %d active counters\n", nincr); @@ -202,8 +202,8 @@ clear_counters_command_fn (vlib_main_t * vm, u32 nincr = 0; /* *INDENT-OFF* */ - pool_foreach (session, lm->sessions, - ({ + pool_foreach (session, lm->sessions) + { session_index = session - lm->sessions; counter_index = session_index_to_counter_index (session_index, @@ -211,7 +211,7 @@ clear_counters_command_fn (vlib_main_t * vm, vlib_zero_combined_counter (&lm->counter_main, counter_index); vlib_zero_combined_counter (&lm->counter_main, counter_index+1); nincr++; - })); + } /* *INDENT-ON* */ vlib_cli_output (vm, "Cleared %d active counters\n", nincr); diff --git a/src/plugins/l2tp/l2tp_api.c b/src/plugins/l2tp/l2tp_api.c index fb675ddff5e..ba9d2681b35 100644 --- a/src/plugins/l2tp/l2tp_api.c +++ b/src/plugins/l2tp/l2tp_api.c @@ -90,10 +90,10 @@ vl_api_sw_if_l2tpv3_tunnel_dump_t_handler (vl_api_sw_if_l2tpv3_tunnel_dump_t * return; /* *INDENT-OFF* */ - pool_foreach (session, lm->sessions, - ({ + pool_foreach (session, lm->sessions) + { send_sw_if_l2tpv3_tunnel_details (am, reg, session, lm, mp->context); - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/l3xc/l3xc.c b/src/plugins/l3xc/l3xc.c index 9839278dfb2..21f3eea8b01 100644 --- a/src/plugins/l3xc/l3xc.c +++ b/src/plugins/l3xc/l3xc.c @@ -305,11 +305,11 @@ l3xc_walk (l3xc_walk_cb_t cb, void *ctx) u32 l3xci; /* *INDENT-OFF* */ - pool_foreach_index(l3xci, l3xc_pool, - ({ + pool_foreach_index (l3xci, l3xc_pool) + { if (!cb(l3xci, ctx)) break; - })); + } /* *INDENT-ON* */ } @@ -320,10 +320,10 @@ l3xc_show_cmd (vlib_main_t * vm, l3xc_t *l3xc; /* *INDENT-OFF* */ - pool_foreach(l3xc, l3xc_pool, - ({ + pool_foreach (l3xc, l3xc_pool) + { vlib_cli_output(vm, "%U", format_l3xc, l3xc); - })); + } /* *INDENT-ON* */ return (NULL); diff --git a/src/plugins/lacp/cli.c b/src/plugins/lacp/cli.c index 7abc6f0c4ca..fee9a5a2269 100644 --- a/src/plugins/lacp/cli.c +++ b/src/plugins/lacp/cli.c @@ -29,7 +29,7 @@ lacp_dump_ifs (lacp_interface_details_t ** out_lacpifs) lacp_interface_details_t *lacpif = NULL; /* *INDENT-OFF* */ - pool_foreach (mif, bm->neighbors, + pool_foreach (mif, bm->neighbors) { if (mif->lacp_enabled == 0) continue; vec_add2(r_lacpifs, lacpif, 1); @@ -60,7 +60,7 @@ lacp_dump_ifs (lacp_interface_details_t ** out_lacpifs) lacpif->tx_state = mif->tx_state; lacpif->ptx_state = mif->ptx_state; lacpif->mux_state = mif->mux_state; - ); + } /* *INDENT-ON* */ *out_lacpifs = r_lacpifs; @@ -295,9 +295,8 @@ show_lacp_fn (vlib_main_t * vm, unformat_input_t * input, if (vec_len (sw_if_indices) == 0) { - pool_foreach (mif, bm->neighbors, - vec_add1 (sw_if_indices, mif->sw_if_index); - ); + pool_foreach (mif, bm->neighbors) + vec_add1 (sw_if_indices, mif->sw_if_index); } if (details) diff --git a/src/plugins/lacp/lacp.c b/src/plugins/lacp/lacp.c index 319a8f79d48..44a32aa23a9 100644 --- a/src/plugins/lacp/lacp.c +++ b/src/plugins/lacp/lacp.c @@ -143,8 +143,8 @@ lacp_periodic (vlib_main_t * vm) u8 actor_state, partner_state; /* *INDENT-OFF* */ - pool_foreach (mif, bm->neighbors, - ({ + pool_foreach (mif, bm->neighbors) + { if (mif->port_enabled == 0) continue; @@ -184,7 +184,7 @@ lacp_periodic (vlib_main_t * vm) [mif->sw_if_index].partner_state, mif->partner.state); } - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/lacp/rx_machine.c b/src/plugins/lacp/rx_machine.c index 60edc80d863..6e36a661034 100644 --- a/src/plugins/lacp/rx_machine.c +++ b/src/plugins/lacp/rx_machine.c @@ -344,7 +344,7 @@ lacp_port_is_moved (vlib_main_t * vm, member_if_t * mif) lacp_pdu_t *lacpdu = (lacp_pdu_t *) mif->last_rx_pkt; /* *INDENT-OFF* */ - pool_foreach (mif2, bm->neighbors, { + pool_foreach (mif2, bm->neighbors) { { if ((mif != mif2) && (mif2->rx_state == LACP_RX_STATE_PORT_DISABLED) && !memcmp (mif2->partner.system, @@ -352,7 +352,7 @@ lacp_port_is_moved (vlib_main_t * vm, member_if_t * mif) (mif2->partner.port_number == lacpdu->partner.port_info.port_number)) return 1; } - }); + } /* *INDENT-ON* */ return 0; diff --git a/src/plugins/lb/api.c b/src/plugins/lb/api.c index 176da24ce16..e44f815cb9c 100644 --- a/src/plugins/lb/api.c +++ b/src/plugins/lb/api.c @@ -177,7 +177,7 @@ vl_api_lb_vip_dump_t_handler lb_vip_t *vip = 0; /* construct vip list */ - pool_foreach(vip, lbm->vips, { + pool_foreach (vip, lbm->vips) { /* Hide placeholder VIP */ if (vip != lbm->vips) { msg_size = sizeof (*rmp); @@ -199,7 +199,7 @@ vl_api_lb_vip_dump_t_handler vl_api_send_msg (reg, (u8 *) rmp); } - }); + } } @@ -216,7 +216,7 @@ static void send_lb_as_details /* construct as list under this vip */ lb_as_t *as; - pool_foreach(as_index, vip->as_indexes, { + pool_foreach (as_index, vip->as_indexes) { /* Hide placeholder As for specific VIP */ if (*as_index != 0) { as = &lbm->ass[*as_index]; @@ -237,7 +237,7 @@ static void send_lb_as_details vl_api_send_msg (reg, (u8 *) rmp); asindex++; } - }); + } } @@ -261,8 +261,8 @@ vl_api_lb_as_dump_t_handler dump_all = (prefix.ip6.as_u64[0] == 0) && (prefix.ip6.as_u64[1] == 0); /* *INDENT-OFF* */ - pool_foreach(vip, lbm->vips, - ({ + pool_foreach (vip, lbm->vips) + { if ( dump_all || ((prefix.as_u64[0] == vip->prefix.as_u64[0]) && (prefix.as_u64[1] == vip->prefix.as_u64[1]) @@ -271,7 +271,7 @@ vl_api_lb_as_dump_t_handler { send_lb_as_details(reg, mp->context, vip); } - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/lb/cli.c b/src/plugins/lb/cli.c index ecc5e66fd9e..7b5dc5c8549 100644 --- a/src/plugins/lb/cli.c +++ b/src/plugins/lb/cli.c @@ -387,11 +387,11 @@ lb_show_vips_command_fn (vlib_main_t * vm, verbose = 1; /* Hide placeholder VIP */ - pool_foreach(vip, lbm->vips, { + pool_foreach (vip, lbm->vips) { if (vip != lbm->vips) { vlib_cli_output(vm, "%U\n", verbose?format_lb_vip_detailed:format_lb_vip, vip); } - }); + } unformat_free (&line_input); return NULL; diff --git a/src/plugins/lb/lb.c b/src/plugins/lb/lb.c index 21a14844f5e..6fc7f0f92b2 100644 --- a/src/plugins/lb/lb.c +++ b/src/plugins/lb/lb.c @@ -255,7 +255,7 @@ u8 *format_lb_vip_detailed (u8 * s, va_list * args) lb_as_t *as; u32 *as_index; - pool_foreach(as_index, vip->as_indexes, { + pool_foreach (as_index, vip->as_indexes) { as = &lbm->ass[*as_index]; s = format(s, "%U %U %u buckets %Lu flows dpo:%u %s\n", format_white_space, indent, @@ -264,7 +264,7 @@ u8 *format_lb_vip_detailed (u8 * s, va_list * args) vlib_refcount_get(&lbm->as_refcount, as - lbm->ass), as->dpo.dpoi_index, (as->flags & LB_AS_FLAGS_USED)?"used":" removed"); - }); + } vec_free(count); return s; @@ -302,7 +302,7 @@ static void lb_vip_garbage_collection(lb_vip_t *vip) vip->last_garbage_collection = now; lb_as_t *as; u32 *as_index; - pool_foreach(as_index, vip->as_indexes, { + pool_foreach (as_index, vip->as_indexes) { as = &lbm->ass[*as_index]; if (!(as->flags & LB_AS_FLAGS_USED) && //Not used clib_u32_loop_gt(now, as->last_used + LB_CONCURRENCY_TIMEOUT) && @@ -351,7 +351,7 @@ static void lb_vip_garbage_collection(lb_vip_t *vip) pool_put(vip->as_indexes, as_index); pool_put(lbm->ass, as); } - }); + } } void lb_garbage_collection() @@ -360,14 +360,14 @@ void lb_garbage_collection() lb_get_writer_lock(); lb_vip_t *vip; u32 *to_be_removed_vips = 0, *i; - pool_foreach(vip, lbm->vips, { + pool_foreach (vip, lbm->vips) { lb_vip_garbage_collection(vip); if (!(vip->flags & LB_VIP_FLAGS_USED) && (pool_elts(vip->as_indexes) == 0)) { vec_add1(to_be_removed_vips, vip - lbm->vips); } - }); + } vec_foreach(i, to_be_removed_vips) { vip = &lbm->vips[*i]; @@ -392,13 +392,13 @@ static void lb_vip_update_new_flow_table(lb_vip_t *vip) //Check if some AS is configured or not i = 0; - pool_foreach(as_index, vip->as_indexes, { + pool_foreach (as_index, vip->as_indexes) { as = &lbm->ass[*as_index]; if (as->flags & LB_AS_FLAGS_USED) { //Not used anymore i = 1; goto out; //Not sure 'break' works in this macro-loop } - }); + } out: if (i == 0) { @@ -414,14 +414,14 @@ out: vec_alloc(sort_arr, pool_elts(vip->as_indexes)); i = 0; - pool_foreach(as_index, vip->as_indexes, { + pool_foreach (as_index, vip->as_indexes) { as = &lbm->ass[*as_index]; if (!(as->flags & LB_AS_FLAGS_USED)) //Not used anymore continue; sort_arr[i].as_index = as - lbm->ass; i++; - }); + } _vec_len(sort_arr) = i; vec_sort_with_function(sort_arr, lb_pseudorand_compare); @@ -503,7 +503,7 @@ int lb_vip_port_find_index(ip46_address_t *prefix, u8 plen, /* This must be called with the lock owned */ CLIB_SPINLOCK_ASSERT_LOCKED (&lbm->writer_lock); ip46_prefix_normalize(prefix, plen); - pool_foreach(vip, lbm->vips, { + pool_foreach (vip, lbm->vips) { if ((vip->flags & LB_AS_FLAGS_USED) && vip->plen == plen && vip->prefix.as_u64[0] == prefix->as_u64[0] && @@ -522,7 +522,7 @@ int lb_vip_port_find_index(ip46_address_t *prefix, u8 plen, return 0; } } - }); + } return VNET_API_ERROR_NO_SUCH_ENTRY; } @@ -569,7 +569,7 @@ static int lb_as_find_index_vip(lb_vip_t *vip, ip46_address_t *address, u32 *as_ CLIB_SPINLOCK_ASSERT_LOCKED (&lbm->writer_lock); lb_as_t *as; u32 *asi; - pool_foreach(asi, vip->as_indexes, { + pool_foreach (asi, vip->as_indexes) { as = &lbm->ass[*asi]; if (as->vip_index == (vip - lbm->vips) && as->address.as_u64[0] == address->as_u64[0] && @@ -578,7 +578,7 @@ static int lb_as_find_index_vip(lb_vip_t *vip, ip46_address_t *address, u32 *as_ *as_index = as - lbm->ass; return 0; } - }); + } return -1; } @@ -1224,10 +1224,10 @@ int lb_vip_del(u32 vip_index) lb_as_t *as; u32 *as_index; - pool_foreach(as_index, vip->as_indexes, { + pool_foreach (as_index, vip->as_indexes) { as = &lbm->ass[*as_index]; vec_add1(ass, as->address); - }); + } if (vec_len(ass)) lb_vip_del_ass_withlock(vip_index, ass, vec_len(ass), 0); vec_free(ass); diff --git a/src/plugins/lisp/lisp-cp/control.c b/src/plugins/lisp/lisp-cp/control.c index 6eee74ac7d0..446a8d7e2cb 100644 --- a/src/plugins/lisp/lisp-cp/control.c +++ b/src/plugins/lisp/lisp-cp/control.c @@ -581,15 +581,15 @@ vnet_lisp_adjacencies_get_by_vni (u32 vni) lisp_adjacency_t *adjs = 0, adj; /* *INDENT-OFF* */ - pool_foreach(fwd, lcm->fwd_entry_pool, - ({ + pool_foreach (fwd, lcm->fwd_entry_pool) + { if (gid_address_vni (&fwd->reid) != vni) continue; gid_address_copy (&adj.reid, &fwd->reid); gid_address_copy (&adj.leid, &fwd->leid); vec_add1 (adjs, adj); - })); + } /* *INDENT-ON* */ return adjs; @@ -804,8 +804,8 @@ vnet_lisp_map_cache_add_del (vnet_lisp_add_del_mapping_args_t * a, * TODO: Address this in a more efficient way. */ /* *INDENT-OFF* */ - pool_foreach (rmts, lcm->lcl_to_rmt_adjacencies, - ({ + pool_foreach (rmts, lcm->lcl_to_rmt_adjacencies) + { vec_foreach_index (rmts_itr, rmts[0]) { remote_idx = vec_elt (rmts[0], rmts_itr); @@ -815,7 +815,7 @@ vnet_lisp_map_cache_add_del (vnet_lisp_add_del_mapping_args_t * a, break; } } - })); + } /* *INDENT-ON* */ } @@ -1392,10 +1392,10 @@ vnet_lisp_clear_all_remote_adjacencies (void) vnet_lisp_add_del_locator_set_args_t _ls, *ls = &_ls; /* *INDENT-OFF* */ - pool_foreach_index (mi, lcm->mapping_pool, - ({ + pool_foreach_index (mi, lcm->mapping_pool) + { vec_add1 (map_indices, mi); - })); + } /* *INDENT-ON* */ vec_foreach (map_indexp, map_indices) @@ -2191,10 +2191,10 @@ lisp_cp_disable_l2_l3_ifaces (lisp_cp_main_t * lcm) pool_free (lcm->fwd_entry_pool); /* Clear state tracking rmt-lcl fwd entries */ /* *INDENT-OFF* */ - pool_foreach(rmts, lcm->lcl_to_rmt_adjacencies, + pool_foreach (rmts, lcm->lcl_to_rmt_adjacencies) { vec_free(rmts[0]); - }); + } /* *INDENT-ON* */ hash_free (lcm->lcl_to_rmt_adjs_by_lcl_idx); pool_free (lcm->lcl_to_rmt_adjacencies); @@ -2672,7 +2672,7 @@ build_map_register_record_list (lisp_cp_main_t * lcm) mapping_t *recs = 0, rec, *m; /* *INDENT-OFF* */ - pool_foreach(m, lcm->mapping_pool, + pool_foreach (m, lcm->mapping_pool) { /* for now build only local mappings */ if (!m->local) @@ -2681,7 +2681,7 @@ build_map_register_record_list (lisp_cp_main_t * lcm) rec = m[0]; add_locators (lcm, &rec, m->locator_set_index, NULL); vec_add1 (recs, rec); - }); + } /* *INDENT-ON* */ return recs; @@ -2902,7 +2902,7 @@ send_rloc_probes (lisp_cp_main_t * lcm) u32 si, rloc_probes_sent = 0; /* *INDENT-OFF* */ - pool_foreach (e, lcm->fwd_entry_pool, + pool_foreach (e, lcm->fwd_entry_pool) { if (vec_len (e->locator_pairs) == 0) continue; @@ -2930,7 +2930,7 @@ send_rloc_probes (lisp_cp_main_t * lcm) &lp->rmt_loc); rloc_probes_sent++; } - }); + } /* *INDENT-ON* */ vlib_node_increment_counter (vlib_get_main (), lisp_cp_output_node.index, @@ -3041,15 +3041,15 @@ _send_encapsulated_map_request (lisp_cp_main_t * lcm, /* if there is already a pending request remember it */ /* *INDENT-OFF* */ - pool_foreach(pmr, lcm->pending_map_requests_pool, - ({ + pool_foreach (pmr, lcm->pending_map_requests_pool) + { if (!gid_address_cmp (&pmr->src, seid) && !gid_address_cmp (&pmr->dst, deid)) { duplicate_pmr = pmr; break; } - })); + } /* *INDENT-ON* */ if (!is_resend && duplicate_pmr) @@ -4066,10 +4066,10 @@ map_record_args_get () /* Cleanup first */ /* *INDENT-OFF* */ - pool_foreach (rec, lcm->map_records_args_pool[vlib_get_thread_index()], ({ + pool_foreach (rec, lcm->map_records_args_pool[vlib_get_thread_index()]) { if (rec->is_free) map_records_arg_free (rec); - })); + } /* *INDENT-ON* */ pool_get (lcm->map_records_args_pool[vlib_get_thread_index ()], rec); @@ -4656,8 +4656,8 @@ remove_dead_pending_map_requests (lisp_cp_main_t * lcm) u32 *to_be_removed = 0, *pmr_index; /* *INDENT-OFF* */ - pool_foreach (pmr, lcm->pending_map_requests_pool, - ({ + pool_foreach (pmr, lcm->pending_map_requests_pool) + { if (pmr->to_be_removed) { clib_fifo_foreach (nonce, pmr->nonces, ({ @@ -4666,7 +4666,7 @@ remove_dead_pending_map_requests (lisp_cp_main_t * lcm) vec_add1 (to_be_removed, pmr - lcm->pending_map_requests_pool); } - })); + } /* *INDENT-ON* */ vec_foreach (pmr_index, to_be_removed) @@ -4754,15 +4754,15 @@ update_map_register (lisp_cp_main_t * lcm, f64 dt) return; /* *INDENT-OFF* */ - pool_foreach (pmr, lcm->pending_map_registers_pool, - ({ + pool_foreach (pmr, lcm->pending_map_registers_pool) + { if (!update_pending_map_register (pmr, dt, &del_all)) { if (del_all) break; vec_add1 (to_be_removed, pmr - lcm->pending_map_registers_pool); } - })); + } /* *INDENT-ON* */ if (del_all) @@ -4814,11 +4814,11 @@ send_map_resolver_service (vlib_main_t * vm, (void) vlib_process_get_events (vm, 0); /* *INDENT-OFF* */ - pool_foreach (pmr, lcm->pending_map_requests_pool, - ({ + pool_foreach (pmr, lcm->pending_map_requests_pool) + { if (!pmr->to_be_removed) update_pending_request (pmr, period); - })); + } /* *INDENT-ON* */ remove_dead_pending_map_requests (lcm); diff --git a/src/plugins/lisp/lisp-cp/lisp_api.c b/src/plugins/lisp/lisp-cp/lisp_api.c index 041069d5613..d8f889a24fa 100644 --- a/src/plugins/lisp/lisp-cp/lisp_api.c +++ b/src/plugins/lisp/lisp-cp/lisp_api.c @@ -590,8 +590,8 @@ vl_api_lisp_locator_set_dump_t_handler (vl_api_lisp_locator_set_dump_t * mp) filter = mp->filter; /* *INDENT-OFF* */ - pool_foreach (lsit, lcm->locator_set_pool, - ({ + pool_foreach (lsit, lcm->locator_set_pool) + { if (filter && !((1 == filter && lsit->local) || (2 == filter && !lsit->local))) { @@ -599,7 +599,7 @@ vl_api_lisp_locator_set_dump_t_handler (vl_api_lisp_locator_set_dump_t * mp) } send_lisp_locator_set_details (lcm, lsit, reg, mp->context, lsit - lcm->locator_set_pool); - })); + } /* *INDENT-ON* */ } @@ -704,11 +704,11 @@ vl_api_lisp_eid_table_dump_t_handler (vl_api_lisp_eid_table_dump_t * mp) else { /* *INDENT-OFF* */ - pool_foreach (mapit, lcm->mapping_pool, - ({ + pool_foreach (mapit, lcm->mapping_pool) + { send_lisp_eid_table_details(mapit, reg, mp->context, mp->filter); - })); + } /* *INDENT-ON* */ } } diff --git a/src/plugins/lisp/lisp-cp/lisp_cli.c b/src/plugins/lisp/lisp-cp/lisp_cli.c index 8685c1cc04a..569d695b033 100644 --- a/src/plugins/lisp/lisp-cp/lisp_cli.c +++ b/src/plugins/lisp/lisp-cp/lisp_cli.c @@ -841,8 +841,8 @@ lisp_show_eid_table_command_fn (vlib_main_t * vm, if (print_all) { /* *INDENT-OFF* */ - pool_foreach (mapit, lcm->mapping_pool, - ({ + pool_foreach (mapit, lcm->mapping_pool) + { if (mapit->pitr_set) continue; @@ -855,7 +855,7 @@ lisp_show_eid_table_command_fn (vlib_main_t * vm, } vlib_cli_output (vm, "%U", format_eid_entry, lcm->vnet_main, lcm, mapit, ls); - })); + } /* *INDENT-ON* */ } else @@ -1300,8 +1300,8 @@ lisp_cp_show_locator_sets_command_fn (vlib_main_t * vm, "Priority", "Weight"); /* *INDENT-OFF* */ - pool_foreach (lsit, lcm->locator_set_pool, - ({ + pool_foreach (lsit, lcm->locator_set_pool) + { u8 * msg = 0; int next_line = 0; if (lsit->local) @@ -1330,7 +1330,7 @@ lisp_cp_show_locator_sets_command_fn (vlib_main_t * vm, } vlib_cli_output (vm, "%v", msg); vec_free (msg); - })); + } /* *INDENT-ON* */ return 0; } diff --git a/src/plugins/lisp/lisp-cp/one_api.c b/src/plugins/lisp/lisp-cp/one_api.c index eb0b4c691b7..3969dd245ab 100644 --- a/src/plugins/lisp/lisp-cp/one_api.c +++ b/src/plugins/lisp/lisp-cp/one_api.c @@ -791,8 +791,8 @@ vl_api_one_locator_set_dump_t_handler (vl_api_one_locator_set_dump_t * mp) filter = mp->filter; /* *INDENT-OFF* */ - pool_foreach (lsit, lcm->locator_set_pool, - ({ + pool_foreach (lsit, lcm->locator_set_pool) + { if (filter && !((1 == filter && lsit->local) || (2 == filter && !lsit->local))) { @@ -800,7 +800,7 @@ vl_api_one_locator_set_dump_t_handler (vl_api_one_locator_set_dump_t * mp) } send_one_locator_set_details (lcm, lsit, reg, mp->context, lsit - lcm->locator_set_pool); - })); + } /* *INDENT-ON* */ } @@ -921,11 +921,11 @@ vl_api_one_eid_table_dump_t_handler (vl_api_one_eid_table_dump_t * mp) else { /* *INDENT-OFF* */ - pool_foreach (mapit, lcm->mapping_pool, - ({ + pool_foreach (mapit, lcm->mapping_pool) + { send_one_eid_table_details(mapit, reg, mp->context, mp->filter); - })); + } /* *INDENT-ON* */ } } diff --git a/src/plugins/lisp/lisp-cp/one_cli.c b/src/plugins/lisp/lisp-cp/one_cli.c index b43532684ef..b85fea16ea7 100644 --- a/src/plugins/lisp/lisp-cp/one_cli.c +++ b/src/plugins/lisp/lisp-cp/one_cli.c @@ -1157,8 +1157,8 @@ lisp_show_eid_table_command_fn (vlib_main_t * vm, if (print_all) { /* *INDENT-OFF* */ - pool_foreach (mapit, lcm->mapping_pool, - ({ + pool_foreach (mapit, lcm->mapping_pool) + { if (mapit->pitr_set || mapit->nsh_set) continue; @@ -1171,7 +1171,7 @@ lisp_show_eid_table_command_fn (vlib_main_t * vm, } vlib_cli_output (vm, "%U", format_eid_entry, lcm->vnet_main, lcm, mapit, ls); - })); + } /* *INDENT-ON* */ } else @@ -1841,8 +1841,8 @@ lisp_cp_show_locator_sets_command_fn (vlib_main_t * vm, "Priority", "Weight"); /* *INDENT-OFF* */ - pool_foreach (lsit, lcm->locator_set_pool, - ({ + pool_foreach (lsit, lcm->locator_set_pool) + { u8 * msg = 0; int next_line = 0; if (lsit->local) @@ -1871,7 +1871,7 @@ lisp_cp_show_locator_sets_command_fn (vlib_main_t * vm, } vlib_cli_output (vm, "%v", msg); vec_free (msg); - })); + } /* *INDENT-ON* */ return 0; } diff --git a/src/plugins/lisp/lisp-gpe/lisp_gpe_adjacency.c b/src/plugins/lisp/lisp-gpe/lisp_gpe_adjacency.c index d93f3abaad2..8d20412a1f2 100644 --- a/src/plugins/lisp/lisp-gpe/lisp_gpe_adjacency.c +++ b/src/plugins/lisp/lisp-gpe/lisp_gpe_adjacency.c @@ -559,13 +559,13 @@ lisp_gpe_adjacency_show (vlib_main_t * vm, else { /* *INDENT-OFF* */ - pool_foreach (ladj, lisp_adj_pool, - ({ + pool_foreach (ladj, lisp_adj_pool) + { vlib_cli_output (vm, "[%d] %U\n", ladj - lisp_adj_pool, format_lisp_gpe_adjacency, ladj, LISP_GPE_ADJ_FORMAT_FLAG_NONE); - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/lisp/lisp-gpe/lisp_gpe_fwd_entry.c b/src/plugins/lisp/lisp-gpe/lisp_gpe_fwd_entry.c index 00d5af4922a..5f196fb22e3 100644 --- a/src/plugins/lisp/lisp-gpe/lisp_gpe_fwd_entry.c +++ b/src/plugins/lisp/lisp-gpe/lisp_gpe_fwd_entry.c @@ -1357,8 +1357,8 @@ vnet_lisp_gpe_fwd_entry_flush (void) lisp_gpe_fwd_entry_t *lfe; /* *INDENT-OFF* */ - pool_foreach (lfe, lgm->lisp_fwd_entry_pool, - ({ + pool_foreach (lfe, lgm->lisp_fwd_entry_pool) + { switch (fid_addr_type(&lfe->key->rmt)) { case FID_ADDR_MAC: @@ -1371,7 +1371,7 @@ vnet_lisp_gpe_fwd_entry_flush (void) del_nsh_fwd_entry_i (lgm, lfe); break; } - })); + } /* *INDENT-ON* */ } @@ -1477,13 +1477,13 @@ lisp_gpe_fwd_entry_show (vlib_main_t * vm, } /* *INDENT-OFF* */ - pool_foreach (lfe, lgm->lisp_fwd_entry_pool, - ({ + pool_foreach (lfe, lgm->lisp_fwd_entry_pool) + { if ((vni == ~0) || (lfe->key->vni == vni)) vlib_cli_output (vm, "%U", format_lisp_gpe_fwd_entry, lfe, LISP_GPE_FWD_ENTRY_FORMAT_NONE); - })); + } /* *INDENT-ON* */ return (NULL); @@ -1522,10 +1522,10 @@ vnet_lisp_gpe_get_fwd_entry_vnis (void) u32 *vnis = 0; /* *INDENT-OFF* */ - pool_foreach (lfe, lgm->lisp_fwd_entry_pool, - ({ + pool_foreach (lfe, lgm->lisp_fwd_entry_pool) + { hash_set (vnis, lfe->key->vni, 0); - })); + } /* *INDENT-ON* */ return vnis; @@ -1539,8 +1539,8 @@ vnet_lisp_gpe_fwd_entries_get_by_vni (u32 vni) lisp_api_gpe_fwd_entry_t *entries = 0, e; /* *INDENT-OFF* */ - pool_foreach (lfe, lgm->lisp_fwd_entry_pool, - ({ + pool_foreach (lfe, lgm->lisp_fwd_entry_pool) + { if (lfe->key->vni == vni) { clib_memset (&e, 0, sizeof (e)); @@ -1553,7 +1553,7 @@ vnet_lisp_gpe_fwd_entries_get_by_vni (u32 vni) memcpy (&e.leid, &lfe->key->lcl, sizeof (e.leid)); vec_add1 (entries, e); } - })); + } /* *INDENT-ON* */ return entries; diff --git a/src/plugins/lisp/lisp-gpe/lisp_gpe_sub_interface.c b/src/plugins/lisp/lisp-gpe/lisp_gpe_sub_interface.c index b84c76f0103..9c48c0064ca 100644 --- a/src/plugins/lisp/lisp-gpe/lisp_gpe_sub_interface.c +++ b/src/plugins/lisp/lisp-gpe/lisp_gpe_sub_interface.c @@ -245,10 +245,10 @@ lisp_gpe_sub_interface_show (vlib_main_t * vm, "local RLOC"); /* *INDENT-OFF* */ - pool_foreach (l3s, lisp_gpe_sub_interface_pool, - ({ + pool_foreach (l3s, lisp_gpe_sub_interface_pool) + { vlib_cli_output (vm, "%U", format_lisp_gpe_sub_interface, l3s); - })); + } /* *INDENT-ON* */ return 0; diff --git a/src/plugins/lisp/lisp-gpe/lisp_gpe_tenant.c b/src/plugins/lisp/lisp-gpe/lisp_gpe_tenant.c index fb6aa1ac1d5..b6173b273c0 100644 --- a/src/plugins/lisp/lisp-gpe/lisp_gpe_tenant.c +++ b/src/plugins/lisp/lisp-gpe/lisp_gpe_tenant.c @@ -263,11 +263,11 @@ lisp_gpe_tenant_flush (void) lisp_gpe_tenant_t *lt; /* *INDENT-OFF* */ - pool_foreach(lt, lisp_gpe_tenant_pool, - ({ + pool_foreach (lt, lisp_gpe_tenant_pool) + { lisp_gpe_tenant_l2_iface_unlock(lt->lt_vni); lisp_gpe_tenant_l3_iface_unlock(lt->lt_vni); - })); + } /* *INDENT-ON* */ } @@ -306,10 +306,10 @@ lisp_gpe_tenant_show (vlib_main_t * vm, lisp_gpe_tenant_t *lt; /* *INDENT-OFF* */ - pool_foreach (lt, lisp_gpe_tenant_pool, - ({ + pool_foreach (lt, lisp_gpe_tenant_pool) + { vlib_cli_output (vm, "%U", format_lisp_gpe_tenant, lt); - })); + } /* *INDENT-ON* */ return 0; diff --git a/src/plugins/lisp/lisp-gpe/lisp_gpe_tunnel.c b/src/plugins/lisp/lisp-gpe/lisp_gpe_tunnel.c index b2426429322..14ee095d2de 100644 --- a/src/plugins/lisp/lisp-gpe/lisp_gpe_tunnel.c +++ b/src/plugins/lisp/lisp-gpe/lisp_gpe_tunnel.c @@ -254,10 +254,10 @@ show_lisp_gpe_tunnel_command_fn (vlib_main_t * vm, else { /* *INDENT-OFF* */ - pool_foreach (lgt, lisp_gpe_tunnel_pool, - ({ + pool_foreach (lgt, lisp_gpe_tunnel_pool) + { vlib_cli_output (vm, "%U", format_lisp_gpe_tunnel, lgt); - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/lldp/lldp_cli.c b/src/plugins/lldp/lldp_cli.c index ef3fccc8b4b..583804d121c 100644 --- a/src/plugins/lldp/lldp_cli.c +++ b/src/plugins/lldp/lldp_cli.c @@ -581,8 +581,8 @@ format_lldp_intfs_detail (u8 * s, vlib_main_t * vm, const lldp_main_t * lm) f64 now = vlib_time_now (vm); /* *INDENT-OFF* */ - pool_foreach( - n, lm->intfs, ({ + pool_foreach ( + n, lm->intfs) { hw = vnet_get_hw_interface(vnm, n->hw_if_index); sw = vnet_get_sw_interface(lm->vnet_main, hw->sw_if_index); @@ -639,7 +639,7 @@ format_lldp_intfs_detail (u8 * s, vlib_main_t * vm, const lldp_main_t * lm) vec_len(n->port_id), 1, format_time_ago, n->last_sent, now, format_time_ago, n->last_heard, now); } - })); + } /* *INDENT-ON* */ return s; } @@ -664,8 +664,8 @@ format_lldp_intfs (u8 * s, va_list * va) "Status"); /* *INDENT-OFF* */ - pool_foreach( - n, lm->intfs, ({ + pool_foreach ( + n, lm->intfs) { const vnet_hw_interface_t *hw = vnet_get_hw_interface(vnm, n->hw_if_index); const vnet_sw_interface_t *sw = @@ -688,7 +688,7 @@ format_lldp_intfs (u8 * s, va_list * va) "", "", format_time_ago, n->last_heard, now, format_time_ago, n->last_sent, now, "inactive"); } - })); + } /* *INDENT-ON* */ return s; } diff --git a/src/plugins/mactime/builtins.c b/src/plugins/mactime/builtins.c index 1525ab66ae7..d7fd7a0b32b 100644 --- a/src/plugins/mactime/builtins.c +++ b/src/plugins/mactime/builtins.c @@ -43,10 +43,10 @@ handle_get_mactime (http_builtin_method_type_t reqtype, mm->sunday_midnight = clib_timebase_find_sunday_midnight (now); /* *INDENT-OFF* */ - pool_foreach (dp, mm->devices, - ({ + pool_foreach (dp, mm->devices) + { vec_add1 (pool_indices, dp - mm->devices); - })); + } /* *INDENT-ON* */ s = format (s, "{%smactime%s: [\n", q, q); diff --git a/src/plugins/mactime/mactime.c b/src/plugins/mactime/mactime.c index 66df70bca2f..a2219bebe9a 100644 --- a/src/plugins/mactime/mactime.c +++ b/src/plugins/mactime/mactime.c @@ -195,8 +195,8 @@ vl_api_mactime_dump_t_handler (vl_api_mactime_dump_t * mp) } /* *INDENT-OFF* */ - pool_foreach (dev, mm->devices, - ({ + pool_foreach (dev, mm->devices) + { message_size = sizeof(*ep) + vec_len(dev->device_name) + vec_len(dev->ranges) * sizeof(ep->ranges[0]); @@ -230,7 +230,7 @@ vl_api_mactime_dump_t_handler (vl_api_mactime_dump_t * mp) name_len); ep->device_name [ARRAY_LEN(ep->device_name) -1] = 0; vl_api_send_msg (rp, (u8 *)ep); - })); + } /* *INDENT-OFF* */ send_reply: @@ -578,10 +578,10 @@ show_mactime_command_fn (vlib_main_t * vm, vlib_cli_output (vm, "Time now: %U", format_clib_timebase_time, now); /* *INDENT-OFF* */ - pool_foreach (dp, mm->devices, - ({ + pool_foreach (dp, mm->devices) + { vec_add1 (pool_indices, dp - mm->devices); - })); + } /* *INDENT-ON* */ vlib_cli_output (vm, "%-15s %18s %14s %10s %11s %13s", diff --git a/src/plugins/mactime/mactime_test.c b/src/plugins/mactime/mactime_test.c index b47cc211435..67655ccefad 100644 --- a/src/plugins/mactime/mactime_test.c +++ b/src/plugins/mactime/mactime_test.c @@ -282,10 +282,10 @@ api_mactime_dump (vat_main_t * vam) fformat (vam->ofp, "%U", format_device, 0 /* header */ , 0 /* verbose */ ); /* *INDENT-OFF* */ - pool_foreach (dev, tm->devices, - ({ + pool_foreach (dev, tm->devices) + { fformat (vam->ofp, "%U", format_device, dev, verbose); - })); + } /* *INDENT-ON* */ return ret; diff --git a/src/plugins/mactime/mactime_top.c b/src/plugins/mactime/mactime_top.c index 473cc5b5c0e..72d1964f32f 100644 --- a/src/plugins/mactime/mactime_top.c +++ b/src/plugins/mactime/mactime_top.c @@ -196,10 +196,10 @@ scrape_stats_segment (mt_main_t * mm) vec_reset_length (pool_indices); /* *INDENT-OFF* */ - pool_foreach (dev, mm->devices, - ({ + pool_foreach (dev, mm->devices) + { vec_add1 (pool_indices, dev->pool_index); - })); + } /* *INDENT-ON* */ /* Nothing to do... */ @@ -445,10 +445,10 @@ print_device_table (mt_main_t * mm) fformat (stdout, "%U", format_device, 0 /* header */ , 0 /* verbose */ ); /* *INDENT-OFF* */ - pool_foreach (dev, mm->devices, - ({ + pool_foreach (dev, mm->devices) + { fformat (stdout, "%U", format_device, dev, 0 /* verbose */); - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/map/map.c b/src/plugins/map/map.c index 92d2337d0ba..938793c8947 100644 --- a/src/plugins/map/map.c +++ b/src/plugins/map/map.c @@ -980,8 +980,8 @@ show_map_domain_command_fn (vlib_main_t * vm, unformat_input_t * input, if (!unformat_user (input, unformat_line_input, line_input)) { /* *INDENT-OFF* */ - pool_foreach(d, mm->domains, - ({vlib_cli_output(vm, "%U", format_map_domain, d, counters);})); + pool_foreach (d, mm->domains) + {vlib_cli_output(vm, "%U", format_map_domain, d, counters);} /* *INDENT-ON* */ return 0; } @@ -1009,8 +1009,8 @@ show_map_domain_command_fn (vlib_main_t * vm, unformat_input_t * input, if (map_domain_index == ~0) { /* *INDENT-OFF* */ - pool_foreach(d, mm->domains, - ({vlib_cli_output(vm, "%U", format_map_domain, d, counters);})); + pool_foreach (d, mm->domains) + {vlib_cli_output(vm, "%U", format_map_domain, d, counters);} /* *INDENT-ON* */ } else @@ -1063,14 +1063,14 @@ show_map_stats_command_fn (vlib_main_t * vm, unformat_input_t * input, } /* *INDENT-OFF* */ - pool_foreach(d, mm->domains, ({ + pool_foreach (d, mm->domains) { if (d->rules) { rulecount+= 0x1 << d->psid_length; rules += sizeof(ip6_address_t) * 0x1 << d->psid_length; } domains += sizeof(*d); domaincount++; - })); + } /* *INDENT-ON* */ vlib_cli_output (vm, "MAP domains structure: %d\n", sizeof (map_domain_t)); diff --git a/src/plugins/map/map_api.c b/src/plugins/map/map_api.c index e65174eaf88..4d2378a072f 100644 --- a/src/plugins/map/map_api.c +++ b/src/plugins/map/map_api.c @@ -137,10 +137,10 @@ vl_api_map_domain_dump_t_handler (vl_api_map_domain_dump_t * mp) return; /* *INDENT-OFF* */ - pool_foreach_index(i, mm->domains, - ({ + pool_foreach_index (i, mm->domains) + { send_domain_details(i, reg, mp->context); - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/memif/cli.c b/src/plugins/memif/cli.c index 00c947a594a..b313e9737b3 100644 --- a/src/plugins/memif/cli.c +++ b/src/plugins/memif/cli.c @@ -461,9 +461,8 @@ memif_show_command_fn (vlib_main_t * vm, unformat_input_t * input, if (vec_len (hw_if_indices) == 0) { /* *INDENT-OFF* */ - pool_foreach (mif, mm->interfaces, + pool_foreach (mif, mm->interfaces) vec_add1 (hw_if_indices, mif->hw_if_index); - ); /* *INDENT-ON* */ } diff --git a/src/plugins/memif/memif.c b/src/plugins/memif/memif.c index 4deb46afd73..bf09509266f 100644 --- a/src/plugins/memif/memif.c +++ b/src/plugins/memif/memif.c @@ -557,8 +557,8 @@ memif_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) last_run_duration = start_time = vlib_time_now (vm); /* *INDENT-OFF* */ - pool_foreach (mif, mm->interfaces, - ({ + pool_foreach (mif, mm->interfaces) + { memif_socket_file_t * msf = vec_elt_at_index (mm->socket_files, mif->socket_file_index); /* Allow no more than 10us without a pause */ now = vlib_time_now (vm); @@ -607,7 +607,7 @@ memif_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) sock = clib_mem_alloc (sizeof(clib_socket_t)); } } - })); + } /* *INDENT-ON* */ last_run_duration = vlib_time_now (vm) - last_run_duration; } diff --git a/src/plugins/memif/memif_api.c b/src/plugins/memif/memif_api.c index 00edc7ac2d7..a50e7ce8882 100644 --- a/src/plugins/memif/memif_api.c +++ b/src/plugins/memif/memif_api.c @@ -280,8 +280,8 @@ vl_api_memif_dump_t_handler (vl_api_memif_dump_t * mp) return; /* *INDENT-OFF* */ - pool_foreach (mif, mm->interfaces, - ({ + pool_foreach (mif, mm->interfaces) + { swif = vnet_get_sw_interface (vnm, mif->sw_if_index); if_name = format (if_name, "%U%c", @@ -290,7 +290,7 @@ vl_api_memif_dump_t_handler (vl_api_memif_dump_t * mp) send_memif_details (reg, mif, swif, if_name, mp->context); _vec_len (if_name) = 0; - })); + } /* *INDENT-ON* */ vec_free (if_name); diff --git a/src/plugins/nat/det44/det44.c b/src/plugins/nat/det44/det44.c index 582fd20cd5d..1dbbfdfdebe 100644 --- a/src/plugins/nat/det44/det44.c +++ b/src/plugins/nat/det44/det44.c @@ -151,12 +151,12 @@ snat_det_add_map (ip4_address_t * in_addr, u8 in_plen, /* Add/del external address range to FIB */ /* *INDENT-OFF* */ - pool_foreach (i, dm->interfaces, ({ + pool_foreach (i, dm->interfaces) { if (det44_interface_is_inside(i)) continue; det44_add_del_addr_to_fib(out_addr, out_plen, i->sw_if_index, is_add); goto out; - })); + } /* *INDENT-ON* */ out: return 0; @@ -204,13 +204,13 @@ det44_interface_add_del (u32 sw_if_index, u8 is_inside, int is_del) // then register nodes /* *INDENT-OFF* */ - pool_foreach (tmp, dm->interfaces, ({ + pool_foreach (tmp, dm->interfaces) { if (tmp->sw_if_index == sw_if_index) { i = tmp; goto out; } - })); + } /* *INDENT-ON* */ out: @@ -302,10 +302,10 @@ out: // add/del outside address to FIB snat_det_map_t *mp; /* *INDENT-OFF* */ - pool_foreach (mp, dm->det_maps, ({ + pool_foreach (mp, dm->det_maps) { det44_add_del_addr_to_fib(&mp->out_addr, mp->out_plen, sw_if_index, !is_del); - })); + } /* *INDENT-ON* */ } return 0; @@ -328,14 +328,14 @@ det44_expire_walk_fn (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_process_get_events (vm, NULL); u32 now = (u32) vlib_time_now (vm); /* *INDENT-OFF* */ - pool_foreach (mp, dm->det_maps, ({ + pool_foreach (mp, dm->det_maps) { vec_foreach(ses, mp->sessions) { /* Delete if session expired */ if (ses->in_port && (ses->expire < now)) snat_det_ses_close (mp, ses); } - })); + } /* *INDENT-ON* */ return 0; } @@ -429,10 +429,10 @@ det44_plugin_disable () vec_free (interfaces); /* *INDENT-OFF* */ - pool_foreach (mp, dm->det_maps, - ({ + pool_foreach (mp, dm->det_maps) + { vec_free (mp->sessions); - })); + } /* *INDENT-ON* */ det44_reset_timeouts (); @@ -468,15 +468,15 @@ det44_update_outside_fib (ip4_main_t * im, return; /* *INDENT-OFF* */ - pool_foreach (i, dm->interfaces, - ({ + pool_foreach (i, dm->interfaces) + { if (i->sw_if_index == sw_if_index) { if (!(det44_interface_is_outside (i))) return; match = 1; } - })); + } /* *INDENT-ON* */ if (!match) diff --git a/src/plugins/nat/det44/det44.h b/src/plugins/nat/det44/det44.h index 84d570bfd56..02b0fa7e81d 100644 --- a/src/plugins/nat/det44/det44.h +++ b/src/plugins/nat/det44/det44.h @@ -279,11 +279,11 @@ snat_det_map_by_user (ip4_address_t * user_addr) det44_main_t *dm = &det44_main; snat_det_map_t *mp; /* *INDENT-OFF* */ - pool_foreach (mp, dm->det_maps, - ({ + pool_foreach (mp, dm->det_maps) + { if (is_addr_in_net(user_addr, &mp->in_addr, mp->in_plen)) return mp; - })); + } /* *INDENT-ON* */ return 0; } @@ -294,11 +294,11 @@ snat_det_map_by_out (ip4_address_t * out_addr) det44_main_t *dm = &det44_main; snat_det_map_t *mp; /* *INDENT-OFF* */ - pool_foreach (mp, dm->det_maps, - ({ + pool_foreach (mp, dm->det_maps) + { if (is_addr_in_net(out_addr, &mp->out_addr, mp->out_plen)) return mp; - })); + } /* *INDENT-ON* */ return 0; } diff --git a/src/plugins/nat/det44/det44_api.c b/src/plugins/nat/det44/det44_api.c index 7c7b1788009..1486180aa99 100644 --- a/src/plugins/nat/det44/det44_api.c +++ b/src/plugins/nat/det44/det44_api.c @@ -329,10 +329,10 @@ vl_api_det44_interface_dump_t_handler (vl_api_det44_interface_dump_t * mp) return; /* *INDENT-OFF* */ - pool_foreach (i, dm->interfaces, - ({ + pool_foreach (i, dm->interfaces) + { det44_send_interface_details(i, reg, mp->context); - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/nat/det44/det44_cli.c b/src/plugins/nat/det44/det44_cli.c index 933784f17c6..28569c7b82d 100644 --- a/src/plugins/nat/det44/det44_cli.c +++ b/src/plugins/nat/det44/det44_cli.c @@ -75,8 +75,8 @@ det44_show_mappings_command_fn (vlib_main_t * vm, snat_det_map_t *mp; vlib_cli_output (vm, "NAT44 deterministic mappings:"); /* *INDENT-OFF* */ - pool_foreach (mp, dm->det_maps, - ({ + pool_foreach (mp, dm->det_maps) + { vlib_cli_output (vm, " in %U/%d out %U/%d\n", format_ip4_address, &mp->in_addr, mp->in_plen, format_ip4_address, &mp->out_addr, mp->out_plen); @@ -85,7 +85,7 @@ det44_show_mappings_command_fn (vlib_main_t * vm, vlib_cli_output (vm, " number of ports per inside host: %d\n", mp->ports_per_host); vlib_cli_output (vm, " sessions number: %d\n", mp->ses_num); - })); + } /* *INDENT-ON* */ return 0; } @@ -188,8 +188,8 @@ det44_show_sessions_command_fn (vlib_main_t * vm, snat_det_map_t *mp; vlib_cli_output (vm, "NAT44 deterministic sessions:"); /* *INDENT-OFF* */ - pool_foreach (mp, dm->det_maps, - ({ + pool_foreach (mp, dm->det_maps) + { int i; vec_foreach_index (i, mp->sessions) { @@ -197,7 +197,7 @@ det44_show_sessions_command_fn (vlib_main_t * vm, if (ses->in_port) vlib_cli_output (vm, " %U", format_det_map_ses, mp, ses, &i); } - })); + } /* *INDENT-ON* */ return 0; } @@ -487,14 +487,14 @@ det44_show_interfaces_command_fn (vlib_main_t * vm, unformat_input_t * input, det44_interface_t *i; vlib_cli_output (vm, "DET44 interfaces:"); /* *INDENT-OFF* */ - pool_foreach (i, dm->interfaces, - ({ + pool_foreach (i, dm->interfaces) + { vlib_cli_output (vm, " %U %s", format_vnet_sw_if_index_name, vnm, i->sw_if_index, (det44_interface_is_inside(i) && det44_interface_is_outside(i)) ? "in out" : (det44_interface_is_inside(i) ? "in" : "out")); - })); + } /* *INDENT-ON* */ return 0; } diff --git a/src/plugins/nat/det44/det44_inlines.h b/src/plugins/nat/det44/det44_inlines.h index e4be469562c..aeb55b385d3 100644 --- a/src/plugins/nat/det44/det44_inlines.h +++ b/src/plugins/nat/det44/det44_inlines.h @@ -108,11 +108,11 @@ det44_translate (vlib_node_runtime_t * node, u32 sw_if_index0, { det44_interface_t *i; /* *INDENT-OFF* */ - pool_foreach (i, dm->interfaces, ({ + pool_foreach (i, dm->interfaces) { /* NAT packet aimed at outside interface */ if ((det44_interface_is_outside (i)) && (sw_if_index == i->sw_if_index)) return 0; - })); + } /* *INDENT-ON* */ } } diff --git a/src/plugins/nat/dslite/dslite_cli.c b/src/plugins/nat/dslite/dslite_cli.c index 0819f95261a..25fcd01d523 100644 --- a/src/plugins/nat/dslite/dslite_cli.c +++ b/src/plugins/nat/dslite/dslite_cli.c @@ -287,10 +287,10 @@ dslite_show_sessions_command_fn (vlib_main_t * vm, /* *INDENT-OFF* */ vec_foreach (td, dm->per_thread_data) { - pool_foreach (b4, td->b4s, - ({ + pool_foreach (b4, td->b4s) + { vlib_cli_output (vm, "%U", format_dslite_b4, td, b4); - })); + } } /* *INDENT-ON* */ diff --git a/src/plugins/nat/in2out.c b/src/plugins/nat/in2out.c index 85df078dfd2..309329f12d9 100644 --- a/src/plugins/nat/in2out.c +++ b/src/plugins/nat/in2out.c @@ -171,11 +171,11 @@ nat_not_translate_output_feature (snat_main_t * sm, ip4_header_t * ip0, { /* hairpinning */ /* *INDENT-OFF* */ - pool_foreach (i, sm->output_feature_interfaces, - ({ + pool_foreach (i, sm->output_feature_interfaces) + { if ((nat_interface_is_inside(i)) && (sw_if_index == i->sw_if_index)) return 0; - })); + } /* *INDENT-ON* */ return 1; } diff --git a/src/plugins/nat/in2out_ed.c b/src/plugins/nat/in2out_ed.c index d9a45dc1398..776efdf1395 100644 --- a/src/plugins/nat/in2out_ed.c +++ b/src/plugins/nat/in2out_ed.c @@ -627,11 +627,11 @@ nat44_ed_not_translate_output_feature (snat_main_t * sm, ip4_header_t * ip, /* hairpinning */ /* *INDENT-OFF* */ - pool_foreach (i, sm->output_feature_interfaces, - ({ + pool_foreach (i, sm->output_feature_interfaces) + { if ((nat_interface_is_inside (i)) && (rx_sw_if_index == i->sw_if_index)) return 0; - })); + } /* *INDENT-ON* */ return 1; } @@ -826,7 +826,7 @@ nat44_ed_in2out_unknown_proto (snat_main_t * sm, else { /* *INDENT-OFF* */ - pool_foreach (s, tsm->sessions, { + pool_foreach (s, tsm->sessions) { if (s->ext_host_addr.as_u32 == ip->dst_address.as_u32) { new_addr = ip->src_address.as_u32 = s->out2in.addr.as_u32; @@ -837,7 +837,7 @@ nat44_ed_in2out_unknown_proto (snat_main_t * sm, break; } - }); + } /* *INDENT-ON* */ for (i = 0; i < vec_len (sm->addresses); i++) diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c index 91f14d682f4..0694c348c12 100644 --- a/src/plugins/nat/nat.c +++ b/src/plugins/nat/nat.c @@ -730,22 +730,22 @@ snat_add_address (snat_main_t * sm, ip4_address_t * addr, u32 vrf_id, /* Add external address to FIB */ /* *INDENT-OFF* */ - pool_foreach (i, sm->interfaces, - ({ + pool_foreach (i, sm->interfaces) + { if (nat_interface_is_inside(i) || sm->out2in_dpo) continue; snat_add_del_addr_to_fib(addr, 32, i->sw_if_index, 1); break; - })); - pool_foreach (i, sm->output_feature_interfaces, - ({ + } + pool_foreach (i, sm->output_feature_interfaces) + { if (nat_interface_is_inside(i) || sm->out2in_dpo) continue; snat_add_del_addr_to_fib(addr, 32, i->sw_if_index, 1); break; - })); + } /* *INDENT-ON* */ return 0; @@ -756,15 +756,15 @@ is_snat_address_used_in_static_mapping (snat_main_t * sm, ip4_address_t addr) { snat_static_mapping_t *m; /* *INDENT-OFF* */ - pool_foreach (m, sm->static_mappings, - ({ + pool_foreach (m, sm->static_mappings) + { if (is_addr_only_static_mapping (m) || is_out2in_only_static_mapping (m) || is_identity_static_mapping (m)) continue; if (m->external_addr.as_u32 == addr.as_u32) return 1; - })); + } /* *INDENT-ON* */ return 0; @@ -882,7 +882,7 @@ nat_ed_static_mapping_del_sessions (snat_main_t * sm, snat_session_t *s; u32 *indexes_to_free = NULL; /* *INDENT-OFF* */ - pool_foreach (s, tsm->sessions, { + pool_foreach (s, tsm->sessions) { if (s->in2out.fib_index != fib_index || s->in2out.addr.as_u32 != l_addr.as_u32) { @@ -905,7 +905,7 @@ nat_ed_static_mapping_del_sessions (snat_main_t * sm, vec_add1 (indexes_to_free, s - tsm->sessions); if (!addr_only) break; - }); + } /* *INDENT-ON* */ u32 *ses_index; vec_foreach (ses_index, indexes_to_free) @@ -1031,11 +1031,11 @@ snat_add_static_mapping (ip4_address_t l_addr, ip4_address_t e_addr, if (is_identity_static_mapping (m)) { /* *INDENT-OFF* */ - pool_foreach (local, m->locals, - ({ + pool_foreach (local, m->locals) + { if (local->vrf_id == vrf_id) return VNET_API_ERROR_VALUE_EXIST; - })); + } /* *INDENT-ON* */ pool_get (m->locals, local); local->vrf_id = vrf_id; @@ -1246,11 +1246,11 @@ snat_add_static_mapping (ip4_address_t l_addr, ip4_address_t e_addr, vrf_id = sm->inside_vrf_id; /* *INDENT-OFF* */ - pool_foreach (local, m->locals, - ({ + pool_foreach (local, m->locals) + { if (local->vrf_id == vrf_id) find = local - m->locals; - })); + } /* *INDENT-ON* */ if (find == ~0) return VNET_API_ERROR_NO_SUCH_ENTRY; @@ -1340,22 +1340,22 @@ snat_add_static_mapping (ip4_address_t l_addr, ip4_address_t e_addr, /* Add/delete external address to FIB */ /* *INDENT-OFF* */ - pool_foreach (interface, sm->interfaces, - ({ + pool_foreach (interface, sm->interfaces) + { if (nat_interface_is_inside(interface) || sm->out2in_dpo) continue; snat_add_del_addr_to_fib(&e_addr, 32, interface->sw_if_index, is_add); break; - })); - pool_foreach (interface, sm->output_feature_interfaces, - ({ + } + pool_foreach (interface, sm->output_feature_interfaces) + { if (nat_interface_is_inside(interface) || sm->out2in_dpo) continue; snat_add_del_addr_to_fib(&e_addr, 32, interface->sw_if_index, is_add); break; - })); + } /* *INDENT-ON* */ return 0; @@ -1544,8 +1544,8 @@ nat44_add_del_lb_static_mapping (ip4_address_t e_addr, u16 e_port, } /* *INDENT-OFF* */ - pool_foreach (local, m->locals, - ({ + pool_foreach (local, m->locals) + { fib_table_unlock (local->fib_index, FIB_PROTOCOL_IP4, sm->fib_src_low); if (!out2in_only) @@ -1570,7 +1570,7 @@ init_nat_k(& kv, local->addr, local->port, local->fib_index, m->pro tsm = vec_elt_at_index (sm->per_thread_data, sm->num_workers); /* Delete sessions */ - pool_foreach (s, tsm->sessions, { + pool_foreach (s, tsm->sessions) { if (!(is_lb_session (s))) continue; @@ -1580,8 +1580,8 @@ init_nat_k(& kv, local->addr, local->port, local->fib_index, m->pro nat_free_session_data (sm, s, tsm - sm->per_thread_data, 0); nat_ed_session_delete (sm, s, tsm - sm->per_thread_data, 1); - }); - })); + } + } /* *INDENT-ON* */ if (m->affinity) nat_affinity_flush_service (m->affinity_per_service_list_head_index); @@ -1625,15 +1625,15 @@ nat44_lb_static_mapping_add_del_local (ip4_address_t e_addr, u16 e_port, return VNET_API_ERROR_INVALID_VALUE; /* *INDENT-OFF* */ - pool_foreach (local, m->locals, - ({ + pool_foreach (local, m->locals) + { if ((local->addr.as_u32 == l_addr.as_u32) && (local->port == l_port) && (local->vrf_id == vrf_id)) { match_local = local; break; } - })); + } /* *INDENT-ON* */ if (is_add) @@ -1691,7 +1691,7 @@ nat44_lb_static_mapping_add_del_local (ip4_address_t e_addr, u16 e_port, /* Delete sessions */ /* *INDENT-OFF* */ - pool_foreach (s, tsm->sessions, { + pool_foreach (s, tsm->sessions) { if (!(is_lb_session (s))) continue; @@ -1701,7 +1701,7 @@ nat44_lb_static_mapping_add_del_local (ip4_address_t e_addr, u16 e_port, nat_free_session_data (sm, s, tsm - sm->per_thread_data, 0); nat_ed_session_delete (sm, s, tsm - sm->per_thread_data, 1); - }); + } /* *INDENT-ON* */ pool_put (m->locals, match_local); @@ -1710,8 +1710,8 @@ nat44_lb_static_mapping_add_del_local (ip4_address_t e_addr, u16 e_port, vec_free (m->workers); /* *INDENT-OFF* */ - pool_foreach (local, m->locals, - ({ + pool_foreach (local, m->locals) + { vec_add1 (locals, local - m->locals); if (sm->num_workers > 1) { @@ -1721,7 +1721,7 @@ nat44_lb_static_mapping_add_del_local (ip4_address_t e_addr, u16 e_port, sm->worker_in2out_cb (&ip, local->fib_index, 0), 1); } - })); + } /* *INDENT-ON* */ ASSERT (vec_len (locals) > 1); @@ -1779,8 +1779,8 @@ snat_del_address (snat_main_t * sm, ip4_address_t addr, u8 delete_sm, { ip4_address_t pool_addr = { 0 }; /* *INDENT-OFF* */ - pool_foreach (m, sm->static_mappings, - ({ + pool_foreach (m, sm->static_mappings) + { if (m->external_addr.as_u32 == addr.as_u32) (void) snat_add_static_mapping (m->local_addr, m->external_addr, m->local_port, m->external_port, @@ -1792,7 +1792,7 @@ snat_del_address (snat_main_t * sm, ip4_address_t addr, u8 delete_sm, m->tag, is_identity_static_mapping(m), pool_addr, 0); - })); + } /* *INDENT-ON* */ } else @@ -1814,13 +1814,13 @@ snat_del_address (snat_main_t * sm, ip4_address_t addr, u8 delete_sm, vec_foreach (tsm, sm->per_thread_data) { /* *INDENT-OFF* */ - pool_foreach (ses, tsm->sessions, ({ + pool_foreach (ses, tsm->sessions) { if (ses->out2in.addr.as_u32 == addr.as_u32) { nat_free_session_data (sm, ses, tsm - sm->per_thread_data, 0); vec_add1 (ses_to_be_removed, ses - tsm->sessions); } - })); + } /* *INDENT-ON* */ if (sm->endpoint_dependent) @@ -1858,22 +1858,22 @@ snat_del_address (snat_main_t * sm, ip4_address_t addr, u8 delete_sm, /* Delete external address from FIB */ /* *INDENT-OFF* */ - pool_foreach (interface, sm->interfaces, - ({ + pool_foreach (interface, sm->interfaces) + { if (nat_interface_is_inside(interface) || sm->out2in_dpo) continue; snat_add_del_addr_to_fib(&addr, 32, interface->sw_if_index, 0); break; - })); - pool_foreach (interface, sm->output_feature_interfaces, - ({ + } + pool_foreach (interface, sm->output_feature_interfaces) + { if (nat_interface_is_inside(interface) || sm->out2in_dpo) continue; snat_add_del_addr_to_fib(&addr, 32, interface->sw_if_index, 0); break; - })); + } /* *INDENT-ON* */ return 0; @@ -1997,14 +1997,14 @@ snat_interface_add_del (u32 sw_if_index, u8 is_inside, int is_del) } /* *INDENT-OFF* */ - pool_foreach (i, sm->output_feature_interfaces, - ({ + pool_foreach (i, sm->output_feature_interfaces) + { if (i->sw_if_index == sw_if_index) { nat_log_err ("error interface already configured"); return VNET_API_ERROR_VALUE_EXIST; } - })); + } /* *INDENT-ON* */ if (sm->static_mapping_only && !(sm->static_mapping_connection_tracking)) @@ -2063,8 +2063,8 @@ snat_interface_add_del (u32 sw_if_index, u8 is_inside, int is_del) feature_set: /* *INDENT-OFF* */ - pool_foreach (i, sm->interfaces, - ({ + pool_foreach (i, sm->interfaces) + { if (i->sw_if_index == sw_if_index) { if (is_del) @@ -2180,7 +2180,7 @@ feature_set: goto fib; } - })); + } /* *INDENT-ON* */ if (is_del) @@ -2226,13 +2226,13 @@ fib: vec_foreach (ap, sm->addresses) snat_add_del_addr_to_fib(&ap->addr, 32, sw_if_index, !is_del); - pool_foreach (m, sm->static_mappings, - ({ + pool_foreach (m, sm->static_mappings) + { if (!(is_addr_only_static_mapping(m)) || (m->local_addr.as_u32 == m->external_addr.as_u32)) continue; snat_add_del_addr_to_fib(&m->external_addr, 32, sw_if_index, !is_del); - })); + } /* *INDENT-ON* */ return 0; @@ -2263,14 +2263,14 @@ snat_interface_add_del_output_feature (u32 sw_if_index, } /* *INDENT-OFF* */ - pool_foreach (i, sm->interfaces, - ({ + pool_foreach (i, sm->interfaces) + { if (i->sw_if_index == sw_if_index) { nat_log_err ("error interface already configured"); return VNET_API_ERROR_VALUE_EXIST; } - })); + } /* *INDENT-ON* */ if (sm->endpoint_dependent) @@ -2403,8 +2403,8 @@ fq: vlib_frame_queue_main_init (sm->out2in_node_index, 0); /* *INDENT-OFF* */ - pool_foreach (i, sm->output_feature_interfaces, - ({ + pool_foreach (i, sm->output_feature_interfaces) + { if (i->sw_if_index == sw_if_index) { if (is_del) @@ -2414,7 +2414,7 @@ fq: goto fib; } - })); + } /* *INDENT-ON* */ if (is_del) @@ -2441,13 +2441,13 @@ fib: vec_foreach (ap, sm->addresses) snat_add_del_addr_to_fib(&ap->addr, 32, sw_if_index, !is_del); - pool_foreach (m, sm->static_mappings, - ({ + pool_foreach (m, sm->static_mappings) + { if (!((is_addr_only_static_mapping(m))) || (m->local_addr.as_u32 == m->external_addr.as_u32)) continue; snat_add_del_addr_to_fib(&m->external_addr, 32, sw_if_index, !is_del); - })); + } /* *INDENT-ON* */ return 0; @@ -2499,25 +2499,25 @@ snat_update_outside_fib (ip4_main_t * im, uword opaque, } /* *INDENT-OFF* */ - pool_foreach (i, sm->interfaces, - ({ + pool_foreach (i, sm->interfaces) + { if (i->sw_if_index == sw_if_index) { if (!(nat_interface_is_outside (i))) return; match = 1; } - })); + } - pool_foreach (i, sm->output_feature_interfaces, - ({ + pool_foreach (i, sm->output_feature_interfaces) + { if (i->sw_if_index == sw_if_index) { if (!(nat_interface_is_outside (i))) return; match = 1; } - })); + } /* *INDENT-ON* */ if (!match) @@ -3251,8 +3251,8 @@ snat_static_mapping_match (snat_main_t * sm, { u32 thread_index = vlib_get_thread_index (); /* *INDENT-OFF* */ - pool_foreach_index (i, m->locals, - ({ + pool_foreach_index (i, m->locals) + { local = pool_elt_at_index (m->locals, i); ip4_header_t ip = { @@ -3264,17 +3264,17 @@ snat_static_mapping_match (snat_main_t * sm, { vec_add1 (tmp, i); } - })); + } /* *INDENT-ON* */ ASSERT (vec_len (tmp) != 0); } else { /* *INDENT-OFF* */ - pool_foreach_index (i, m->locals, - ({ + pool_foreach_index (i, m->locals) + { vec_add1 (tmp, i); - })); + } /* *INDENT-ON* */ } hi = vec_len (tmp) - 1; diff --git a/src/plugins/nat/nat44_api.c b/src/plugins/nat/nat44_api.c index 4600645d402..5bc4b4cb4e6 100644 --- a/src/plugins/nat/nat44_api.c +++ b/src/plugins/nat/nat44_api.c @@ -725,10 +725,10 @@ vl_api_nat44_interface_dump_t_handler (vl_api_nat44_interface_dump_t * mp) return; /* *INDENT-OFF* */ - pool_foreach (i, sm->interfaces, - ({ + pool_foreach (i, sm->interfaces) + { send_nat44_interface_details(i, reg, mp->context); - })); + } /* *INDENT-ON* */ } @@ -785,10 +785,10 @@ static void return; /* *INDENT-OFF* */ - pool_foreach (i, sm->output_feature_interfaces, - ({ + pool_foreach (i, sm->output_feature_interfaces) + { send_nat44_interface_output_feature_details(i, reg, mp->context); - })); + } /* *INDENT-ON* */ } @@ -982,11 +982,11 @@ vl_api_nat44_static_mapping_dump_t_handler (vl_api_nat44_static_mapping_dump_t return; /* *INDENT-OFF* */ - pool_foreach (m, sm->static_mappings, - ({ + pool_foreach (m, sm->static_mappings) + { if (!is_identity_static_mapping(m) && !is_lb_static_mapping (m)) send_nat44_static_mapping_details (m, reg, mp->context); - })); + } /* *INDENT-ON* */ for (j = 0; j < vec_len (sm->to_resolve); j++) @@ -1104,16 +1104,16 @@ static void return; /* *INDENT-OFF* */ - pool_foreach (m, sm->static_mappings, - ({ + pool_foreach (m, sm->static_mappings) + { if (is_identity_static_mapping(m) && !is_lb_static_mapping (m)) { - pool_foreach_index (j, m->locals, - ({ + pool_foreach_index (j, m->locals) + { send_nat44_identity_mapping_details (m, j, reg, mp->context); - })); + } } - })); + } /* *INDENT-ON* */ for (j = 0; j < vec_len (sm->to_resolve); j++) @@ -1251,7 +1251,7 @@ nat_ed_users_create (snat_main_per_thread_data_t * tsm) { snat_session_t *s; /* *INDENT-OFF* */ - pool_foreach (s, tsm->sessions, { nat_ed_user_create_helper (tsm, s); }); + pool_foreach (s, tsm->sessions) { nat_ed_user_create_helper (tsm, s); } /* *INDENT-ON* */ } @@ -1286,10 +1286,10 @@ vl_api_nat44_user_dump_t_handler (vl_api_nat44_user_dump_t * mp) { nat_ed_users_create (tsm); } - pool_foreach (u, tsm->users, - ({ + pool_foreach (u, tsm->users) + { send_nat44_user_details (u, reg, mp->context); - })); + } if (sm->endpoint_dependent) { nat_ed_users_destroy (tsm); @@ -1407,12 +1407,12 @@ vl_api_nat44_user_session_dump_t_handler (vl_api_nat44_user_session_dump_t * else { /* *INDENT-OFF* */ - pool_foreach (s, tsm->sessions, { + pool_foreach (s, tsm->sessions) { if (s->in2out.addr.as_u32 == ukey.addr.as_u32) { send_nat44_user_session_details (s, reg, mp->context); } - }); + } /* *INDENT-ON* */ } } @@ -1556,15 +1556,15 @@ send_nat44_lb_static_mapping_details (snat_static_mapping_t * m, locals = (vl_api_nat44_lb_addr_port_t *) rmp->locals; /* *INDENT-OFF* */ - pool_foreach (ap, m->locals, - ({ + pool_foreach (ap, m->locals) + { clib_memcpy (locals->addr, &(ap->addr), 4); locals->port = ap->port; locals->probability = ap->probability; locals->vrf_id = ntohl (ap->vrf_id); locals++; local_num++; - })); + } /* *INDENT-ON* */ rmp->local_num = ntohl (local_num); @@ -1587,11 +1587,11 @@ static void return; /* *INDENT-OFF* */ - pool_foreach (m, sm->static_mappings, - ({ + pool_foreach (m, sm->static_mappings) + { if (is_lb_static_mapping(m)) send_nat44_lb_static_mapping_details (m, reg, mp->context); - })); + } /* *INDENT-ON* */ } @@ -1644,13 +1644,13 @@ static void /* *INDENT-OFF* */ vec_foreach (tsm, sm->per_thread_data) { - pool_foreach (s, tsm->sessions, - ({ + pool_foreach (s, tsm->sessions) + { if (is_fwd_bypass_session(s)) { vec_add1 (ses_to_be_removed, s - tsm->sessions); } - })); + } if(sm->endpoint_dependent){ vec_foreach (ses_index, ses_to_be_removed) { diff --git a/src/plugins/nat/nat44_cli.c b/src/plugins/nat/nat44_cli.c index 29807649ff8..ca396fd22fe 100644 --- a/src/plugins/nat/nat44_cli.c +++ b/src/plugins/nat/nat44_cli.c @@ -773,8 +773,8 @@ nat44_show_summary_command_fn (vlib_main_t * vm, unformat_input_t * input, /* *INDENT-OFF* */ vec_foreach (tsm, sm->per_thread_data) { - pool_foreach (s, tsm->sessions, - ({ + pool_foreach (s, tsm->sessions) + { sess_timeout_time = s->last_heard + (f64) nat44_session_get_timeout (sm, s); if (now >= sess_timeout_time) @@ -810,7 +810,7 @@ nat44_show_summary_command_fn (vlib_main_t * vm, unformat_input_t * input, udp_sessions++; break; } - })); + } nat44_show_lru_summary (vm, tsm, now, sess_timeout_time); count += pool_elts (tsm->sessions); } @@ -820,8 +820,8 @@ nat44_show_summary_command_fn (vlib_main_t * vm, unformat_input_t * input, { tsm = vec_elt_at_index (sm->per_thread_data, sm->num_workers); /* *INDENT-OFF* */ - pool_foreach (s, tsm->sessions, - ({ + pool_foreach (s, tsm->sessions) + { sess_timeout_time = s->last_heard + (f64) nat44_session_get_timeout (sm, s); if (now >= sess_timeout_time) @@ -857,7 +857,7 @@ nat44_show_summary_command_fn (vlib_main_t * vm, unformat_input_t * input, udp_sessions++; break; } - })); + } /* *INDENT-ON* */ nat44_show_lru_summary (vm, tsm, now, sess_timeout_time); count = pool_elts (tsm->sessions); @@ -1037,24 +1037,24 @@ nat44_show_interfaces_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_output (vm, "NAT44 interfaces:"); /* *INDENT-OFF* */ - pool_foreach (i, sm->interfaces, - ({ + pool_foreach (i, sm->interfaces) + { vlib_cli_output (vm, " %U %s", format_vnet_sw_if_index_name, vnm, i->sw_if_index, (nat_interface_is_inside(i) && nat_interface_is_outside(i)) ? "in out" : (nat_interface_is_inside(i) ? "in" : "out")); - })); + } - pool_foreach (i, sm->output_feature_interfaces, - ({ + pool_foreach (i, sm->output_feature_interfaces) + { vlib_cli_output (vm, " %U output-feature %s", format_vnet_sw_if_index_name, vnm, i->sw_if_index, (nat_interface_is_inside(i) && nat_interface_is_outside(i)) ? "in out" : (nat_interface_is_inside(i) ? "in" : "out")); - })); + } /* *INDENT-ON* */ return 0; @@ -1473,10 +1473,10 @@ nat44_show_static_mappings_command_fn (vlib_main_t * vm, vlib_cli_output (vm, "NAT44 static mappings:"); /* *INDENT-OFF* */ - pool_foreach (m, sm->static_mappings, - ({ + pool_foreach (m, sm->static_mappings) + { vlib_cli_output (vm, " %U", format_snat_static_mapping, m); - })); + } vec_foreach (rp, sm->to_resolve) vlib_cli_output (vm, " %U", format_snat_static_map_to_resolve, rp); /* *INDENT-ON* */ @@ -1611,18 +1611,18 @@ print: if (!sm->endpoint_dependent) { snat_user_t *u; - pool_foreach (u, tsm->users, - ({ + pool_foreach (u, tsm->users) + { vlib_cli_output (vm, " %U", format_snat_user, tsm, u, detail); - })); + } } else { snat_session_t *s; - pool_foreach (s, tsm->sessions, - ({ + pool_foreach (s, tsm->sessions) + { vlib_cli_output (vm, " %U\n", format_snat_session, tsm, s); - })); + } } } /* *INDENT-ON* */ diff --git a/src/plugins/nat/nat44_hairpinning.c b/src/plugins/nat/nat44_hairpinning.c index 2859046ae05..9432f554246 100644 --- a/src/plugins/nat/nat44_hairpinning.c +++ b/src/plugins/nat/nat44_hairpinning.c @@ -746,8 +746,8 @@ snat_hairpin_src_fn_inline (vlib_main_t * vm, vnet_feature_next (&next0, b0); /* *INDENT-OFF* */ - pool_foreach (i, sm->output_feature_interfaces, - ({ + pool_foreach (i, sm->output_feature_interfaces) + { /* Only packets from NAT inside interface */ if ((nat_interface_is_inside(i)) && (sw_if_index0 == i->sw_if_index)) { @@ -761,7 +761,7 @@ snat_hairpin_src_fn_inline (vlib_main_t * vm, } break; } - })); + } /* *INDENT-ON* */ if (next0 != SNAT_HAIRPIN_SRC_NEXT_DROP) diff --git a/src/plugins/nat/nat64/nat64.c b/src/plugins/nat/nat64/nat64.c index 240f3ef0fba..ae7bb350436 100644 --- a/src/plugins/nat/nat64/nat64.c +++ b/src/plugins/nat/nat64/nat64.c @@ -423,14 +423,14 @@ nat64_add_del_pool_addr (u32 thread_index, /* Add/del external address to FIB */ /* *INDENT-OFF* */ - pool_foreach (interface, nm->interfaces, - ({ + pool_foreach (interface, nm->interfaces) + { if (nat64_interface_is_inside(interface)) continue; nat64_add_del_addr_to_fib (addr, 32, interface->sw_if_index, is_add); break; - })); + } /* *INDENT-ON* */ return 0; @@ -547,14 +547,14 @@ nat64_interface_add_del (u32 sw_if_index, u8 is_inside, u8 is_add) /* Check if interface already exists */ /* *INDENT-OFF* */ - pool_foreach (i, nm->interfaces, - ({ + pool_foreach (i, nm->interfaces) + { if (i->sw_if_index == sw_if_index) { interface = i; break; } - })); + } /* *INDENT-ON* */ if (is_add) @@ -642,11 +642,11 @@ nat64_interfaces_walk (nat64_interface_walk_fn_t fn, void *ctx) nat64_interface_t *i = 0; /* *INDENT-OFF* */ - pool_foreach (i, nm->interfaces, - ({ + pool_foreach (i, nm->interfaces) + { if (fn (i, ctx)) break; - })); + } /* *INDENT-ON* */ } @@ -823,8 +823,8 @@ nat64_static_bib_worker_fn (vlib_main_t * vm, vlib_node_runtime_t * rt, ip46_address_t addr; /* *INDENT-OFF* */ - pool_foreach (static_bib, nm->static_bibs, - ({ + pool_foreach (static_bib, nm->static_bibs) + { if ((static_bib->thread_index != thread_index) || (static_bib->done)) continue; @@ -858,7 +858,7 @@ nat64_static_bib_worker_fn (vlib_main_t * vm, vlib_node_runtime_t * rt, } static_bib->done = 1; - })); + } /* *INDENT-ON* */ return 0; @@ -978,11 +978,11 @@ nat64_add_del_static_bib_entry (ip6_address_t * in_addr, if (nm->num_workers) { /* *INDENT-OFF* */ - pool_foreach (static_bib, nm->static_bibs, - ({ + pool_foreach (static_bib, nm->static_bibs) + { if (static_bib->done) vec_add1 (to_be_free, static_bib - nm->static_bibs); - })); + } vec_foreach (index, to_be_free) pool_put_index (nm->static_bibs, index[0]); /* *INDENT-ON* */ @@ -1567,10 +1567,10 @@ nat64_plugin_disable () nm->enabled = 0; /* *INDENT-OFF* */ - pool_foreach (i, nm->interfaces, - ({ + pool_foreach (i, nm->interfaces) + { vec_add1 (interfaces, *i); - })); + } /* *INDENT-ON* */ vec_foreach (i, interfaces) { diff --git a/src/plugins/nat/nat64/nat64_db.c b/src/plugins/nat/nat64/nat64_db.c index 49909fdfeb6..82ef70de5cf 100644 --- a/src/plugins/nat/nat64/nat64_db.c +++ b/src/plugins/nat/nat64/nat64_db.c @@ -177,11 +177,11 @@ nat64_db_bib_entry_free (u32 thread_index, nat64_db_t * db, /* 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])); @@ -274,17 +274,17 @@ nat64_db_bib_walk (nat64_db_t * db, u8 proto, /* *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 @@ -305,11 +305,11 @@ nat64_db_bib_walk (nat64_db_t * db, u8 proto, } /* *INDENT-OFF* */ - pool_foreach (bibe, bib, - ({ + pool_foreach (bibe, bib) + { if (fn (bibe, ctx)) return; - })); + } /* *INDENT-ON* */ } } @@ -348,17 +348,17 @@ nat64_db_st_walk (nat64_db_t * db, u8 proto, /* *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 @@ -379,11 +379,11 @@ nat64_db_st_walk (nat64_db_t * db, u8 proto, } /* *INDENT-OFF* */ - pool_foreach (ste, st, - ({ + pool_foreach (ste, st) + { if (fn (ste, ctx)) return; - })); + } /* *INDENT-ON* */ } } @@ -670,12 +670,12 @@ nad64_db_st_free_expired (u32 thread_index, nat64_db_t * db, u32 now) /* *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])); \ @@ -684,10 +684,10 @@ nad64_db_st_free_expired (u32 thread_index, nat64_db_t * db, u32 now) 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])); @@ -707,11 +707,11 @@ nat64_db_free_out_addr (u32 thread_index, /* *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])); \ @@ -720,11 +720,11 @@ nat64_db_free_out_addr (u32 thread_index, 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])); diff --git a/src/plugins/nat/nat66/nat66.c b/src/plugins/nat/nat66/nat66.c index 0a90f732b95..a8de3f6e0fa 100644 --- a/src/plugins/nat/nat66/nat66.c +++ b/src/plugins/nat/nat66/nat66.c @@ -94,14 +94,14 @@ nat66_interface_add_del (u32 sw_if_index, u8 is_inside, u8 is_add) const char *feature_name; /* *INDENT-OFF* */ - pool_foreach (i, nm->interfaces, - ({ + pool_foreach (i, nm->interfaces) + { if (i->sw_if_index == sw_if_index) { interface = i; break; } - })); + } /* *INDENT-ON* */ if (is_add) @@ -139,11 +139,11 @@ nat66_interfaces_walk (nat66_interface_walk_fn_t fn, void *ctx) nat66_interface_t *i = 0; /* *INDENT-OFF* */ - pool_foreach (i, nm->interfaces, - ({ + pool_foreach (i, nm->interfaces) + { if (fn (i, ctx)) break; - })); + } /* *INDENT-ON* */ } @@ -257,11 +257,11 @@ nat66_static_mappings_walk (nat66_static_mapping_walk_fn_t fn, void *ctx) nat66_static_mapping_t *sm = 0; /* *INDENT-OFF* */ - pool_foreach (sm, nm->sm, - ({ + pool_foreach (sm, nm->sm) + { if (fn (sm, ctx)) break; - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/nat/nat66/nat66_in2out.c b/src/plugins/nat/nat66/nat66_in2out.c index 4c4d3ab0299..356100f89ef 100644 --- a/src/plugins/nat/nat66/nat66_in2out.c +++ b/src/plugins/nat/nat66/nat66_in2out.c @@ -95,12 +95,12 @@ nat66_not_translate (u32 rx_fib_index, ip6_address_t ip6_addr) } /* *INDENT-OFF* */ - pool_foreach (i, nm->interfaces, - ({ + pool_foreach (i, nm->interfaces) + { /* NAT packet aimed at outside interface */ if (nat66_interface_is_outside (i) && sw_if_index == i->sw_if_index) return 0; - })); + } /* *INDENT-ON* */ return 1; diff --git a/src/plugins/nat/nat_format.c b/src/plugins/nat/nat_format.c index f0e7a5d5cd0..90faeb96e9b 100644 --- a/src/plugins/nat/nat_format.c +++ b/src/plugins/nat/nat_format.c @@ -234,10 +234,10 @@ format_snat_static_mapping (u8 * s, va_list * args) clib_net_to_host_u16 (m->local_port)); /* *INDENT-OFF* */ - pool_foreach (local, m->locals, - ({ + pool_foreach (local, m->locals) + { s = format (s, " vrf %d", local->vrf_id); - })); + } /* *INDENT-ON* */ return s; @@ -264,13 +264,13 @@ format_snat_static_mapping (u8 * s, va_list * args) is_out2in_only_static_mapping (m) ? "out2in-only" : ""); /* *INDENT-OFF* */ - pool_foreach (local, m->locals, - ({ + pool_foreach (local, m->locals) + { s = format (s, "\n local %U:%d vrf %d probability %d\%", format_ip4_address, &local->addr, clib_net_to_host_u16 (local->port), local->vrf_id, local->probability); - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/nat/nat_inlines.h b/src/plugins/nat/nat_inlines.h index 3d0f5ba05c4..ccb9cdf1221 100644 --- a/src/plugins/nat/nat_inlines.h +++ b/src/plugins/nat/nat_inlines.h @@ -713,11 +713,11 @@ snat_not_translate_fast (snat_main_t * sm, vlib_node_runtime_t * node, snat_interface_t *i; /* *INDENT-OFF* */ - pool_foreach (i, sm->interfaces, ({ + pool_foreach (i, sm->interfaces) { /* NAT packet aimed at outside interface */ if ((nat_interface_is_outside (i)) && (sw_if_index == i->sw_if_index)) return 0; - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/nsh/nsh-md2-ioam/nsh_md2_ioam.c b/src/plugins/nsh/nsh-md2-ioam/nsh_md2_ioam.c index 57e5e6cfa39..63e6a98fe27 100644 --- a/src/plugins/nsh/nsh-md2-ioam/nsh_md2_ioam.c +++ b/src/plugins/nsh/nsh-md2-ioam/nsh_md2_ioam.c @@ -64,11 +64,11 @@ nsh_md2_ioam_clear_output_feature_on_all_intfs (vlib_main_t * vm) vnet_main_t *vnm = vnet_get_main (); vnet_interface_main_t *im = &vnm->interface_main; - pool_foreach (si, im->sw_interfaces, ( + pool_foreach (si, im->sw_interfaces) { nsh_md2_ioam_set_clear_output_feature_on_intf (vm, si->sw_if_index, 0); - })); + } return; } @@ -305,7 +305,7 @@ nsh_md2_ioam_refresh_output_feature_on_all_dest (void) i = vec_len (hm->bool_ref_by_sw_if_index); vec_free (hm->bool_ref_by_sw_if_index); vec_validate_init_empty (hm->bool_ref_by_sw_if_index, i, ~0); - pool_foreach (t, hm->dst_tunnels, ( + pool_foreach (t, hm->dst_tunnels) { nsh_md2_ioam_enable_disable_for_dest (gm->vlib_main, @@ -315,7 +315,6 @@ nsh_md2_ioam_refresh_output_feature_on_all_dest (void) /* is_add */ ); } - )); return; } @@ -382,7 +381,7 @@ int nsh_md2_ioam_disable_for_dest return 0; } - pool_foreach (t, hm->dst_tunnels, ( + pool_foreach (t, hm->dst_tunnels) { nsh_md2_ioam_enable_disable_for_dest (gm->vlib_main, @@ -391,7 +390,6 @@ int nsh_md2_ioam_disable_for_dest (t->fp_proto == FIB_PROTOCOL_IP4), 1 /* is_add */ ); } - )); nsh_md2_ioam_clear_output_feature_on_select_intfs (); return (0); diff --git a/src/plugins/nsh/nsh_api.c b/src/plugins/nsh/nsh_api.c index 2f40f31e62d..143285e3a3b 100644 --- a/src/plugins/nsh/nsh_api.c +++ b/src/plugins/nsh/nsh_api.c @@ -189,12 +189,10 @@ vl_api_nsh_map_dump_t_handler (vl_api_nsh_map_dump_t * mp) if (~0 == map_index) { - pool_foreach (t, nm->nsh_mappings, ( - { - send_nsh_map_details (t, rp, - mp->context); - } - )); + pool_foreach (t, nm->nsh_mappings) + { + send_nsh_map_details (t, rp, mp->context); + } } else { @@ -652,12 +650,10 @@ vl_api_nsh_entry_dump_t_handler (vl_api_nsh_entry_dump_t * mp) if (~0 == entry_index) { - pool_foreach (t, nm->nsh_entries, ( - { - send_nsh_entry_details (t, rp, - mp->context); - } - )); + pool_foreach (t, nm->nsh_entries) + { + send_nsh_entry_details (t, rp, mp->context); + } } else { diff --git a/src/plugins/nsh/nsh_cli.c b/src/plugins/nsh/nsh_cli.c index 8bebb7220c4..7bcaf1c51ad 100644 --- a/src/plugins/nsh/nsh_cli.c +++ b/src/plugins/nsh/nsh_cli.c @@ -141,13 +141,13 @@ nsh_get_adj_by_sw_if_index (u32 sw_if_index) adj_index_t ai = ~0; /* *INDENT-OFF* */ - pool_foreach_index(ai, adj_pool, - ({ + pool_foreach_index (ai, adj_pool) + { if (sw_if_index == adj_get_sw_if_index(ai)) { return ai; } - })); + } /* *INDENT-ON* */ return ~0; @@ -314,13 +314,10 @@ show_nsh_map_command_fn (vlib_main_t * vm, if (pool_elts (nm->nsh_mappings) == 0) vlib_cli_output (vm, "No nsh maps configured."); - pool_foreach (map, nm->nsh_mappings, ( - { - vlib_cli_output (vm, "%U", - format_nsh_map, - map); - } - )); + pool_foreach (map, nm->nsh_mappings) + { + vlib_cli_output (vm, "%U", format_nsh_map, map); + } return 0; } @@ -615,16 +612,11 @@ show_nsh_entry_command_fn (vlib_main_t * vm, if (pool_elts (nm->nsh_entries) == 0) vlib_cli_output (vm, "No nsh entries configured."); - pool_foreach (nsh_entry, nm->nsh_entries, ( - { - vlib_cli_output (vm, "%U", - format_nsh_header, - nsh_entry->rewrite); - vlib_cli_output (vm, - " rewrite_size: %d bytes", - nsh_entry->rewrite_size); - } - )); + pool_foreach (nsh_entry, nm->nsh_entries) + { + vlib_cli_output (vm, "%U", format_nsh_header, nsh_entry->rewrite); + vlib_cli_output (vm, " rewrite_size: %d bytes", nsh_entry->rewrite_size); + } return 0; } diff --git a/src/plugins/perfmon/perfmon.c b/src/plugins/perfmon/perfmon.c index 525a864b584..28d2f456507 100644 --- a/src/plugins/perfmon/perfmon.c +++ b/src/plugins/perfmon/perfmon.c @@ -553,10 +553,10 @@ show_pmc_command_fn (vlib_main_t * vm, } /* *INDENT-OFF* */ - pool_foreach (c, pm->capture_pool, - ({ + pool_foreach (c, pm->capture_pool) + { vec_add1 (captures, *c); - })); + } /* *INDENT-ON* */ vec_sort_with_function (captures, capture_name_sort); diff --git a/src/plugins/pppoe/pppoe.c b/src/plugins/pppoe/pppoe.c index 5ad82694ac1..1589725eddd 100644 --- a/src/plugins/pppoe/pppoe.c +++ b/src/plugins/pppoe/pppoe.c @@ -632,10 +632,10 @@ show_pppoe_session_command_fn (vlib_main_t * vm, if (pool_elts (pem->sessions) == 0) vlib_cli_output (vm, "No pppoe sessions configured..."); - pool_foreach (t, pem->sessions, - ({ + pool_foreach (t, pem->sessions) + { vlib_cli_output (vm, "%U",format_pppoe_session, t); - })); + } return 0; } diff --git a/src/plugins/pppoe/pppoe_api.c b/src/plugins/pppoe/pppoe_api.c index 6da66c8f9f1..6705fb6acea 100644 --- a/src/plugins/pppoe/pppoe_api.c +++ b/src/plugins/pppoe/pppoe_api.c @@ -121,10 +121,10 @@ vl_api_pppoe_session_dump_t_handler (vl_api_pppoe_session_dump_t * mp) if (~0 == sw_if_index) { /* *INDENT-OFF* */ - pool_foreach (t, pem->sessions, - ({ + pool_foreach (t, pem->sessions) + { send_pppoe_session_details(t, reg, mp->context); - })); + } /* *INDENT-ON* */ } else diff --git a/src/plugins/quic/quic.c b/src/plugins/quic/quic.c index 87a61cc22ab..7f879cc582e 100644 --- a/src/plugins/quic/quic.c +++ b/src/plugins/quic/quic.c @@ -131,13 +131,13 @@ quic_app_cert_key_pair_delete_callback (app_cert_key_pair_t * ckpair) for (i = 0; i < num_threads; i++) { /* *INDENT-OFF* */ - pool_foreach (crctx, qm->wrk_ctx[i].crypto_ctx_pool, ({ + pool_foreach (crctx, qm->wrk_ctx[i].crypto_ctx_pool) { if (crctx->ckpair_index == ckpair->cert_key_index) { quic_crypto_context_make_key_from_crctx (&kv, crctx); clib_bihash_add_del_24_8 (&qm->wrk_ctx[i].crypto_context_hash, &kv, 0 /* is_add */ ); } - })); + } /* *INDENT-ON* */ } return 0; @@ -179,9 +179,9 @@ quic_list_crypto_context_command_fn (vlib_main_t * vm, for (i = 0; i < num_threads; i++) { /* *INDENT-OFF* */ - pool_foreach (crctx, qm->wrk_ctx[i].crypto_ctx_pool, ({ + pool_foreach (crctx, qm->wrk_ctx[i].crypto_ctx_pool) { vlib_cli_output (vm, "[%d][Q]%U", i, format_crypto_context, crctx); - })); + } /* *INDENT-ON* */ } return 0; @@ -2647,8 +2647,8 @@ quic_show_aggregated_stats (vlib_main_t * vm) for (i = 0; i < num_workers + 1; i++) { /* *INDENT-OFF* */ - pool_foreach (ctx, qm->ctx_pool[i], - ({ + pool_foreach (ctx, qm->ctx_pool[i]) + { if (quic_ctx_is_conn (ctx) && ctx->conn) { quicly_get_stats (ctx->conn, &st); @@ -2665,7 +2665,7 @@ quic_show_aggregated_stats (vlib_main_t * vm) } else if (quic_ctx_is_stream (ctx)) nstream++; - })); + } /* *INDENT-ON* */ } vlib_cli_output (vm, "-------- Connections --------"); @@ -2822,15 +2822,15 @@ quic_show_connections_command_fn (vlib_main_t * vm, for (int i = 0; i < num_workers + 1; i++) { /* *INDENT-OFF* */ - pool_foreach (ctx, qm->ctx_pool[i], - ({ + pool_foreach (ctx, qm->ctx_pool[i]) + { if (quic_ctx_is_stream (ctx) && show_stream) vlib_cli_output (vm, "%U", quic_format_stream_ctx, ctx); else if (quic_ctx_is_listener (ctx) && show_listeners) vlib_cli_output (vm, "%U", quic_format_listener_ctx, ctx); else if (quic_ctx_is_conn (ctx) && show_conn) vlib_cli_output (vm, "%U", quic_format_connection_ctx, ctx); - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/stn/stn.c b/src/plugins/stn/stn.c index 760061fe23f..241f7169e8b 100644 --- a/src/plugins/stn/stn.c +++ b/src/plugins/stn/stn.c @@ -378,9 +378,9 @@ show_stn_rules_fn (vlib_main_t * vm, stn_main_t *stn = &stn_main; u8 *s = 0; stn_rule_t *rule; - pool_foreach(rule, stn->rules, { + pool_foreach (rule, stn->rules) { s = format (s, "- %U\n", format_stn_rule, rule); - }); + } vlib_cli_output(vm, "%v", s); diff --git a/src/plugins/stn/stn_api.c b/src/plugins/stn/stn_api.c index 818c4a65c0a..e8685931db5 100644 --- a/src/plugins/stn/stn_api.c +++ b/src/plugins/stn/stn_api.c @@ -85,9 +85,9 @@ vl_api_stn_rules_dump_t_handler (vl_api_stn_rules_dump_t * mp) return; /* *INDENT-OFF* */ - pool_foreach (r, stn->rules,({ + pool_foreach (r, stn->rules) { send_stn_rules_details (r, reg, mp->context); - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/tracedump/tracedump.c b/src/plugins/tracedump/tracedump.c index 5347f82d612..53dc1a9e4d6 100644 --- a/src/plugins/tracedump/tracedump.c +++ b/src/plugins/tracedump/tracedump.c @@ -248,10 +248,10 @@ vl_api_trace_dump_t_handler (vl_api_trace_dump_t * mp) /* Filter as directed */ trace_apply_filter(this_vlib_main); - pool_foreach (th, tm->trace_buffer_pool, - ({ + pool_foreach (th, tm->trace_buffer_pool) + { vec_add1 (client_trace_cache[i], th[0]); - })); + } /* Sort them by increasing time. */ if (vec_len (client_trace_cache[i])) diff --git a/src/plugins/vmxnet3/cli.c b/src/plugins/vmxnet3/cli.c index ad66e768ad3..71342bd535c 100644 --- a/src/plugins/vmxnet3/cli.c +++ b/src/plugins/vmxnet3/cli.c @@ -556,9 +556,8 @@ show_vmxnet3_fn (vlib_main_t * vm, unformat_input_t * input, if (vec_len (hw_if_indices) == 0) { - pool_foreach (vd, vmxm->devices, - vec_add1 (hw_if_indices, vd->hw_if_index); - ); + pool_foreach (vd, vmxm->devices) + vec_add1 (hw_if_indices, vd->hw_if_index); } show_vmxnet3 (vm, hw_if_indices, show_descr, show_one_table, which, diff --git a/src/plugins/vmxnet3/vmxnet3.c b/src/plugins/vmxnet3/vmxnet3.c index ec0ab2b6863..8ec10cd1a73 100644 --- a/src/plugins/vmxnet3/vmxnet3.c +++ b/src/plugins/vmxnet3/vmxnet3.c @@ -661,7 +661,7 @@ vmxnet3_create_if (vlib_main_t * vm, vmxnet3_create_if_args_t * args) } /* *INDENT-OFF* */ - pool_foreach (vd, vmxm->devices, ({ + pool_foreach (vd, vmxm->devices) { if (vd->pci_addr.as_u32 == args->addr.as_u32) { args->rv = VNET_API_ERROR_ADDRESS_IN_USE; @@ -672,7 +672,7 @@ vmxnet3_create_if (vlib_main_t * vm, vmxnet3_create_if_args_t * args) format_vlib_pci_addr, &args->addr, "pci address in use"); return; } - })); + } /* *INDENT-ON* */ if (args->bind) diff --git a/src/plugins/vmxnet3/vmxnet3_api.c b/src/plugins/vmxnet3/vmxnet3_api.c index decb7b64c61..cef0770a63b 100644 --- a/src/plugins/vmxnet3/vmxnet3_api.c +++ b/src/plugins/vmxnet3/vmxnet3_api.c @@ -174,14 +174,14 @@ vl_api_vmxnet3_dump_t_handler (vl_api_vmxnet3_dump_t * mp) return; /* *INDENT-OFF* */ - pool_foreach (vd, vmxm->devices, - ({ + pool_foreach (vd, vmxm->devices) + { swif = vnet_get_sw_interface (vnm, vd->sw_if_index); if_name = format (if_name, "%U%c", format_vnet_sw_interface_name, vnm, swif, 0); send_vmxnet3_details (reg, vd, swif, if_name, mp->context); _vec_len (if_name) = 0; - })); + } /* *INDENT-ON* */ vec_free (if_name); @@ -212,8 +212,8 @@ static void vl_api_sw_vmxnet3_interface_dump_t_handler goto bad_sw_if_index; /* *INDENT-OFF* */ - pool_foreach (vd, vmxm->devices, - ({ + pool_foreach (vd, vmxm->devices) + { if ((filter_sw_if_index == ~0) || (vd->sw_if_index == filter_sw_if_index)) { @@ -223,7 +223,7 @@ static void vl_api_sw_vmxnet3_interface_dump_t_handler send_vmxnet3_details (reg, vd, swif, if_name, mp->context); _vec_len (if_name) = 0; } - })); + } /* *INDENT-ON* */ BAD_SW_IF_INDEX_LABEL; diff --git a/src/plugins/vrrp/vrrp.c b/src/plugins/vrrp/vrrp.c index 771cd709a2a..5ee011cceb1 100644 --- a/src/plugins/vrrp/vrrp.c +++ b/src/plugins/vrrp/vrrp.c @@ -423,11 +423,11 @@ vrrp_intf_enable_disable_mcast (u8 enable, u32 sw_if_index, u8 is_ipv6) fib_index = mfib_table_get_index_for_sw_if_index (proto, sw_if_index); /* *INDENT-OFF* */ - pool_foreach (vr, vrm->vrs, - ({ + pool_foreach (vr, vrm->vrs) + { if (vrrp_vr_is_ipv6 (vr) == is_ipv6) n_vrs++; - })); + } /* *INDENT-ON* */ if (enable) diff --git a/src/plugins/vrrp/vrrp_api.c b/src/plugins/vrrp/vrrp_api.c index 27ca56a6b55..9a206fa6cdc 100644 --- a/src/plugins/vrrp/vrrp_api.c +++ b/src/plugins/vrrp/vrrp_api.c @@ -216,14 +216,14 @@ vl_api_vrrp_vr_dump_t_handler (vl_api_vrrp_vr_dump_t * mp) sw_if_index = htonl (mp->sw_if_index); /* *INDENT-OFF* */ - pool_foreach (vr, vmp->vrs, ({ + pool_foreach (vr, vmp->vrs) { if (sw_if_index && (sw_if_index != ~0) && (sw_if_index != vr->config.sw_if_index)) continue; send_vrrp_vr_details (vr, reg, mp->context); - })); + } /* *INDENT-ON* */ } @@ -364,14 +364,14 @@ vl_api_vrrp_vr_peer_dump_t_handler (vl_api_vrrp_vr_peer_dump_t * mp) } /* *INDENT-OFF* */ - pool_foreach (vr, vmp->vrs, ({ + pool_foreach (vr, vmp->vrs) { if (!vec_len (vr->config.peer_addrs)) continue; send_vrrp_vr_details (vr, reg, mp->context); - })); + } /* *INDENT-ON* */ } @@ -468,14 +468,14 @@ vl_api_vrrp_vr_track_if_dump_t_handler (vl_api_vrrp_vr_track_if_dump_t * mp) } /* *INDENT-OFF* */ - pool_foreach (vr, vmp->vrs, ({ + pool_foreach (vr, vmp->vrs) { if (!vec_len (vr->tracking.interfaces)) continue; send_vrrp_vr_track_if_details (vr, reg, mp->context); - })); + } /* *INDENT-ON* */ } @@ -511,12 +511,12 @@ vrrp_vr_event (vrrp_vr_t * vr, vrrp_vr_state_t new_state) vl_api_registration_t *vl_reg; /* *INDENT-OFF* */ - pool_foreach(reg, vam->vrrp_vr_events_registrations, - ({ + pool_foreach (reg, vam->vrrp_vr_events_registrations) + { vl_reg = vl_api_client_index_to_registration (reg->client_index); if (vl_reg) send_vrrp_vr_event (reg, vl_reg, vr, new_state); - })); + } /* *INDENT-ON* */ } diff --git a/src/plugins/vrrp/vrrp_cli.c b/src/plugins/vrrp/vrrp_cli.c index 447b4749a28..a154a11a8fa 100644 --- a/src/plugins/vrrp/vrrp_cli.c +++ b/src/plugins/vrrp/vrrp_cli.c @@ -196,15 +196,14 @@ vrrp_show_vr_command_fn (vlib_main_t * vm, break; } - pool_foreach (vr, vmp->vrs, ( - { - - if (sw_if_index && (sw_if_index != ~0) && - (sw_if_index != vr->config.sw_if_index)) - continue; - vlib_cli_output (vm, "%U", format_vrrp_vr, - vr);} - )); + pool_foreach (vr, vmp->vrs) + { + + if (sw_if_index && (sw_if_index != ~0) && + (sw_if_index != vr->config.sw_if_index)) + continue; + vlib_cli_output (vm, "%U", format_vrrp_vr, vr); + } return 0; } diff --git a/src/plugins/wireguard/wireguard_if.c b/src/plugins/wireguard/wireguard_if.c index 3c59407e3b7..f7eb5a1d9e0 100644 --- a/src/plugins/wireguard/wireguard_if.c +++ b/src/plugins/wireguard/wireguard_if.c @@ -373,11 +373,11 @@ wg_if_walk (wg_if_walk_cb_t fn, void *data) index_t wgii; /* *INDENT-OFF* */ - pool_foreach_index (wgii, wg_if_pool, + pool_foreach_index (wgii, wg_if_pool) { if (WALK_STOP == fn(wgii, data)) break; - }); + } /* *INDENT-ON* */ } diff --git a/src/plugins/wireguard/wireguard_peer.c b/src/plugins/wireguard/wireguard_peer.c old mode 100755 new mode 100644 index 147adbf6ebe..c4f06be999d --- a/src/plugins/wireguard/wireguard_peer.c +++ b/src/plugins/wireguard/wireguard_peer.c @@ -290,13 +290,13 @@ wg_peer_add (u32 tun_sw_if_index, return (VNET_API_ERROR_INVALID_SW_IF_INDEX); /* *INDENT-OFF* */ - pool_foreach (peer, wg_peer_pool, - ({ + pool_foreach (peer, wg_peer_pool) + { if (!memcmp (peer->remote.r_public, public_key, NOISE_PUBLIC_KEY_LEN)) { return (VNET_API_ERROR_ENTRY_ALREADY_EXISTS); } - })); + } /* *INDENT-ON* */ if (pool_elts (wg_peer_pool) > MAX_PEERS) @@ -362,11 +362,11 @@ wg_peer_walk (wg_peer_walk_cb_t fn, void *data) index_t peeri; /* *INDENT-OFF* */ - pool_foreach_index(peeri, wg_peer_pool, + pool_foreach_index (peeri, wg_peer_pool) { if (WALK_STOP == fn(peeri, data)) return peeri; - }); + } /* *INDENT-ON* */ return INDEX_INVALID; } -- cgit 1.2.3-korg