diff options
author | Pavel Kotucek <pavel.kotucek@pantheon.tech> | 2018-11-27 09:59:44 +0100 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2018-11-29 08:49:17 +0000 |
commit | 609e1210c6339376dd6cdd0f79195b436d5614d2 (patch) | |
tree | 5483c93c35261230750e67e5277108b8b081f65b /src/vnet/ip/ip6_punt_drop.c | |
parent | dfe4cf48ae344b882f0fd53d08b6917ef4391530 (diff) |
VPP-1507: Added binary api to dump configured ip_punt_redirect
Change-Id: I790f7785e183cc9aaffd5b593617c4e12a32e20d
Signed-off-by: Pavel Kotucek <pavel.kotucek@pantheon.tech>
Diffstat (limited to 'src/vnet/ip/ip6_punt_drop.c')
-rw-r--r-- | src/vnet/ip/ip6_punt_drop.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/vnet/ip/ip6_punt_drop.c b/src/vnet/ip/ip6_punt_drop.c index ea8477f81a5..3c839ffdd74 100644 --- a/src/vnet/ip/ip6_punt_drop.c +++ b/src/vnet/ip/ip6_punt_drop.c @@ -399,6 +399,46 @@ VLIB_CLI_COMMAND (ip6_punt_redirect_command, static) = }; /* *INDENT-ON* */ +ip_punt_redirect_detail_t * +ip6_punt_redirect_entries (u32 sw_if_index) +{ + ip_punt_redirect_rx_t *pr; + ip_punt_redirect_detail_t *prs = 0; + u32 rx_sw_if_index; + + vec_foreach_index (rx_sw_if_index, + ip6_punt_redirect_cfg.redirect_by_rx_sw_if_index) + { + if (sw_if_index == ~0 || sw_if_index == rx_sw_if_index) + { + pr = + &ip6_punt_redirect_cfg.redirect_by_rx_sw_if_index[rx_sw_if_index]; + if (NULL != pr && ~0 != pr->tx_sw_if_index) + { + ip_punt_redirect_detail_t detail = {.rx_sw_if_index = + rx_sw_if_index, + .punt_redirect = *pr + }; + vec_add1 (prs, detail); + } + } + } + if (~0 != ip6_punt_redirect_cfg.any_rx_sw_if_index.tx_sw_if_index) + { + pr = &ip6_punt_redirect_cfg.any_rx_sw_if_index; + if (NULL != pr) + { + ip_punt_redirect_detail_t detail = {.rx_sw_if_index = + rx_sw_if_index, + .punt_redirect = *pr + }; + vec_add1 (prs, detail); + } + } + + return prs; +} + static clib_error_t * ip6_punt_redirect_show_cmd (vlib_main_t * vm, unformat_input_t * main_input, |