Skip to content

Commit

Permalink
ospfd: Add a function to return the name of the vrf we are in.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
donaldsharp committed Nov 19, 2019
1 parent f573ec6 commit 88b6b28
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ospfd/ospfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
1 change: 1 addition & 0 deletions ospfd/ospfd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 88b6b28

Please sign in to comment.