From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Sven Eckelmann Date: Mon, 22 Oct 2018 00:55:14 +0200 Message-Id: <20181021225524.8155-29-sven@narfation.org> In-Reply-To: <20181021225524.8155-1-sven@narfation.org> References: <20181021225524.8155-1-sven@narfation.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [B.A.T.M.A.N.] [PATCH 28/38] batctl: Move aggregation setting to own file List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: b.a.t.m.a.n@lists.open-mesh.org 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 --- Makefile | 1 + aggregation.c | 33 +++++++++++++++++++++++++++++++++ sys.c | 9 --------- 3 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 aggregation.c 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/aggregation.c b/aggregation.c new file mode 100644 index 0000000..57c1dbb --- /dev/null +++ b/aggregation.c @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (C) 2009-2018 B.A.T.M.A.N. contributors: + * + * Marek Lindner + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA + * + * License-Filename: LICENSES/preferred/GPL-2.0 + */ + +#include "main.h" +#include "sys.h" + +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"); 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, -- 2.19.1