diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-02-07 23:48:49 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-05-17 00:27:08 +0000 |
| commit | 53e60e5c5819ea3a602d1bd60b50b0b30caf7702 (patch) | |
| tree | bcbf644e60899329c024416485d8b165c150795a /vrrpd/vrrp.h | |
| parent | 8ec512164cfc1b0b14d99e6030ec124abb61f2fc (diff) | |
vrrpd: autoconfig support
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'vrrpd/vrrp.h')
| -rw-r--r-- | vrrpd/vrrp.h | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/vrrpd/vrrp.h b/vrrpd/vrrp.h index 0df588b221..57ec55eea4 100644 --- a/vrrpd/vrrp.h +++ b/vrrpd/vrrp.h @@ -53,13 +53,17 @@ extern struct zebra_privs_t vrrp_privs; /* Global hash of all Virtual Routers */ struct hash *vrrp_vrouters_hash; -/* - * VRRP Router. - * - * This struct contains all state for a particular VRRP Router operating in a - * Virtual Router for either IPv4 or IPv6. - */ -struct vrrp_router { +/* Whether to automatically configure VRRP instances */ +static bool vrrp_autoconfig_on; +static int vrrp_autoconfig_version; + + /* + * VRRP Router. + * + * This struct contains all state for a particular VRRP Router operating + * in a Virtual Router for either IPv4 or IPv6. + */ + struct vrrp_router { /* * Whether this VRRP Router is active. */ @@ -164,6 +168,9 @@ struct vrrp_router { * implementations. */ struct vrrp_vrouter { + /* Whether this instance was automatically configured */ + bool autoconf; + /* Interface */ struct interface *ifp; @@ -418,6 +425,23 @@ int vrrp_event(struct vrrp_router *r, int event); /* Other ------------------------------------------------------------------- */ /* + * Search for and automatically configure VRRP instances on interfaces. + * + * ifp + * Interface to autoconfig. If it is a macvlan interface and has a VRRP MAC, + * a VRRP instance corresponding to VMAC assigned to macvlan will be created + * on the parent interface and all addresses on the macvlan interface except + * the v6 link local will be configured as VRRP addresses. If NULL, this + * treatment will be applied to all existing interfaces matching the above + * criterion. + * + * Returns: + * -1 on failure + * 0 otherwise + */ +int vrrp_autoconfig(struct interface *ifp); + +/* * Find VRRP Virtual Router by Virtual Router ID */ struct vrrp_vrouter *vrrp_lookup(struct interface *ifp, uint8_t vrid); |
