From patchwork Wed Aug 24 13:00:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 1251 Return-Path: Received: from nm7.bullet.mail.ukl.yahoo.com (nm7.bullet.mail.ukl.yahoo.com [217.146.182.248]) by open-mesh.org (Postfix) with SMTP id 7E2FA60084E for ; Wed, 24 Aug 2011 15:01:10 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@yahoo.de; dkim-adsp=none Received: from [217.146.183.215] by nm7.bullet.mail.ukl.yahoo.com with NNFMP; 24 Aug 2011 13:01:10 -0000 Received: from [217.146.183.42] by tm8.bullet.mail.ukl.yahoo.com with NNFMP; 24 Aug 2011 13:01:10 -0000 Received: from [127.0.0.1] by omp1027.mail.ukl.yahoo.com with NNFMP; 24 Aug 2011 13:01:10 -0000 X-Yahoo-Newman-Id: 364039.46434.bm@omp1027.mail.ukl.yahoo.com Received: (qmail 16290 invoked from network); 24 Aug 2011 13:01:10 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.de; h=DKIM-Signature:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=b8IMOy/aJgUEd8SfAsCVtqh10qNy20/zCO0S5In0L2uZwo0RIZLZvOkL7ip9oav+FBlItoa+2ji+1m/X5Igukd3INonQbcf3lYGQ1dwguE9SMQ+8FOJH0rchUxSGi9e8vb86/t1ldGKYNxGidBeMj9BsS75yTsiYmbCAGuRu6S0= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1314190870; bh=C0IhnWCE3cHqQuRvg8HPq6Hc4IKC2BVKLZO0qnlyZ1M=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=LAwPK4H6hRbwqSo8IGq6dk4hlCWe9kEEO+Mb1Jc3msxF4GjhQL2cjM10eem4eJ1p6WRigkK+zO6mhFe3upkexS3zTSkyKj1Ps0jO6Fb13XWp/iPGYF0XC9vDlRTVDTXvlKMMUHL7V9NQocwKctjn9SEpNIb08a9wupX6U9E8BpU= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ZGXZIZIVM1kPAoB4hhkQyUiqpVmRhBxkR3boG8TnNPGAGbH 5ZCn4O1i_IBS5z7lSI3NfoHzNzH7kP.RAp14v9i.7NKDznexUHOy7rX9FpmA 1cTc3nP0nwyBaJR6yjJFkQ.eH_0kSYq8ciIR.VC.8mfw.wQIUINfvwPWuz2Y b9mppoFS_dcnQl93X7nZ_ag8K7Sc1dW_e548ySj.yqZd8Vii72wV911So8Ef vQVAadfewaAqeEKeO4k5D341o4WMQCiHCAykEZOp39H.usXPVCQyVQFy.Hhd DXFiAwA.V04.8LUy4lxF9.OLVqNSHJZ8BuZ_rBp6RJqBM8GgqPSfF.ZPbKrB 7bDuYEHNThjXw4pud4p733QmlyXguL2JEVqhPzITNiypMbuKBnTHZwQE- X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@90.61.151.134 with plain) by smtp126.mail.ukl.yahoo.com with SMTP; 24 Aug 2011 13:01:09 +0000 GMT From: Marek Lindner To: davem@davemloft.net Date: Wed, 24 Aug 2011 15:00:36 +0200 Message-Id: <1314190838-2273-7-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.5.3 In-Reply-To: <1314190838-2273-1-git-send-email-lindner_marek@yahoo.de> References: <1314190838-2273-1-git-send-email-lindner_marek@yahoo.de> Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Marek Lindner Subject: [B.A.T.M.A.N.] [PATCH 6/8] batman-adv: print client flags in the local/global transtables output X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2011 13:01:10 -0000 From: Antonio Quartulli Since clients can have several flags on or off, this patches make them appear in the local/global transtable output so that they can be checked for debugging purposes. Signed-off-by: Antonio Quartulli Signed-off-by: Marek Lindner --- net/batman-adv/translation-table.c | 37 ++++++++++++++++++++++++++--------- 1 files changed, 27 insertions(+), 10 deletions(-) diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 1f128e1..e8f849f 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -332,7 +332,7 @@ int tt_local_seq_print_text(struct seq_file *seq, void *offset) rcu_read_lock(); __hlist_for_each_rcu(node, head) - buf_size += 21; + buf_size += 29; rcu_read_unlock(); } @@ -351,8 +351,19 @@ int tt_local_seq_print_text(struct seq_file *seq, void *offset) rcu_read_lock(); hlist_for_each_entry_rcu(tt_local_entry, node, head, hash_entry) { - pos += snprintf(buff + pos, 22, " * %pM\n", - tt_local_entry->addr); + pos += snprintf(buff + pos, 30, " * %pM " + "[%c%c%c%c%c]\n", + tt_local_entry->addr, + (tt_local_entry->flags & + TT_CLIENT_ROAM ? 'R' : '.'), + (tt_local_entry->flags & + TT_CLIENT_NOPURGE ? 'P' : '.'), + (tt_local_entry->flags & + TT_CLIENT_NEW ? 'N' : '.'), + (tt_local_entry->flags & + TT_CLIENT_PENDING ? 'X' : '.'), + (tt_local_entry->flags & + TT_CLIENT_WIFI ? 'W' : '.')); } rcu_read_unlock(); } @@ -589,8 +600,8 @@ int tt_global_seq_print_text(struct seq_file *seq, void *offset) seq_printf(seq, "Globally announced TT entries received via the mesh %s\n", net_dev->name); - seq_printf(seq, " %-13s %s %-15s %s\n", - "Client", "(TTVN)", "Originator", "(Curr TTVN)"); + seq_printf(seq, " %-13s %s %-15s %s %s\n", + "Client", "(TTVN)", "Originator", "(Curr TTVN)", "Flags"); buf_size = 1; /* Estimate length for: " * xx:xx:xx:xx:xx:xx (ttvn) via @@ -600,7 +611,7 @@ int tt_global_seq_print_text(struct seq_file *seq, void *offset) rcu_read_lock(); __hlist_for_each_rcu(node, head) - buf_size += 59; + buf_size += 67; rcu_read_unlock(); } @@ -619,14 +630,20 @@ int tt_global_seq_print_text(struct seq_file *seq, void *offset) rcu_read_lock(); hlist_for_each_entry_rcu(tt_global_entry, node, head, hash_entry) { - pos += snprintf(buff + pos, 61, - " * %pM (%3u) via %pM (%3u)\n", - tt_global_entry->addr, + pos += snprintf(buff + pos, 69, + " * %pM (%3u) via %pM (%3u) " + "[%c%c%c]\n", tt_global_entry->addr, tt_global_entry->ttvn, tt_global_entry->orig_node->orig, (uint8_t) atomic_read( &tt_global_entry->orig_node-> - last_ttvn)); + last_ttvn), + (tt_global_entry->flags & + TT_CLIENT_ROAM ? 'R' : '.'), + (tt_global_entry->flags & + TT_CLIENT_PENDING ? 'X' : '.'), + (tt_global_entry->flags & + TT_CLIENT_WIFI ? 'W' : '.')); } rcu_read_unlock(); }