Repository : ssh://git@open-mesh.org/batctl
On branch : master
commit 150efb5aa42b0b19665d5bfe38eac830981f4c6e Author: Sven Eckelmann sven@narfation.org Date: Thu Oct 25 18:22:37 2018 +0200
batctl: Move isolation_mark 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
150efb5aa42b0b19665d5bfe38eac830981f4c6e Makefile | 1 + ap_isolation.c => isolation_mark.c | 14 ++++++++------ sys.c | 9 --------- 3 files changed, 9 insertions(+), 15 deletions(-)
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/ap_isolation.c b/isolation_mark.c similarity index 72% copy from ap_isolation.c copy to isolation_mark.c index 2d16c68..13ba869 100644 --- a/ap_isolation.c +++ b/isolation_mark.c @@ -20,14 +20,16 @@ * License-Filename: LICENSES/preferred/GPL-2.0 */
+#include <stddef.h> + #include "main.h" #include "sys.h"
-static struct settings_data batctl_settings_ap_isolation = { - .sysfs_name = "ap_isolation", - .params = sysfs_param_enable, +static struct settings_data batctl_settings_isolation_mark = { + .sysfs_name = "isolation_mark", + .params = NULL, };
-COMMAND_NAMED(SUBCOMMAND, ap_isolation, "ap", handle_sys_setting, - COMMAND_FLAG_MESH_IFACE, &batctl_settings_ap_isolation, - "[0|1] \tdisplay or modify ap_isolation setting"); +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,