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* */
}
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* */
}
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
{
/* *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
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
{
/* 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
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
}
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) ?
n_adds -
n_dels,
n_epoch_changes);
- }));
+ }
/* *INDENT-ON* */
vlib_cli_output (vm, " connection timeout type lists:", wk);
{
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;
}
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* */
}
{
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;
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);
}
- }));
+ }
}
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)) {
format_vec32, acontext->acl_indices, "%d");
}
}
- }));
+ }
}
void *
* 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)
{
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;
&args->addr, "pci address in use");
return;
}
- }));
+ }
/* *INDENT-ON* */
pool_get (am->devices, adp);
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* */
}
/* 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 */
"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;
}
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 */
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)));
cnat_client_cnt_session (cc);
vec_add1(del_vec, addr - cnat_client_db.throttle_pool[i]);
}
- }));
+ }
/* *INDENT-ON* */
vec_foreach (ai, del_vec)
{
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));
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);
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);
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* */
}
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
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);
{
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* */
}
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);
}
/* *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",
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",
{
/* *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
}
/* *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;
dhcp_client_t *c;
/* *INDENT-OFF* */
- pool_foreach (c, dcm->clients,
- ({
+ pool_foreach (c, dcm->clients)
+ {
if (!cb(c, ctx))
break;
- }));
+ }
/* *INDENT-ON* */
}
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)
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))
address_already_present = 1;
goto address_pool_foreach_out;
}
- }));
+ }
/* *INDENT-ON* */
address_pool_foreach_out:
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;
{
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)
0, 1);
}
}
- }));
+ }
/* *INDENT-ON* */
for (i = 0; i < vec_len (rm->client_state_by_sw_if_index); i++)
{
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;
}
/* *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) &&
clib_warning ("Failed to delete interface address");
pool_put (rm->address_pool, address_info);
}
- }));
+ }
/* *INDENT-ON* */
}
* 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++)
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)
{
vec_validate (prefix_list, pos);
clib_memcpy (&prefix_list[pos], prefix_info, sizeof (*prefix_info));
}
- }));
+ }
/* *INDENT-ON* */
return prefix_list;
{
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)
}
}
}
- }));
+ }
/* *INDENT-ON* */
for (i = 0; i < vec_len (rm->client_state_by_sw_if_index); i++)
{
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;
}
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, "
prefix_group,
prefix_info->preferred_lt, prefix_info->valid_lt,
prefix_info->due_time - current_time);
- }));
+ }
/* *INDENT-ON* */
return error;
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)
{
set_is_dhcpv6_pd_prefix (prefix_info, 0);
pool_put (pm->prefix_pool, prefix_info);
}
- }));
+ }
/* *INDENT-ON* */
vec_free (prefix_list);
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);
msg->pid = reg->client_pid;
vl_api_send_msg (vl_reg, (u8 *) msg);
}
- }));
+ }
/* *INDENT-ON* */
clib_mem_free (event);
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);
msg->pid = reg->client_pid;
vl_api_send_msg (vl_reg, (u8 *) msg);
}
- }));
+ }
/* *INDENT-ON* */
clib_mem_free (event);
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);
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);
verbose);
}
vec_add1 (s, '\n');
- }));
+ }
/* *INDENT-ON* */
}
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
tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
vec_add1 (conf->eal_init_args, tmp);
}
- }));
+ }
/* *INDENT-ON* */
#undef _
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* */
}
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* */
}
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* */
}
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)
}
else
vlib_cli_output (vm, " %U", format_gbp_contract, gci);
- }));
+ }
/* *INDENT-ON* */
return (NULL);
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* */
}
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* */
}
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* */
}
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);
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* */
}
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* */
}
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)
if (WALK_STOP == cb (grd->grd_id, &gs->gs_key->gsk_pfx,
gs->gs_type, sw_if_index, sclass, ctx))
break;
- }));
+ }
/* *INDENT-ON* */
}
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* */
}
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* */
}
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;
}
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
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;
}
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
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)
{
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)
else
ECHO_LOG (2,"%U: PASSIVE close", echo_format_session, s);
}
- }));
+ }
/* *INDENT-ON* */
}
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++)
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
/* *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* */
}
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;
/* 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++)
ikev2_id_t *id_rem, *id_loc;
/* *INDENT-OFF* */
- pool_foreach (p, km->profiles, ({
+ pool_foreach (p, km->profiles) {
if (sa->is_initiator)
{
}
break;
- }));
+ }
/* *INDENT-ON* */
if (tsi && tsr)
}
/* *INDENT-OFF* */
- pool_foreach (p, km->profiles, ({
+ pool_foreach (p, km->profiles) {
/* check id */
if (!ikev2_is_id_equal (&p->rem_id, id_rem)
vec_free(auth);
vec_free(psk);
- }));
+ }
/* *INDENT-ON* */
if (sel_p)
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 */
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)
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)
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* */
}
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* */
}
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* */
}
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)
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)
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;
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,
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;
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)
/* 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);
return;
/* *INDENT-OFF* */
- pool_foreach (profile, im->profiles,
- ({
+ pool_foreach (profile, im->profiles)
+ {
send_profile (profile, reg, mp->context);
- }));
+ }
/* *INDENT-ON* */
}
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* */
}
}
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)
}
else
s = format (s, "%U\n", format_ikev2_sa, sa, details);
- }));
+ }
/* *INDENT-ON* */
}
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)
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;
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;
}
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++)
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);
}
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);
/* 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]);
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;
}
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;
}
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);
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* */
}
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,
1/*pkt*/, 2222 /*bytes*/);
nincr++;
- }));
+ }
/* *INDENT-ON* */
vlib_cli_output (vm, "Incremented %d active counters\n", nincr);
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,
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);
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* */
}
u32 l3xci;
/* *INDENT-OFF* */
- pool_foreach_index(l3xci, l3xc_pool,
- ({
+ pool_foreach_index (l3xci, l3xc_pool)
+ {
if (!cb(l3xci, ctx))
break;
- }));
+ }
/* *INDENT-ON* */
}
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);
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);
lacpif->tx_state = mif->tx_state;
lacpif->ptx_state = mif->ptx_state;
lacpif->mux_state = mif->mux_state;
- );
+ }
/* *INDENT-ON* */
*out_lacpifs = r_lacpifs;
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)
u8 actor_state, partner_state;
/* *INDENT-OFF* */
- pool_foreach (mif, bm->neighbors,
- ({
+ pool_foreach (mif, bm->neighbors)
+ {
if (mif->port_enabled == 0)
continue;
[mif->sw_if_index].partner_state,
mif->partner.state);
}
- }));
+ }
/* *INDENT-ON* */
}
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,
(mif2->partner.port_number == lacpdu->partner.port_info.port_number))
return 1;
}
- });
+ }
/* *INDENT-ON* */
return 0;
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);
vl_api_send_msg (reg, (u8 *) rmp);
}
- });
+ }
}
/* 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];
vl_api_send_msg (reg, (u8 *) rmp);
asindex++;
}
- });
+ }
}
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])
{
send_lb_as_details(reg, mp->context, vip);
}
- }));
+ }
/* *INDENT-ON* */
}
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;
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,
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;
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) &&
pool_put(vip->as_indexes, as_index);
pool_put(lbm->ass, as);
}
- });
+ }
}
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];
//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) {
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);
/* 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] &&
return 0;
}
}
- });
+ }
return VNET_API_ERROR_NO_SUCH_ENTRY;
}
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] &&
*as_index = as - lbm->ass;
return 0;
}
- });
+ }
return -1;
}
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);
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;
* 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);
break;
}
}
- }));
+ }
/* *INDENT-ON* */
}
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)
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);
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)
rec = m[0];
add_locators (lcm, &rec, m->locator_set_index, NULL);
vec_add1 (recs, rec);
- });
+ }
/* *INDENT-ON* */
return recs;
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;
&lp->rmt_loc);
rloc_probes_sent++;
}
- });
+ }
/* *INDENT-ON* */
vlib_node_increment_counter (vlib_get_main (), lisp_cp_output_node.index,
/* 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)
/* 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);
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, ({
vec_add1 (to_be_removed, pmr - lcm->pending_map_requests_pool);
}
- }));
+ }
/* *INDENT-ON* */
vec_foreach (pmr_index, to_be_removed)
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)
(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);
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)))
{
}
send_lisp_locator_set_details (lcm, lsit, reg, mp->context,
lsit - lcm->locator_set_pool);
- }));
+ }
/* *INDENT-ON* */
}
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* */
}
}
if (print_all)
{
/* *INDENT-OFF* */
- pool_foreach (mapit, lcm->mapping_pool,
- ({
+ pool_foreach (mapit, lcm->mapping_pool)
+ {
if (mapit->pitr_set)
continue;
}
vlib_cli_output (vm, "%U", format_eid_entry, lcm->vnet_main,
lcm, mapit, ls);
- }));
+ }
/* *INDENT-ON* */
}
else
"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)
}
vlib_cli_output (vm, "%v", msg);
vec_free (msg);
- }));
+ }
/* *INDENT-ON* */
return 0;
}
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)))
{
}
send_one_locator_set_details (lcm, lsit, reg, mp->context,
lsit - lcm->locator_set_pool);
- }));
+ }
/* *INDENT-ON* */
}
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* */
}
}
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;
}
vlib_cli_output (vm, "%U", format_eid_entry, lcm->vnet_main,
lcm, mapit, ls);
- }));
+ }
/* *INDENT-ON* */
}
else
"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)
}
vlib_cli_output (vm, "%v", msg);
vec_free (msg);
- }));
+ }
/* *INDENT-ON* */
return 0;
}
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* */
}
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:
del_nsh_fwd_entry_i (lgm, lfe);
break;
}
- }));
+ }
/* *INDENT-ON* */
}
}
/* *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);
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;
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));
memcpy (&e.leid, &lfe->key->lcl, sizeof (e.leid));
vec_add1 (entries, e);
}
- }));
+ }
/* *INDENT-ON* */
return entries;
"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;
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* */
}
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;
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* */
}
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);
vec_len(n->port_id), 1, format_time_ago, n->last_sent,
now, format_time_ago, n->last_heard, now);
}
- }));
+ }
/* *INDENT-ON* */
return s;
}
"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 =
"", "", format_time_ago, n->last_heard, now,
format_time_ago, n->last_sent, now, "inactive");
}
- }));
+ }
/* *INDENT-ON* */
return s;
}
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);
}
/* *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]);
name_len);
ep->device_name [ARRAY_LEN(ep->device_name) -1] = 0;
vl_api_send_msg (rp, (u8 *)ep);
- }));
+ }
/* *INDENT-OFF* */
send_reply:
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",
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;
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... */
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* */
}
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;
}
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
}
/* *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));
return;
/* *INDENT-OFF* */
- pool_foreach_index(i, mm->domains,
- ({
+ pool_foreach_index (i, mm->domains)
+ {
send_domain_details(i, reg, mp->context);
- }));
+ }
/* *INDENT-ON* */
}
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* */
}
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);
sock = clib_mem_alloc (sizeof(clib_socket_t));
}
}
- }));
+ }
/* *INDENT-ON* */
last_run_duration = vlib_time_now (vm) - last_run_duration;
}
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",
send_memif_details (reg, mif, swif, if_name, mp->context);
_vec_len (if_name) = 0;
- }));
+ }
/* *INDENT-ON* */
vec_free (if_name);
/* 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;
// 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:
// 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;
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;
}
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 ();
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)
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;
}
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;
}
return;
/* *INDENT-OFF* */
- pool_foreach (i, dm->interfaces,
- ({
+ pool_foreach (i, dm->interfaces)
+ {
det44_send_interface_details(i, reg, mp->context);
- }));
+ }
/* *INDENT-ON* */
}
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);
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;
}
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)
{
if (ses->in_port)
vlib_cli_output (vm, " %U", format_det_map_ses, mp, ses, &i);
}
- }));
+ }
/* *INDENT-ON* */
return 0;
}
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;
}
{
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* */
}
}
/* *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* */
{
/* 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;
}
/* 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;
}
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;
break;
}
- });
+ }
/* *INDENT-ON* */
for (i = 0; i < vec_len (sm->addresses); i++)
/* 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;
{
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;
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)
{
vec_add1 (indexes_to_free, s - tsm->sessions);
if (!addr_only)
break;
- });
+ }
/* *INDENT-ON* */
u32 *ses_index;
vec_foreach (ses_index, indexes_to_free)
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;
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;
/* 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;
}
/* *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)
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;
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);
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)
/* Delete sessions */
/* *INDENT-OFF* */
- pool_foreach (s, tsm->sessions, {
+ pool_foreach (s, tsm->sessions) {
if (!(is_lb_session (s)))
continue;
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);
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)
{
sm->worker_in2out_cb (&ip, local->fib_index, 0),
1);
}
- }));
+ }
/* *INDENT-ON* */
ASSERT (vec_len (locals) > 1);
{
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,
m->tag,
is_identity_static_mapping(m),
pool_addr, 0);
- }));
+ }
/* *INDENT-ON* */
}
else
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)
/* 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;
}
/* *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))
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)
goto fib;
}
- }));
+ }
/* *INDENT-ON* */
if (is_del)
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;
}
/* *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)
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)
goto fib;
}
- }));
+ }
/* *INDENT-ON* */
if (is_del)
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;
}
/* *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)
{
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 = {
{
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;
return;
/* *INDENT-OFF* */
- pool_foreach (i, sm->interfaces,
- ({
+ pool_foreach (i, sm->interfaces)
+ {
send_nat44_interface_details(i, reg, mp->context);
- }));
+ }
/* *INDENT-ON* */
}
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* */
}
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++)
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++)
{
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* */
}
{
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);
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* */
}
}
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);
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* */
}
/* *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)
{
/* *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)
udp_sessions++;
break;
}
- }));
+ }
nat44_show_lru_summary (vm, tsm, now, sess_timeout_time);
count += pool_elts (tsm->sessions);
}
{
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)
udp_sessions++;
break;
}
- }));
+ }
/* *INDENT-ON* */
nat44_show_lru_summary (vm, tsm, now, sess_timeout_time);
count = pool_elts (tsm->sessions);
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;
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* */
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* */
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))
{
}
break;
}
- }));
+ }
/* *INDENT-ON* */
if (next0 != SNAT_HAIRPIN_SRC_NEXT_DROP)
/* 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;
/* 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)
nat64_interface_t *i = 0;
/* *INDENT-OFF* */
- pool_foreach (i, nm->interfaces,
- ({
+ pool_foreach (i, nm->interfaces)
+ {
if (fn (i, ctx))
break;
- }));
+ }
/* *INDENT-ON* */
}
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;
}
static_bib->done = 1;
- }));
+ }
/* *INDENT-ON* */
return 0;
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* */
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)
{
/* 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]));
/* *INDENT-OFF* */
#define _(N, i, n, s) \
bib = db->bib._##n##_bib; \
- pool_foreach (bibe, bib, ({ \
+ pool_foreach (bibe, bib) { \
if (fn (bibe, ctx)) \
return; \
- }));
+ }
foreach_nat_protocol
#undef _
bib = db->bib._unk_proto_bib;
- pool_foreach (bibe, bib, ({
+ pool_foreach (bibe, bib) {
if (fn (bibe, ctx))
return;
- }));
+ }
/* *INDENT-ON* */
}
else
}
/* *INDENT-OFF* */
- pool_foreach (bibe, bib,
- ({
+ pool_foreach (bibe, bib)
+ {
if (fn (bibe, ctx))
return;
- }));
+ }
/* *INDENT-ON* */
}
}
/* *INDENT-OFF* */
#define _(N, i, n, s) \
st = db->st._##n##_st; \
- pool_foreach (ste, st, ({ \
+ pool_foreach (ste, st) { \
if (fn (ste, ctx)) \
return; \
- }));
+ }
foreach_nat_protocol
#undef _
st = db->st._unk_proto_st;
- pool_foreach (ste, st, ({
+ pool_foreach (ste, st) {
if (fn (ste, ctx))
return;
- }));
+ }
/* *INDENT-ON* */
}
else
}
/* *INDENT-OFF* */
- pool_foreach (ste, st,
- ({
+ pool_foreach (ste, st)
+ {
if (fn (ste, ctx))
return;
- }));
+ }
/* *INDENT-ON* */
}
}
/* *INDENT-OFF* */
#define _(N, i, n, s) \
st = db->st._##n##_st; \
- pool_foreach (ste, st, ({\
+ pool_foreach (ste, st) {\
if (i == NAT_PROTOCOL_TCP && !ste->tcp_state) \
continue; \
if (ste->expire < now) \
vec_add1 (ste_to_be_free, ste - st); \
- })); \
+ } \
vec_foreach (ste_index, ste_to_be_free) \
nat64_db_st_entry_free (thread_index, db, \
pool_elt_at_index(st, ste_index[0])); \
foreach_nat_protocol
#undef _
st = db->st._unk_proto_st;
- pool_foreach (ste, st, ({
+ pool_foreach (ste, st) {
if (ste->expire < now)
vec_add1 (ste_to_be_free, ste - st);
- }));
+ }
vec_foreach (ste_index, ste_to_be_free)
nat64_db_st_entry_free (thread_index, db,
pool_elt_at_index(st, ste_index[0]));
/* *INDENT-OFF* */
#define _(N, i, n, s) \
st = db->st._##n##_st; \
- pool_foreach (ste, st, ({ \
+ pool_foreach (ste, st) { \
bibe = pool_elt_at_index (db->bib._##n##_bib, ste->bibe_index); \
if (bibe->out_addr.as_u32 == out_addr->as_u32) \
vec_add1 (ste_to_be_free, ste - st); \
- })); \
+ } \
vec_foreach (ste_index, ste_to_be_free) \
nat64_db_st_entry_free (thread_index, db, \
pool_elt_at_index(st, ste_index[0])); \
foreach_nat_protocol
#undef _
st = db->st._unk_proto_st;
- pool_foreach (ste, st, ({
+ pool_foreach (ste, st) {
bibe = pool_elt_at_index (db->bib._unk_proto_bib, ste->bibe_index);
if (bibe->out_addr.as_u32 == out_addr->as_u32)
vec_add1 (ste_to_be_free, ste - st);
- }));
+ }
vec_foreach (ste_index, ste_to_be_free)
nat64_db_st_entry_free (thread_index, db,
pool_elt_at_index(st, ste_index[0]));
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)
nat66_interface_t *i = 0;
/* *INDENT-OFF* */
- pool_foreach (i, nm->interfaces,
- ({
+ pool_foreach (i, nm->interfaces)
+ {
if (fn (i, ctx))
break;
- }));
+ }
/* *INDENT-ON* */
}
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* */
}
}
/* *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;
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;
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* */
}
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* */
}
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;
}
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,
/* is_add */
);
}
- ));
return;
}
return 0;
}
- pool_foreach (t, hm->dst_tunnels, (
+ pool_foreach (t, hm->dst_tunnels)
{
nsh_md2_ioam_enable_disable_for_dest
(gm->vlib_main,
(t->fp_proto ==
FIB_PROTOCOL_IP4), 1 /* is_add */ );
}
- ));
nsh_md2_ioam_clear_output_feature_on_select_intfs ();
return (0);
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
{
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
{
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;
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;
}
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;
}
}
/* *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);
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;
}
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
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;
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;
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);
}
else if (quic_ctx_is_stream (ctx))
nstream++;
- }));
+ }
/* *INDENT-ON* */
}
vlib_cli_output (vm, "-------- Connections --------");
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* */
}
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);
return;
/* *INDENT-OFF* */
- pool_foreach (r, stn->rules,({
+ pool_foreach (r, stn->rules) {
send_stn_rules_details (r, reg, mp->context);
- }));
+ }
/* *INDENT-ON* */
}
/* 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]))
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,
}
/* *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;
format_vlib_pci_addr, &args->addr, "pci address in use");
return;
}
- }));
+ }
/* *INDENT-ON* */
if (args->bind)
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);
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))
{
send_vmxnet3_details (reg, vd, swif, if_name, mp->context);
_vec_len (if_name) = 0;
}
- }));
+ }
/* *INDENT-ON* */
BAD_SW_IF_INDEX_LABEL;
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)
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* */
}
}
/* *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* */
}
}
/* *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* */
}
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* */
}
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;
}
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* */
}
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)
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;
}
* find_or_create.
*/
/* *INDENT-OFF* */
- pool_foreach (subp, mp->subregions, ({
+ pool_foreach (subp, mp->subregions) {
name = vec_dup (subp->subregion_name);
vec_add1(svm_names, name);
- }));
+ }
/* *INDENT-ON* */
pthread_mutex_unlock (&root_rp->mutex);
* find_or_create.
*/
/* *INDENT-OFF* */
- pool_foreach (subp, mp->subregions, ({
+ pool_foreach (subp, mp->subregions) {
name = vec_dup (subp->subregion_name);
vec_add1(svm_names, name);
- }));
+ }
/* *INDENT-ON* */
pthread_mutex_unlock (&root_rp->mutex);
* find_or_create.
*/
/* *INDENT-OFF* */
- pool_foreach (subp, mp->subregions, ({
+ pool_foreach (subp, mp->subregions) {
name = vec_dup (subp->subregion_name);
vec_add1(svm_names, name);
- }));
+ }
/* *INDENT-ON* */
pthread_mutex_unlock (&root_rp->mutex);
}
/* *INDENT-OFF* */
- pool_foreach (ldpw, ldp->workers, ({
+ pool_foreach (ldpw, ldp->workers) {
clib_memset (&ldpw->clib_time, 0, sizeof (ldpw->clib_time));
- }));
+ }
/* *INDENT-ON* */
LDBG (0, "LDP initialization: done!");
vcl_locked_session_t *vls, *parent_vls;
/* *INDENT-OFF* */
- pool_foreach (vls, vls_wrk->vls_pool, ({
+ pool_foreach (vls, vls_wrk->vls_pool) {
/* Initialize sharing on parent session */
if (vls->shared_data_index == ~0)
{
vls->shared_data_index = parent_vls->shared_data_index;
}
vls_share_session (vls_wrk, vls);
- }));
+ }
/* *INDENT-ON* */
}
is_current = current_wrk == wrk->wrk_index;
/* *INDENT-OFF* */
- pool_foreach (s, wrk->sessions, ({
+ pool_foreach (s, wrk->sessions) {
vls = vls_get (vls_si_wi_to_vlsh (s->session_index, wrk->wrk_index));
if (vls && (is_current || vls_is_shared_by_wrk (vls, current_wrk)))
vls_unshare_session (vls, wrk);
- }));
+ }
/* *INDENT-ON* */
}
current_wrk = vcl_worker_get_current ();
/* *INDENT-OFF* */
- pool_foreach (wrk, vcm->workers, ({
+ pool_foreach (wrk, vcm->workers) {
if (current_wrk != wrk)
vcl_worker_cleanup (wrk, 0 /* notify vpp */ );
- }));
+ }
/* *INDENT-ON* */
vcl_api_detach (current_wrk);
/* Close all known open files */
/* *INDENT-OFF* */
- pool_foreach(f, fm->file_pool,
- ({
+ pool_foreach (f, fm->file_pool)
+ {
if (f->file_descriptor > 2)
close(f->file_descriptor);
- }));
+ }
/* *INDENT-ON* */
/* Exec ourself */
pf->next_frame_index += n_insert;
}
/* *INDENT-OFF* */
- pool_foreach (pf, nm->suspended_process_frames, ({
+ pool_foreach (pf, nm->suspended_process_frames) {
if (pf->next_frame_index != ~0 && pf->next_frame_index >= i)
pf->next_frame_index += n_insert;
- }));
+ }
/* *INDENT-ON* */
r->n_next_nodes = vec_len (node->next_nodes);
*/
n_accepted = 0;
/* *INDENT-OFF* */
- pool_foreach (h, tm->trace_buffer_pool,
- ({
+ pool_foreach (h, tm->trace_buffer_pool)
+ {
accept = filter_accept(tm, h[0]);
if ((n_accepted == tm->filter_count) || !accept)
vec_add1 (traces_to_remove, h);
else
n_accepted++;
- }));
+ }
/* *INDENT-ON* */
/* remove all traces that we don't want to keep */
trace_apply_filter(this_vlib_main);
traces = 0;
- pool_foreach (h, tm->trace_buffer_pool,
- ({
+ pool_foreach (h, tm->trace_buffer_pool)
+ {
vec_add1 (traces, h[0]);
- }));
+ }
if (vec_len (traces) == 0)
{
"Read", "Write", "Error", "File Name", "Description");
/* *INDENT-OFF* */
- pool_foreach (f, fm->file_pool,(
+ pool_foreach (f, fm->file_pool)
{
int rv;
s = format (s, "/proc/self/fd/%d%c", f->file_descriptor, 0);
f->read_events, f->write_events, f->error_events,
path, f->description);
vec_reset_length (s);
- }));
+ }
/* *INDENT-ON* */
vec_free (s);
#define fl(x, y) ( (x) ? toupper((y)) : tolower((y)) )
/* *INDENT-OFF* */
- pool_foreach (cf, cm->cli_file_pool, ({
+ pool_foreach (cf, cm->cli_file_pool) {
uf = pool_elt_at_index (fm->file_pool, cf->clib_file_index);
n = vlib_get_node (vm, cf->process_node_index);
vlib_cli_output (vm,
fl (cf->line_mode, 'l'),
fl (cf->has_epipe, 'p'),
fl (cf->ansi_capable, 'a'));
- }));
+ }
/* *INDENT-ON* */
#undef fl
vec_reset_length (confused_indices);
/* *INDENT-OFF* */
- pool_foreach (regpp, am->vl_clients, ({
+ pool_foreach (regpp, am->vl_clients) {
vl_mem_send_client_keepalive_w_reg (am, now, regpp, &dead_indices,
&confused_indices);
- }));
+ }
/* *INDENT-ON* */
/* This should "never happen," but if it does, fix it... */
/* For horizontal scaling, add a hash table... */
/* *INDENT-OFF* */
- pool_foreach (regpp, am->vl_clients,
- ({
+ pool_foreach (regpp, am->vl_clients)
+ {
regp = *regpp;
if (regp && regp->vlib_rp == vlib_rp)
{
vlib_cli_output (vm, "%s segment rings:", regp->name);
goto found;
}
- }));
+ }
vlib_cli_output (vm, "regp %llx not found?", regp);
continue;
/* *INDENT-ON* */
vlib_cli_output (vm, "Socket clients");
vlib_cli_output (vm, "%20s %8s", "Name", "Fildesc");
/* *INDENT-OFF* */
- pool_foreach (reg, sm->registration_pool,
- ({
+ pool_foreach (reg, sm->registration_pool)
+ {
if (reg->registration_type == REGISTRATION_TYPE_SOCKET_SERVER) {
f = vl_api_registration_file (reg);
vlib_cli_output (vm, "%20s %8d", reg->name, f->file_descriptor);
}
- }));
+ }
/* *INDENT-ON* */
}
{
u32 index;
/* *INDENT-OFF* */
- pool_foreach (rp, sm->registration_pool, ({
+ pool_foreach (rp, sm->registration_pool) {
vl_api_registration_del_file (rp);
index = rp->vl_api_registration_pool_index;
vl_socket_free_registration_index (index);
- }));
+ }
/* *INDENT-ON* */
}
"Name", "PID", "Queue Length", "Queue VA", "Health");
/* *INDENT-OFF* */
- pool_foreach (regpp, am->vl_clients,
- ({
+ pool_foreach (regpp, am->vl_clients)
+ {
regp = *regpp;
if (regp)
regpp - am->vl_clients);
vec_add1 (confused_indices, regpp - am->vl_clients);
}
- }));
+ }
/* *INDENT-ON* */
/* This should "never happen," but if it does, fix it... */
else
{
/* *INDENT-OFF* */
- pool_foreach_index(ai, adj_pool,
- ({
+ pool_foreach_index (ai, adj_pool)
+ {
if (~0 != sw_if_index &&
sw_if_index != adj_get_sw_if_index(ai))
{
format_ip_adjacency, ai,
FORMAT_IP_ADJACENCY_NONE);
}
- }));
+ }
/* *INDENT-ON* */
}
}
vpe_client_registration_t *reg;
vl_api_registration_t *vl_reg;
/* *INDENT-OFF* */
- pool_foreach (reg, vam->bfd_events_registrations, ({
+ pool_foreach (reg, vam->bfd_events_registrations) {
vl_reg = vl_api_client_index_to_registration (reg->client_index);
if (vl_reg)
{
send_bfd_udp_session_details (vl_reg, 0, bs);
}
}
- }));
+ }
/* *INDENT-ON* */
}
bfd_session_t *bs = NULL;
/* *INDENT-OFF* */
- pool_foreach (bs, bfd_main.sessions, ({
+ pool_foreach (bs, bfd_main.sessions) {
if (bs->transport == BFD_TRANSPORT_UDP4 ||
bs->transport == BFD_TRANSPORT_UDP6)
send_bfd_udp_session_details (reg, mp->context, bs);
- }));
+ }
/* *INDENT-ON* */
}
vl_api_bfd_auth_keys_details_t *rmp = NULL;
/* *INDENT-OFF* */
- pool_foreach (key, bfd_main.auth_keys, ({
+ pool_foreach (key, bfd_main.auth_keys) {
rmp = vl_msg_api_alloc (sizeof (*rmp));
clib_memset (rmp, 0, sizeof (*rmp));
rmp->_vl_msg_id = ntohs (VL_API_BFD_AUTH_KEYS_DETAILS);
rmp->auth_type = key->auth_type;
rmp->use_count = clib_host_to_net_u32 (key->use_count);
vl_api_send_msg (reg, (u8 *)rmp);
- }));
+ }
/* *INDENT-ON* */
}
u8 *s = format (NULL, "%=10s %=25s %=10s\n", "Configuration Key ID",
"Type", "Use Count");
/* *INDENT-OFF* */
- pool_foreach (key, bm->auth_keys, {
+ pool_foreach (key, bm->auth_keys) {
s = format (s, "%10u %-25s %10u\n", key->conf_key_id,
bfd_auth_type_str (key->auth_type), key->use_count);
- });
+ }
/* *INDENT-ON* */
vlib_cli_output (vm, "%v\n", s);
vec_free (s);
u8 *s = format (NULL, "%=10s %=32s %=20s %=20s\n", "Index", "Property",
"Local value", "Remote value");
/* *INDENT-OFF* */
- pool_foreach (bs, bm->sessions, {
+ pool_foreach (bs, bm->sessions) {
s = format (s, "%U", format_bfd_session_cli, vm, bs);
- });
+ }
/* *INDENT-ON* */
vlib_cli_output (vm, "%v", s);
vec_free (s);
if (!is_create)
{
bfd_session_t *bs;
- pool_foreach (bs, bfd_udp_main.bfd_main->sessions,
- {
- if (bs->transport != BFD_TRANSPORT_UDP4 &&
- bs->transport != BFD_TRANSPORT_UDP6)
- {
- continue;}
- if (bs->udp.key.sw_if_index != sw_if_index)
- {
- continue;}
- vec_add1 (to_be_freed, bs);}
- );
+ pool_foreach (bs, bfd_udp_main.bfd_main->sessions)
+ {
+ if (bs->transport != BFD_TRANSPORT_UDP4 &&
+ bs->transport != BFD_TRANSPORT_UDP6)
+ {
+ continue;
+ }
+ if (bs->udp.key.sw_if_index != sw_if_index)
+ {
+ continue;
+ }
+ vec_add1 (to_be_freed, bs);
+ }
}
bfd_session_t **bs;
vec_foreach (bs, to_be_freed)
if (!reg)
return;
- pool_foreach(bt, bier_table_pool,
- ({
+ pool_foreach (bt, bier_table_pool)
+ {
/*
* skip the ecmp tables.
*/
{
send_bier_table_details(reg, mp->context, bt);
}
- }));
+ }
}
static void
if (!reg)
return;
- pool_foreach(bi, bier_imp_pool,
- ({
+ pool_foreach (bi, bier_imp_pool)
+ {
send_bier_imp_details(reg, mp->context, bi);
- }));
+ }
}
static void
if (!reg)
return;
- pool_foreach(bdt, bier_disp_table_pool,
- ({
+ pool_foreach (bdt, bier_disp_table_pool)
+ {
send_bier_disp_table_details(reg, mp->context, bdt);
- }));
+ }
}
static void
if (INDEX_INVALID == bdti)
{
- pool_foreach(bdt, bier_disp_table_pool,
- ({
+ pool_foreach (bdt, bier_disp_table_pool)
+ {
vlib_cli_output(vm, "%U", format_bier_disp_table,
bier_disp_table_get_index(bdt),
0, BIER_SHOW_BRIEF);
- }));
+ }
}
else
{
if (INDEX_INVALID == bfmi)
{
- pool_foreach(bfm, bier_fmask_pool,
- ({
+ pool_foreach (bfm, bier_fmask_pool)
+ {
vlib_cli_output (vm, "[@%d] %U",
bier_fmask_get_index(bfm),
format_bier_fmask, bier_fmask_get_index(bfm), 0);
- }));
+ }
}
else
{
if (INDEX_INVALID == bii)
{
- pool_foreach(bi, bier_imp_pool,
- ({
+ pool_foreach (bi, bier_imp_pool)
+ {
vlib_cli_output(vm, "%U", format_bier_imp,
bier_imp_get_index(bi),
1,
BIER_SHOW_BRIEF);
- }));
+ }
}
else
{
{
int ii;
- pool_foreach_index(ii, bier_table_pool,
- ({
+ pool_foreach_index (ii, bier_table_pool)
+ {
vlib_cli_output (vm, "%U", format_bier_table, ii, flags);
- }));
+ }
}
}
bond_interface_details_t *bondif = NULL;
/* *INDENT-OFF* */
- pool_foreach (bif, bm->interfaces,
+ pool_foreach (bif, bm->interfaces) {
vec_add2(r_bondifs, bondif, 1);
clib_memset (bondif, 0, sizeof (*bondif));
bondif->id = bif->id;
bondif->numa_only = bif->numa_only;
bondif->active_members = vec_len (bif->active_members);
bondif->members = vec_len (bif->members);
- );
+ }
/* *INDENT-ON* */
*out_bondifs = r_bondifs;
"load balance", "active members", "members");
/* *INDENT-OFF* */
- pool_foreach (bif, bm->interfaces,
- ({
+ pool_foreach (bif, bm->interfaces)
+ {
vlib_cli_output (vm, "%-16U %-12d %-13U %-13U %-14u %u",
format_bond_interface_name, bif->dev_instance,
bif->sw_if_index, format_bond_mode, bif->mode,
format_bond_load_balance, bif->lb,
vec_len (bif->active_members), vec_len (bif->members));
- }));
+ }
/* *INDENT-ON* */
}
u32 *sw_if_index;
/* *INDENT-OFF* */
- pool_foreach (bif, bm->interfaces,
- ({
+ pool_foreach (bif, bm->interfaces)
+ {
vlib_cli_output (vm, "%U", format_bond_interface_name, bif->dev_instance);
vlib_cli_output (vm, " mode: %U",
format_bond_mode, bif->mode);
vlib_cli_output (vm, " interface id: %d", bif->id);
vlib_cli_output (vm, " sw_if_index: %d", bif->sw_if_index);
vlib_cli_output (vm, " hw_if_index: %d", bif->hw_if_index);
- }));
+ }
/* *INDENT-ON* */
}
u32 count;
/* *INDENT-OFF* */
- pool_foreach (t, cm->tables,
- ({
+ pool_foreach (t, cm->tables)
+ {
vec_add1 (table_ids, ntohl(t - cm->tables));
- }));
+ }
/* *INDENT-ON* */
count = vec_len (table_ids);
vnet_classify_table_t *t;
/* *INDENT-OFF* */
- pool_foreach (t, cm->tables,
- ({
+ pool_foreach (t, cm->tables)
+ {
if (table_id == t - cm->tables)
{
rmp = vl_msg_api_alloc_as_if_client
rmp->retval = 0;
break;
}
- }));
+ }
/* *INDENT-ON* */
if (rmp == 0)
return;
/* *INDENT-OFF* */
- pool_foreach (t, cm->tables,
- ({
+ pool_foreach (t, cm->tables)
+ {
if (table_id == t - cm->tables)
{
vnet_classify_bucket_t * b;
}
break;
}
- }));
+ }
/* *INDENT-ON* */
}
}
/* *INDENT-OFF* */
- pool_foreach (t, cm->tables,
- ({
+ pool_foreach (t, cm->tables)
+ {
if (match_index == ~0 || (match_index == t - cm->tables))
vec_add1 (indices, t - cm->tables);
- }));
+ }
/* *INDENT-ON* */
if (vec_len (indices))
af_packet_if_detail_t *af_packet_if = NULL;
/* *INDENT-OFF* */
- pool_foreach (apif, apm->interfaces,
- ({
+ pool_foreach (apif, apm->interfaces)
+ {
vec_add2 (r_af_packet_ifs, af_packet_if, 1);
af_packet_if->sw_if_index = apif->sw_if_index;
if (apif->host_if_name)
MIN (ARRAY_LEN (af_packet_if->host_if_name) - 1,
strlen ((const char *) apif->host_if_name)));
}
- }));
+ }
/* *INDENT-ON* */
*out_af_packet_ifs = r_af_packet_ifs;
if (vec_len (hw_if_indices) == 0)
{
/* *INDENT-OFF* */
- pool_foreach (vif, mm->interfaces,
+ pool_foreach (vif, mm->interfaces)
vec_add1 (hw_if_indices, vif->hw_if_index);
- );
/* *INDENT-ON* */
}
if (vec_len (hw_if_indices) == 0)
{
/* *INDENT-OFF* */
- pool_foreach (vif, mm->interfaces,
+ pool_foreach (vif, mm->interfaces)
vec_add1 (hw_if_indices, vif->hw_if_index);
- );
/* *INDENT-ON* */
}
tap_interface_details_t *tapid = NULL;
/* *INDENT-OFF* */
- pool_foreach (vif, mm->interfaces,
+ pool_foreach (vif, mm->interfaces) {
if ((vif->type != VIRTIO_IF_TYPE_TAP)
&& (vif->type != VIRTIO_IF_TYPE_TUN))
continue;
clib_memcpy(tapid->host_ip6_addr.as_u8, &vif->host_ip6_addr, 16);
tapid->host_ip6_prefix_len = vif->host_ip6_prefix_len;
tapid->host_mtu_size = vif->host_mtu_size;
- );
+ }
/* *INDENT-ON* */
*out_tapids = r_tapids;
if (vec_len (hw_if_indices) == 0)
{
- pool_foreach (vif, vim->interfaces,
- vec_add1 (hw_if_indices, vif->hw_if_index);
- );
+ pool_foreach (vif, vim->interfaces)
+ vec_add1 (hw_if_indices, vif->hw_if_index);
}
else if (show_device_config)
{
u32 interrupt_count = 0;
/* *INDENT-OFF* */
- pool_foreach (vif, vim->interfaces, ({
+ pool_foreach (vif, vim->interfaces) {
if (vif->pci_addr.as_u32 == args->addr)
{
args->rv = VNET_API_ERROR_ADDRESS_IN_USE;
" PCI address in use");
return;
}
- }));
+ }
/* *INDENT-ON* */
pool_get (vim->interfaces, vif);
case ~0:
/* *INDENT-OFF* */
- pool_foreach (vui, vum->vhost_user_interfaces, {
+ pool_foreach (vui, vum->vhost_user_interfaces) {
next_timeout = timeout;
for (qid = 0; qid < VHOST_VRING_MAX_N / 2; qid += 2)
{
if ((next_timeout < timeout) && (next_timeout > 0.0))
timeout = next_timeout;
}
- });
+ }
/* *INDENT-ON* */
break;
timeout = 3.0;
/* *INDENT-OFF* */
- pool_foreach (vui, vum->vhost_user_interfaces, {
+ pool_foreach (vui, vum->vhost_user_interfaces) {
if (vui->unix_server_index == ~0) { //Nothing to do for server sockets
if (vui->clib_file_index == ~0)
}
}
}
- });
+ }
/* *INDENT-ON* */
}
return 0;
vlib_worker_thread_barrier_sync (vlib_get_main ());
/* *INDENT-OFF* */
- pool_foreach (vui, vum->vhost_user_interfaces, {
+ pool_foreach (vui, vum->vhost_user_interfaces) {
vhost_user_delete_if (vnm, vm, vui->sw_if_index);
- });
+ }
/* *INDENT-ON* */
vlib_worker_thread_barrier_release (vlib_get_main ());
return 0;
if (!out_vuids)
return -1;
- pool_foreach (vui, vum->vhost_user_interfaces,
- vec_add1 (hw_if_indices, vui->hw_if_index);
- );
+ pool_foreach (vui, vum->vhost_user_interfaces)
+ vec_add1 (hw_if_indices, vui->hw_if_index);
for (i = 0; i < vec_len (hw_if_indices); i++)
{
}
if (vec_len (hw_if_indices) == 0)
{
- pool_foreach (vui, vum->vhost_user_interfaces,
- vec_add1 (hw_if_indices, vui->hw_if_index);
- );
+ pool_foreach (vui, vum->vhost_user_interfaces)
+ vec_add1 (hw_if_indices, vui->hw_if_index);
}
vlib_cli_output (vm, "Virtio vhost-user interfaces");
vlib_cli_output (vm, "Global:\n coalesce frames %d time %e",
if (vum->dont_dump_vhost_user_memory)
{
- pool_foreach (vui, vum->vhost_user_interfaces,
- unmap_all_mem_regions (vui);
- );
+ pool_foreach (vui, vum->vhost_user_interfaces)
+ unmap_all_mem_regions (vui);
}
}
if (!reg)
return;
- pool_foreach (vif, vmx->interfaces, (
- {
- if (vif->type == VIRTIO_IF_TYPE_PCI)
- {
- virtio_pci_send_sw_interface_details
- (am, reg, vif, mp->context);}
- }
- ));
+ pool_foreach (vif, vmx->interfaces)
+ {
+ if (vif->type == VIRTIO_IF_TYPE_PCI)
+ {
+ virtio_pci_send_sw_interface_details (am, reg, vif, mp->context);
+ }
+ }
}
#define vl_msg_name_crc_list
case ~0:
/* *INDENT-OFF* */
- pool_foreach (vif, vim->interfaces, {
+ pool_foreach (vif, vim->interfaces) {
if (vif->packet_coalesce || vif->packet_buffering)
{
virtio_vring_t *vring;
RX_QUEUE_ACCESS (vring->queue_id));
}
}
- });
+ }
/* *INDENT-ON* */
break;
{
load_balance_t *lb;
- pool_foreach(lb, load_balance_pool,
- ({
+ pool_foreach (lb, load_balance_pool)
+ {
vlib_cli_output (vm, "%U", format_load_balance,
load_balance_get_index(lb),
LOAD_BALANCE_FORMAT_NONE);
- }));
+ }
}
return 0;
{
load_balance_map_t *lbm;
- pool_foreach(lbm, load_balance_map_pool,
- ({
+ pool_foreach (lbm, load_balance_map_pool)
+ {
vlib_cli_output (vm, "%U", format_load_balance_map,
load_balance_map_get_index(lbm), 0);
- }));
+ }
}
return 0;
{
lookup_dpo_t *lkd;
- pool_foreach(lkd, lookup_dpo_pool,
- ({
+ pool_foreach (lkd, lookup_dpo_pool)
+ {
vlib_cli_output (vm, "[@%d] %U",
lookup_dpo_get_index(lkd),
format_lookup_dpo,
lookup_dpo_get_index(lkd));
- }));
+ }
}
return 0;
{
replicate_t *rep;
- pool_foreach(rep, replicate_pool,
- ({
+ pool_foreach (rep, replicate_pool)
+ {
vlib_cli_output (vm, "%U", format_replicate,
replicate_get_index(rep),
REPLICATE_FORMAT_NONE);
- }));
+ }
}
return 0;
pool_len(fib_entry_pool),
sizeof(fib_entry_t));
- pool_foreach(entry, fib_entry_pool,
- ({
+ pool_foreach (entry, fib_entry_pool)
+ {
n_srcs += vec_len(entry->fe_srcs);
vec_foreach(esrc, entry->fe_srcs)
{
n_exts += fib_path_ext_list_length(&esrc->fes_path_exts);
}
- }));
+ }
fib_show_memory_usage("Entry Source",
n_srcs, n_srcs, sizeof(fib_entry_src_t));
fib_node_index_t *fei, *feis = NULL;
fib_entry_t *fib_entry;
- pool_foreach (fib_entry, fib_entry_pool,
- ({
+ pool_foreach (fib_entry, fib_entry_pool)
+ {
if (fib_entry->fe_fib_index == fib_table->ft_index)
vec_add1 (feis, fib_entry_get_index(fib_entry));
- }));
+ }
if (vec_len(feis))
{
* show all
*/
vlib_cli_output (vm, "FIB Entries:");
- pool_foreach_index(fei, fib_entry_pool,
- ({
+ pool_foreach_index (fei, fib_entry_pool)
+ {
vlib_cli_output (vm, "%d@%U",
fei,
format_fib_entry, fei,
FIB_ENTRY_FORMAT_BRIEF);
- }));
+ }
}
return (NULL);
* show all
*/
vlib_cli_output (vm, "FIB Entry Delegates:");
- pool_foreach_index(fedi, fib_entry_delegate_pool,
- ({
+ pool_foreach_index (fedi, fib_entry_delegate_pool)
+ {
vlib_cli_output (vm, "%d@%U",
fedi,
format_fib_entry_delegate, fedi);
- }));
+ }
}
return (NULL);
else
{
vlib_cli_output (vm, "FIB Paths");
- pool_foreach_index (pi, fib_path_pool,
- ({
+ pool_foreach_index (pi, fib_path_pool)
+ {
vlib_cli_output (vm, "%U", format_fib_path, pi, 0,
FIB_PATH_FORMAT_FLAGS_NONE);
- }));
+ }
}
return (NULL);
* show all
*/
vlib_cli_output (vm, "FIB Path Lists");
- pool_foreach_index (pli, fib_path_list_pool,
- ({
+ pool_foreach_index (pli, fib_path_list_pool)
+ {
vlib_cli_output (vm, "%U", format_fib_path_list, pli, 0);
- }));
+ }
}
return (NULL);
}
* show all
*/
vlib_cli_output (vm, "FIB uRPF Entries:");
- pool_foreach_index(ui, fib_urpf_list_pool,
- ({
+ pool_foreach_index (ui, fib_urpf_list_pool)
+ {
vlib_cli_output (vm, "%d@%U",
ui,
format_fib_urpf_list, ui);
- }));
+ }
}
return (NULL);
break;
}
- pool_foreach (fib_table, im4->fibs,
- ({
+ pool_foreach (fib_table, im4->fibs)
+ {
ip4_fib_t *fib = pool_elt_at_index(im4->v4_fibs, fib_table->ft_index);
fib_source_t source;
u8 *s = NULL;
ip4_fib_table_show_one(fib, vm, &matching_address,
matching_mask, detail);
}
- }));
+ }
if (memory)
{
return (NULL);
}
- pool_foreach (fib_table, im6->fibs,
- ({
+ pool_foreach (fib_table, im6->fibs)
+ {
fib_source_t source;
u8 *s = NULL;
{
ip6_fib_table_show_one(fib, vm, &matching_address, mask_len, detail);
}
- }));
+ }
return 0;
}
break;
}
- pool_foreach (fib_table, mpls_main.fibs,
- ({
+ pool_foreach (fib_table, mpls_main.fibs)
+ {
fib_source_t source;
u8 *s = NULL;
{
mpls_fib_table_show_one(mpls_fib_get(fib_table->ft_index), label, vm);
}
- }));
+ }
return 0;
}
no_args:
/* *INDENT-OFF* */
- pool_foreach (f, fm->global_flow_pool,
+ pool_foreach (f, fm->global_flow_pool)
{
vlib_cli_output (vm, "%U\n", format_flow, f);
- });
+ }
/* *INDENT-ON* */
return 0;
if (~0 == sw_if_index)
{
/* *INDENT-OFF* */
- pool_foreach (t, gm->tunnels,
- ({
+ pool_foreach (t, gm->tunnels)
+ {
send_gre_tunnel_details(t, mp);
- }));
+ }
/* *INDENT-ON* */
}
if (~0 == ti)
{
/* *INDENT-OFF* */
- pool_foreach (t, gm->tunnels,
- ({
+ pool_foreach (t, gm->tunnels)
+ {
vlib_cli_output (vm, "%U", format_gre_tunnel, t);
- }));
+ }
/* *INDENT-ON* */
}
else
/* Serialize hardware interface classes since they may have changed.
Must do this before sending up/down flags. */
/* *INDENT-OFF* */
- pool_foreach (hif, im->hw_interfaces, ({
+ pool_foreach (hif, im->hw_interfaces) {
vnet_hw_interface_class_t * hw_class = vnet_get_hw_interface_class (vnm, hif->hw_class_index);
serialize_cstring (m, hw_class->name);
- }));
+ }
/* *INDENT-ON* */
/* Send sw/hw interface state when non-zero. */
/* *INDENT-OFF* */
- pool_foreach (sif, im->sw_interfaces, ({
+ pool_foreach (sif, im->sw_interfaces) {
if (sif->flags != 0)
{
vec_add2 (sts, st, 1);
st->sw_hw_if_index = sif->sw_if_index;
st->flags = sif->flags;
}
- }));
+ }
/* *INDENT-ON* */
vec_serialize (m, sts, serialize_vec_vnet_sw_hw_interface_state);
_vec_len (sts) = 0;
/* *INDENT-OFF* */
- pool_foreach (hif, im->hw_interfaces, ({
+ pool_foreach (hif, im->hw_interfaces) {
if (hif->flags != 0)
{
vec_add2 (sts, st, 1);
st->sw_hw_if_index = hif->hw_if_index;
st->flags = vnet_hw_interface_flags_to_sw(hif->flags);
}
- }));
+ }
/* *INDENT-ON* */
vec_serialize (m, sts, serialize_vec_vnet_sw_hw_interface_state);
clib_error_t *error;
/* *INDENT-OFF* */
- pool_foreach (hif, im->hw_interfaces, ({
+ pool_foreach (hif, im->hw_interfaces) {
unserialize_cstring (m, &class_name);
p = hash_get_mem (im->hw_interface_class_by_name, class_name);
if (p)
if (error)
clib_error_report (error);
vec_free (class_name);
- }));
+ }
/* *INDENT-ON* */
}
im = &vnm->interface_main;
/* *INDENT-OFF* */
- pool_foreach (hi, im->hw_interfaces,
- ({
+ pool_foreach (hi, im->hw_interfaces)
+ {
if (WALK_STOP == fn(vnm, hi->hw_if_index, ctx))
break;
- }));
+ }
/* *INDENT-ON* */
}
im = &vnm->interface_main;
/* *INDENT-OFF* */
- pool_foreach (si, im->sw_interfaces,
+ pool_foreach (si, im->sw_interfaces)
{
if (WALK_STOP == fn (vnm, si, ctx))
break;
- });
+ }
/* *INDENT-ON* */
}
char *strcasestr (char *, char *); /* lnx hdr file botch */
/* *INDENT-OFF* */
- pool_foreach (swif, im->sw_interfaces,
- ({
+ pool_foreach (swif, im->sw_interfaces)
+ {
if (!vnet_swif_is_api_visible (swif))
continue;
vec_reset_length(name);
continue;
send_sw_interface_details (am, rp, swif, name, mp->context);
- }));
+ }
/* *INDENT-ON* */
vec_free (name);
continue;
/* *INDENT-OFF* */
- pool_foreach(reg, vam->interface_events_registrations,
- ({
+ pool_foreach (reg, vam->interface_events_registrations)
+ {
vl_reg = vl_api_client_index_to_registration (reg->client_index);
if (vl_reg)
send_sw_interface_event (vam, reg, vl_reg, i, event_by_sw_if_index[i]);
- }));
+ }
/* *INDENT-ON* */
}
vec_reset_length (event_by_sw_if_index);
/* Gather interfaces. */
if (vec_len (hw_if_indices) == 0)
- pool_foreach (hi, im->hw_interfaces,
- vec_add1 (hw_if_indices, hi - im->hw_interfaces));
+ pool_foreach (hi, im->hw_interfaces)
+ vec_add1 (hw_if_indices, hi - im->hw_interfaces);
if (verbose < 0)
verbose = 1; /* default to verbose (except bond) */
vec_new (vnet_sw_interface_t, pool_elts (im->sw_interfaces));
_vec_len (sorted_sis) = 0;
/* *INDENT-OFF* */
- pool_foreach (si, im->sw_interfaces,
- ({
+ pool_foreach (si, im->sw_interfaces)
+ {
int visible = vnet_swif_is_api_visible (si);
if (visible)
- vec_add1 (sorted_sis, si[0]);}
- ));
+ vec_add1 (sorted_sis, si[0]);
+ }
/* *INDENT-ON* */
/* Sort by name. */
vec_sort_with_function (sorted_sis, sw_interface_name_compare);
vec_new (vnet_sw_interface_t, pool_elts (im->sw_interfaces));
_vec_len (sorted_sis) = 0;
/* *INDENT-OFF* */
- pool_foreach (si, im->sw_interfaces,
- ({
+ pool_foreach (si, im->sw_interfaces)
+ {
int visible = vnet_swif_is_api_visible (si);
if (visible)
- vec_add1 (sorted_sis, si[0]);}
- ));
+ vec_add1 (sorted_sis, si[0]);
+ }
/* *INDENT-ON* */
/* Sort by name. */
vec_sort_with_function (sorted_sis, sw_interface_name_compare);
ip_neighbor_t *ipn;
/* *INDENT-OFF* */
- pool_foreach (ipn, ip_neighbor_pool,
- ({
+ pool_foreach (ipn, ip_neighbor_pool)
+ {
if ((sw_if_index == ~0 ||
ipn->ipn_key->ipnk_sw_if_index == sw_if_index) &&
(N_AF == af ||
ip_neighbor_get_af(ipn) == af))
vec_add1 (ipnis, ip_neighbor_get_index(ipn));
- }));
+ }
/* *INDENT-ON* */
sw_if_index);
/* *INDENT-OFF* */
- pool_foreach (ipn, ip_neighbor_pool,
- ({
+ pool_foreach (ipn, ip_neighbor_pool)
+ {
if (ipn->ipn_key->ipnk_sw_if_index == sw_if_index)
adj_nbr_walk_nh (ipn->ipn_key->ipnk_sw_if_index,
ip_address_family_to_fib_proto(ip_neighbor_get_af(ipn)),
&ip_addr_46(&ipn->ipn_key->ipnk_ip),
ip_neighbor_mk_complete_walk,
ipn);
- }));
+ }
/* *INDENT-ON* */
adj_glean_update_rewrite_itf (sw_if_index);
sw_if_index, format_ip_address_family, af);
/* *INDENT-OFF* */
- pool_foreach (ipn, ip_neighbor_pool,
- ({
+ pool_foreach (ipn, ip_neighbor_pool)
+ {
if (ip_neighbor_get_af(ipn) == af &&
ipn->ipn_key->ipnk_sw_if_index == sw_if_index)
vec_add1 (ipnis, ipn - ip_neighbor_pool);
- }));
+ }
/* *INDENT-ON* */
vec_foreach (ipni, ipnis)
sw_if_index, format_ip_address_family, af);
/* *INDENT-OFF* */
- pool_foreach (ipn, ip_neighbor_pool,
- ({
+ pool_foreach (ipn, ip_neighbor_pool)
+ {
if (ip_neighbor_get_af(ipn) == af &&
ipn->ipn_key->ipnk_sw_if_index == sw_if_index &&
ip_neighbor_is_dynamic (ipn))
vec_add1 (ipnis, ipn - ip_neighbor_pool);
- }));
+ }
/* *INDENT-ON* */
vec_foreach (ipni, ipnis) ip_neighbor_destroy (ip_neighbor_get (*ipni));
ip_interface_address_t *ia;
vnet_sw_interface_t *sif;
- pool_foreach(sif, vnm->interface_main.sw_interfaces,
- ({
+ pool_foreach (sif, vnm->interface_main.sw_interfaces)
+ {
if (im->fib_index_by_sw_if_index[sw_if_index] ==
im->fib_index_by_sw_if_index[sif->sw_if_index])
{
}
}));
}
- }));
+ }
}
/* *INDENT-ON* */
ip_interface_address_t *ia;
vnet_sw_interface_t *sif;
- pool_foreach(sif, vnm->interface_main.sw_interfaces,
- ({
+ pool_foreach (sif, vnm->interface_main.sw_interfaces)
+ {
if (im->fib_index_by_sw_if_index[sw_if_index] ==
im->fib_index_by_sw_if_index[sif->sw_if_index])
{
}
}));
}
- }));
+ }
}
/* *INDENT-ON* */
return;
/* *INDENT-OFF* */
- pool_foreach (fib_table, ip4_main.fibs,
- ({
+ pool_foreach (fib_table, ip4_main.fibs)
+ {
send_ip_table_details(am, reg, mp->context, fib_table);
- }));
- pool_foreach (fib_table, ip6_main.fibs,
- ({
+ }
+ pool_foreach (fib_table, ip6_main.fibs)
+ {
/* don't send link locals */
if (fib_table->ft_flags & FIB_TABLE_FLAG_IP6_LL)
continue;
send_ip_table_details(am, reg, mp->context, fib_table);
- }));
+ }
/* *INDENT-ON* */
}
return;
/* *INDENT-OFF* */
- pool_foreach (mfib_table, ip4_main.mfibs,
- ({
+ pool_foreach (mfib_table, ip4_main.mfibs)
+ {
send_ip_mtable_details (reg, mp->context, mfib_table);
- }));
- pool_foreach (mfib_table, ip6_main.mfibs,
- ({
+ }
+ pool_foreach (mfib_table, ip6_main.mfibs)
+ {
send_ip_mtable_details (reg, mp->context, mfib_table);
- }));
+ }
/* *INDENT-ON* */
}
else
{
/* *INDENT-OFF* */
- pool_foreach (si, im->sw_interfaces,
- ({
+ pool_foreach (si, im->sw_interfaces)
+ {
if ((si->flags & VNET_SW_INTERFACE_FLAG_UNNUMBERED))
{
send_ip_unnumbered_details(am, reg,
si->unnumbered_sw_if_index,
mp->context);
}
- }));
+ }
/* *INDENT-ON* */
}
sorted_sis = vec_new (vnet_sw_interface_t, pool_elts (im->sw_interfaces));
_vec_len (sorted_sis) = 0;
/* *INDENT-OFF* */
- pool_foreach (si, im->sw_interfaces,
- ({
+ pool_foreach (si, im->sw_interfaces)
+ {
vec_add1 (sorted_sis, si[0]);
- }));
+ }
/* *INDENT-ON* */
vec_foreach (si, sorted_sis)
/* Shut down interfaces in this FIB / clean out intfc routes */
/* *INDENT-OFF* */
- pool_foreach (si, im->sw_interfaces,
- ({
+ pool_foreach (si, im->sw_interfaces)
+ {
if (fib_index == fib_table_get_index_for_sw_if_index (fproto,
si->sw_if_index))
{
flags &= ~VNET_SW_INTERFACE_FLAG_ADMIN_UP;
vnet_sw_interface_set_flags (vnm, si->sw_if_index, flags);
}
- }));
+ }
/* *INDENT-ON* */
fib_table_flush (fib_index, fproto, FIB_SOURCE_API);
};
/* *INDENT-OFF* */
- pool_foreach (fib_table, ip4_main.fibs,
- ({
+ pool_foreach (fib_table, ip4_main.fibs)
+ {
fib_table_walk(fib_table->ft_index,
FIB_PROTOCOL_IP4,
ip_container_proxy_fib_table_walk,
&wctx);
- }));
- pool_foreach (fib_table, ip6_main.fibs,
- ({
+ }
+ pool_foreach (fib_table, ip6_main.fibs)
+ {
fib_table_walk(fib_table->ft_index,
FIB_PROTOCOL_IP6,
ip_container_proxy_fib_table_walk,
&wctx);
- }));
+ }
/* *INDENT-ON* */
}
vec_reset_length (pool_indexes_to_free);
/* *INDENT-OFF* */
- pool_foreach_index (index, rt->pool, ({
+ pool_foreach_index (index, rt->pool) {
reass = pool_elt_at_index (rt->pool, index);
if (now > reass->last_heard + rm->timeout)
{
vec_add1 (pool_indexes_to_free, index);
}
- }));
+ }
/* *INDENT-ON* */
int *i;
/* *INDENT-OFF* */
if (details)
{
/* *INDENT-OFF* */
- pool_foreach (reass, rt->pool, {
+ pool_foreach (reass, rt->pool) {
vlib_cli_output (vm, "%U", format_ip4_reass, vm, reass);
- });
+ }
/* *INDENT-ON* */
}
sum_reass_n += rt->reass_n;
vec_reset_length (pool_indexes_to_free);
/* *INDENT-OFF* */
- pool_foreach_index (index, rt->pool, ({
+ pool_foreach_index (index, rt->pool) {
reass = pool_elt_at_index (rt->pool, index);
if (now > reass->last_heard + rm->timeout)
{
vec_add1 (pool_indexes_to_free, index);
}
- }));
+ }
/* *INDENT-ON* */
int *i;
/* *INDENT-OFF* */
if (details)
{
/* *INDENT-OFF* */
- pool_foreach (reass, rt->pool, {
+ pool_foreach (reass, rt->pool) {
vlib_cli_output (vm, "%U", format_ip4_sv_reass, vm, reass);
- });
+ }
/* *INDENT-ON* */
}
sum_reass_n += rt->reass_n;
vec_reset_length (pool_indexes_to_free);
/* *INDENT-OFF* */
- pool_foreach_index (index, rt->pool, ({
+ pool_foreach_index (index, rt->pool) {
reass = pool_elt_at_index (rt->pool, index);
if (now > reass->last_heard + rm->timeout)
{
vec_add1 (pool_indexes_to_free, index);
}
- }));
+ }
/* *INDENT-ON* */
int *i;
/* *INDENT-OFF* */
if (details)
{
/* *INDENT-OFF* */
- pool_foreach (reass, rt->pool, {
+ pool_foreach (reass, rt->pool) {
vlib_cli_output (vm, "%U", format_ip6_full_reass, vm, reass);
- });
+ }
/* *INDENT-ON* */
}
sum_reass_n += rt->reass_n;
vec_reset_length (pool_indexes_to_free);
/* *INDENT-OFF* */
- pool_foreach_index (index, rt->pool, ({
+ pool_foreach_index (index, rt->pool) {
reass = pool_elt_at_index (rt->pool, index);
if (now > reass->last_heard + rm->timeout)
{
vec_add1 (pool_indexes_to_free, index);
}
- }));
+ }
/* *INDENT-ON* */
int *i;
/* *INDENT-OFF* */
if (details)
{
/* *INDENT-OFF* */
- pool_foreach (reass, rt->pool, {
+ pool_foreach (reass, rt->pool) {
vlib_cli_output (vm, "%U", format_ip6_sv_reass, vm, reass);
- });
+ }
/* *INDENT-ON* */
}
sum_reass_n += rt->reass_n;
rh0->icmp.checksum = 0;
/* *INDENT-OFF* */
- pool_foreach (m, imd->mldp_group_pool,
- ({
+ pool_foreach (m, imd->mldp_group_pool)
+ {
rr.type = m->type;
rr.aux_data_len_u32s = 0;
rr.num_sources = clib_host_to_net_u16 (m->num_sources);
}
payload_length += sizeof( icmp6_multicast_address_record_t);
- }));
+ }
/* *INDENT-ON* */
rh0->rsvd = 0;
/* Interface ip6 radv info list */
/* *INDENT-OFF* */
- pool_foreach (imd, ip6_mld_pool,
- ({
+ pool_foreach (imd, ip6_mld_pool)
+ {
if (!vnet_sw_interface_is_admin_up (vnm, imd->sw_if_index))
{
imd->all_routers_mcast = 0;
ip6_neighbor_send_mldpv2_report(imd->sw_if_index);
imd->all_routers_mcast = 1;
}
- }));
+ }
/* *INDENT-ON* */
return 0;
s = format (s, "%UJoined group address(es):\n", format_white_space, indent);
/* *INDENT-OFF* */
- pool_foreach (m, imd->mldp_group_pool,
- ({
+ pool_foreach (m, imd->mldp_group_pool)
+ {
s = format (s, "%U%U\n",
format_white_space, indent+2,
format_ip6_address,
&m->mcast_address);
- }));
+ }
/* *INDENT-ON* */
return (s);
return;
/* *INDENT-OFF* */
- pool_foreach (fib_table, im6->fibs,
- ({
+ pool_foreach (fib_table, im6->fibs)
+ {
fib_table_walk(fib_table->ft_index,
FIB_PROTOCOL_IP6,
api_ip6nd_proxy_fib_table_walk,
&ctx);
- }));
+ }
/* *INDENT-ON* */
vec_sort_with_function (ctx.indices, fib_entry_cmp_for_sort);
/* *INDENT-OFF* */
vpe_client_registration_t *rp;
- pool_foreach(rp, vpe_api_main.ip6_ra_events_registrations,
- ({
+ pool_foreach (rp, vpe_api_main.ip6_ra_events_registrations)
+ {
vl_api_registration_t *vl_reg;
vl_reg = vl_api_client_index_to_registration (rp->client_index);
vl_api_send_msg (vl_reg, (u8 *) event);
}
- }));
+ }
/* *INDENT-ON* */
}
ip6_radv_prefix_t *pr_info;
/* *INDENT-OFF* */
- pool_foreach (pr_info, radv_info->adv_prefixes_pool,
- ({
+ pool_foreach (pr_info, radv_info->adv_prefixes_pool)
+ {
if(pr_info->enabled &&
(!pr_info->decrement_lifetime_flag
|| (pr_info->pref_lifetime_expires >0)))
}
}
- }));
+ }
/* *INDENT-ON* */
/* add additional options before here */
/* look for matching prefix - if we our advertising it, it better be consistant */
/* *INDENT-OFF* */
- pool_foreach (pr_info, radv_info->adv_prefixes_pool,
- ({
+ pool_foreach (pr_info, radv_info->adv_prefixes_pool)
+ {
ip6_address_t mask;
ip6_address_mask_from_width(&mask, pr_info->prefix_len);
}
}
break;
- }));
+ }
/* *INDENT-ON* */
break;
}
{
due_time = current_time + 1e9;
/* *INDENT-OFF* */
- pool_foreach (radv_info, ip6_ra_pool,
- ({
+ pool_foreach (radv_info, ip6_ra_pool)
+ {
if (check_send_rs (vm, radv_info, current_time, &dt)
&& (dt < due_time))
due_time = dt;
- }));
+ }
/* *INDENT-ON* */
current_time = vlib_time_now (vm);
}
vec_reset_length (radv_indices);
/* *INDENT-OFF* */
- pool_foreach (radv_info, ip6_ra_pool,
- ({
+ pool_foreach (radv_info, ip6_ra_pool)
+ {
vec_add1 (radv_indices, radv_info - ip6_ra_pool);
- }));
+ }
/* *INDENT-ON* */
/*
continue;
/* *INDENT-OFF* */
- pool_foreach (this_prefix, radv_info->adv_prefixes_pool,
- ({
+ pool_foreach (this_prefix, radv_info->adv_prefixes_pool)
+ {
if (this_prefix->prefix_len == prefix_len
&& ip6_address_is_equal_masked (&this_prefix->prefix, address,
&mask))
if (rv != 0)
clib_warning ("ip6_neighbor_ra_prefix returned %d", rv);
}
- }));
+ }
/* *INDENT-ON*/
}
}
/* Interface ip6 radv info list */
/* *INDENT-OFF* */
- pool_foreach (radv_info, ip6_ra_pool,
- ({
+ pool_foreach (radv_info, ip6_ra_pool)
+ {
if( !vnet_sw_interface_is_admin_up (vnm, radv_info->sw_if_index))
{
radv_info->initial_adverts_sent = radv_info->initial_adverts_count-1;
f = 0;
}
}
- }));
+ }
/* *INDENT-ON* */
if (f)
indent += 2;
/* *INDENT-OFF* */
- pool_foreach (p, radv_info->adv_prefixes_pool,
- ({
+ pool_foreach (p, radv_info->adv_prefixes_pool)
+ {
s = format (s, "%Uprefix %U, length %d\n",
format_white_space, indent+2,
format_ip6_address, &p->prefix, p->prefix_len);
- }));
+ }
/* *INDENT-ON* */
s = format (s, "%UMTU is %d\n",
router_lifetime_in_sec = r->router_lifetime_in_sec;
u8 route_already_present = 0;
/* *INDENT-OFF* */
- pool_foreach (default_route, rm->default_route_pool,
- ({
+ pool_foreach (default_route, rm->default_route_pool)
+ {
if (default_route->sw_if_index != sw_if_index)
;
else if (0 != memcmp (&default_route->router_address,
route_already_present = 1;
goto default_route_pool_foreach_out;
}
- }));
+ }
/* *INDENT-ON* */
default_route_pool_foreach_out:
u8 address_already_present = 0;
/* *INDENT-OFF* */
- pool_foreach (slaac_address, rm->slaac_address_pool,
- ({
+ pool_foreach (slaac_address, rm->slaac_address_pool)
+ {
if (slaac_address->sw_if_index != sw_if_index)
;
else if (slaac_address->address_length != prefix_length)
address_already_present = 1;
goto slaac_address_pool_foreach_out;
}
- }));
+ }
/* *INDENT-ON* */
slaac_address_pool_foreach_out:
* as we are removing elements inside the loop body
*/
/* *INDENT-OFF* */
- pool_foreach_index (index, rm->slaac_address_pool,
- ({
+ pool_foreach_index (index, rm->slaac_address_pool)
+ {
slaac_address = pool_elt_at_index(rm->slaac_address_pool, index);
if (slaac_address->due_time > current_time)
{
/* make sure ip6 stays enabled */
ip6_link_enable (sw_if_index, NULL);
}
- }));
- pool_foreach_index (index, rm->default_route_pool,
- ({
+ }
+ pool_foreach_index (index, rm->default_route_pool)
+ {
default_route = pool_elt_at_index(rm->default_route_pool, index);
if (default_route->due_time > current_time)
{
}
else
remove_default_route (vm, default_route);
- }));
+ }
/* *INDENT-ON* */
current_time = vlib_time_now (vm);
}
if (if_config->enabled && !enable)
{
/* *INDENT-OFF* */
- pool_foreach (slaac_address, rm->slaac_address_pool,
- ({
+ pool_foreach (slaac_address, rm->slaac_address_pool)
+ {
remove_slaac_address (vm, slaac_address);
- }));
+ }
/* *INDENT-ON* */
}
if (if_config->install_default_routes && !install_default_routes)
{
/* *INDENT-OFF* */
- pool_foreach (default_route, rm->default_route_pool,
- ({
+ pool_foreach (default_route, rm->default_route_pool)
+ {
remove_default_route (vm, default_route);
- }));
+ }
/* *INDENT-ON* */
}
if (sw_if_index == ~0)
{
/* *INDENT-OFF* */
- pool_foreach(t, im->tunnels,
- ({
+ pool_foreach (t, im->tunnels)
+ {
send_ipip_tunnel_details(t, mp);
- }));
+ }
/* *INDENT-ON* */
}
else
if (ti == ~0)
{
/* *INDENT-OFF* */
- pool_foreach(t, gm->tunnels,
- ({vlib_cli_output(vm, "%U", format_ipip_tunnel, t); }));
+ pool_foreach (t, gm->tunnels)
+ {vlib_cli_output(vm, "%U", format_ipip_tunnel, t); }
/* *INDENT-ON* */
}
else
ipsec_sa_t *sa;
/* lock all SAs before change im->async_mode */
- pool_foreach (sa, im->sad, (
- {
- fib_node_lock (&sa->node);
- }));
+ pool_foreach (sa, im->sad)
+ {
+ fib_node_lock (&sa->node);
+ }
im->async_mode = is_enabled;
/* change SA crypto op data before unlock them */
- pool_foreach (sa, im->sad, (
- {
- sa->crypto_op_data = is_enabled ?
- sa->async_op_data.data : sa->sync_op_data.data;
- fib_node_unlock (&sa->node);
- }));
+ pool_foreach (sa, im->sad)
+ {
+ sa->crypto_op_data = is_enabled ?
+ sa->async_op_data.data : sa->sync_op_data.data;
+ fib_node_unlock (&sa->node);
+ }
}
static void
return;
/* *INDENT-OFF* */
- pool_foreach (spd, im->spds, ({
+ pool_foreach (spd, im->spds) {
send_ipsec_spds_details (spd, reg, mp->context);
- }));
+ }
/* *INDENT-ON* */
#else
clib_warning ("unimplemented");
ipsec_ah_backend_t *ab;
ipsec_esp_backend_t *eb;
/* *INDENT-OFF* */
- pool_foreach (ab, im->ah_backends, {
+ pool_foreach (ab, im->ah_backends) {
vl_api_ipsec_backend_details_t *mp = vl_msg_api_alloc (sizeof (*mp));
clib_memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = ntohs (VL_API_IPSEC_BACKEND_DETAILS);
mp->index = ab - im->ah_backends;
mp->active = mp->index == im->ah_current_backend ? 1 : 0;
vl_api_send_msg (rp, (u8 *)mp);
- });
- pool_foreach (eb, im->esp_backends, {
+ }
+ pool_foreach (eb, im->esp_backends) {
vl_api_ipsec_backend_details_t *mp = vl_msg_api_alloc (sizeof (*mp));
clib_memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = ntohs (VL_API_IPSEC_BACKEND_DETAILS);
mp->index = eb - im->esp_backends;
mp->active = mp->index == im->esp_current_backend ? 1 : 0;
vl_api_send_msg (rp, (u8 *)mp);
- });
+ }
/* *INDENT-ON* */
}
u32 sai;
/* *INDENT-OFF* */
- pool_foreach_index (sai, im->sad, ({
+ pool_foreach_index (sai, im->sad) {
vlib_cli_output(vm, "%U", format_ipsec_sa, sai,
(detail ? IPSEC_FORMAT_DETAIL : IPSEC_FORMAT_BRIEF));
- }));
+ }
/* *INDENT-ON* */
}
u32 spdi;
/* *INDENT-OFF* */
- pool_foreach_index (spdi, im->spds, ({
+ pool_foreach_index (spdi, im->spds) {
vlib_cli_output(vm, "%U", format_ipsec_spd, spdi);
- }));
+ }
/* *INDENT-ON* */
}
if (~0 == sai)
{
/* *INDENT-OFF* */
- pool_foreach_index (sai, im->sad, ({
+ pool_foreach_index (sai, im->sad) {
ipsec_sa_clear(sai);
- }));
+ }
/* *INDENT-ON* */
}
else
u8 *s = format (NULL, "%=25s %=25s %=10s\n", "Name", "Index", "Active");
ipsec_ah_backend_t *ab;
/* *INDENT-OFF* */
- pool_foreach (ab, im->ah_backends, {
+ pool_foreach (ab, im->ah_backends) {
s = format (s, "%=25s %=25u %=10s\n", ab->name, ab - im->ah_backends,
ab - im->ah_backends == im->ah_current_backend ? "yes" : "no");
if (verbose) {
n = vlib_get_node (vm, ab->ah6_decrypt_node_index);
s = format (s, " dec6 %s (next %d)\n", n->name, ab->ah6_decrypt_next_index);
}
- });
+ }
/* *INDENT-ON* */
vlib_cli_output (vm, "%v", s);
_vec_len (s) = 0;
s = format (s, "%=25s %=25s %=10s\n", "Name", "Index", "Active");
ipsec_esp_backend_t *eb;
/* *INDENT-OFF* */
- pool_foreach (eb, im->esp_backends, {
+ pool_foreach (eb, im->esp_backends) {
s = format (s, "%=25s %=25u %=10s\n", eb->name, eb - im->esp_backends,
eb - im->esp_backends == im->esp_current_backend ? "yes"
: "no");
n = vlib_get_node (vm, eb->esp6_decrypt_node_index);
s = format (s, " dec6 %s (next %d)\n", n->name, eb->esp6_decrypt_next_index);
}
- });
+ }
/* *INDENT-ON* */
vlib_cli_output (vm, "%v", s);
index_t ii;
/* *INDENT-OFF* */
- pool_foreach_index (ii, ipsec_itf_pool,
- ({
+ pool_foreach_index (ii, ipsec_itf_pool)
+ {
vlib_cli_output (vm, "%U", format_ipsec_itf, ii);
- }));
+ }
/* *INDENT-ON* */
return NULL;
ipsec_sa_t *sa;
/* *INDENT-OFF* */
- pool_foreach (sa, im->sad,
- ({
+ pool_foreach (sa, im->sad)
+ {
if (WALK_CONTINUE != cb(sa, ctx))
break;
- }));
+ }
/* *INDENT-ON* */
}
index_t itpi;
/* *INDENT-OFF* */
- pool_foreach_index(itpi, ipsec_tun_protect_pool,
- ({
+ pool_foreach_index (itpi, ipsec_tun_protect_pool)
+ {
fn (itpi, ctx);
- }));
+ }
/* *INDENT-ON* */
}
return;
/* *INDENT-OFF* */
- pool_foreach (swif, im->sw_interfaces,
- ({
+ pool_foreach (swif, im->sw_interfaces)
+ {
config = vec_elt_at_index (l2im->configs, swif->sw_if_index);
if (l2_input_is_xconnect(config))
send_l2_xconnect_details (reg, mp->context, swif->sw_if_index,
config->output_sw_if_index);
- }));
+ }
/* *INDENT-ON* */
}
last = now;
/* *INDENT-OFF* */
- pool_foreach(reg, vpe_api_main.l2_arp_term_events_registrations,
- ({
+ pool_foreach (reg, vpe_api_main.l2_arp_term_events_registrations)
+ {
vl_api_registration_t *vl_reg;
vl_reg = vl_api_client_index_to_registration (reg->client_index);
ALWAYS_ASSERT (vl_reg != NULL);
mac_address_encode(&event->mac, vevent->mac);
vl_api_send_msg (vl_reg, (u8 *) vevent);
}
- }));
+ }
/* *INDENT-ON* */
}
vec_reset_length (l2am->publish_events);
sis = vec_new (vnet_sw_interface_t, pool_elts (im->sw_interfaces));
_vec_len (sis) = 0;
/* *INDENT-OFF* */
- pool_foreach (si, im->sw_interfaces, ({ vec_add1 (sis, si[0]); }));
+ pool_foreach (si, im->sw_interfaces) { vec_add1 (sis, si[0]); }
/* *INDENT-ON* */
}
vlib_cli_output (vm, "No entries\n");
/* *INDENT-OFF* */
- pool_foreach(e, rw->entries, {
+ pool_foreach (e, rw->entries) {
vlib_cli_output (vm, "%U\n", format_l2_rw_entry, e);
- });
+ }
/* *INDENT-ON* */
return 0;
}
vlib_cli_output (vm, "%U", format_l2xcrw, 0, 0);
/* *INDENT-OFF* */
- pool_foreach (t, xcm->tunnels,
- ({
+ pool_foreach (t, xcm->tunnels)
+ {
vlib_cli_output (vm, "%U", format_l2xcrw, vnm, t);
- }));
+ }
/* *INDENT-ON* */
return 0;
total_memory = 0;
- pool_foreach (mfib_table, ip4_main.mfibs,
- ({
+ pool_foreach (mfib_table, ip4_main.mfibs)
+ {
ip4_mfib_t *mfib = &mfib_table->v4;
uword mfib_size;
int i;
}
total_memory += mfib_size;
- }));
+ }
s = format(s, "%=30s %=6d %=12ld\n",
"IPv4 multicast",
break;
}
- pool_foreach (mfib_table, im4->mfibs,
- ({
+ pool_foreach (mfib_table, im4->mfibs)
+ {
ip4_mfib_t *mfib = &mfib_table->v4;
if (table_id >= 0 && table_id != (int)mfib->table_id)
{
ip4_mfib_table_show_one(mfib, vm, &src, &grp, mask);
}
- }));
+ }
if (memory)
vlib_cli_output (vm, "totals: hash:%ld", total_hash_memory);
break;
}
- pool_foreach (mfib_table, im6->mfibs,
- ({
+ pool_foreach (mfib_table, im6->mfibs)
+ {
ip6_mfib_t *mfib = &mfib_table->v6;
if (table_id >= 0 && table_id != (int)mfib->table_id)
{
ip6_mfib_table_show_one(mfib, vm, &src, &grp, mask, cover);
}
- }));
+ }
return 0;
}
* show all
*/
vlib_cli_output (vm, "FIB Entries:");
- pool_foreach_index(fei, mfib_entry_pool,
- ({
+ pool_foreach_index (fei, mfib_entry_pool)
+ {
vlib_cli_output (vm, "%d@%U",
fei,
format_mfib_entry, fei,
MFIB_ENTRY_FORMAT_BRIEF);
- }));
+ }
}
return (NULL);
* show all
*/
vlib_cli_output (vm, "mFIB interfaces::");
- pool_foreach_index(mfii, mfib_itf_pool,
- ({
+ pool_foreach_index (mfii, mfib_itf_pool)
+ {
vlib_cli_output (vm, "%d@%U",
mfii,
format_mfib_itf, mfii);
- }));
+ }
}
return (NULL);
return;
/* *INDENT-OFF* */
- pool_foreach (fib_table, mm->fibs,
- ({
+ pool_foreach (fib_table, mm->fibs)
+ {
send_mpls_table_details(am, reg, mp->context, fib_table);
- }));
+ }
/* *INDENT-ON* */
}
{
u32 mti;
- pool_foreach_index(mti, mpls_tunnel_pool,
- ({
+ pool_foreach_index (mti, mpls_tunnel_pool)
+ {
cb(mti, ctx);
- }));
+ }
}
void
if (~0 == mti)
{
- pool_foreach (mt, mpls_tunnel_pool,
- ({
+ pool_foreach (mt, mpls_tunnel_pool)
+ {
vlib_cli_output (vm, "[@%d] %U",
mt - mpls_tunnel_pool,
format_mpls_tunnel, mt);
- }));
+ }
}
else
{
{
/* No stream specified: enable/disable all streams. */
/* *INDENT-OFF* */
- pool_foreach (s, pg->streams, ({
+ pool_foreach (s, pg->streams) {
pg_stream_enable_disable (pg, s, is_enable);
- }));
+ }
/* *INDENT-ON* */
}
else
vlib_cli_output (vm, "%U", format_pg_stream, 0, 0);
/* *INDENT-OFF* */
- pool_foreach (s, pg->streams, ({
+ pool_foreach (s, pg->streams) {
vlib_cli_output (vm, "%U", format_pg_stream, s, verbose);
- }));
+ }
/* *INDENT-ON* */
done:
app->app_index, api_client_index);
/* *INDENT-OFF* */
- pool_foreach (wrk_map, app->worker_maps, ({
+ pool_foreach (wrk_map, app->worker_maps) {
app_wrk = app_worker_get (wrk_map->wrk_index);
if (app_wrk->api_client_index == api_client_index)
vec_add1 (wrks, app_wrk->wrk_index);
- }));
+ }
/* *INDENT-ON* */
if (!vec_len (wrks))
}
/* *INDENT-OFF* */
- pool_foreach (wrk_map, app->worker_maps, ({
+ pool_foreach (wrk_map, app->worker_maps) {
app_wrk = app_worker_get (wrk_map->wrk_index);
if (hash_elts (app_wrk->listeners_table) == 0)
continue;
vlib_cli_output (vm, "%U", format_app_worker_listener, app_wrk,
handle, sm_index, verbose);
}));
- }));
+ }
/* *INDENT-ON* */
}
}
/* *INDENT-OFF* */
- pool_foreach (wrk_map, app->worker_maps, ({
+ pool_foreach (wrk_map, app->worker_maps) {
app_wrk = app_worker_get (wrk_map->wrk_index);
app_worker_format_connects (app_wrk, verbose);
- }));
+ }
/* *INDENT-ON* */
}
format_memory_size, props->tx_fifo_size);
/* *INDENT-OFF* */
- pool_foreach (wrk_map, app->worker_maps, ({
+ pool_foreach (wrk_map, app->worker_maps) {
app_wrk = app_worker_get (wrk_map->wrk_index);
s = format (s, "%U", format_app_worker, app_wrk);
- }));
+ }
/* *INDENT-ON* */
return s;
application_format_listeners (0, verbose);
/* *INDENT-OFF* */
- pool_foreach (app, app_main.app_pool, ({
+ pool_foreach (app, app_main.app_pool) {
application_format_listeners (app, verbose);
- }));
+ }
/* *INDENT-ON* */
}
application_format_connects (0, verbose);
/* *INDENT-OFF* */
- pool_foreach (app, app_main.app_pool, ({
+ pool_foreach (app, app_main.app_pool) {
application_format_connects (app, verbose);
- }));
+ }
/* *INDENT-ON* */
}
session_cli_return_if_not_enabled ();
/* *INDENT-OFF* */
- pool_foreach (ckpair, app_main.cert_key_pair_store, ({
+ pool_foreach (ckpair, app_main.cert_key_pair_store) {
vlib_cli_output (vm, "%U", format_cert_key_pair, ckpair);
- }));
+ }
/* *INDENT-ON* */
return 0;
}
app_worker_map_t *map;
app_worker_t *wrk;
/* *INDENT-OFF* */
- pool_foreach (map, app->worker_maps, ({
+ pool_foreach (map, app->worker_maps) {
wrk = app_worker_get (map->wrk_index);
vlib_cli_output (vm, "[A%d][%d]%U", app->app_index,
map->wrk_index, format_svm_msg_q,
wrk->event_queue);
- }));
+ }
/* *INDENT-ON* */
}
}
/* *INDENT-OFF* */
- pool_foreach (app, app_main.app_pool, ({
+ pool_foreach (app, app_main.app_pool) {
appliction_format_app_mq (vm, app);
- }));
+ }
/* *INDENT-ON* */
return 0;
}
{
vlib_cli_output (vm, "%U", format_application, 0, 0);
/* *INDENT-OFF* */
- pool_foreach (app, app_main.app_pool, ({
+ pool_foreach (app, app_main.app_pool) {
vlib_cli_output (vm, "%U", format_application, app, 0);
- }));
+ }
/* *INDENT-ON* */
}
/* *INDENT-OFF* */
- pool_foreach (cs, app_ns->app_sockets, ({
+ pool_foreach (cs, app_ns->app_sockets) {
handle = (app_ns_api_handle_t *) &cs->private_data;
cf = clib_file_get (&file_main, handle->aah_file_index);
if (handle->aah_app_wrk_index == APP_INVALID_INDEX)
app_wrk = app_worker_get (handle->aah_app_wrk_index);
vlib_cli_output (vm, "%12d%12d%5u", app_wrk->app_index,
app_wrk->wrk_map_index, cf->file_descriptor);
- }));
+ }
/* *INDENT-ON* */
}
"sw_if_index", "Name");
/* *INDENT-OFF* */
- pool_foreach (app_ns, app_namespace_pool, ({
+ pool_foreach (app_ns, app_namespace_pool) {
vlib_cli_output (vm, "%U", format_app_namespace, app_ns);
- }));
+ }
/* *INDENT-ON* */
done:
#define segment_manager_foreach_segment_w_lock(VAR, SM, BODY) \
do { \
clib_rwlock_reader_lock (&(SM)->segments_rwlock); \
- pool_foreach((VAR), ((SM)->segments), (BODY)); \
+ pool_foreach((VAR), ((SM)->segments)) (BODY); \
clib_rwlock_reader_unlock (&(SM)->segments_rwlock); \
} while (0)
clib_rwlock_writer_lock (&sm->segments_rwlock);
/* *INDENT-OFF* */
- pool_foreach (fifo_segment, sm->segments, ({
+ pool_foreach (fifo_segment, sm->segments) {
segment_manager_del_segment (sm, fifo_segment);
- }));
+ }
/* *INDENT-ON* */
clib_rwlock_writer_unlock (&sm->segments_rwlock);
segment_manager_segment_reader_lock (sm);
/* *INDENT-OFF* */
- pool_foreach (cur, sm->segments, ({
+ pool_foreach (cur, sm->segments) {
free_bytes = fifo_segment_available_bytes (cur);
if (free_bytes > max_free_bytes)
{
max_free_bytes = free_bytes;
fs = cur;
}
- }));
+ }
/* *INDENT-ON* */
if (fs)
"HighWater", "LowWater", "FifoTuning");
/* *INDENT-OFF* */
- pool_foreach (sm, smm->segment_managers, ({
+ pool_foreach (sm, smm->segment_managers) {
app_wrk = app_worker_get_if_valid (sm->app_wrk_index);
app = app_wrk ? application_get (app_wrk->app_index) : 0;
custom_logic = (app && (app->cb_fns.fifo_tuning_callback)) ? 1 : 0;
format_memory_size, max_fifo_size,
sm->high_watermark, sm->low_watermark,
custom_logic ? "custom" : "none");
- }));
+ }
/* *INDENT-ON* */
vlib_cli_output (vm, "\n");
vlib_cli_output (vm, "%U", format_fifo_segment, 0, verbose);
/* *INDENT-OFF* */
- pool_foreach (sm, smm->segment_managers, ({
+ pool_foreach (sm, smm->segment_managers) {
segment_manager_foreach_segment_w_lock (seg, sm, ({
vlib_cli_output (vm, "%U", format_fifo_segment, seg, verbose);
}));
- }));
+ }
/* *INDENT-ON* */
}
clib_rwlock_reader_lock (&sm->segments_rwlock);
/* *INDENT-OFF* */
- pool_foreach (fs, sm->segments, ({
+ pool_foreach (fs, sm->segments) {
for (slice_index = 0; slice_index < fs->n_slices; slice_index++)
{
f = fifo_segment_get_slice_fifo_list (fs, slice_index);
}
vec_free (s);
}
- }));
+ }
/* *INDENT-ON* */
clib_rwlock_reader_unlock (&sm->segments_rwlock);
u8 *tag = 0;
/* *INDENT-OFF* */
srt16 = &srt->session_rules_tables_16;
- pool_foreach (rule16, srt16->rules, ({
+ pool_foreach (rule16, srt16->rules) {
ri = mma_rules_table_rule_index_16 (srt16, rule16);
tag = session_rules_table_rule_tag (srt, ri, 1);
send_session_rule_details4 (rule16, is_local, tp, appns_index, tag,
reg, context);
- }));
+ }
/* *INDENT-ON* */
}
if (is_local || fib_proto == FIB_PROTOCOL_IP6)
u8 *tag = 0;
/* *INDENT-OFF* */
srt40 = &srt->session_rules_tables_40;
- pool_foreach (rule40, srt40->rules, ({
+ pool_foreach (rule40, srt40->rules) {
ri = mma_rules_table_rule_index_40 (srt40, rule40);
tag = session_rules_table_rule_tag (srt, ri, 1);
send_session_rule_details6 (rule40, is_local, tp, appns_index, tag,
reg, context);
- }));
+ }
/* *INDENT-ON* */
}
}
n_closed = 0;
/* *INDENT-OFF* */
- pool_foreach(s, pool, ({
+ pool_foreach (s, pool) {
if (s->session_state >= SESSION_STATE_TRANSPORT_DELETED)
{
n_closed += 1;
continue;
}
vlib_cli_output (vm, "%U", format_session, s, verbose);
- }));
+ }
/* *INDENT-ON* */
if (!n_closed)
"App");
/* *INDENT-OFF* */
- pool_foreach (s, smm->wrk[0].sessions, ({
+ pool_foreach (s, smm->wrk[0].sessions) {
if (s->session_state != SESSION_STATE_LISTENING
|| s->session_type != sst)
continue;
app_name = application_name_from_index (app_wrk->app_index);
vlib_cli_output (vm, "%U%-25v%", format_session, s, 0,
app_name);
- }));
+ }
/* *INDENT-ON* */
goto done;
}
/* *INDENT-OFF* */
vec_foreach (wrk, smm->wrk)
{
- pool_foreach(session, wrk->sessions, ({
+ pool_foreach (session, wrk->sessions) {
clear_session (session);
- }));
+ }
};
/* *INDENT-ON* */
}
vlib_cli_output (vm, "IP4 rules");
/* *INDENT-OFF* */
- pool_foreach(sr4, srt4->rules, ({
+ pool_foreach (sr4, srt4->rules) {
vlib_cli_output (vm, "%U", format_session_rule4, srt, sr4);
- }));
+ }
/* *INDENT-ON* */
}
vlib_cli_output (vm, "IP6 rules");
/* *INDENT-OFF* */
- pool_foreach(sr6, srt6->rules, ({
+ pool_foreach (sr6, srt6->rules) {
vlib_cli_output (vm, "%U", format_session_rule6, srt, sr6);
- }));
+ }
/* *INDENT-ON* */
}
session_table_t *_get_session_tables ();
#define session_table_foreach(VAR, BODY) \
- pool_foreach(VAR, _get_session_tables (), BODY)
+ pool_foreach (VAR, _get_session_tables ()) BODY
#endif /* SRC_VNET_SESSION_SESSION_TABLE_H_ */
/* *INDENT-ON* */
vlib_cli_output (vm, "SR MPLS policies:");
/* *INDENT-OFF* */
- pool_foreach(sr_policy, sm->sr_policies, {
+ pool_foreach (sr_policy, sm->sr_policies) {
vec_add1(vec_policies, sr_policy);
- });
+ }
/* *INDENT-ON* */
vec_foreach_index (i, vec_policies)
vlib_cli_output (vm, "SR MPLS steering policies:");
/* *INDENT-OFF* */
- pool_foreach(steer_pl, sm->steer_policies, ({
+ pool_foreach (steer_pl, sm->steer_policies) {
vec_add1(steer_policies, steer_pl);
- }));
+ }
/* *INDENT-ON* */
for (i = 0; i < vec_len (steer_policies); i++)
{
srp_interface_t * si;
serialize_integer (m, pool_elts (sm->interface_pool), sizeof (u32));
- pool_foreach (si, sm->interface_pool, ({
+ pool_foreach (si, sm->interface_pool) {
serialize_integer (m, si->rings[SRP_RING_OUTER].hw_if_index, sizeof (u32));
serialize_integer (m, si->rings[SRP_RING_INNER].hw_if_index, sizeof (u32));
- }));
+ }
}
void unserialize_srp_main (serialize_main_t * m, va_list * va)
while (1)
{
- pool_foreach (si, sm->interface_pool, ({
+ pool_foreach (si, sm->interface_pool) {
maybe_send_ips_message (si);
- }));
+ }
vlib_process_suspend (vm, 1.0);
}
return;
/* *INDENT-OFF* */
- pool_foreach (t, sm->localsids,
- ({
+ pool_foreach (t, sm->localsids)
+ {
send_sr_localsid_details(t, reg, mp->context);
- }));
+ }
/* *INDENT-ON* */
}
return;
/* *INDENT-OFF* */
- pool_foreach (t, sm->sr_policies,
- ({
+ pool_foreach (t, sm->sr_policies)
+ {
send_sr_policies_details(t, reg, mp->context);
- }));
+ }
/* *INDENT-ON* */
}
return;
/* *INDENT-OFF* */
- pool_foreach (t, sm->sr_policies,
- ({
+ pool_foreach (t, sm->sr_policies)
+ {
send_sr_policies_details_with_sl_index(t, reg, mp->context);
- }));
+ }
/* *INDENT-ON* */
}
return;
/* *INDENT-OFF* */
- pool_foreach (t, sm->steer_policies,
- ({
+ pool_foreach (t, sm->steer_policies)
+ {
send_sr_steering_pol_details(t, reg, mp->context);
- }));
+ }
/* *INDENT-ON* */
}
/* Create a vector out of the plugin pool as recommended */
/* *INDENT-OFF* */
- pool_foreach (plugin, sm->plugin_functions,
+ pool_foreach (plugin, sm->plugin_functions)
{
vec_add1 (vec_plugins, plugin);
- });
+ }
/* *INDENT-ON* */
vec_foreach (plugin_it, vec_plugins)
vlib_cli_output (vm, "SRv6 - My LocalSID Table:");
vlib_cli_output (vm, "=========================");
/* *INDENT-OFF* */
- pool_foreach (ls, sm->localsids, ({ vec_add1 (localsid_list, ls); }));
+ pool_foreach (ls, sm->localsids) { vec_add1 (localsid_list, ls); }
/* *INDENT-ON* */
for (i = 0; i < vec_len (localsid_list); i++)
{
"SR LocalSIDs behaviors:\n-----------------------\n\n");
/* *INDENT-OFF* */
- pool_foreach (plugin, sm->plugin_functions,
- ({ vec_add1 (plugins_vec, plugin); }));
+ pool_foreach (plugin, sm->plugin_functions)
+ { vec_add1 (plugins_vec, plugin); }
/* *INDENT-ON* */
/* Print static behaviors */
sr_policy_fn_registration_t **plugin_it = 0;
/* *INDENT-OFF* */
- pool_foreach (plugin, sm->policy_plugin_functions,
+ pool_foreach (plugin, sm->policy_plugin_functions)
{
vec_add1 (vec_plugins, plugin);
- });
+ }
/* *INDENT-ON* */
vec_foreach (plugin_it, vec_plugins)
vlib_cli_output (vm, "SR policies:");
/* *INDENT-OFF* */
- pool_foreach (sr_policy, sm->sr_policies,
- {vec_add1 (vec_policies, sr_policy); } );
+ pool_foreach (sr_policy, sm->sr_policies)
+ {vec_add1 (vec_policies, sr_policy); }
/* *INDENT-ON* */
vec_foreach_index (i, vec_policies)
vlib_cli_output (vm, "SR Policy behaviors:\n-----------------------\n\n");
/* *INDENT-OFF* */
- pool_foreach (plugin, sm->policy_plugin_functions,
- ({ vec_add1 (plugins_vec, plugin); }));
+ pool_foreach (plugin, sm->policy_plugin_functions)
+ { vec_add1 (plugins_vec, plugin); }
/* *INDENT-ON* */
vlib_cli_output (vm, "Plugin behaviors:\n");
vlib_cli_output (vm, "SR steering policies:");
/* *INDENT-OFF* */
- pool_foreach (steer_pl, sm->steer_policies, ({vec_add1(steer_policies, steer_pl);}));
+ pool_foreach (steer_pl, sm->steer_policies) {vec_add1(steer_policies, steer_pl);}
/* *INDENT-ON* */
vlib_cli_output (vm, "Traffic\t\tSR policy BSID");
for (i = 0; i < vec_len (steer_policies); i++)
vec_reset_length (samples);
/* *INDENT-OFF* */
- pool_foreach (bts, bt->samples, ({
+ pool_foreach (bts, bt->samples) {
vec_add1 (samples, bts - bt->samples);
- }));
+ }
/* *INDENT-ON* */
vec_foreach (si, samples)
index_t tei;
/* *INDENT-OFF* */
- pool_foreach_index(tei, teib_pool,
- ({
+ pool_foreach_index (tei, teib_pool)
+ {
fn(tei, ctx);
- }));
+ }
/* *INDENT-ON* */
}
index_t tei;
/* *INDENT-OFF* */
- pool_foreach_index(tei, teib_pool,
- ({
+ pool_foreach_index (tei, teib_pool)
+ {
if (sw_if_index == teib_entry_get_sw_if_index(teib_entry_get(tei)))
fn(tei, ctx);
- }));
+ }
/* *INDENT-ON* */
}
index_t tei;
/* *INDENT-OFF* */
- pool_foreach_index(tei, teib_pool,
- ({
+ pool_foreach_index (tei, teib_pool)
+ {
if (sw_if_index == teib_entry_get_sw_if_index(teib_entry_get(tei)) &&
af == teib_entry_get_af(teib_entry_get(tei)))
fn(tei, ctx);
- }));
+ }
/* *INDENT-ON* */
}
return;
/* *INDENT-OFF* */
- pool_foreach(ue, udp_encap_pool,
- ({
+ pool_foreach (ue, udp_encap_pool)
+ {
send_udp_encap_details(ue, reg, mp->context);
- }));
+ }
/* *INDENT-ON* */
}
index_t uei;
/* *INDENT-OFF* */
- pool_foreach_index(uei, udp_encap_pool,
- ({
+ pool_foreach_index (uei, udp_encap_pool)
+ {
if (WALK_STOP == cb(uei, ctx))
break;
- }));
+ }
/* *INDENT-ON* */
}
if (INDEX_INVALID == uei)
{
/* *INDENT-OFF* */
- pool_foreach_index(uei, udp_encap_pool,
- ({
+ pool_foreach_index (uei, udp_encap_pool)
+ {
vlib_cli_output(vm, "%U", format_udp_encap, uei, 0);
- }));
+ }
/* *INDENT-ON* */
}
else
trace_apply_filter(this_vlib_main);
traces = 0;
- pool_foreach (h, tm->trace_buffer_pool,
- ({
+ pool_foreach (h, tm->trace_buffer_pool)
+ {
vec_add1 (traces, h[0]);
- }));
+ }
if (vec_len (traces) == 0)
{
vlib_cli_output (vm, "No vxlan-gbp tunnels configured...");
/* *INDENT-OFF* */
- pool_foreach (t, vxm->tunnels,
- ({
+ pool_foreach (t, vxm->tunnels)
+ {
vlib_cli_output (vm, "%U", format_vxlan_gbp_tunnel, t);
- }));
+ }
/* *INDENT-ON* */
if (raw)
if (~0 == sw_if_index)
{
/* *INDENT-OFF* */
- pool_foreach (t, vxm->tunnels,
- ({
+ pool_foreach (t, vxm->tunnels)
+ {
send_vxlan_gbp_tunnel_details(t, reg, mp->context);
- }));
+ }
/* *INDENT-ON* */
}
else
vlib_cli_output (vm, "No vxlan-gpe tunnels configured.");
/* *INDENT-OFF* */
- pool_foreach (t, ngm->tunnels,
- ({
+ pool_foreach (t, ngm->tunnels)
+ {
vlib_cli_output (vm, "%U", format_vxlan_gpe_tunnel, t);
- }));
+ }
/* *INDENT-ON* */
return 0;
if (~0 == sw_if_index)
{
/* *INDENT-OFF* */
- pool_foreach (t, vgm->tunnels,
- ({
+ pool_foreach (t, vgm->tunnels)
+ {
send_vxlan_gpe_tunnel_details(t, reg, mp->context);
- }));
+ }
/* *INDENT-ON* */
}
else
vlib_cli_output (vm, "No vxlan tunnels configured...");
/* *INDENT-OFF* */
- pool_foreach (t, vxm->tunnels,
- ({
+ pool_foreach (t, vxm->tunnels)
+ {
vlib_cli_output (vm, "%U", format_vxlan_tunnel, t);
- }));
+ }
/* *INDENT-ON* */
if (raw)
if (~0 == sw_if_index)
{
/* *INDENT-OFF* */
- pool_foreach (t, vxm->tunnels,
- ({
+ pool_foreach (t, vxm->tunnels)
+ {
send_vxlan_tunnel_details(t, reg, mp->context);
- }));
+ }
/* *INDENT-ON* */
}
else
svm_queue_t * q; \
\
/* One registration only... */ \
- pool_foreach(reg, vam->nn##_registrations, \
+ pool_foreach (reg, vam->nn##_registrations) \
({ \
q = vl_api_client_index_to_input_queue (reg->client_index); \
if (q) { \
/* *INDENT-OFF* */
stat_segment_gauges_pool_t *g;
- pool_foreach(g, sm->gauges,
- ({
+ pool_foreach (g, sm->gauges)
+ {
g->fn(&sm->directory_vector[g->directory_index], g->caller_index);
- }));
+ }
/* *INDENT-ON* */
/* Heartbeat, so clients detect we're still here */
s = format (s, "graph %d nodes", pool_elts (g->nodes));
/* *INDENT-OFF* */
- pool_foreach (n, g->nodes, ({
+ pool_foreach (n, g->nodes) {
s = format (s, "\n%U", format_white_space, indent + 2);
s = format (s, "%U -> ", format_graph_node, g, n - g->nodes);
vec_foreach (l, n->next.links)
s = format (s, "%U (%d), ",
format_graph_node, g, l->node_index,
l->distance);
- }));
+ }
/* *INDENT-ON* */
return s;
/* *INDENT-OFF* */
- pool_foreach (a, pm->arenas,
+ pool_foreach (a, pm->arenas)
{
u32 *page_index;
s = format (s, "\n%Uarena '%s' pages %u subpage-size %U numa-node %u",
s = format (s, "\n%U%U", format_white_space, indent + 4,
format_pmalloc_page, pp, verbose);
}
- });
+ }
/* *INDENT-ON* */
return s;
vec_foreach() (or plain for-loop) to walk the active index vector.
*/
-#define pool_foreach2(VAR,POOL) \
+#define pool_foreach(VAR,POOL) \
if (POOL) \
for (VAR = POOL + pool_get_first_index (POOL); \
VAR < vec_end (POOL); \
VAR = POOL + pool_get_next_index (POOL, VAR - POOL))
-#define pool_foreach(VAR,POOL,BODY) \
- pool_foreach2(VAR,POOL) \
+#define pool_foreach_old(VAR,POOL,BODY) \
+ pool_foreach(VAR,POOL) \
{ BODY; }
/** Returns pointer to element at given index.
_pool_var(rv); \
})
-#define pool_foreach_index2(i,v) \
+#define pool_foreach_index(i,v) \
if (v) \
for (i = pool_get_first_index (v); \
i < vec_len (v); \
i = pool_get_next_index (v, i)) \
/** Iterate pool by index. */
-#define pool_foreach_index(i,v,body) \
- pool_foreach_index2 (i,v) \
+#define pool_foreach_index_old(i,v,body) \
+ pool_foreach_index (i,v) \
{ body; }
/**
{ \
uword *_pool_var(ii), *_pool_var(dv) = NULL; \
\
- pool_foreach((VAR), (POOL), \
- ({ \
+ pool_foreach((VAR), (POOL)) \
+ { \
vec_add1(_pool_var(dv), (VAR) - (POOL)); \
- })); \
+ } \
vec_foreach(_pool_var(ii), _pool_var(dv)) \
{ \
(VAR) = pool_elt_at_index((POOL), *_pool_var(ii)); \
while (next != ~0);
/* *INDENT-OFF* */
- pool_foreach (junk, tp,
- ({
+ pool_foreach (junk, tp)
+ {
int is_free;
is_free = pool_is_free_index (tp, junk - tp);
if (i != 1 && i != 65)
clib_warning ("oops, busy index %d reported free", i);
}
- }));
+ }
/* *INDENT-ON* */
return 0;
j = 0;
vec_reset_length (deleted_indices);
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
tw_timer_stop_2t_1w_2048sl (&tm->single_wheel, e->stop_timer_handle);
vec_add1 (deleted_indices, e - tm->test_elts);
if (++j >= tm->ntimers / 4)
goto del_and_re_add;
- }));
+ }
/* *INDENT-ON* */
del_and_re_add:
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat (stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
pool_free (tm->test_elts);
j = 0;
vec_reset_length (deleted_indices);
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
tw_timer_stop_16t_2w_512sl (&tm->double_wheel, e->stop_timer_handle);
vec_add1 (deleted_indices, e - tm->test_elts);
if (++j >= tm->ntimers / 4)
goto del_and_re_add;
- }));
+ }
/* *INDENT-ON* */
del_and_re_add:
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat (stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
pool_free (tm->test_elts);
j = 0;
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
expiration_time = get_expiration_time (tm);
max_expiration_time = clib_max (expiration_time, max_expiration_time);
e->expected_to_expire = expiration_time
expiration_time);
if (++j >= tm->ntimers / 4)
goto done;
- }));
+ }
/* *INDENT-ON* */
done:
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat (stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
pool_free (tm->test_elts);
j = 0;
vec_reset_length (deleted_indices);
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
tw_timer_stop_4t_3w_256sl (&tm->triple_wheel, e->stop_timer_handle);
vec_add1 (deleted_indices, e - tm->test_elts);
if (++j >= tm->ntimers / 4)
goto del_and_re_add;
- }));
+ }
/* *INDENT-ON* */
del_and_re_add:
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat (stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
pool_free (tm->test_elts);
j = 0;
vec_reset_length (deleted_indices);
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
tw_timer_stop_1t_3w_1024sl_ov (&tm->triple_ov_wheel,
e->stop_timer_handle);
vec_add1 (deleted_indices, e - tm->test_elts);
if (++j >= tm->ntimers / 4)
goto del_and_re_add;
- }));
+ }
/* *INDENT-ON* */
del_and_re_add:
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
TWT (tw_timer) * t;
fformat (stdout, "[%d] expected to expire %d\n",
e->expected_to_expire);
t = pool_elt_at_index (tm->triple_ov_wheel.timers, e->stop_timer_handle);
fformat (stdout, " expiration_time %lld\n", t->expiration_time);
- }));
+ }
/* *INDENT-ON* */
pool_free (tm->test_elts);
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat(stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
fformat (stdout,
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat(stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
fformat (stdout,
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat(stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
fformat (stdout,
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat (stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
pool_free (tm->test_elts);
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat (stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
pool_free (tm->test_elts);
pool_elts (tm->test_elts));
/* *INDENT-OFF* */
- pool_foreach (e, tm->test_elts,
- ({
+ pool_foreach (e, tm->test_elts)
+ {
fformat (stdout, "[%d] expected to expire %d\n",
e - tm->test_elts,
e->expected_to_expire);
- }));
+ }
/* *INDENT-ON* */
pool_free (tm->test_elts);
{
timing_wheel_overflow_elt_t *oe;
/* *INDENT-OFF* */
- pool_foreach (oe, w->overflow_pool, ({
+ pool_foreach (oe, w->overflow_pool) {
if (oe->user_data == user_data)
pool_put (w->overflow_pool, oe);
- }));
+ }
/* *INDENT-ON* */
}
min_t = w->cpu_time_base + min_dt;
/* *INDENT-OFF* */
- pool_foreach (oe, w->overflow_pool,
- ({ min_t = clib_min (min_t, oe->cpu_time); }));
+ pool_foreach (oe, w->overflow_pool)
+ { min_t = clib_min (min_t, oe->cpu_time); }
/* *INDENT-ON* */
done:
{
timing_wheel_overflow_elt_t *oe;
/* *INDENT-OFF* */
- pool_foreach (oe, w->overflow_pool, ({
+ pool_foreach (oe, w->overflow_pool) {
/* It fits now into 32 bits. */
if (0 == ((oe->cpu_time - w->cpu_time_base) >> BITS (e->cpu_time_relative_to_base)))
{
timing_wheel_insert_helper (w, oe->cpu_time, oe->user_data);
pool_put (w->overflow_pool, oe);
}
- }));
+ }
/* *INDENT-ON* */
}
return expired_user_data;