From patchwork Sun Oct 21 22:55:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17543 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 0A5D18316B; Mon, 22 Oct 2018 00:57:36 +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="qzQ+5Daz"; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=79.140.41.39; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver= Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id 7E7BC83094 for ; Mon, 22 Oct 2018 00:56:16 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593D704FD0000000000008096.dip0.t-ipconnect.de [IPv6:2003:c5:93d7:4fd::8096]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 169AA1100D5; Mon, 22 Oct 2018 00:56:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1540162576; bh=wOxSFdaJza3OP5tGedu/wWOXmeJL/7/LaIdLr28WT6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qzQ+5DazKFX2V3ijPr96I30mXO8mW1REeqJFfphvVAAGUn346E8YtwJV5s/Sgs4hq Gmlt1+7p/m1kNJRiUlbSxb3ALM6OzYNatFcPk3aDB7bNJK8vEwtDsPsOr/i+f8zI+U sdd1HsOCQLfH22OZ2szDJU8DTUb/dHJbQl7Ev3Zc= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Mon, 22 Oct 2018 00:55:19 +0200 Message-Id: <20181021225524.8155-34-sven@narfation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181021225524.8155-1-sven@narfation.org> References: <20181021225524.8155-1-sven@narfation.org> MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCH 33/38] batctl: Move isolation_mark 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 + isolation_mark.c | 35 +++++++++++++++++++++++++++++++++++ sys.c | 9 --------- 3 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 isolation_mark.c diff --git a/Makefile b/Makefile index 7f82d44..9598065 100755 --- a/Makefile +++ b/Makefile @@ -51,6 +51,7 @@ OBJ += gw_mode.o OBJ += hash.o OBJ += icmp_helper.o OBJ += interface.o +OBJ += isolation_mark.o OBJ += loglevel.o OBJ += log.o OBJ += main.o diff --git a/isolation_mark.c b/isolation_mark.c new file mode 100644 index 0000000..300bb02 --- /dev/null +++ b/isolation_mark.c @@ -0,0 +1,35 @@ +// 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 + +#include "main.h" +#include "sys.h" + +static struct settings_data batctl_settings_isolation_mark = { + .sysfs_name = "isolation_mark", + .params = NULL, +}; + +COMMAND_NAMED(SUBCOMMAND, isolation_mark, "mark", handle_sys_setting, + COMMAND_FLAG_MESH_IFACE, &batctl_settings_isolation_mark, + "[mark] \tdisplay or modify isolation_mark setting"); diff --git a/sys.c b/sys.c index f81298b..355b801 100644 --- a/sys.c +++ b/sys.c @@ -155,15 +155,6 @@ 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_isolation_mark = { - .sysfs_name = "isolation_mark", - .params = NULL, -}; - -COMMAND_NAMED(SUBCOMMAND, isolation_mark, "mark", handle_sys_setting, - COMMAND_FLAG_MESH_IFACE, &batctl_settings_isolation_mark, - "[mark] \tdisplay or modify isolation_mark setting"); - static struct settings_data batctl_settings_multicast_mode = { .sysfs_name = SYS_MULTICAST_MODE, .params = sysfs_param_enable,