Repository : ssh://git@open-mesh.org/batctl
On branch : master
commit d6788776ba3cff08a7f4721203633c31b964981b Author: Sven Eckelmann sven@narfation.org Date: Thu Oct 25 18:22:39 2018 +0200
batctl: Move network_coding 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
d6788776ba3cff08a7f4721203633c31b964981b Makefile | 1 + multicast_mode.c => network_coding.c | 12 ++++++------ sys.c | 9 --------- 3 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/Makefile b/Makefile index 9e5199d..8582bf6 100755 --- a/Makefile +++ b/Makefile @@ -60,6 +60,7 @@ OBJ += multicast_mode.o OBJ += nc_nodes.o OBJ += neighbors.o OBJ += netlink.o +OBJ += network_coding.o OBJ += ping.o OBJ += originators.o OBJ += routing_algo.o diff --git a/multicast_mode.c b/network_coding.c similarity index 72% copy from multicast_mode.c copy to network_coding.c index 8542928..a4c4296 100644 --- a/multicast_mode.c +++ b/network_coding.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright (C) 2009-2018 B.A.T.M.A.N. contributors: * - * Linus Lüssing linus.luessing@c0d3.blue + * Martin Hundebøll martin@hundeboll.net * * 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_multicast_mode = { - .sysfs_name = SYS_MULTICAST_MODE, +static struct settings_data batctl_settings_network_coding = { + .sysfs_name = SYS_NETWORK_CODING, .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"); +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"); diff --git a/sys.c b/sys.c index 80ef3ab..932a7e8 100644 --- a/sys.c +++ b/sys.c @@ -145,12 +145,3 @@ static struct settings_data batctl_settings_orig_interval = { 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_network_coding = { - .sysfs_name = SYS_NETWORK_CODING, - .params = sysfs_param_enable, -}; - -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");