Repository : ssh://git@open-mesh.org/batctl
On branch : master
commit e7a5920424cea3863bef10f9ddc98dcc589051d3 Author: Sven Eckelmann sven@narfation.org Date: Thu Oct 25 18:22:40 2018 +0200
batctl: Move orig_interval 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
e7a5920424cea3863bef10f9ddc98dcc589051d3 Makefile | 1 + fragmentation.c => orig_interval.c | 14 ++++++++------ sys.c | 9 --------- 3 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/Makefile b/Makefile index 8582bf6..a6971d8 100755 --- a/Makefile +++ b/Makefile @@ -63,6 +63,7 @@ OBJ += netlink.o OBJ += network_coding.o OBJ += ping.o OBJ += originators.o +OBJ += orig_interval.o OBJ += routing_algo.o OBJ += statistics.o OBJ += sys.o diff --git a/fragmentation.c b/orig_interval.c similarity index 73% copy from fragmentation.c copy to orig_interval.c index e159bdd..d308ea2 100644 --- a/fragmentation.c +++ b/orig_interval.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_fragmentation = { - .sysfs_name = "fragmentation", - .params = sysfs_param_enable, +static struct settings_data batctl_settings_orig_interval = { + .sysfs_name = "orig_interval", + .params = NULL, };
-COMMAND_NAMED(SUBCOMMAND, fragmentation, "f", handle_sys_setting, - COMMAND_FLAG_MESH_IFACE, &batctl_settings_fragmentation, - "[0|1] \tdisplay or modify fragmentation setting"); +COMMAND_NAMED(SUBCOMMAND, orig_interval, "it", handle_sys_setting, + COMMAND_FLAG_MESH_IFACE, &batctl_settings_orig_interval, + "[interval] \tdisplay or modify orig_interval setting"); diff --git a/sys.c b/sys.c index 932a7e8..6b98ac4 100644 --- a/sys.c +++ b/sys.c @@ -136,12 +136,3 @@ out: free(base_dev); return res; } - -static struct settings_data batctl_settings_orig_interval = { - .sysfs_name = "orig_interval", - .params = NULL, -}; - -COMMAND_NAMED(SUBCOMMAND, orig_interval, "it", handle_sys_setting, - COMMAND_FLAG_MESH_IFACE, &batctl_settings_orig_interval, - "[interval] \tdisplay or modify orig_interval setting");