diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2020-06-21 19:21:51 +0300 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2020-06-22 10:09:35 +0300 |
| commit | a2719d0e88ac2d459238f90281cbafe09d088d79 (patch) | |
| tree | e940c5a41260e58bf65cbca61a6718ba2a423129 /lib/if.c | |
| parent | 8803809f0b51319606b339db00684f1f0eddfc0f (diff) | |
zebra: show interfaces from all VRFs in "show interface ..." commands
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/if.c')
| -rw-r--r-- | lib/if.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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; |
