With the introduction of DAT in batman-adv, another table is now exported through debugfs. This patch adds the possibility to print it
Signed-off-by: Antonio Quartulli ordex@autistici.org ---
v5: - long option renamed from 'datcache' to dat_cache'
README | 18 ++++++++++++++++++ debug.c | 5 +++++ debug.h | 1 + functions.c | 1 + man/batctl.8 | 3 +++ 5 files changed, 28 insertions(+)
diff --git a/README b/README index 03d36c4..5e58452 100644 --- a/README +++ b/README @@ -408,6 +408,24 @@ where:
If any of the flags is not enabled, a '.' will substitute its symbol.
+batctl dat_cache +================= + +display the local D.A.T. cache + +Usage batctl dat_cache|dc + +Example: + +Distributed ARP Table (bat0): + IPv4 MAC last-seen + * 172.100.0.1 b6:9b:d0:ea:b1:13 0:00 + +where: +- IPv4 is the IP address of a client in the mesh network +- MAC is the MAC address associated to that IP +- last-seen is the amount of time since last refresh of this entry + batctl vis_mode =================
diff --git a/debug.c b/debug.c index 9b5146f..a230a12 100644 --- a/debug.c +++ b/debug.c @@ -64,6 +64,11 @@ const struct debug_table_data batctl_debug_tables[BATCTL_TABLE_NUM] = { .opt_short = "bbt", .debugfs_name = "bla_backbone_table", }, + { + .opt_long = "dat_cache", + .opt_short = "dc", + .debugfs_name = "dat_cache", + }, };
void debug_table_usage(int debug_table) diff --git a/debug.h b/debug.h index 6068c2c..4e935cb 100644 --- a/debug.h +++ b/debug.h @@ -31,6 +31,7 @@ enum batctl_debug_tables { BATCTL_TABLE_TRANSGLOBAL, BATCTL_TABLE_BLA_CLAIMS, BATCTL_TABLE_BLA_BACKBONES, + BATCTL_TABLE_DAT, BATCTL_TABLE_NUM, };
diff --git a/functions.c b/functions.c index e095fd0..0d88137 100644 --- a/functions.c +++ b/functions.c @@ -48,6 +48,7 @@ const char *fs_compile_out_param[] = { batctl_settings[BATCTL_SETTINGS_BLA].sysfs_name, batctl_debug_tables[BATCTL_TABLE_BLA_CLAIMS].debugfs_name, batctl_debug_tables[BATCTL_TABLE_BLA_BACKBONES].debugfs_name, + batctl_debug_tables[BATCTL_TABLE_DAT].debugfs_name, NULL, };
diff --git a/man/batctl.8 b/man/batctl.8 index ab02e9a..310b43f 100644 --- a/man/batctl.8 +++ b/man/batctl.8 @@ -187,6 +187,9 @@ List of debug tables: .RS 10 - backbonetable|bbt (compile time option) .RE +.RS 10 +- datcache|dc (compile time option) +.RE .RE .br .IP "\fBstatistics\fP|\fBs\fP"
Signed-off-by: Antonio Quartulli ordex@autistici.org ---
v5: - noop.
README | 1 + man/batctl.8 | 7 ++++--- sys.c | 7 ++++++- 3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/README b/README index 5e58452..0958fcb 100644 --- a/README +++ b/README @@ -342,6 +342,7 @@ $ batctl loglevel [ ] messages related to route added / changed / deleted (routes) [ ] messages related to translation table operations (tt) [ ] messages related to bridge loop avoidance (bla) +[ ] messages related to arp snooping and distributetd arp table (dat)
batctl aggregation ================== diff --git a/man/batctl.8 b/man/batctl.8 index 310b43f..250e461 100644 --- a/man/batctl.8 +++ b/man/batctl.8 @@ -85,9 +85,10 @@ disable fragmentation. If no parameter is given the current log level settings are displayed otherwise the parameter(s) is/are used to set the log level. Level 'none' disables all verbose logging. Level 'batman' enables messages related to routing / flooding / broadcasting. Level 'routes' enables messages related to routes being added / changed / deleted. Level 'tt' enables messages related to -translation table operations. Level 'bla' enables messages related to the bridge loop avoidance. Level 'all' enables all -messages. The messages are sent to the batman-adv debug log. Use \fBbatctl log\fP to retrieve it. Make sure to have debugging -output enabled when compiling the module otherwise the output as well as the loglevel options won't be available. +translation table operations. Level 'bla' enables messages related to the bridge loop avoidance. Level 'dat' enables +messages related to ARP snooping and the Distributed Arp Table. Level 'all' enables all messages. The messages are sent +to the batman-adv debug log. Use \fBbatctl log\fP to retrieve it. Make sure to have debugging output enabled when compiling +the module otherwise the output as well as the loglevel options won't be available. .br .IP "\fBlog\fP|\fBl\fP [\fB-n\fP]\fP" batctl will read the batman-adv debug log which has to be compiled into the kernel module. If "-n" is given batctl will not diff --git a/sys.c b/sys.c index 6f94483..815ff88 100644 --- a/sys.c +++ b/sys.c @@ -258,6 +258,7 @@ static void log_level_usage(void) printf(" \t routes Messages related to route added / changed / deleted\n"); printf(" \t tt Messages related to translation table operations\n"); printf(" \t bla Messages related to bridge loop avoidance\n"); + printf(" \t dat Messages related to arp snooping and distributed arp table\n"); }
int handle_loglevel(char *mesh_iface, int argc, char **argv) @@ -288,7 +289,7 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv) log_level = 0; break; } else if (strcmp(argv[i], "all") == 0) { - log_level = 15; + log_level = 31; break; } else if (strcmp(argv[i], "batman") == 0) log_level |= BIT(0); @@ -298,6 +299,8 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv) log_level |= BIT(2); else if (strcmp(argv[i], "bla") == 0) log_level |= BIT(3); + else if (strcmp(argv[i], "dat") == 0) + log_level |= BIT(4); else { log_level_usage(); goto out; @@ -327,6 +330,8 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv) "messages related to translation table operations", "tt"); printf("[%c] %s (%s)\n", (log_level & BIT(3)) ? 'x' : ' ', "messages related to bridge loop avoidance", "bla"); + printf("[%c] %s (%s)\n", (log_level & BIT(4)) ? 'x' : ' ', + "messages related to arp snooping and distributed arp table", "dat");
out: free(path_buff);
On Sunday, October 14, 2012 22:54:32 Antonio Quartulli wrote:
Signed-off-by: Antonio Quartulli ordex@autistici.org
v5:
- noop.
README | 1 + man/batctl.8 | 7 ++++--- sys.c | 7 ++++++- 3 files changed, 11 insertions(+), 4 deletions(-)
Applied in revision ac27265.
Thanks, Marek
Signed-off-by: Antonio Quartulli ordex@autistici.org ---
v5: - noop.
functions.c | 1 + man/batctl.8 | 4 ++++ sys.c | 6 ++++++ sys.h | 1 + 4 files changed, 12 insertions(+)
diff --git a/functions.c b/functions.c index 0d88137..1cde235 100644 --- a/functions.c +++ b/functions.c @@ -46,6 +46,7 @@ const char *fs_compile_out_param[] = { SYS_LOG, SYS_LOG_LEVEL, batctl_settings[BATCTL_SETTINGS_BLA].sysfs_name, + batctl_settings[BATCTL_SETTINGS_DAT].sysfs_name, batctl_debug_tables[BATCTL_TABLE_BLA_CLAIMS].debugfs_name, batctl_debug_tables[BATCTL_TABLE_BLA_BACKBONES].debugfs_name, batctl_debug_tables[BATCTL_TABLE_DAT].debugfs_name, diff --git a/man/batctl.8 b/man/batctl.8 index 250e461..4359411 100644 --- a/man/batctl.8 +++ b/man/batctl.8 @@ -66,6 +66,10 @@ If no parameter is given the current bridge loop avoidance setting is displayed. or disable the bridge loop avoidance. Bridge loop avoidance support has to be enabled when compiling the module otherwise this option won't be available. .br +.IP "\fBdistributed_arp_table\fP|\fBdat\fP [\fB0\fP|\fB1\fP]" +If no parameter is given the current distributed arp table setting is displayed. Otherwise the parameter is used to +enable or disable the distributed arp table. +.br .IP "\fBvis_mode|vm\fP [\fBclient|server\fP]\fP" If no parameter is given the current vis mode is displayed otherwise the parameter is used to set the vis mode. .br diff --git a/sys.c b/sys.c index 815ff88..3d5e129 100644 --- a/sys.c +++ b/sys.c @@ -69,6 +69,12 @@ const struct settings_data batctl_settings[BATCTL_SETTINGS_NUM] = { .params = sysfs_param_enable, }, { + .opt_long = "distributed_arp_table", + .opt_short = "dat", + .sysfs_name = "distributed_arp_table", + .params = sysfs_param_enable, + }, + { .opt_long = "vis_mode", .opt_short = "vm", .sysfs_name = "vis_mode", diff --git a/sys.h b/sys.h index 1fc473e..40b64b1 100644 --- a/sys.h +++ b/sys.h @@ -35,6 +35,7 @@ enum batctl_settings_list { BATCTL_SETTINGS_ORIG_INTERVAL, BATCTL_SETTINGS_AP_ISOLATION, BATCTL_SETTINGS_BLA, + BATCTL_SETTINGS_DAT, BATCTL_SETTINGS_VIS_MODE, BATCTL_SETTINGS_AGGREGATION, BATCTL_SETTINGS_BONDING,
On Sunday, October 14, 2012 22:54:33 Antonio Quartulli wrote:
Signed-off-by: Antonio Quartulli ordex@autistici.org
v5:
- noop.
functions.c | 1 + man/batctl.8 | 4 ++++ sys.c | 6 ++++++ sys.h | 1 + 4 files changed, 12 insertions(+)
Applied in revision f395fb7.
Thanks, Marek
On Sunday, October 14, 2012 22:54:31 Antonio Quartulli wrote:
With the introduction of DAT in batman-adv, another table is now exported through debugfs. This patch adds the possibility to print it
Signed-off-by: Antonio Quartulli ordex@autistici.org
v5:
- long option renamed from 'datcache' to dat_cache'
README | 18 ++++++++++++++++++ debug.c | 5 +++++ debug.h | 1 + functions.c | 1 + man/batctl.8 | 3 +++ 5 files changed, 28 insertions(+)
Applied in revision 167c37a.
Thanks, Marek
b.a.t.m.a.n@lists.open-mesh.org