From patchwork Fri May 13 16:35:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Linus_L=C3=BCssing?= X-Patchwork-Id: 16191 X-Patchwork-Delegate: mareklindner@neomailbox.ch Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 90508818DD; Fri, 13 May 2016 18:36:08 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=c0d3.blue Received-SPF: None (no SPF record) identity=mailfrom; client-ip=138.201.29.205; helo=mail.aperture-lab.de; envelope-from=linus.luessing@c0d3.blue; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=none header.from=c0d3.blue Received: from mail.aperture-lab.de (mail.aperture-lab.de [138.201.29.205]) by open-mesh.org (Postfix) with ESMTPS id 93F688069C for ; Fri, 13 May 2016 18:35:49 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.aperture-lab.de (Postfix) with ESMTP id 8E3FDE160E; Fri, 13 May 2016 18:35:48 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aperture-lab.de Received: from mail.aperture-lab.de ([127.0.0.1]) by localhost (mail.aperture-lab.de [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id OI6uoj-whqAa; Fri, 13 May 2016 18:35:48 +0200 (CEST) Received: from localhost (unknown [IPv6:2001:67c:2d50:0:c85:8cff:fe0f:63fe]) (Authenticated sender: linus.luessing@c0d3.blue) by mail.aperture-lab.de (Postfix) with ESMTPSA; Fri, 13 May 2016 18:35:48 +0200 (CEST) From: =?UTF-8?q?Linus=20L=C3=BCssing?= To: b.a.t.m.a.n@lists.open-mesh.org Date: Fri, 13 May 2016 18:35:42 +0200 Message-Id: <1463157342-13195-3-git-send-email-linus.luessing@c0d3.blue> X-Mailer: git-send-email 2.8.0.rc3 In-Reply-To: <1463157342-13195-1-git-send-email-linus.luessing@c0d3.blue> References: <1463157342-13195-1-git-send-email-linus.luessing@c0d3.blue> MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCHv5 2/2] batctl: adding mcast flags debugfs table X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" From: Linus Lüssing This patch adds an option to retrieve the per originator multicast flags table. Signed-off-by: Linus Lüssing --- Changes in v5: * fixed README description of mcast_flags (copy & paste error from DAT) Changes in v4: * rebase to current master (no conflicts) Changes in v3: * updated mcast_flags example in README file Changes in v2: * header_lines for 'mcast_flags' increased from 2 to 6 * Example updated to more verbose, 6 lines debugfs header output * (kept order for the noted manpage section as it wasn't alphabetically orderd in the first place - instead keeping the previous "logical" order - 'mcast' after 'nc') README | 34 ++++++++++++++++++++++++++++++++++ debug.c | 6 ++++++ debug.h | 1 + functions.c | 1 + man/batctl.8 | 3 +++ 5 files changed, 45 insertions(+) diff --git a/README b/README index b5de8a6..6df669a 100644 --- a/README +++ b/README @@ -426,6 +426,40 @@ display or modify the multicast mode setting Usage: batctl multicast_mode|mm [0|1] +batctl mcast_flags +================= + +display local and remote multicast flags + +Usage batctl mcast_flags|mf + +Example: + +Multicast flags (own flags: [U46]) +* Bridged [U] U +* No IGMP/MLD Querier [4/6]: ./. +* Shadowing IGMP/MLD Querier [4/6]: 4/6 +------------------------------------------- + Originator Flags +02:04:64:a4:39:c1 [U..] +02:04:64:a4:39:c2 [U..] +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 ================== diff --git a/debug.c b/debug.c index 3db3ed9..5b280cb 100644 --- a/debug.c +++ b/debug.c @@ -84,6 +84,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 = 6, + }, }; static void debug_table_usage(int debug_table) diff --git a/debug.h b/debug.h index df65f50..46e8c3c 100644 --- a/debug.h +++ b/debug.h @@ -40,6 +40,7 @@ enum batctl_debug_tables { BATCTL_TABLE_BLA_BACKBONES, BATCTL_TABLE_DAT, BATCTL_TABLE_NETWORK_CODING_NODES, + BATCTL_TABLE_MCAST_FLAGS, BATCTL_TABLE_NUM, }; diff --git a/functions.c b/functions.c index be8f8b0..97a6dbd 100644 --- a/functions.c +++ b/functions.c @@ -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, }; diff --git a/man/batctl.8 b/man/batctl.8 index f8955d0..05f68d3 100644 --- a/man/batctl.8 +++ b/man/batctl.8 @@ -236,6 +236,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"