misc: move to new pool_foreach macros
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
This commit is contained in:
committed by
Dave Barach
parent
62c25abaa3
commit
b2c31b685f
@@ -472,11 +472,11 @@ abf_itf_attach_walk (abf_itf_attach_walk_cb_t cb, void *ctx)
|
||||
u32 aii;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach_index(aii, abf_itf_attach_pool,
|
||||
({
|
||||
pool_foreach_index (aii, abf_itf_attach_pool)
|
||||
{
|
||||
if (!cb(aii, ctx))
|
||||
break;
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
|
||||
@@ -346,11 +346,11 @@ abf_policy_walk (abf_policy_walk_cb_t cb, void *ctx)
|
||||
u32 api;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach_index(api, abf_policy_pool,
|
||||
({
|
||||
pool_foreach_index (api, abf_policy_pool)
|
||||
{
|
||||
if (!cb(api, ctx))
|
||||
break;
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
@@ -375,10 +375,10 @@ abf_show_policy_cmd (vlib_main_t * vm,
|
||||
if (INDEX_INVALID == policy_id)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach(ap, abf_policy_pool,
|
||||
({
|
||||
pool_foreach (ap, abf_policy_pool)
|
||||
{
|
||||
vlib_cli_output(vm, "%U", format_abf, ap);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
else
|
||||
|
||||
+15
-15
@@ -1965,10 +1965,10 @@ vl_api_acl_dump_t_handler (vl_api_acl_dump_t * mp)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
/* Just dump all ACLs */
|
||||
pool_foreach (acl, am->acls,
|
||||
({
|
||||
pool_foreach (acl, am->acls)
|
||||
{
|
||||
send_acl_details(am, reg, acl, mp->context);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
else
|
||||
@@ -2050,10 +2050,10 @@ vl_api_acl_interface_list_dump_t_handler (vl_api_acl_interface_list_dump_t *
|
||||
if (mp->sw_if_index == ~0)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (swif, im->sw_interfaces,
|
||||
({
|
||||
pool_foreach (swif, im->sw_interfaces)
|
||||
{
|
||||
send_acl_interface_list_details(am, reg, swif->sw_if_index, mp->context);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
else
|
||||
@@ -2215,10 +2215,10 @@ vl_api_macip_acl_dump_t_handler (vl_api_macip_acl_dump_t * mp)
|
||||
{
|
||||
/* Just dump all ACLs for now, with sw_if_index = ~0 */
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (acl, am->macip_acls,
|
||||
({
|
||||
pool_foreach (acl, am->macip_acls)
|
||||
{
|
||||
send_macip_acl_details (am, reg, acl, mp->context);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
else
|
||||
@@ -2424,10 +2424,10 @@ static void
|
||||
if (mp->sw_if_index == ~0)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (swif, im->sw_interfaces,
|
||||
({
|
||||
pool_foreach (swif, im->sw_interfaces)
|
||||
{
|
||||
send_acl_interface_etype_whitelist_details(am, reg, swif->sw_if_index, mp->context);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
else
|
||||
@@ -3268,8 +3268,8 @@ acl_plugin_show_sessions (acl_main_t * am,
|
||||
}
|
||||
vlib_cli_output (vm, " connection add/del stats:", wk);
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (swif, im->sw_interfaces,
|
||||
({
|
||||
pool_foreach (swif, im->sw_interfaces)
|
||||
{
|
||||
u32 sw_if_index = swif->sw_if_index;
|
||||
u64 n_adds =
|
||||
(sw_if_index < vec_len (pw->fa_session_adds_by_sw_if_index) ?
|
||||
@@ -3291,7 +3291,7 @@ acl_plugin_show_sessions (acl_main_t * am,
|
||||
n_adds -
|
||||
n_dels,
|
||||
n_epoch_changes);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
vlib_cli_output (vm, " connection timeout type lists:", wk);
|
||||
|
||||
@@ -262,11 +262,11 @@ find_mask_type_index(acl_main_t *am, fa_5tuple_t *mask)
|
||||
{
|
||||
ace_mask_type_entry_t *mte;
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach(mte, am->ace_mask_type_pool,
|
||||
({
|
||||
pool_foreach (mte, am->ace_mask_type_pool)
|
||||
{
|
||||
if(memcmp(&mte->mask, mask, sizeof(*mask)) == 0)
|
||||
return (mte - am->ace_mask_type_pool);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
return ~0;
|
||||
}
|
||||
@@ -1160,13 +1160,13 @@ acl_plugin_show_tables_mask_type (void)
|
||||
|
||||
vlib_cli_output (vm, "Mask-type entries:");
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach(mte, am->ace_mask_type_pool,
|
||||
({
|
||||
pool_foreach (mte, am->ace_mask_type_pool)
|
||||
{
|
||||
vlib_cli_output(vm, " %3d: %016llx %016llx %016llx %016llx %016llx %016llx refcount %d",
|
||||
mte - am->ace_mask_type_pool,
|
||||
mte->mask.kv_40_8.key[0], mte->mask.kv_40_8.key[1], mte->mask.kv_40_8.key[2],
|
||||
mte->mask.kv_40_8.key[3], mte->mask.kv_40_8.key[4], mte->mask.kv_40_8.value, mte->refcount);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
|
||||
@@ -37,12 +37,12 @@ static u32 get_acl_user_id(acl_main_t *am, char *user_module_name, char *val1_la
|
||||
{
|
||||
acl_lookup_context_user_t *auser;
|
||||
|
||||
pool_foreach (auser, am->acl_users,
|
||||
({
|
||||
pool_foreach (auser, am->acl_users)
|
||||
{
|
||||
if (0 == strcmp(auser->user_module_name, user_module_name)) {
|
||||
return (auser - am->acl_users);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
pool_get(am->acl_users, auser);
|
||||
auser->user_module_name = user_module_name;
|
||||
@@ -310,13 +310,13 @@ acl_plugin_show_lookup_user (u32 user_index)
|
||||
vlib_main_t *vm = am->vlib_main;
|
||||
acl_lookup_context_user_t *auser;
|
||||
|
||||
pool_foreach (auser, am->acl_users,
|
||||
({
|
||||
pool_foreach (auser, am->acl_users)
|
||||
{
|
||||
u32 curr_user_index = (auser - am->acl_users);
|
||||
if (user_index == ~0 || (curr_user_index == user_index)) {
|
||||
vlib_cli_output (vm, "index %d:%s:%s:%s", curr_user_index, auser->user_module_name, auser->val1_label, auser->val2_label);
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -333,8 +333,8 @@ acl_plugin_show_lookup_context (u32 lc_index)
|
||||
return;
|
||||
}
|
||||
|
||||
pool_foreach (acontext, am->acl_lookup_contexts,
|
||||
({
|
||||
pool_foreach (acontext, am->acl_lookup_contexts)
|
||||
{
|
||||
u32 curr_lc_index = (acontext - am->acl_lookup_contexts);
|
||||
if ((lc_index == ~0) || (curr_lc_index == lc_index)) {
|
||||
if (acl_user_id_valid(am, acontext->context_user_id)) {
|
||||
@@ -350,7 +350,7 @@ acl_plugin_show_lookup_context (u32 lc_index)
|
||||
format_vec32, acontext->acl_indices, "%d");
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
void *
|
||||
|
||||
@@ -1307,10 +1307,10 @@ avf_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f)
|
||||
* during suspend */
|
||||
vec_reset_length (dev_pointers);
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach_index (i, am->devices,
|
||||
pool_foreach_index (i, am->devices)
|
||||
{
|
||||
vec_add1 (dev_pointers, avf_get_device (i));
|
||||
});
|
||||
}
|
||||
|
||||
vec_foreach_index (i, dev_pointers)
|
||||
{
|
||||
@@ -1519,7 +1519,7 @@ avf_create_if (vlib_main_t * vm, avf_create_if_args_t * args)
|
||||
return;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (adp, am->devices, ({
|
||||
pool_foreach (adp, am->devices) {
|
||||
if ((*adp)->pci_addr.as_u32 == args->addr.as_u32)
|
||||
{
|
||||
args->rv = VNET_API_ERROR_ADDRESS_IN_USE;
|
||||
@@ -1528,7 +1528,7 @@ avf_create_if (vlib_main_t * vm, avf_create_if_args_t * args)
|
||||
&args->addr, "pci address in use");
|
||||
return;
|
||||
}
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
pool_get (am->devices, adp);
|
||||
|
||||
@@ -101,10 +101,10 @@ handle_get_interface_stats (http_builtin_method_type_t reqtype,
|
||||
else /* default, HTTP_BUILTIN_METHOD_GET */
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (hi, im->hw_interfaces,
|
||||
({
|
||||
pool_foreach (hi, im->hw_interfaces)
|
||||
{
|
||||
vec_add1 (sw_if_indices, hi->sw_if_index);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
@@ -156,12 +156,12 @@ handle_get_interface_list (http_builtin_method_type_t reqtype,
|
||||
|
||||
/* Construct vector of active hw_if_indexes ... */
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (hi, im->hw_interfaces,
|
||||
({
|
||||
pool_foreach (hi, im->hw_interfaces)
|
||||
{
|
||||
/* No point in mentioning "local0"... */
|
||||
if (hi - im->hw_interfaces)
|
||||
vec_add1 (hw_if_indices, hi - im->hw_interfaces);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
/* Build answer */
|
||||
|
||||
@@ -439,15 +439,15 @@ format_cdp_neighbors (u8 * s, va_list * va)
|
||||
"Our Port", "Peer System", "Peer Port", "Last Heard");
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (n, cm->neighbors,
|
||||
({
|
||||
pool_foreach (n, cm->neighbors)
|
||||
{
|
||||
hw = vnet_get_sup_hw_interface (vnm, n->sw_if_index);
|
||||
|
||||
if (n->disabled == 0)
|
||||
s = format (s, "%=25v %=25s %=25s %=10.1f\n",
|
||||
hw->name, n->device_name, n->port_id,
|
||||
n->last_heard);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -358,10 +358,10 @@ cdp_periodic (vlib_main_t * vm)
|
||||
static cdp_neighbor_t **n_list = 0;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (n, cm->neighbors,
|
||||
({
|
||||
pool_foreach (n, cm->neighbors)
|
||||
{
|
||||
vec_add1 (n_list, n);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
/* Across all cdp neighbors known to the system */
|
||||
|
||||
@@ -84,7 +84,7 @@ cnat_client_throttle_pool_process ()
|
||||
vec_reset_length (del_vec);
|
||||
clib_spinlock_lock (&cnat_client_db.throttle_pool_lock[i]);
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach(addr, cnat_client_db.throttle_pool[i], ({
|
||||
pool_foreach (addr, cnat_client_db.throttle_pool[i]) {
|
||||
cc = (AF_IP4 == addr->version ?
|
||||
cnat_client_ip4_find (&ip_addr_v4(addr)) :
|
||||
cnat_client_ip6_find (&ip_addr_v6(addr)));
|
||||
@@ -94,7 +94,7 @@ cnat_client_throttle_pool_process ()
|
||||
cnat_client_cnt_session (cc);
|
||||
vec_add1(del_vec, addr - cnat_client_db.throttle_pool[i]);
|
||||
}
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
vec_foreach (ai, del_vec)
|
||||
{
|
||||
@@ -301,9 +301,8 @@ cnat_client_show (vlib_main_t * vm,
|
||||
if (INDEX_INVALID == cci)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach_index(cci, cnat_client_pool, ({
|
||||
pool_foreach_index (cci, cnat_client_pool)
|
||||
vlib_cli_output(vm, "%U", format_cnat_client, cci, 0);
|
||||
}))
|
||||
/* *INDENT-ON* */
|
||||
|
||||
vlib_cli_output (vm, "%d clients", pool_elts (cnat_client_pool));
|
||||
|
||||
@@ -243,11 +243,11 @@ cnat_timestamp_show (vlib_main_t * vm,
|
||||
cnat_timestamp_t *ts;
|
||||
clib_rwlock_reader_lock (&cnat_main.ts_lock);
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (ts, cnat_timestamps, ({
|
||||
pool_foreach (ts, cnat_timestamps) {
|
||||
vlib_cli_output (vm, "[%d] last_seen:%f lifetime:%u ref:%u",
|
||||
ts - cnat_timestamps,
|
||||
ts->last_seen, ts->lifetime, ts->refcnt);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
clib_rwlock_reader_unlock (&cnat_main.ts_lock);
|
||||
return (NULL);
|
||||
|
||||
@@ -69,11 +69,11 @@ cnat_translation_unwatch_addr (u32 cti, cnat_addr_resol_type_t type)
|
||||
addr_resolution_t *ar;
|
||||
index_t *indexes = 0, *ari;
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (ar, tr_resolutions, ({
|
||||
pool_foreach (ar, tr_resolutions) {
|
||||
if ((cti == INDEX_INVALID || ar->cti == cti) &&
|
||||
(ar->type == type || CNAT_RESOLV_ADDR_ANY == type))
|
||||
vec_add1(indexes, ar - tr_resolutions);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
vec_foreach (ari, indexes) pool_put_index (tr_resolutions, *ari);
|
||||
|
||||
@@ -313,11 +313,11 @@ cnat_translation_walk (cnat_translation_walk_cb_t cb, void *ctx)
|
||||
u32 api;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach_index(api, cnat_translation_pool,
|
||||
({
|
||||
pool_foreach_index (api, cnat_translation_pool)
|
||||
{
|
||||
if (!cb(api, ctx))
|
||||
break;
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
@@ -381,11 +381,11 @@ cnat_translation_show (vlib_main_t * vm,
|
||||
if (INDEX_INVALID == cti)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach_index(cti, cnat_translation_pool,
|
||||
({
|
||||
pool_foreach_index (cti, cnat_translation_pool)
|
||||
{
|
||||
ct = pool_elt_at_index (cnat_translation_pool, cti);
|
||||
vlib_cli_output(vm, "%U", format_cnat_translation, ct);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
else
|
||||
@@ -403,10 +403,10 @@ cnat_translation_purge (void)
|
||||
index_t tri, *trp, *trs = NULL;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach_index(tri, cnat_translation_pool,
|
||||
({
|
||||
pool_foreach_index (tri, cnat_translation_pool)
|
||||
{
|
||||
vec_add1(trs, tri);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
vec_foreach (trp, trs) cnat_translation_delete (*trp);
|
||||
@@ -649,13 +649,13 @@ cnat_if_addr_add_del_callback (u32 sw_if_index, ip_address_t * address,
|
||||
{
|
||||
addr_resolution_t *ar;
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (ar, tr_resolutions, ({
|
||||
pool_foreach (ar, tr_resolutions) {
|
||||
if (ar->sw_if_index != sw_if_index)
|
||||
continue;
|
||||
if (ar->af != ip_addr_version (address))
|
||||
continue;
|
||||
cnat_if_addr_add_cbs[ar->type] (ar, address, is_del);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
|
||||
@@ -322,10 +322,10 @@ show_ct6_command_fn_command_fn (vlib_main_t * vm,
|
||||
0 /* pool */ , 0 /* header */ , verbose);
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (s0, cmp->sessions[i],
|
||||
({
|
||||
pool_foreach (s0, cmp->sessions[i])
|
||||
{
|
||||
s = format (s, "%U", format_ct6_session, cmp, i, s0, verbose);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
vlib_cli_output (cmp->vlib_main, "%v", s);
|
||||
@@ -431,10 +431,10 @@ test_ct6_command_fn_command_fn (vlib_main_t * vm,
|
||||
}
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (s0, cmp->sessions[0],
|
||||
({
|
||||
pool_foreach (s0, cmp->sessions[0])
|
||||
{
|
||||
s = format (s, "%U", format_ct6_session, cmp, 0, s0, 1 /* verbose */);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
vlib_cli_output (vm, "\nEnd state: first index %d last index %d\n%v",
|
||||
@@ -451,10 +451,10 @@ test_ct6_command_fn_command_fn (vlib_main_t * vm,
|
||||
ct6_update_session_hit (cmp, s0, 234.0);
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (s0, cmp->sessions[0],
|
||||
({
|
||||
pool_foreach (s0, cmp->sessions[0])
|
||||
{
|
||||
s = format (s, "%U", format_ct6_session, cmp, 0, s0, 1 /* verbose */);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
vlib_cli_output (vm, "\nEnd state: first index %d last index %d\n%v",
|
||||
|
||||
@@ -867,13 +867,13 @@ dhcp_client_process (vlib_main_t * vm,
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
next_expire_time = 1e70;
|
||||
pool_foreach (c, dcm->clients,
|
||||
({
|
||||
pool_foreach (c, dcm->clients)
|
||||
{
|
||||
this_next_expire_time = dhcp_client_sm
|
||||
(now, timeout, (uword) (c - dcm->clients));
|
||||
next_expire_time = this_next_expire_time < next_expire_time ?
|
||||
this_next_expire_time : next_expire_time;
|
||||
}));
|
||||
}
|
||||
if (next_expire_time > now)
|
||||
timeout = next_expire_time - now;
|
||||
else
|
||||
@@ -939,12 +939,12 @@ show_dhcp_client_command_fn (vlib_main_t * vm,
|
||||
}
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (c, dcm->clients,
|
||||
({
|
||||
pool_foreach (c, dcm->clients)
|
||||
{
|
||||
vlib_cli_output (vm, "%U",
|
||||
format_dhcp_client, dcm,
|
||||
c, verbose);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
return 0;
|
||||
@@ -1114,11 +1114,11 @@ dhcp_client_walk (dhcp_client_walk_cb_t cb, void *ctx)
|
||||
dhcp_client_t *c;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (c, dcm->clients,
|
||||
({
|
||||
pool_foreach (c, dcm->clients)
|
||||
{
|
||||
if (!cb(c, ctx))
|
||||
break;
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
}
|
||||
|
||||
@@ -62,12 +62,12 @@ generate_client_duid (void)
|
||||
ethernet_interface_t *eth_if = 0;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (hi, im->hw_interfaces,
|
||||
({
|
||||
pool_foreach (hi, im->hw_interfaces)
|
||||
{
|
||||
eth_if = ethernet_get_interface (ðernet_main, hi->hw_if_index);
|
||||
if (eth_if)
|
||||
break;
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
if (eth_if)
|
||||
|
||||
@@ -273,8 +273,8 @@ dhcp6_reply_event_handler (vl_api_dhcp6_reply_event_t * mp)
|
||||
|
||||
u8 address_already_present = 0;
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (address_info, rm->address_pool,
|
||||
({
|
||||
pool_foreach (address_info, rm->address_pool)
|
||||
{
|
||||
if (address_info->sw_if_index != sw_if_index)
|
||||
;
|
||||
else if (!ip6_addresses_equal (&address_info->address, address))
|
||||
@@ -284,7 +284,7 @@ dhcp6_reply_event_handler (vl_api_dhcp6_reply_event_t * mp)
|
||||
address_already_present = 1;
|
||||
goto address_pool_foreach_out;
|
||||
}
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
address_pool_foreach_out:
|
||||
|
||||
@@ -346,15 +346,15 @@ create_address_list (u32 sw_if_index)
|
||||
address_info_t *address_info, *address_list = 0;;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (address_info, rm->address_pool,
|
||||
({
|
||||
pool_foreach (address_info, rm->address_pool)
|
||||
{
|
||||
if (address_info->sw_if_index == sw_if_index)
|
||||
{
|
||||
u32 pos = vec_len (address_list);
|
||||
vec_validate (address_list, pos);
|
||||
clib_memcpy (&address_list[pos], address_info, sizeof (*address_info));
|
||||
}
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
return address_list;
|
||||
@@ -395,8 +395,8 @@ dhcp6_client_cp_process (vlib_main_t * vm, vlib_node_runtime_t * rt,
|
||||
{
|
||||
due_time = current_time + 1e9;
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (address_info, rm->address_pool,
|
||||
({
|
||||
pool_foreach (address_info, rm->address_pool)
|
||||
{
|
||||
if (address_info->due_time > current_time)
|
||||
{
|
||||
if (address_info->due_time < due_time)
|
||||
@@ -423,7 +423,7 @@ dhcp6_client_cp_process (vlib_main_t * vm, vlib_node_runtime_t * rt,
|
||||
0, 1);
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
for (i = 0; i < vec_len (rm->client_state_by_sw_if_index); i++)
|
||||
{
|
||||
@@ -526,15 +526,15 @@ dhcp6_addresses_show_command_function (vlib_main_t * vm,
|
||||
f64 current_time = vlib_time_now (vm);
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (address_info, dm->address_pool,
|
||||
({
|
||||
pool_foreach (address_info, dm->address_pool)
|
||||
{
|
||||
vlib_cli_output (vm, "address: %U, "
|
||||
"preferred lifetime: %u, valid lifetime: %u "
|
||||
"(%f remaining)",
|
||||
format_ip6_address, &address_info->address,
|
||||
address_info->preferred_lt, address_info->valid_lt,
|
||||
address_info->due_time - current_time);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
return error;
|
||||
@@ -661,8 +661,8 @@ dhcp6_client_enable_disable (u32 sw_if_index, u8 enable)
|
||||
}
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (address_info, rm->address_pool,
|
||||
({
|
||||
pool_foreach (address_info, rm->address_pool)
|
||||
{
|
||||
if (address_info->sw_if_index == sw_if_index)
|
||||
{
|
||||
ASSERT (sw_if_index < vec_len (rm->client_state_by_sw_if_index) &&
|
||||
@@ -680,7 +680,7 @@ dhcp6_client_enable_disable (u32 sw_if_index, u8 enable)
|
||||
clib_warning ("Failed to delete interface address");
|
||||
pool_put (rm->address_pool, address_info);
|
||||
}
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
|
||||
@@ -372,10 +372,10 @@ dhcp6_pd_reply_event_handler (vl_api_dhcp6_pd_reply_event_t * mp)
|
||||
* so collect active indices.
|
||||
*/
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (prefix_info, pm->prefix_pool,
|
||||
({
|
||||
pool_foreach (prefix_info, pm->prefix_pool)
|
||||
{
|
||||
vec_add1 (pm->indices, prefix_info - pm->prefix_pool);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
for (i = 0; i < n_prefixes; i++)
|
||||
@@ -481,8 +481,8 @@ create_prefix_list (u32 sw_if_index)
|
||||
prefix_info_t *prefix_info, *prefix_list = 0;;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (prefix_info, pm->prefix_pool,
|
||||
({
|
||||
pool_foreach (prefix_info, pm->prefix_pool)
|
||||
{
|
||||
if (is_dhcpv6_pd_prefix (prefix_info) &&
|
||||
prefix_info->opaque_data == sw_if_index)
|
||||
{
|
||||
@@ -490,7 +490,7 @@ create_prefix_list (u32 sw_if_index)
|
||||
vec_validate (prefix_list, pos);
|
||||
clib_memcpy (&prefix_list[pos], prefix_info, sizeof (*prefix_info));
|
||||
}
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
return prefix_list;
|
||||
@@ -531,8 +531,8 @@ dhcp6_pd_client_cp_process (vlib_main_t * vm, vlib_node_runtime_t * rt,
|
||||
{
|
||||
due_time = current_time + 1e9;
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (prefix_info, pm->prefix_pool,
|
||||
({
|
||||
pool_foreach (prefix_info, pm->prefix_pool)
|
||||
{
|
||||
if (is_dhcpv6_pd_prefix (prefix_info))
|
||||
{
|
||||
if (prefix_info->due_time > current_time)
|
||||
@@ -558,7 +558,7 @@ dhcp6_pd_client_cp_process (vlib_main_t * vm, vlib_node_runtime_t * rt,
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
for (i = 0; i < vec_len (rm->client_state_by_sw_if_index); i++)
|
||||
{
|
||||
@@ -788,12 +788,12 @@ cp_ip6_address_find_new_active_prefix (u32 prefix_group_index,
|
||||
prefix_info_t *prefix_info;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (prefix_info, pm->prefix_pool,
|
||||
({
|
||||
pool_foreach (prefix_info, pm->prefix_pool)
|
||||
{
|
||||
if (prefix_info->prefix_group_index == prefix_group_index &&
|
||||
prefix_info - pm->prefix_pool != ignore_prefix_index)
|
||||
return prefix_info - pm->prefix_pool;
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
return ~0;
|
||||
}
|
||||
@@ -1139,8 +1139,8 @@ cp_ip6_prefixes_show_command_function (vlib_main_t * vm,
|
||||
f64 current_time = vlib_time_now (vm);
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (prefix_info, pm->prefix_pool,
|
||||
({
|
||||
pool_foreach (prefix_info, pm->prefix_pool)
|
||||
{
|
||||
prefix_group =
|
||||
pm->prefix_group_name_by_index[prefix_info->prefix_group_index];
|
||||
vlib_cli_output (vm, "opaque_data: %lu, prefix: %U/%d, prefix group: %s, "
|
||||
@@ -1151,7 +1151,7 @@ cp_ip6_prefixes_show_command_function (vlib_main_t * vm,
|
||||
prefix_group,
|
||||
prefix_info->preferred_lt, prefix_info->valid_lt,
|
||||
prefix_info->due_time - current_time);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
return error;
|
||||
@@ -1305,8 +1305,8 @@ dhcp6_pd_client_enable_disable (u32 sw_if_index,
|
||||
vec_validate (prefix_list, 0);
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (prefix_info, pm->prefix_pool,
|
||||
({
|
||||
pool_foreach (prefix_info, pm->prefix_pool)
|
||||
{
|
||||
if (is_dhcpv6_pd_prefix (prefix_info) &&
|
||||
prefix_info->opaque_data == sw_if_index)
|
||||
{
|
||||
@@ -1324,7 +1324,7 @@ dhcp6_pd_client_enable_disable (u32 sw_if_index,
|
||||
set_is_dhcpv6_pd_prefix (prefix_info, 0);
|
||||
pool_put (pm->prefix_pool, prefix_info);
|
||||
}
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
vec_free (prefix_list);
|
||||
|
||||
@@ -700,8 +700,8 @@ dhcp6_reply_process (vlib_main_t * vm, vlib_node_runtime_t * rt,
|
||||
|
||||
vpe_client_registration_t *reg;
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach(reg, vpe_api_main.dhcp6_reply_events_registrations,
|
||||
({
|
||||
pool_foreach (reg, vpe_api_main.dhcp6_reply_events_registrations)
|
||||
{
|
||||
vl_api_registration_t *vl_reg;
|
||||
vl_reg =
|
||||
vl_api_client_index_to_registration (reg->client_index);
|
||||
@@ -715,7 +715,7 @@ dhcp6_reply_process (vlib_main_t * vm, vlib_node_runtime_t * rt,
|
||||
msg->pid = reg->client_pid;
|
||||
vl_api_send_msg (vl_reg, (u8 *) msg);
|
||||
}
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
clib_mem_free (event);
|
||||
@@ -812,8 +812,8 @@ dhcp6_pd_reply_process (vlib_main_t * vm, vlib_node_runtime_t * rt,
|
||||
|
||||
vpe_client_registration_t *reg;
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach(reg, vpe_api_main.dhcp6_pd_reply_events_registrations,
|
||||
({
|
||||
pool_foreach (reg, vpe_api_main.dhcp6_pd_reply_events_registrations)
|
||||
{
|
||||
vl_api_registration_t *vl_reg;
|
||||
vl_reg =
|
||||
vl_api_client_index_to_registration (reg->client_index);
|
||||
@@ -827,7 +827,7 @@ dhcp6_pd_reply_process (vlib_main_t * vm, vlib_node_runtime_t * rt,
|
||||
msg->pid = reg->client_pid;
|
||||
vl_api_send_msg (vl_reg, (u8 *) msg);
|
||||
}
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
clib_mem_free (event);
|
||||
|
||||
@@ -52,11 +52,11 @@ dns_cache_clear (dns_main_t * dm)
|
||||
dns_cache_lock (dm, 1);
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (ep, dm->entries,
|
||||
({
|
||||
pool_foreach (ep, dm->entries)
|
||||
{
|
||||
vec_free (ep->name);
|
||||
vec_free (ep->pending_requests);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
pool_free (dm->entries);
|
||||
@@ -2157,8 +2157,8 @@ format_dns_cache (u8 * s, va_list * args)
|
||||
if (verbose > 0)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (ep, dm->entries,
|
||||
({
|
||||
pool_foreach (ep, dm->entries)
|
||||
{
|
||||
if (ep->flags & DNS_CACHE_ENTRY_FLAG_VALID)
|
||||
{
|
||||
ASSERT (ep->dns_response);
|
||||
@@ -2194,7 +2194,7 @@ format_dns_cache (u8 * s, va_list * args)
|
||||
verbose);
|
||||
}
|
||||
vec_add1 (s, '\n');
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
|
||||
@@ -1429,7 +1429,7 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
|
||||
devconf->x = conf->default_devconf.x ;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (devconf, conf->dev_confs, ({
|
||||
pool_foreach (devconf, conf->dev_confs) {
|
||||
|
||||
/* default per-device config items */
|
||||
foreach_dpdk_device_config_item
|
||||
@@ -1471,7 +1471,7 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
|
||||
tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
|
||||
vec_add1 (conf->eal_init_args, tmp);
|
||||
}
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
#undef _
|
||||
|
||||
@@ -791,12 +791,12 @@ flowprobe_show_table_fn (vlib_main_t * vm,
|
||||
for (i = 0; i < vec_len (fm->pool_per_worker); i++)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (e, fm->pool_per_worker[i], (
|
||||
pool_foreach (e, fm->pool_per_worker[i])
|
||||
{
|
||||
vlib_cli_output (vm, "%U",
|
||||
format_flowprobe_entry,
|
||||
e);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
}
|
||||
|
||||
@@ -364,11 +364,11 @@ gbp_bridge_domain_walk (gbp_bridge_domain_cb_t cb, void *ctx)
|
||||
gbp_bridge_domain_t *gbpe;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach(gbpe, gbp_bridge_domain_pool,
|
||||
pool_foreach (gbpe, gbp_bridge_domain_pool)
|
||||
{
|
||||
if (!cb(gbpe, ctx))
|
||||
break;
|
||||
});
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
|
||||
@@ -567,11 +567,11 @@ gbp_contract_walk (gbp_contract_cb_t cb, void *ctx)
|
||||
gbp_contract_t *gc;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach(gc, gbp_contract_pool,
|
||||
({
|
||||
pool_foreach (gc, gbp_contract_pool)
|
||||
{
|
||||
if (!cb(gc, ctx))
|
||||
break;
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
@@ -710,8 +710,8 @@ gbp_contract_show (vlib_main_t * vm,
|
||||
vlib_cli_output (vm, "Contracts:");
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (gc, gbp_contract_pool,
|
||||
({
|
||||
pool_foreach (gc, gbp_contract_pool)
|
||||
{
|
||||
gci = gc - gbp_contract_pool;
|
||||
|
||||
if (SCLASS_INVALID != src && SCLASS_INVALID != dst)
|
||||
@@ -732,7 +732,7 @@ gbp_contract_show (vlib_main_t * vm,
|
||||
}
|
||||
else
|
||||
vlib_cli_output (vm, " %U", format_gbp_contract, gci);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
return (NULL);
|
||||
|
||||
@@ -1063,11 +1063,11 @@ gbp_endpoint_walk (gbp_endpoint_cb_t cb, void *ctx)
|
||||
u32 index;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach_index(index, gbp_endpoint_pool,
|
||||
pool_foreach_index (index, gbp_endpoint_pool)
|
||||
{
|
||||
if (!cb(index, ctx))
|
||||
break;
|
||||
});
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
|
||||
@@ -241,11 +241,11 @@ gbp_endpoint_group_walk (gbp_endpoint_group_cb_t cb, void *ctx)
|
||||
gbp_endpoint_group_t *gbpe;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach(gbpe, gbp_endpoint_group_pool,
|
||||
pool_foreach (gbpe, gbp_endpoint_group_pool)
|
||||
{
|
||||
if (!cb(gbpe, ctx))
|
||||
break;
|
||||
});
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
|
||||
@@ -233,11 +233,11 @@ gbp_ext_itf_walk (gbp_ext_itf_cb_t cb, void *ctx)
|
||||
gbp_ext_itf_t *ge;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach(ge, gbp_ext_itf_pool,
|
||||
pool_foreach (ge, gbp_ext_itf_pool)
|
||||
{
|
||||
if (!cb(ge, ctx))
|
||||
break;
|
||||
});
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
|
||||
@@ -541,10 +541,10 @@ gbp_itf_show (vlib_main_t * vm,
|
||||
vlib_cli_output (vm, "Interfaces:");
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach_index (gii, gbp_itf_pool,
|
||||
({
|
||||
pool_foreach_index (gii, gbp_itf_pool)
|
||||
{
|
||||
vlib_cli_output (vm, " [%d] %U", gii, format_gbp_itf, gii);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
return (NULL);
|
||||
|
||||
@@ -227,11 +227,11 @@ gbp_recirc_walk (gbp_recirc_cb_t cb, void *ctx)
|
||||
gbp_recirc_t *ge;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach(ge, gbp_recirc_pool,
|
||||
pool_foreach (ge, gbp_recirc_pool)
|
||||
{
|
||||
if (!cb(ge, ctx))
|
||||
break;
|
||||
});
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
|
||||
@@ -290,11 +290,11 @@ gbp_route_domain_walk (gbp_route_domain_cb_t cb, void *ctx)
|
||||
gbp_route_domain_t *gbpe;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach(gbpe, gbp_route_domain_pool,
|
||||
pool_foreach (gbpe, gbp_route_domain_pool)
|
||||
{
|
||||
if (!cb(gbpe, ctx))
|
||||
break;
|
||||
});
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
|
||||
@@ -424,8 +424,8 @@ gbp_subnet_walk (gbp_subnet_cb_t cb, void *ctx)
|
||||
sw_if_index = ~0;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach (gs, gbp_subnet_pool,
|
||||
({
|
||||
pool_foreach (gs, gbp_subnet_pool)
|
||||
{
|
||||
grd = gbp_route_domain_get(gs->gs_rd);
|
||||
|
||||
switch (gs->gs_type)
|
||||
@@ -447,7 +447,7 @@ gbp_subnet_walk (gbp_subnet_cb_t cb, void *ctx)
|
||||
if (WALK_STOP == cb (grd->grd_id, &gs->gs_key->gsk_pfx,
|
||||
gs->gs_type, sw_if_index, sclass, ctx))
|
||||
break;
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
@@ -549,11 +549,11 @@ gbp_subnet_show (vlib_main_t * vm,
|
||||
else
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
pool_foreach_index(gsi, gbp_subnet_pool,
|
||||
({
|
||||
pool_foreach_index (gsi, gbp_subnet_pool)
|
||||
{
|
||||
vlib_cli_output (vm, "%U", format_gbp_subnet, gsi,
|
||||
GBP_SUBNET_SHOW_BRIEF);
|
||||
}));
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user