]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: Add a function to return the name of the vrf we are in.
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 12 Nov 2019 19:17:14 +0000 (14:17 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 19 Nov 2019 12:47:19 +0000 (07:47 -0500)
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>
ospfd/ospfd.c
ospfd/ospfd.h

index b12fa63723639b9bd1fc6f317d31d191f142a67c..5058886f362b32465cef555088932276e72d061b 100644 (file)
@@ -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;
+}
index b31ad303758d175f4e80abfa0f986da016a1ef69..937d363b4c2030b293f006ec6889c6b5e0009072 100644 (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);
 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 */