diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-02-08 11:46:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-08 11:46:29 +0100 |
| commit | 8e71b98f72e843d4910abd02410f07fe1e6565cc (patch) | |
| tree | a84f92632eb0deed948f6b961c489573ede1ac0b /lib/vrf.h | |
| parent | 25236dd35df008a1484f2605299c8228ea1cfc5b (diff) | |
| parent | 9d00a48754440cc9d4674e9b9405642edd983f0f (diff) | |
Merge pull request #1654 from mkanjari/evpn-symm-routing-enhancements
Evpn symmetric routing enhancements
Diffstat (limited to 'lib/vrf.h')
| -rw-r--r-- | lib/vrf.h | 29 |
1 files changed, 28 insertions, 1 deletions
@@ -75,7 +75,8 @@ struct vrf { /* Zebra internal VRF status */ u_char status; -#define VRF_ACTIVE (1 << 0) +#define VRF_ACTIVE (1 << 0) /* VRF is up in kernel */ +#define VRF_CONFIGURED (1 << 1) /* VRF has some FRR configuration */ /* Interfaces belonging to this VRF */ struct if_name_head ifaces_by_name; @@ -120,6 +121,32 @@ extern vrf_id_t vrf_name_to_id(const char *); } while (0) /* + * Check whether the VRF is enabled. + */ +static inline int vrf_is_enabled(struct vrf *vrf) +{ + return vrf && CHECK_FLAG(vrf->status, VRF_ACTIVE); +} + +/* check if the vrf is user configured */ +static inline int vrf_is_user_cfged(struct vrf *vrf) +{ + return vrf && CHECK_FLAG(vrf->status, VRF_CONFIGURED); +} + +/* Mark that VRF has user configuration */ +static inline void vrf_set_user_cfged(struct vrf *vrf) +{ + SET_FLAG(vrf->status, VRF_CONFIGURED); +} + +/* Mark that VRF no longer has any user configuration */ +static inline void vrf_reset_user_cfged(struct vrf *vrf) +{ + UNSET_FLAG(vrf->status, VRF_CONFIGURED); +} + +/* * Utilities to obtain the user data */ |
