From a2719d0e88ac2d459238f90281cbafe09d088d79 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Sun, 21 Jun 2020 19:21:51 +0300 Subject: zebra: show interfaces from all VRFs in "show interface ..." commands Signed-off-by: Igor Ryzhov --- lib/if.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/if.c') diff --git a/lib/if.c b/lib/if.c index f03574e787..e12b4f8c8f 100644 --- a/lib/if.c +++ b/lib/if.c @@ -383,6 +383,17 @@ struct interface *if_lookup_by_name(const char *name, vrf_id_t vrf_id) return RB_FIND(if_name_head, &vrf->ifaces_by_name, &if_tmp); } +struct interface *if_lookup_by_name_vrf(const char *name, struct vrf *vrf) +{ + struct interface if_tmp; + + if (!name || strnlen(name, INTERFACE_NAMSIZ) == INTERFACE_NAMSIZ) + return NULL; + + strlcpy(if_tmp.name, name, sizeof(if_tmp.name)); + return RB_FIND(if_name_head, &vrf->ifaces_by_name, &if_tmp); +} + struct interface *if_lookup_by_name_all_vrf(const char *name) { struct vrf *vrf; -- cgit v1.2.3