Repository : ssh://git@open-mesh.org/batctl
On branch : master
commit 0b56f895587027fa2643e6be088fa65bb30785b0 Author: Sven Eckelmann sven@narfation.org Date: Thu Oct 25 18:22:26 2018 +0200
batctl: Move nc_nodes debug table to own file
The other commands are stored in separate files and nc_nodes might also receive a netlink implementation. The latter would increase the complexity significantly and thus justify that the command is also added via an extra file.
Signed-off-by: Sven Eckelmann sven@narfation.org
0b56f895587027fa2643e6be088fa65bb30785b0 Makefile | 1 + debug.c | 8 -------- allocate.h => nc_nodes.c | 20 +++++++++----------- 3 files changed, 10 insertions(+), 19 deletions(-)
diff --git a/Makefile b/Makefile index a725986..ac4824b 100755 --- a/Makefile +++ b/Makefile @@ -49,6 +49,7 @@ OBJ += loglevel.o OBJ += log.o OBJ += main.o OBJ += mcast_flags.o +OBJ += nc_nodes.o OBJ += netlink.o OBJ += ping.o OBJ += routing_algo.o diff --git a/debug.c b/debug.c index 4b480a3..531c6aa 100644 --- a/debug.c +++ b/debug.c @@ -241,11 +241,3 @@ static struct debug_table_data batctl_debug_table_transglobal = {
COMMAND_NAMED(DEBUGTABLE, transglobal, "tg", handle_debug_table, COMMAND_FLAG_MESH_IFACE, &batctl_debug_table_transglobal, ""); - -static struct debug_table_data batctl_debug_table_nc_nodes = { - .debugfs_name = DEBUG_NC_NODES, - .header_lines = 0, -}; - -COMMAND_NAMED(DEBUGTABLE, nc_nodes, "nn", handle_debug_table, - COMMAND_FLAG_MESH_IFACE, &batctl_debug_table_nc_nodes, ""); diff --git a/allocate.h b/nc_nodes.c similarity index 71% copy from allocate.h copy to nc_nodes.c index cc4c283..9cf437d 100644 --- a/allocate.h +++ b/nc_nodes.c @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +// SPDX-License-Identifier: GPL-2.0 /* Copyright (C) 2009-2018 B.A.T.M.A.N. contributors: * * Marek Lindner mareklindner@neomailbox.ch @@ -20,15 +20,13 @@ * License-Filename: LICENSES/preferred/GPL-2.0 */
+#include "debug.h" +#include "main.h"
-#ifndef _BATCTL_ALLOCATE_H -#define _BATCTL_ALLOCATE_H +static struct debug_table_data batctl_debug_table_nc_nodes = { + .debugfs_name = DEBUG_NC_NODES, + .header_lines = 0, +};
-/* debug allocate wrapper to keep hash.c happy */ - -#include <stdlib.h> - -#define debugMalloc(length, tag) malloc(length) -#define debugFree(mem, tag) free(mem) - -#endif +COMMAND_NAMED(DEBUGTABLE, nc_nodes, "nn", handle_debug_table, + COMMAND_FLAG_MESH_IFACE, &batctl_debug_table_nc_nodes, "");