mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 18:16:43 +00:00
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>
This commit is contained in:
parent
ac2914d326
commit
b7e48f2147
@ -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; \
|
||||
|
Loading…
Reference in New Issue
Block a user