- for (i = 0; i < h->nbuckets; i++)
- {
- b = &h->buckets[i];
- if (b->offset == 0)
- continue;
- v = BV (clib_bihash_get_value) (h, b->offset);
- for (j = 0; j < (1 << b->log2_pages); j++)
- {
- for (k = 0; k < BIHASH_KVP_PER_PAGE; k++)
- {
- if (v->kvp[k].key == ~0ULL && v->kvp[k].value == ~0ULL)
- continue;
-
- if (verbose && first_entry)
- {
- first_entry = 0;
- vlib_cli_output (vm,
- "%=19s%=7s%=7s%=8s%=9s%=7s%=7s%=5s%=30s",
- "Mac-Address", "BD-Idx", "If-Idx",
- "BSN-ISN", "Age(min)", "static", "filter",
- "bvi", "Interface-Name");
- }
-
- key.raw = v->kvp[k].key;
- result.raw = v->kvp[k].value;
- total_entries++;
-
- if (verbose &&
- ((bd_index >> 31) || (bd_index == key.fields.bd_index)))
- {
- if (learn && result.fields.age_not)
- continue; /* skip provisioned macs */
-
- if (add && !result.fields.age_not)
- continue; /* skip learned macs */
-
- bd_config = vec_elt_at_index (l2input_main.bd_configs,
- key.fields.bd_index);
-
- if (result.fields.age_not)
- s = format (s, "no");
- else if (bd_config->mac_age == 0)
- s = format (s, "-");
- else
- {
- i16 delta = now - result.fields.timestamp;
- delta += delta < 0 ? 256 : 0;
- s = format (s, "%d", delta);
- }