diff options
author | Damjan Marion <damarion@cisco.com> | 2022-01-06 20:36:14 +0100 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2022-01-07 12:49:47 +0000 |
commit | 5c954c4641c7894636aa0533634ef4f5a6bed615 (patch) | |
tree | ee3cbeb1e94fadda57aa8620eacfc30d16b7b1df /src/plugins/unittest/fib_test.c | |
parent | c58b1747b34fe1987835f68268218779a81ae3db (diff) |
ethernet: new interface registration function
Prep for supporting multiple callbacks, optional args, etc.
Type: improvement
Change-Id: I96244c098712e8213374678623f12527b0e7f387
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/unittest/fib_test.c')
-rw-r--r-- | src/plugins/unittest/fib_test.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/plugins/unittest/fib_test.c b/src/plugins/unittest/fib_test.c index 3166e649bfe..2261a9d28d0 100644 --- a/src/plugins/unittest/fib_test.c +++ b/src/plugins/unittest/fib_test.c @@ -142,16 +142,15 @@ fib_test_mk_intf (u32 ninterfaces) for (i = 0; i < ninterfaces; i++) { - hw_address[5] = i; + vnet_eth_interface_registration_t eir = {}; + vnet_main_t *vnm = vnet_get_main(); - error = ethernet_register_interface(vnet_get_main(), - test_interface_device_class.index, - i /* instance */, - hw_address, - &tm->hw_if_indicies[i], - /* flag change */ 0); + hw_address[5] = i; - FIB_TEST((NULL == error), "ADD interface %d", i); + eir.dev_class_index = test_interface_device_class.index; + eir.dev_instance = i; + eir.address = hw_address; + tm->hw_if_indicies[i] = vnet_eth_register_interface (vnm, &eir); error = vnet_hw_interface_set_flags(vnet_get_main(), tm->hw_if_indicies[i], @@ -5169,12 +5168,11 @@ fib_test_v6 (void) /* * Add the interface back. routes stay unresolved. */ - error = ethernet_register_interface(vnet_get_main(), - test_interface_device_class.index, - 0 /* instance */, - hw_address, - &tm->hw_if_indicies[0], - /* flag change */ 0); + vnet_eth_interface_registration_t eir = {}; + eir.dev_class_index = test_interface_device_class.index; + eir.dev_instance = 0; + eir.address = hw_address; + tm->hw_if_indicies[0] = vnet_eth_register_interface (vnet_get_main(), &eir); fei = fib_table_lookup_exact_match(fib_index, &pfx_2001_b_s_64); FIB_TEST(load_balance_is_drop(fib_entry_contribute_ip_forwarding(fei)), |