X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fl2%2Fl2_fib.c;h=48be42e8ce91f3b149ad3514b8f809c8d253b008;hb=4d5b917;hp=60d0db56d9dd3ae9d2fc710a1c912d8fed7c0b4a;hpb=b54d081873ac975e06be2569a17e6150779e3018;p=vpp.git diff --git a/src/vnet/l2/l2_fib.c b/src/vnet/l2/l2_fib.c index 60d0db56d9d..48be42e8ce9 100644 --- a/src/vnet/l2/l2_fib.c +++ b/src/vnet/l2/l2_fib.c @@ -54,6 +54,27 @@ l2fib_main_t l2fib_main; +u8 * +format_l2fib_entry_result_flags (u8 * s, va_list * args) +{ + l2fib_entry_result_flags_t flags = va_arg (*args, int); + + if (L2FIB_ENTRY_RESULT_FLAG_NONE == flags) + { + s = format (s, "none"); + } + else + { +#define _(a,v,t) { \ + if (flags & L2FIB_ENTRY_RESULT_FLAG_##a) \ + s = format (s, "%s ", t); \ + } + foreach_l2fib_entry_result_attr +#undef _ + } + return (s); +} + static void incr_mac_address (u8 * mac) { @@ -287,7 +308,7 @@ show_l2fib (vlib_main_t * vm, } /*? - * This command dispays the MAC Address entries of the L2 FIB table. + * This command displays the MAC Address entries of the L2 FIB table. * Output can be filtered to just get the number of MAC Addresses or display * each MAC Address for all bridge domains or just a single bridge domain. * @@ -376,7 +397,7 @@ l2fib_cur_seq_num (u32 bd_index, u32 sw_if_index) * If the entry already exists then overwrite it */ void -l2fib_add_entry (u8 * mac, u32 bd_index, +l2fib_add_entry (const u8 * mac, u32 bd_index, u32 sw_if_index, l2fib_entry_result_flags_t flags) { l2fib_entry_key_t key; @@ -389,7 +410,7 @@ l2fib_add_entry (u8 * mac, u32 bd_index, /* set up key */ key.raw = l2fib_make_key (mac, bd_index); - /* check if entry alread exist */ + /* check if entry already exist */ if (BV (clib_bihash_search) (&fm->mac_table, &kv, &kv)) { /* decrement counter if overwriting a learned mac */ @@ -660,7 +681,7 @@ VLIB_CLI_COMMAND (l2fib_test_command, static) = { * sw_if_index is non-zero and does not match that in the entry. */ u32 -l2fib_del_entry (u8 * mac, u32 bd_index, u32 sw_if_index) +l2fib_del_entry (const u8 * mac, u32 bd_index, u32 sw_if_index) { l2fib_entry_result_t result; l2fib_main_t *mp = &l2fib_main; @@ -1070,7 +1091,7 @@ l2fib_scan (vlib_main_t * vm, f64 start_time, u8 event_only) } if (event_only || l2fib_entry_result_is_set_AGE_NOT (&result)) - continue; /* skip aging - static_mac alsways age_not */ + continue; /* skip aging - static_mac always age_not */ /* start aging processing */ u32 bd_index = key.fields.bd_index; @@ -1242,7 +1263,7 @@ l2fib_init (vlib_main_t * vm) L2FIB_NUM_BUCKETS, L2FIB_MEMORY_SIZE); /* verify the key constructor is good, since it is endian-sensitive */ - memset (test_mac, 0, sizeof (test_mac)); + clib_memset (test_mac, 0, sizeof (test_mac)); test_mac[0] = 0x11; test_key.raw = 0; test_key.raw = l2fib_make_key ((u8 *) & test_mac, 0x1234);