Repository : ssh://git@open-mesh.org/batctl
On branch : master
commit 33ddb6c04e1b33d43a94620a86f40bbbf873f44e Author: Sven Eckelmann sven@narfation.org Date: Thu Oct 25 18:22:34 2018 +0200
batctl: Move bridge_loop_avoidance setting to own file
The sysfs settings are planned to get also be implemented in netlink. To avoid cluttering up netlink.c again, it should be stored in a separate file. This also allows to order the usage lines using the Makefile.
Signed-off-by: Sven Eckelmann sven@narfation.org
33ddb6c04e1b33d43a94620a86f40bbbf873f44e Makefile | 1 + bonding.c => bridge_loop_avoidance.c | 12 ++++++------ sys.c | 9 --------- 3 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/Makefile b/Makefile index c1b8484..6664aa0 100755 --- a/Makefile +++ b/Makefile @@ -37,6 +37,7 @@ ifeq ($(CONFIG_BATCTL_BISECT),y) OBJ += $(OBJ_BISECT) endif OBJ += bonding.o +OBJ += bridge_loop_avoidance.o OBJ += claimtable.o OBJ += dat_cache.o OBJ += debugfs.o diff --git a/bonding.c b/bridge_loop_avoidance.c similarity index 70% copy from bonding.c copy to bridge_loop_avoidance.c index f7105c9..0db49f2 100644 --- a/bonding.c +++ b/bridge_loop_avoidance.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright (C) 2009-2018 B.A.T.M.A.N. contributors: * - * Marek Lindner mareklindner@neomailbox.ch + * Simon Wunderlich sw@simonwunderlich.de * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public @@ -23,11 +23,11 @@ #include "main.h" #include "sys.h"
-static struct settings_data batctl_settings_bonding = { - .sysfs_name = "bonding", +static struct settings_data batctl_settings_bridge_loop_avoidance = { + .sysfs_name = SYS_BLA, .params = sysfs_param_enable, };
-COMMAND_NAMED(SUBCOMMAND, bonding, "b", handle_sys_setting, - COMMAND_FLAG_MESH_IFACE, &batctl_settings_bonding, - "[0|1] \tdisplay or modify bonding setting"); +COMMAND_NAMED(SUBCOMMAND, bridge_loop_avoidance, "bl", handle_sys_setting, + COMMAND_FLAG_MESH_IFACE, &batctl_settings_bridge_loop_avoidance, + "[0|1] \tdisplay or modify bridge_loop_avoidance setting"); diff --git a/sys.c b/sys.c index 8ad925e..e08738d 100644 --- a/sys.c +++ b/sys.c @@ -146,15 +146,6 @@ COMMAND_NAMED(SUBCOMMAND, orig_interval, "it", handle_sys_setting, COMMAND_FLAG_MESH_IFACE, &batctl_settings_orig_interval, "[interval] \tdisplay or modify orig_interval setting");
-static struct settings_data batctl_settings_bridge_loop_avoidance = { - .sysfs_name = SYS_BLA, - .params = sysfs_param_enable, -}; - -COMMAND_NAMED(SUBCOMMAND, bridge_loop_avoidance, "bl", handle_sys_setting, - COMMAND_FLAG_MESH_IFACE, &batctl_settings_bridge_loop_avoidance, - "[0|1] \tdisplay or modify bridge_loop_avoidance setting"); - static struct settings_data batctl_settings_distributed_arp_table = { .sysfs_name = SYS_DAT, .params = sysfs_param_enable,