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 <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2019-11-12 14:17:14 -05:00
parent f573ec607c
commit 88b6b28ef3
2 changed files with 9 additions and 0 deletions

View File

@ -2173,3 +2173,11 @@ const char *ospf_vrf_id_to_name(vrf_id_t vrf_id)
return vrf ? vrf->name : "NIL"; 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;
}

View File

@ -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); const char *ospf_vrf_id_to_name(vrf_id_t vrf_id);
int ospf_area_nssa_no_summary_set(struct ospf *, struct in_addr); 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 */ #endif /* _ZEBRA_OSPFD_H */