From: Donald Sharp Date: Tue, 18 Dec 2018 12:44:23 +0000 (-0500) Subject: zebra: Add some small infrastructure to get the mlag code in zebra started X-Git-Tag: frr-7.1-dev~53^2~17 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=df3956009145194f4025c136ded9942d9564c455;p=mirror%2Ffrr.git zebra: Add some small infrastructure to get the mlag code in zebra started Add a zebra_mlag.h and a zebra_mlag.c startup/shutdown code to zebra. Signed-off-by: Donald Sharp --- diff --git a/zebra/subdir.am b/zebra/subdir.am index b8f5e0d409..977990c381 100644 --- a/zebra/subdir.am +++ b/zebra/subdir.am @@ -64,6 +64,7 @@ zebra_zebra_SOURCES = \ zebra/rtread_sysctl.c \ zebra/rule_netlink.c \ zebra/rule_socket.c \ + zebra/zebra_mlag.c \ zebra/zebra_l2.c \ zebra/zebra_memory.c \ zebra/zebra_dplane.c \ @@ -119,6 +120,7 @@ noinst_HEADERS += \ zebra/rt_netlink.h \ zebra/rtadv.h \ zebra/rule_netlink.h \ + zebra/zebra_mlag.h \ zebra/zebra_fpm_private.h \ zebra/zebra_l2.h \ zebra/zebra_dplane.h \ diff --git a/zebra/zebra_mlag.c b/zebra/zebra_mlag.c new file mode 100644 index 0000000000..d1fc71a5a0 --- /dev/null +++ b/zebra/zebra_mlag.c @@ -0,0 +1,34 @@ +/* Zebra Mlag Code. + * Copyright (C) 2018 Cumulus Networks, Inc. + * Donald Sharp + * + * This file is part of 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 FRR; see the file COPYING. If not, write to the Free + * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ +#include "zebra.h" + +#include "hook.h" + +#include "zebra/zebra_mlag.h" + +void zebra_mlag_init(void) +{ +} + +void zebra_mlag_terminate(void) +{ +} diff --git a/zebra/zebra_mlag.h b/zebra/zebra_mlag.h new file mode 100644 index 0000000000..97065bb841 --- /dev/null +++ b/zebra/zebra_mlag.h @@ -0,0 +1,29 @@ +/* Zebra mlag header. + * Copyright (C) 2018 Cumulus Networks, Inc. + * Donald Sharp + * + * This file is part of 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 FRR; see the file COPYING. If not, write to the Free + * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ +#ifndef __ZEBRA_MLAG_H__ +#define __ZEBRA_MLAG_H__ + +#include "mlag.h" + +void zebra_mlag_init(void); +void zebra_mlag_terminate(void); +#endif diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c index 2e1c69fb92..ae18a0d290 100644 --- a/zebra/zebra_router.c +++ b/zebra/zebra_router.c @@ -25,6 +25,7 @@ #include "zebra_memory.h" #include "zebra_pbr.h" #include "zebra_vxlan.h" +#include "zebra_mlag.h" struct zebra_router zrouter; @@ -159,6 +160,8 @@ void zebra_router_terminate(void) } zebra_vxlan_disable(); + zebra_mlag_terminate(); + hash_clean(zrouter.rules_hash, zebra_pbr_rules_free); hash_free(zrouter.rules_hash); @@ -173,6 +176,8 @@ void zebra_router_terminate(void) void zebra_router_init(void) { zebra_vxlan_init(); + zebra_mlag_init(); + zrouter.rules_hash = hash_create_size(8, zebra_pbr_rules_hash_key, zebra_pbr_rules_hash_equal, "Rules Hash");