diff options
author | Marek Lindner <mareklindner@neomailbox.ch> | 2015-08-04 13:09:57 (GMT) |
---|---|---|
committer | Antonio Quartulli <a@unstable.cc> | 2015-12-15 16:21:42 (GMT) |
commit | 7587405ab93e5383e64ac311f460c30a02a8e9cb (patch) | |
tree | a6457b7afeaa0b5bddaf4864f8d46ed5446a9d39 /net/batman-adv/originator.c | |
parent | 8248a4c7c866a9c15b6b379ca98aa8c95363f502 (diff) | |
download | linux-7587405ab93e5383e64ac311f460c30a02a8e9cb.tar.xz |
batman-adv: export single hop neighbor list via debugfs
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 | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index 27dd326..3c782a33 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c @@ -693,6 +693,40 @@ out: } /** + * batadv_hardif_neigh_seq_print_text - print the single hop neighbour list + * @seq: neighbour table seq_file struct + * @offset: not used + * + * Always returns 0. + */ +int batadv_hardif_neigh_seq_print_text(struct seq_file *seq, void *offset) +{ + struct net_device *net_dev = (struct net_device *)seq->private; + struct batadv_priv *bat_priv = netdev_priv(net_dev); + struct batadv_hard_iface *primary_if; + + primary_if = batadv_seq_print_text_primary_if_get(seq); + if (!primary_if) + return 0; + + seq_printf(seq, "[B.A.T.M.A.N. adv %s, MainIF/MAC: %s/%pM (%s %s)]\n", + BATADV_SOURCE_VERSION, primary_if->net_dev->name, + primary_if->net_dev->dev_addr, net_dev->name, + bat_priv->bat_algo_ops->name); + + batadv_hardif_free_ref(primary_if); + + if (!bat_priv->bat_algo_ops->bat_neigh_print) { + seq_puts(seq, + "No printing function for this routing protocol\n"); + return 0; + } + + bat_priv->bat_algo_ops->bat_neigh_print(bat_priv, seq); + return 0; +} + +/** * batadv_orig_ifinfo_free_rcu - free the orig_ifinfo object * @rcu: rcu pointer of the orig_ifinfo object */ |