Repository : ssh://git@open-mesh.org/batctl
On branch : master
commit c2fbdcd127925009156678959f96ee5bb7d74ea2 Author: Sven Eckelmann sven@narfation.org Date: Thu Oct 25 18:22:31 2018 +0200
batctl: Move aggregation 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
c2fbdcd127925009156678959f96ee5bb7d74ea2 Makefile | 1 + nc_nodes.c => aggregation.c | 13 +++++++------ sys.c | 9 --------- 3 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/Makefile b/Makefile index 93db44a..dfc59af 100755 --- a/Makefile +++ b/Makefile @@ -29,6 +29,7 @@ BINARY_NAME = batctl
OBJ_BISECT = bisect_iv.o
+OBJ += aggregation.o OBJ += bat-hosts.o OBJ += backbonetable.o ifeq ($(CONFIG_BATCTL_BISECT),y) diff --git a/nc_nodes.c b/aggregation.c similarity index 72% copy from nc_nodes.c copy to aggregation.c index 9cf437d..57c1dbb 100644 --- a/nc_nodes.c +++ b/aggregation.c @@ -20,13 +20,14 @@ * License-Filename: LICENSES/preferred/GPL-2.0 */
-#include "debug.h" #include "main.h" +#include "sys.h"
-static struct debug_table_data batctl_debug_table_nc_nodes = { - .debugfs_name = DEBUG_NC_NODES, - .header_lines = 0, +static struct settings_data batctl_settings_aggregation = { + .sysfs_name = "aggregated_ogms", + .params = sysfs_param_enable, };
-COMMAND_NAMED(DEBUGTABLE, nc_nodes, "nn", handle_debug_table, - COMMAND_FLAG_MESH_IFACE, &batctl_debug_table_nc_nodes, ""); +COMMAND_NAMED(SUBCOMMAND, aggregation, "ag", handle_sys_setting, + COMMAND_FLAG_MESH_IFACE, &batctl_settings_aggregation, + "[0|1] \tdisplay or modify aggregation setting"); diff --git a/sys.c b/sys.c index 08b389e..00e452c 100644 --- a/sys.c +++ b/sys.c @@ -173,15 +173,6 @@ COMMAND_NAMED(SUBCOMMAND, distributed_arp_table, "dat", handle_sys_setting, COMMAND_FLAG_MESH_IFACE, &batctl_settings_distributed_arp_table, "[0|1] \tdisplay or modify distributed_arp_table setting");
-static struct settings_data batctl_settings_aggregation = { - .sysfs_name = "aggregated_ogms", - .params = sysfs_param_enable, -}; - -COMMAND_NAMED(SUBCOMMAND, aggregation, "ag", handle_sys_setting, - COMMAND_FLAG_MESH_IFACE, &batctl_settings_aggregation, - "[0|1] \tdisplay or modify aggregation setting"); - static struct settings_data batctl_settings_bonding = { .sysfs_name = "bonding", .params = sysfs_param_enable,