diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-02-14 14:09:25 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-02-14 14:15:40 +0100 |
commit | b7e48f2147051be7f1e67f7cecba866f7bde620d (patch) | |
tree | fd28e391041acc5a3776ccceb9d8e6111fea310b /lib/vrf.h | |
parent | lib: Format according to our standard (diff) | |
download | frr-b7e48f2147051be7f1e67f7cecba866f7bde620d.tar.xz frr-b7e48f2147051be7f1e67f7cecba866f7bde620d.zip |
lib: Add a macro to allow for quick/easy display of vrf name
Add a quick macro to allow for safe dereference of the vrf
since it may or may not exist in all cases.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r-- | lib/vrf.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -114,6 +114,8 @@ extern struct vrf *vrf_get(vrf_id_t, const char *); extern const char *vrf_id_to_name(vrf_id_t vrf_id); extern vrf_id_t vrf_name_to_id(const char *); +#define VRF_LOGNAME(V) V ? V->name : "Unknown" + #define VRF_GET_ID(V, NAME, USE_JSON) \ do { \ struct vrf *_vrf; \ |