diff options
Diffstat (limited to 'src/vnet/interface_funcs.h')
-rw-r--r-- | src/vnet/interface_funcs.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/vnet/interface_funcs.h b/src/vnet/interface_funcs.h index ab808dfa545..b3aca2fdd28 100644 --- a/src/vnet/interface_funcs.h +++ b/src/vnet/interface_funcs.h @@ -183,6 +183,26 @@ vnet_sw_interface_is_admin_up (vnet_main_t * vnm, u32 sw_if_index) } always_inline uword +vnet_swif_is_api_visible (vnet_sw_interface_t * si) +{ + return !(si->flags & VNET_SW_INTERFACE_FLAG_HIDDEN); +} + +always_inline uword +vnet_sw_interface_is_api_visible (vnet_main_t * vnm, u32 sw_if_index) +{ + vnet_sw_interface_t *si = vnet_get_sw_interface (vnm, sw_if_index); + return vnet_swif_is_api_visible (si); +} + +always_inline uword +vnet_sw_interface_is_api_valid (vnet_main_t * vnm, u32 sw_if_index) +{ + return !pool_is_free_index (vnm->interface_main.sw_interfaces, sw_if_index) + && vnet_sw_interface_is_api_visible (vnm, sw_if_index); +} + +always_inline uword vnet_hw_interface_get_flags (vnet_main_t * vnm, u32 hw_if_index) { vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index); |