Repository : ssh://git@open-mesh.org/batctl
On branch : master
commit d3e6ccd5e09eb99b633462242cfea7b4a076cb5e Author: Sven Eckelmann sven@narfation.org Date: Thu Oct 25 18:22:38 2018 +0200
batctl: Move multicast_mode 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
d3e6ccd5e09eb99b633462242cfea7b4a076cb5e Makefile | 1 + bonding.c => multicast_mode.c | 12 ++++++------ sys.c | 9 --------- 3 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/Makefile b/Makefile index 9598065..9e5199d 100755 --- a/Makefile +++ b/Makefile @@ -56,6 +56,7 @@ OBJ += loglevel.o OBJ += log.o OBJ += main.o OBJ += mcast_flags.o +OBJ += multicast_mode.o OBJ += nc_nodes.o OBJ += neighbors.o OBJ += netlink.o diff --git a/bonding.c b/multicast_mode.c similarity index 71% copy from bonding.c copy to multicast_mode.c index f7105c9..8542928 100644 --- a/bonding.c +++ b/multicast_mode.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 + * Linus Lüssing linus.luessing@c0d3.blue * * 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_multicast_mode = { + .sysfs_name = SYS_MULTICAST_MODE, .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, multicast_mode, "mm", handle_sys_setting, + COMMAND_FLAG_MESH_IFACE, &batctl_settings_multicast_mode, + "[0|1] \tdisplay or modify multicast_mode setting"); diff --git a/sys.c b/sys.c index 355b801..80ef3ab 100644 --- a/sys.c +++ b/sys.c @@ -154,12 +154,3 @@ static struct settings_data batctl_settings_network_coding = { COMMAND_NAMED(SUBCOMMAND, network_coding, "nc", handle_sys_setting, COMMAND_FLAG_MESH_IFACE, &batctl_settings_network_coding, "[0|1] \tdisplay or modify network_coding setting"); - -static struct settings_data batctl_settings_multicast_mode = { - .sysfs_name = SYS_MULTICAST_MODE, - .params = sysfs_param_enable, -}; - -COMMAND_NAMED(SUBCOMMAND, multicast_mode, "mm", handle_sys_setting, - COMMAND_FLAG_MESH_IFACE, &batctl_settings_multicast_mode, - "[0|1] \tdisplay or modify multicast_mode setting");