From: Donald Sharp Date: Tue, 12 Nov 2019 19:17:14 +0000 (-0500) Subject: ospfd: Add a function to return the name of the vrf we are in. X-Git-Tag: base_7.3~153^2~4 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=88b6b28ef33ff3c80ca4504c882735d3847279fc;p=matthieu%2Ffrr.git ospfd: Add a function to return the name of the vrf we are in. Add a helper function to return the name of the vrf we are in so it can be used as part of debug strings. Signed-off-by: Donald Sharp --- diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index b12fa63723..5058886f36 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -2173,3 +2173,11 @@ const char *ospf_vrf_id_to_name(vrf_id_t vrf_id) return vrf ? vrf->name : "NIL"; } + +const char *ospf_get_name(const struct ospf *ospf) +{ + if (ospf->name) + return ospf->name; + else + return VRF_DEFAULT_NAME; +} diff --git a/ospfd/ospfd.h b/ospfd/ospfd.h index b31ad30375..937d363b4c 100644 --- a/ospfd/ospfd.h +++ b/ospfd/ospfd.h @@ -572,4 +572,5 @@ extern void ospf_vrf_unlink(struct ospf *ospf, struct vrf *vrf); const char *ospf_vrf_id_to_name(vrf_id_t vrf_id); int ospf_area_nssa_no_summary_set(struct ospf *, struct in_addr); +const char *ospf_get_name(const struct ospf *ospf); #endif /* _ZEBRA_OSPFD_H */