diff options
Diffstat (limited to 'src/vnet/ip/ip4_punt_drop.c')
-rw-r--r-- | src/vnet/ip/ip4_punt_drop.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/vnet/ip/ip4_punt_drop.c b/src/vnet/ip/ip4_punt_drop.c index cec2c5aed9b..e36980ce9ed 100644 --- a/src/vnet/ip/ip4_punt_drop.c +++ b/src/vnet/ip/ip4_punt_drop.c @@ -521,6 +521,42 @@ format_ip_punt_redirect (u8 * s, va_list * args) return (s); } +ip_punt_redirect_detail_t * +ip4_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, + ip4_punt_redirect_cfg.redirect_by_rx_sw_if_index) + { + if (sw_if_index == ~0 || sw_if_index == rx_sw_if_index) + { + pr = + &ip4_punt_redirect_cfg.redirect_by_rx_sw_if_index[rx_sw_if_index]; + if (~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 != ip4_punt_redirect_cfg.any_rx_sw_if_index.tx_sw_if_index) + { + pr = &ip4_punt_redirect_cfg.any_rx_sw_if_index; + ip_punt_redirect_detail_t detail = {.rx_sw_if_index = ~0, + .punt_redirect = *pr + }; + vec_add1 (prs, detail); + } + + return prs; +} + static clib_error_t * ip4_punt_redirect_show_cmd (vlib_main_t * vm, unformat_input_t * main_input, |