From patchwork Thu Oct 25 16:22:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17584 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 9402E831EC; Thu, 25 Oct 2018 18:24:23 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="Ha/E87+J"; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2001:4d88:2000:7::2; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver= Received: from v3-1039.vlinux.de (narfation.org [IPv6:2001:4d88:2000:7::2]) by open-mesh.org (Postfix) with ESMTPS id 4FA3B83184 for ; Thu, 25 Oct 2018 18:23:36 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593D355EE7FED32DEE9F3DCBB.dip0.t-ipconnect.de [IPv6:2003:c5:93d3:55ee:7fed:32de:e9f3:dcbb]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 58393110135; Thu, 25 Oct 2018 18:23:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1540484613; bh=og/LIq4JmiI47I7PtXOPGCIiSx3D7rD79W0zZJBKP9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ha/E87+JAnM5eLSvrp9x5/f4qmVc0goBjbHxhZE9RekZmh/ZYwHOOfi2ngwOTKJbm 0he8odDoy6rd0cM0O0AaSymbtIlALHeiZ66IeQRA9oLhjhMisNhJ0luusyRnXlbQcm vvA8taB89+UbOtHnpZ33c6ddVcnoLs8CjUcsvZQc= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Thu, 25 Oct 2018 18:22:35 +0200 Message-Id: <20181025162245.19389-33-sven@narfation.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181025162245.19389-1-sven@narfation.org> References: <20181025162245.19389-1-sven@narfation.org> Subject: [B.A.T.M.A.N.] [PATCH v3 32/42] batctl: Move distributed_arp_table setting to own file X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" 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 + distributed_arp_table.c | 33 +++++++++++++++++++++++++++++++++ sys.c | 9 --------- 3 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 distributed_arp_table.c diff --git a/Makefile b/Makefile index 6664aa0..9cbef82 100755 --- a/Makefile +++ b/Makefile @@ -42,6 +42,7 @@ OBJ += claimtable.o OBJ += dat_cache.o OBJ += debugfs.o OBJ += debug.o +OBJ += distributed_arp_table.o OBJ += functions.o OBJ += gateways.o OBJ += genl.o diff --git a/distributed_arp_table.c b/distributed_arp_table.c new file mode 100644 index 0000000..ba6e5b7 --- /dev/null +++ b/distributed_arp_table.c @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (C) 2009-2018 B.A.T.M.A.N. contributors: + * + * Antonio Quartulli + * + * 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_distributed_arp_table = { + .sysfs_name = SYS_DAT, + .params = sysfs_param_enable, +}; + +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"); diff --git a/sys.c b/sys.c index e08738d..9ce7a90 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_distributed_arp_table = { - .sysfs_name = SYS_DAT, - .params = sysfs_param_enable, -}; - -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_fragmentation = { .sysfs_name = "fragmentation", .params = sysfs_param_enable,