summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/interface.c')
-rw-r--r--src/vnet/interface.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/vnet/interface.c b/src/vnet/interface.c
index d3ad896be12..36793f1177e 100644
--- a/src/vnet/interface.c
+++ b/src/vnet/interface.c
@@ -998,11 +998,30 @@ vnet_hw_interface_walk_sw (vnet_main_t * vnm,
hash_foreach (id, sw_if_index,
hi->sub_interface_sw_if_index_by_id,
({
- fn (vnm, sw_if_index, ctx);
+ if (WALK_STOP == fn (vnm, sw_if_index, ctx))
+ break;
}));
/* *INDENT-ON* */
}
+void
+vnet_sw_interface_walk (vnet_main_t * vnm,
+ vnet_sw_interface_walk_t fn, void *ctx)
+{
+ vnet_interface_main_t *im;
+ vnet_sw_interface_t *si;
+
+ im = &vnm->interface_main;
+
+ /* *INDENT-OFF* */
+ pool_foreach (si, im->sw_interfaces,
+ {
+ if (WALK_STOP == fn (vnm, si, ctx))
+ break;
+ });
+ /* *INDENT-ON* */
+}
+
static void
serialize_vnet_hw_interface_set_class (serialize_main_t * m, va_list * va)
{