]> git.proxmox.com Git - mirror_frr.git/commitdiff
isisd: Register as BFD client
authorChristian Franke <chris@opensourcerouting.org>
Thu, 20 Sep 2018 13:38:22 +0000 (15:38 +0200)
committerChristian Franke <chris@opensourcerouting.org>
Fri, 5 Oct 2018 12:05:26 +0000 (14:05 +0200)
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
isisd/isis_bfd.c [new file with mode: 0644]
isisd/isis_bfd.h [new file with mode: 0644]
isisd/isis_main.c
isisd/subdir.am

diff --git a/isisd/isis_bfd.c b/isisd/isis_bfd.c
new file mode 100644 (file)
index 0000000..3abf80a
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * IS-IS Rout(e)ing protocol - BFD support
+ *
+ * Copyright (C) 2018 Christian Franke
+ *
+ * This file is part of FreeRangeRouting (FRR)
+ *
+ * FRR is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#include <zebra.h>
+
+#include "zclient.h"
+#include "bfd.h"
+
+#include "isisd/isis_bfd.h"
+#include "isisd/isis_zebra.h"
+
+static int isis_bfd_interface_dest_update(int command, struct zclient *zclient,
+                                         zebra_size_t length, vrf_id_t vrf_id)
+{
+       return 0;
+}
+
+static int isis_bfd_nbr_replay(int command, struct zclient *zclient,
+                              zebra_size_t length, vrf_id_t vrf_id)
+{
+       bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
+       return 0;
+}
+
+static void (*orig_zebra_connected)(struct zclient *);
+static void isis_bfd_zebra_connected(struct zclient *zclient)
+{
+       if (orig_zebra_connected)
+               orig_zebra_connected(zclient);
+
+       bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
+}
+
+void isis_bfd_init(void)
+{
+       bfd_gbl_init();
+
+       orig_zebra_connected = zclient->zebra_connected;
+       zclient->zebra_connected = isis_bfd_zebra_connected;
+       zclient->interface_bfd_dest_update = isis_bfd_interface_dest_update;
+       zclient->bfd_dest_replay = isis_bfd_nbr_replay;
+}
diff --git a/isisd/isis_bfd.h b/isisd/isis_bfd.h
new file mode 100644 (file)
index 0000000..e9bf436
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * IS-IS Rout(e)ing protocol - BFD support
+ *
+ * Copyright (C) 2018 Christian Franke
+ *
+ * This file is part of FreeRangeRouting (FRR)
+ *
+ * FRR is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#ifndef ISIS_BFD_H
+#define ISIS_BFD_H
+
+void isis_bfd_init(void);
+
+#endif
+
index 4d6a6da5d602b2b883d4b0ba75055a22bf3d70da..fcf07745b96fb40b2cc8511a33053b3cb18c05ce 100644 (file)
@@ -55,6 +55,7 @@
 #include "isisd/isis_te.h"
 #include "isisd/isis_errors.h"
 #include "isisd/isis_vty_common.h"
+#include "isisd/isis_bfd.h"
 
 /* Default configuration file name */
 #define ISISD_DEFAULT_CONFIG "isisd.conf"
@@ -218,6 +219,7 @@ int main(int argc, char **argv, char **envp)
        isis_new(1);
 
        isis_zebra_init(master);
+       isis_bfd_init();
 
        frr_config_fork();
        frr_run(master);
index 7571255e59251cc0b22c135da34fd2967b9bd3c0..552bc49b80ebe82e2fea6a8036c7e2e673da6e23 100644 (file)
@@ -27,6 +27,7 @@ endif
 noinst_HEADERS += \
        isisd/dict.h \
        isisd/isis_adjacency.h \
+       isisd/isis_bfd.h \
        isisd/isis_circuit.h \
        isisd/isis_common.h \
        isisd/isis_constants.h \
@@ -60,6 +61,7 @@ noinst_HEADERS += \
 LIBISIS_SOURCES = \
        isisd/dict.c \
        isisd/isis_adjacency.c \
+       isisd/isis_bfd.c \
        isisd/isis_circuit.c \
        isisd/isis_csm.c \
        isisd/isis_dr.c \