diff options
author | Simon Wunderlich <simon@open-mesh.com> | 2013-11-21 11:52:16 +0100 |
---|---|---|
committer | Antonio Quartulli <antonio@meshcoding.com> | 2014-01-12 14:41:16 +0100 |
commit | cb1c92ec37fb70543d133a1fa7d9b54d6f8a1ecd (patch) | |
tree | 5629a86404cd0aab5cffabfa5f769d550685f151 /net/batman-adv/originator.c | |
parent | 5bc7c1eb44f25a2e0d6a37af8eb1e07c7d2d43e6 (diff) | |
download | linux-cb1c92ec37fb70543d133a1fa7d9b54d6f8a1ecd.tar.gz linux-cb1c92ec37fb70543d133a1fa7d9b54d6f8a1ecd.tar.bz2 linux-cb1c92ec37fb70543d133a1fa7d9b54d6f8a1ecd.zip |
batman-adv: add debugfs support to view multiif tables
Show tables for the multi interface operation. Originator tables
are added per hard interface.
This patch also changes the API by adding the interface to the
bat_orig_print() parameters.
Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Diffstat (limited to 'net/batman-adv/originator.c')
-rw-r--r-- | net/batman-adv/originator.c | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index bd887809f08e..5ed037fab184 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c @@ -940,11 +940,57 @@ int batadv_orig_seq_print_text(struct seq_file *seq, void *offset) return 0; } - bat_priv->bat_algo_ops->bat_orig_print(bat_priv, seq); + bat_priv->bat_algo_ops->bat_orig_print(bat_priv, seq, + BATADV_IF_DEFAULT); return 0; } +/** + * batadv_orig_hardif_seq_print_text - writes originator infos for a specific + * outgoing interface + * @seq: debugfs table seq_file struct + * @offset: not used + * + * Returns 0 + */ +int batadv_orig_hardif_seq_print_text(struct seq_file *seq, void *offset) +{ + struct net_device *net_dev = (struct net_device *)seq->private; + struct batadv_hard_iface *hard_iface; + struct batadv_priv *bat_priv; + + hard_iface = batadv_hardif_get_by_netdev(net_dev); + + if (!hard_iface || !hard_iface->soft_iface) { + seq_puts(seq, "Interface not known to B.A.T.M.A.N.\n"); + goto out; + } + + bat_priv = netdev_priv(hard_iface->soft_iface); + if (!bat_priv->bat_algo_ops->bat_orig_print) { + seq_puts(seq, + "No printing function for this routing protocol\n"); + goto out; + } + + if (hard_iface->if_status != BATADV_IF_ACTIVE) { + seq_puts(seq, "Interface not active\n"); + goto out; + } + + seq_printf(seq, "[B.A.T.M.A.N. adv %s, IF/MAC: %s/%pM (%s %s)]\n", + BATADV_SOURCE_VERSION, hard_iface->net_dev->name, + hard_iface->net_dev->dev_addr, + hard_iface->soft_iface->name, bat_priv->bat_algo_ops->name); + + bat_priv->bat_algo_ops->bat_orig_print(bat_priv, seq, hard_iface); + +out: + batadv_hardif_free_ref(hard_iface); + return 0; +} + int batadv_orig_hash_add_if(struct batadv_hard_iface *hard_iface, int max_if_num) { |