Skip to contentSkip to conversation

batctl: adding multicast debug level

PATCH Superseded Linus Lüssing 2 participants 4 messages Jul 15, 2014 – Jul 19, 2014

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 batctl: adding multicast debug level

This patch adds the multicast debug level to check for own multicast flag changes for instance.

---
 README |    1 +
 sys.c  |    5 +++++
 2 files changed, 6 insertions(+)
README +1 -0
index b5fd259..c5e3575 100644
@@ -389,6 +389,7 @@ $  batctl loglevel
 [ ] messages related to bridge loop avoidance (bla)
 [ ] messages related to arp snooping and distributed arp table (dat)
 [ ] messages related to network coding (nc)
+[ ] messages related to multicast (mcast)
 
 batctl nc_nodes
 ===============
sys.c +5 -0
index 676bef1..4fa0e24 100644
@@ -280,6 +280,7 @@ static void log_level_usage(void)
 	fprintf(stderr, " \t bla     Messages related to bridge loop avoidance\n");
 	fprintf(stderr, " \t dat     Messages related to arp snooping and distributed arp table\n");
 	fprintf(stderr, " \t nc      Messages related to network coding\n");
+	fprintf(stderr, " \t mcast   Messages related to multicast\n");
 }
 
 int handle_loglevel(char *mesh_iface, int argc, char **argv)
@@ -325,6 +326,8 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv)
 				log_level |= BIT(4);
 			else if (strcmp(argv[i], "nc") == 0)
 				log_level |= BIT(5);
+			else if (strcmp(argv[i], "mcast") == 0)
+				log_level |= BIT(6);
 			else {
 				log_level_usage();
 				goto out;
@@ -359,6 +362,8 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv)
 	       "messages related to arp snooping and distributed arp table", "dat");
 	printf("[%c] %s (%s)\n", (log_level & BIT(5)) ? 'x' : ' ',
 	       "messages related to network coding", "nc");
+	printf("[%c] %s (%s)\n", (log_level & BIT(6)) ? 'x' : ' ',
+	       "messages related to multicast", "mcast");
 
 out:
 	free(path_buff);
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 2/2 batctl: adding mcast flags debugfs table

This patch adds an option to retrieve the per originator multicast flags table.

---
 README       |   30 ++++++++++++++++++++++++++++++
 debug.c      |    6 ++++++
 debug.h      |    1 +
 functions.c  |    1 +
 man/batctl.8 |    3 +++
 5 files changed, 41 insertions(+)
README +30 -0
index c5e3575..8af6fad 100644
@@ -425,6 +425,36 @@ display or modify the multicast mode setting
 
 Usage: batctl multicast_mode|mm [0|1]
 
+batctl mcast_flags
+=================
+
+display the local D.A.T. cache
+
+Usage batctl mcast_flags|mf
+
+Example:
+
+Multicast flags (own flags: [...])
+       Originator Flags
+02:04:64:a4:39:c4 [...]
+02:04:64:a4:39:c1 [U46]
+02:04:64:a4:39:c3 [...]
+
+where:
+- Originator: the MAC address of the originating (primary interface)
+		batman-adv node
+- Flags: multicast flags of the according node
+- U: wants all unsnoopable multicast traffic, meaning other nodes need to always
+	forward any multicast traffic destined to ff02::1 or 224.0.0.0/24 to it
+- 4: wants all IPv4 multicast traffic, meaning other nodes need to always
+	forward any IPv4 multicast traffic to it
+- 6: wants all IPv6 multicast traffic, meaning other nodes need to always
+	forward any IPv6 multicast traffic to it
+
+If a node does not have multicast optimizations available (e.g. old batman-adv
+version or optimizations not compiled in), therefore not announcing any
+multicast tvlv/flags, a '-' will be displayed instead of '[...]'.
+
 batctl aggregation
 ==================
 
debug.c +6 -0
index dfcf3c3..e00cfa2 100644
@@ -78,6 +78,12 @@ const struct debug_table_data batctl_debug_tables[BATCTL_TABLE_NUM] = {
 		.debugfs_name = "nc_nodes",
 		.header_lines = 0,
 	},
+	{
+		.opt_long = "mcast_flags",
+		.opt_short = "mf",
+		.debugfs_name = "mcast_flags",
+		.header_lines = 2,
+	},
 };
 
 static void debug_table_usage(int debug_table)
debug.h +1 -0
index 76d5e68..6ea32a4 100644
@@ -38,6 +38,7 @@ enum batctl_debug_tables {
 	BATCTL_TABLE_BLA_BACKBONES,
 	BATCTL_TABLE_DAT,
 	BATCTL_TABLE_NETWORK_CODING_NODES,
+	BATCTL_TABLE_MCAST_FLAGS,
 	BATCTL_TABLE_NUM,
 };
 
functions.c +1 -0
index 251e616..7636e85 100644
@@ -68,6 +68,7 @@ const char *fs_compile_out_param[] = {
 	batctl_debug_tables[BATCTL_TABLE_BLA_BACKBONES].debugfs_name,
 	batctl_debug_tables[BATCTL_TABLE_DAT].debugfs_name,
 	batctl_debug_tables[BATCTL_TABLE_NETWORK_CODING_NODES].debugfs_name,
+	batctl_debug_tables[BATCTL_TABLE_MCAST_FLAGS].debugfs_name,
 	NULL,
 };
 
man/batctl.8 +3 -0
index 110020e..ee2749b 100644
@@ -227,6 +227,9 @@ List of debug tables:
 .RS 10
 \- nc_nodes|nn (compile time option)
 .RE
+.RS 10
+\- mcast_flags|mf (compile time option)
+.RE
 .RE
 .br
 .IP "\fBtranslate\fP|\fBt\fP \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP"
Signature · 1 line
1.7.10.4
#2 lore raw

Re: [B.A.T.M.A.N.] [PATCH 2/2] batctl: adding mcast flags debugfs table

Quoted 11 lines · On Tuesday 15 July 2014 04:23:28 Linus Lüssing wrote:
man/batctl.8 +3 -0
@@ -227,6 +227,9 @@ List of debug tables:
 .RS 10
 \- nc_nodes|nn (compile time option)
 .RE
+.RS 10
+\- mcast_flags|mf (compile time option)
+.RE
 .RE
 .br
 .IP "\fBtranslate\fP|\fBt\fP

\fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP"

Please maintain alphabetical order.

Thanks,
Marek

#3 lore raw
In reply to Linus Lüssing
Quoted 8 lines · On Tuesday 15 July 2014 04:23:27 Linus Lüssing wrote:
(quoted diff) +0 -0
@@ -280,6 +280,7 @@ static void log_level_usage(void)
        fprintf(stderr, " \t bla     Messages related to bridge loop

avoidance\n"); fprintf(stderr, " \t dat Messages related to arp
snooping and distributed arp table\n"); fprintf(stderr, " \t
nc Messages related to network coding\n"); + fprintf(stderr, "
\t mcast Messages related to multicast\n"); }

int handle_loglevel(char *mesh_iface, int argc, char **argv)

We have a little section in the manpage dedicated to the loglevel which also needs an update.

Cheers,
Marek