diff options
author | Filip Tehlar <ftehlar@cisco.com> | 2021-07-23 22:03:05 +0000 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2021-10-18 07:03:12 +0000 |
commit | f0e67d78ae23ff3d5751ea10e9e76cb6e81ba4a5 (patch) | |
tree | c63b1ac48809a7247bb288e01d5c9cdfb6038b7c /src/plugins | |
parent | 2e55823af6c1cc6856e4a1f2cea659170bd76fb7 (diff) |
interface: add api test file
Type: improvement
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: Ib07029204ecf12bf2adb5a39afa54bc98fb81f34
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/arping/arping_test.c | 4 | ||||
-rw-r--r-- | src/plugins/gtpu/gtpu_test.c | 18 |
2 files changed, 1 insertions, 21 deletions
diff --git a/src/plugins/arping/arping_test.c b/src/plugins/arping/arping_test.c index ac4349d20d2..00b0b98ab9a 100644 --- a/src/plugins/arping/arping_test.c +++ b/src/plugins/arping/arping_test.c @@ -52,7 +52,6 @@ api_arping (vat_main_t *vam) arping_args_t args = { 0 }; int ret; unformat_input_t *input = vam->input; - vnet_main_t *vnm = vnet_get_main (); f64 interval = ARPING_DEFAULT_INTERVAL; vl_api_control_ping_t *mp_ping; arping_test_main_t *atm = &arping_test_main; @@ -76,8 +75,7 @@ api_arping (vat_main_t *vam) return -99; } - if (!unformat_user (input, unformat_vnet_sw_interface, vnm, - &args.sw_if_index)) + if (!unformat_user (input, api_unformat_sw_if_index, vam, &args.sw_if_index)) { errmsg ("unknown interface `%U'", format_unformat_error, input); return -99; diff --git a/src/plugins/gtpu/gtpu_test.c b/src/plugins/gtpu/gtpu_test.c index 373e7888341..dcfe3d02666 100644 --- a/src/plugins/gtpu/gtpu_test.c +++ b/src/plugins/gtpu/gtpu_test.c @@ -91,24 +91,6 @@ static void vl_api_gtpu_add_del_tunnel_reply_t_handler } static uword -api_unformat_sw_if_index (unformat_input_t * input, va_list * args) -{ - vat_main_t *vam = va_arg (*args, vat_main_t *); - u32 *result = va_arg (*args, u32 *); - u8 *if_name; - uword *p; - - if (!unformat (input, "%s", &if_name)) - return 0; - - p = hash_get_mem (vam->sw_if_index_by_interface_name, if_name); - if (p == 0) - return 0; - *result = p[0]; - return 1; -} - -static uword api_unformat_hw_if_index (unformat_input_t * input, va_list * args) { return 0; |