aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2011-07-07 09:35:38 -0400
committerMarek Lindner <lindner_marek@yahoo.de>2011-08-22 09:16:22 -0400
commitdf6edb9e69cdb29b31b27305f60bb400dd5d91ed (patch)
treed042dd84af6971e98c3b49a377482bc7313f0c3d
parent3d393e47321062dbf9078a66a7cc1c2a52bafecc (diff)
batman-adv: print client flags in the local/global transtables output
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 <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
-rw-r--r--net/batman-adv/translation-table.c37
1 files changed, 27 insertions, 10 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 1f128e1656a7..e8f849f6b5b7 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)
332 332
333 rcu_read_lock(); 333 rcu_read_lock();
334 __hlist_for_each_rcu(node, head) 334 __hlist_for_each_rcu(node, head)
335 buf_size += 21; 335 buf_size += 29;
336 rcu_read_unlock(); 336 rcu_read_unlock();
337 } 337 }
338 338
@@ -351,8 +351,19 @@ int tt_local_seq_print_text(struct seq_file *seq, void *offset)
351 rcu_read_lock(); 351 rcu_read_lock();
352 hlist_for_each_entry_rcu(tt_local_entry, node, 352 hlist_for_each_entry_rcu(tt_local_entry, node,
353 head, hash_entry) { 353 head, hash_entry) {
354 pos += snprintf(buff + pos, 22, " * %pM\n", 354 pos += snprintf(buff + pos, 30, " * %pM "
355 tt_local_entry->addr); 355 "[%c%c%c%c%c]\n",
356 tt_local_entry->addr,
357 (tt_local_entry->flags &
358 TT_CLIENT_ROAM ? 'R' : '.'),
359 (tt_local_entry->flags &
360 TT_CLIENT_NOPURGE ? 'P' : '.'),
361 (tt_local_entry->flags &
362 TT_CLIENT_NEW ? 'N' : '.'),
363 (tt_local_entry->flags &
364 TT_CLIENT_PENDING ? 'X' : '.'),
365 (tt_local_entry->flags &
366 TT_CLIENT_WIFI ? 'W' : '.'));
356 } 367 }
357 rcu_read_unlock(); 368 rcu_read_unlock();
358 } 369 }
@@ -589,8 +600,8 @@ int tt_global_seq_print_text(struct seq_file *seq, void *offset)
589 seq_printf(seq, 600 seq_printf(seq,
590 "Globally announced TT entries received via the mesh %s\n", 601 "Globally announced TT entries received via the mesh %s\n",
591 net_dev->name); 602 net_dev->name);
592 seq_printf(seq, " %-13s %s %-15s %s\n", 603 seq_printf(seq, " %-13s %s %-15s %s %s\n",
593 "Client", "(TTVN)", "Originator", "(Curr TTVN)"); 604 "Client", "(TTVN)", "Originator", "(Curr TTVN)", "Flags");
594 605
595 buf_size = 1; 606 buf_size = 1;
596 /* Estimate length for: " * xx:xx:xx:xx:xx:xx (ttvn) via 607 /* 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)
600 611
601 rcu_read_lock(); 612 rcu_read_lock();
602 __hlist_for_each_rcu(node, head) 613 __hlist_for_each_rcu(node, head)
603 buf_size += 59; 614 buf_size += 67;
604 rcu_read_unlock(); 615 rcu_read_unlock();
605 } 616 }
606 617
@@ -619,14 +630,20 @@ int tt_global_seq_print_text(struct seq_file *seq, void *offset)
619 rcu_read_lock(); 630 rcu_read_lock();
620 hlist_for_each_entry_rcu(tt_global_entry, node, 631 hlist_for_each_entry_rcu(tt_global_entry, node,
621 head, hash_entry) { 632 head, hash_entry) {
622 pos += snprintf(buff + pos, 61, 633 pos += snprintf(buff + pos, 69,
623 " * %pM (%3u) via %pM (%3u)\n", 634 " * %pM (%3u) via %pM (%3u) "
624 tt_global_entry->addr, 635 "[%c%c%c]\n", tt_global_entry->addr,
625 tt_global_entry->ttvn, 636 tt_global_entry->ttvn,
626 tt_global_entry->orig_node->orig, 637 tt_global_entry->orig_node->orig,
627 (uint8_t) atomic_read( 638 (uint8_t) atomic_read(
628 &tt_global_entry->orig_node-> 639 &tt_global_entry->orig_node->
629 last_ttvn)); 640 last_ttvn),
641 (tt_global_entry->flags &
642 TT_CLIENT_ROAM ? 'R' : '.'),
643 (tt_global_entry->flags &
644 TT_CLIENT_PENDING ? 'X' : '.'),
645 (tt_global_entry->flags &
646 TT_CLIENT_WIFI ? 'W' : '.'));
630 } 647 }
631 rcu_read_unlock(); 648 rcu_read_unlock();
632 } 649 }