[B.A.T.M.A.N.] [PATCHv2] batctl: add support for the bla backbone table in debugfs

Simon Wunderlich
2012-06-18T10:21:31Z

[EDITv2: add manpage entry]
---
debug.c | 10 ++++++++++
debug.h | 2 ++
main.c | 6 ++++++
man/batctl.8 | 3 +++
4 files changed, 21 insertions(+)

diff --git a/debug.c b/debug.c
index 928f81d..5dca633 100644
--- a/debug.c
+++ b/debug.c
@@ -70,6 +70,16 @@ void bla_claim_table_usage(void)
printf(" \t -w [interval] watch mode - refresh the bridge loop avoidance claim table continuously\n");
}

+void bla_backbone_table_usage(void)
+{
+ printf("Usage: batctl [options] backbone table\n");
+ printf("options:\n");
+ printf(" \t -h print this help\n");
+ printf(" \t -n don't replace mac addresses with bat-host names\n");
+ printf(" \t -w [interval] watch mode - refresh the bridge loop avoidance backbone table continuously\n");
+}
+
+
void gateways_usage(void)
{
printf("Usage: batctl [options] gateways \n");
diff --git a/debug.h b/debug.h
index 50d0e24..2c6d24c 100644
--- a/debug.h
+++ b/debug.h
@@ -25,6 +25,7 @@
#define DEBUG_TRANSTABLE_LOCAL "transtable_local"
#define DEBUG_TRANSTABLE_GLOBAL "transtable_global"
#define DEBUG_BLA_CLAIM_TABLE "bla_claim_table"
+#define DEBUG_BLA_BACKBONE_TABLE "bla_backbone_table"
#define DEBUG_GATEWAYS "gateways"
#define DEBUG_VIS_DATA "vis_data"
#define DEBUG_LOG "log"
@@ -33,6 +34,7 @@ void originators_usage(void);
void trans_local_usage(void);
void trans_global_usage(void);
void bla_claim_table_usage(void);
+void bla_backbone_table_usage(void);
void gateways_usage(void);
int handle_debug_table(char *mesh_iface, int argc, char **argv,
char *file_path, void table_usage(void));
diff --git a/main.c b/main.c
index 72b1ea4..929b762 100644
--- a/main.c
+++ b/main.c
@@ -56,6 +56,7 @@ void print_usage(void) {
printf(" \ttranslocal|tl \tdisplay the local translation table\n");
printf(" \ttransglobal|tg \tdisplay the global translation table\n");
printf(" \tclaimtable|cl \tdisplay the bridge loop avoidance claim table\n");
+ printf(" \tbackbonetable|bbl \tdisplay the bridge loop avoidance backbone table\n");
printf(" \tvis_mode|vm [mode] \tdisplay or modify the status of the VIS server\n");
printf(" \tvis_data|vd [dot|JSON] \tdisplay the VIS data in dot or JSON format\n");
printf(" \taggregation|ag [0|1] \tdisplay or modify the packet aggregation setting\n");
@@ -158,6 +159,11 @@ int main(int argc, char **argv)

ret = handle_debug_table(mesh_iface, argc - 1, argv + 1,
DEBUG_BLA_CLAIM_TABLE, bla_claim_table_usage);
+ } else if ((strcmp(argv[1], "backbonetable") == 0) || (strcmp(argv[1], "bbl") == 0)) {
+
+ ret = handle_debug_table(mesh_iface, argc - 1, argv + 1,
+ DEBUG_BLA_BACKBONE_TABLE,
+ bla_backbone_table_usage);

} else if ((strcmp(argv[1], "loglevel") == 0) || (strcmp(argv[1], "ll") == 0)) {

diff --git a/man/batctl.8 b/man/batctl.8
index 714f50a..af30b67 100644
--- a/man/batctl.8
+++ b/man/batctl.8
@@ -124,6 +124,9 @@ Display the global translation table. batctl will refresh the list every second
.IP "\fBclaimtable\fP|\fBcl\fP [\fB\-w\fP [\fI\interval\fP]][\fB\-n\fP]"
Display the bridge loop avoidance claim table. batctl will refresh the list every second if the "\-w" option was given or add a number to let it refresh at a custom interval in seconds (with optional decimal places). Use "\-n" to let batctl not replace the MAC addresses with bat\-host names in the output.
.br
+.IP "\fBbackbonetable\fP|\fBbbl\fP [\fB\-w\fP [\fI\interval\fP]][\fB\-n\fP]"
+Display the bridge loop avoidance backbone table. batctl will refresh the list every second if the "\-w" option was given or add a number to let it refresh at a custom interval in seconds (with optional decimal places). Use "\-n" to let batctl not replace the MAC addresses with bat\-host names in the output.
+.br
.IP "\fBvis_mode|vm\fP [\fBmode\fP]\fP"
If no parameter is given the current vis mode is displayed otherwise the parameter is used to set the vis mode.
.br
--
1.7.10