diff options
| author | Christian Franke <chris@opensourcerouting.org> | 2018-09-20 15:38:22 +0200 | 
|---|---|---|
| committer | Christian Franke <chris@opensourcerouting.org> | 2018-10-05 14:05:26 +0200 | 
| commit | 52df822874baeda7d542cd1d0f43049beed5cc90 (patch) | |
| tree | d1af645950e6f8100d967511683ff8367b49d77a | |
| parent | ad10378940516a1ec279e36dc0848232f4c4c377 (diff) | |
isisd: Register as BFD client
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
| -rw-r--r-- | isisd/isis_bfd.c | 60 | ||||
| -rw-r--r-- | isisd/isis_bfd.h | 28 | ||||
| -rw-r--r-- | isisd/isis_main.c | 2 | ||||
| -rw-r--r-- | isisd/subdir.am | 2 | 
4 files changed, 92 insertions, 0 deletions
diff --git a/isisd/isis_bfd.c b/isisd/isis_bfd.c new file mode 100644 index 0000000000..3abf80a2db --- /dev/null +++ b/isisd/isis_bfd.c @@ -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 index 0000000000..e9bf436254 --- /dev/null +++ b/isisd/isis_bfd.h @@ -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 + diff --git a/isisd/isis_main.c b/isisd/isis_main.c index 4d6a6da5d6..fcf07745b9 100644 --- a/isisd/isis_main.c +++ b/isisd/isis_main.c @@ -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); diff --git a/isisd/subdir.am b/isisd/subdir.am index 7571255e59..552bc49b80 100644 --- a/isisd/subdir.am +++ b/isisd/subdir.am @@ -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 \  | 
