diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-12-18 13:44:23 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-01-04 18:21:00 +0100 |
commit | df3956009145194f4025c136ded9942d9564c455 (patch) | |
tree | 1ef9197045391c336e19dcefd351155139c9f946 | |
parent | lib: Add a basic mlag.h file (diff) | |
download | frr-df3956009145194f4025c136ded9942d9564c455.tar.xz frr-df3956009145194f4025c136ded9942d9564c455.zip |
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 <sharpd@cumulusnetworks.com>
-rw-r--r-- | zebra/subdir.am | 2 | ||||
-rw-r--r-- | zebra/zebra_mlag.c | 34 | ||||
-rw-r--r-- | zebra/zebra_mlag.h | 29 | ||||
-rw-r--r-- | zebra/zebra_router.c | 5 |
4 files changed, 70 insertions, 0 deletions
diff --git a/zebra/subdir.am b/zebra/subdir.am index b8f5e0d40..977990c38 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 000000000..d1fc71a5a --- /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 000000000..97065bb84 --- /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 2e1c69fb9..ae18a0d29 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"); |