]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bfdd: add vrf framework
authorPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 25 Mar 2019 16:57:36 +0000 (17:57 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 7 May 2019 13:49:39 +0000 (15:49 +0200)
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>
bfdd/bfd.c
bfdd/bfd.h
bfdd/bfdd.c

index 4a1cad5266575f722af7ea54c25618e96338e28b..196f15d23d4f541f31a1b9bd4c0ff7cfb067827d 100644 (file)
@@ -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);
+}
+
index 36eea2433de42234468ae75f37b995548271533d..f6a5b69396df81cf42d09143ed74b76a52ab20b0 100644 (file)
@@ -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);
 
index a7643c13453b7a423c345556c6c8c0c2a96cca45..d352f11031e1345e0c58c2a3f5b8312a13198081 100644 (file)
@@ -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);