diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2019-03-25 17:57:36 +0100 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2019-05-07 15:49:39 +0200 |
commit | 9fc0bc5cfcb8c59860805934347ec6fd549eb492 (patch) | |
tree | c55c8c16f67e7894bf13b44f594dc1405e7527a4 /bfdd | |
parent | bfdd: use vrf api for creation socket with binding with vrf lite (diff) | |
download | frr-9fc0bc5cfcb8c59860805934347ec6fd549eb492.tar.xz frr-9fc0bc5cfcb8c59860805934347ec6fd549eb492.zip |
bfdd: add vrf framework
vrf initialisation is done. hooks are installed. no specific action is
done, except the vrf initialisation.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bfdd')
-rw-r--r-- | bfdd/bfd.c | 33 | ||||
-rw-r--r-- | bfdd/bfd.h | 1 | ||||
-rw-r--r-- | bfdd/bfdd.c | 2 |
3 files changed, 36 insertions, 0 deletions
diff --git a/bfdd/bfd.c b/bfdd/bfd.c index 4a1cad526..196f15d23 100644 --- a/bfdd/bfd.c +++ b/bfdd/bfd.c @@ -1443,3 +1443,36 @@ void bfd_shutdown(void) hash_free(bfd_id_hash); hash_free(bfd_key_hash); } + +static int bfd_vrf_new(struct vrf *vrf) +{ + log_debug("VRF Created: %s(%u)", vrf->name, vrf->vrf_id); + return 0; +} + +static int bfd_vrf_delete(struct vrf *vrf) +{ + log_debug("VRF Deletion: %s(%u)", vrf->name, vrf->vrf_id); + return 0; +} + +static int bfd_vrf_enable(struct vrf *vrf) +{ + log_debug("VRF enable add %s id %u", vrf->name, vrf->vrf_id); + return 0; +} + +static int bfd_vrf_disable(struct vrf *vrf) +{ + if (vrf->vrf_id == VRF_DEFAULT) + return 0; + log_debug("VRF disable %s id %d", vrf->name, vrf->vrf_id); + return 0; +} + +void bfd_vrf_init(void) +{ + vrf_init(bfd_vrf_new, bfd_vrf_enable, bfd_vrf_disable, + bfd_vrf_delete, NULL); +} + diff --git a/bfdd/bfd.h b/bfdd/bfd.h index 36eea2433..f6a5b6939 100644 --- a/bfdd/bfd.h +++ b/bfdd/bfd.h @@ -541,6 +541,7 @@ void bs_to_bpc(struct bfd_session *bs, struct bfd_peer_cfg *bpc); /* BFD hash data structures interface */ void bfd_initialize(void); void bfd_shutdown(void); +void bfd_vrf_init(void); struct bfd_session *bfd_id_lookup(uint32_t id); struct bfd_session *bfd_key_lookup(struct bfd_key key); diff --git a/bfdd/bfdd.c b/bfdd/bfdd.c index a7643c134..d352f1103 100644 --- a/bfdd/bfdd.c +++ b/bfdd/bfdd.c @@ -208,6 +208,8 @@ int main(int argc, char *argv[]) /* Initialize BFD data structures. */ bfd_initialize(); + bfd_vrf_init(); + /* Initialize zebra connection. */ bfdd_zclient_init(&bfdd_privs); |