aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/originator.c
diff options
context:
space:
mode:
authorSimon Wunderlich <simon@open-mesh.com>2013-11-21 05:52:16 -0500
committerAntonio Quartulli <antonio@meshcoding.com>2014-01-12 08:41:16 -0500
commitcb1c92ec37fb70543d133a1fa7d9b54d6f8a1ecd (patch)
tree5629a86404cd0aab5cffabfa5f769d550685f151 /net/batman-adv/originator.c
parent5bc7c1eb44f25a2e0d6a37af8eb1e07c7d2d43e6 (diff)
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.c48
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)
940 return 0; 940 return 0;
941 } 941 }
942 942
943 bat_priv->bat_algo_ops->bat_orig_print(bat_priv, seq); 943 bat_priv->bat_algo_ops->bat_orig_print(bat_priv, seq,
944 BATADV_IF_DEFAULT);
944 945
945 return 0; 946 return 0;
946} 947}
947 948
949/**
950 * batadv_orig_hardif_seq_print_text - writes originator infos for a specific
951 * outgoing interface
952 * @seq: debugfs table seq_file struct
953 * @offset: not used
954 *
955 * Returns 0
956 */
957int batadv_orig_hardif_seq_print_text(struct seq_file *seq, void *offset)
958{
959 struct net_device *net_dev = (struct net_device *)seq->private;
960 struct batadv_hard_iface *hard_iface;
961 struct batadv_priv *bat_priv;
962
963 hard_iface = batadv_hardif_get_by_netdev(net_dev);
964
965 if (!hard_iface || !hard_iface->soft_iface) {
966 seq_puts(seq, "Interface not known to B.A.T.M.A.N.\n");
967 goto out;
968 }
969
970 bat_priv = netdev_priv(hard_iface->soft_iface);
971 if (!bat_priv->bat_algo_ops->bat_orig_print) {
972 seq_puts(seq,
973 "No printing function for this routing protocol\n");
974 goto out;
975 }
976
977 if (hard_iface->if_status != BATADV_IF_ACTIVE) {
978 seq_puts(seq, "Interface not active\n");
979 goto out;
980 }
981
982 seq_printf(seq, "[B.A.T.M.A.N. adv %s, IF/MAC: %s/%pM (%s %s)]\n",
983 BATADV_SOURCE_VERSION, hard_iface->net_dev->name,
984 hard_iface->net_dev->dev_addr,
985 hard_iface->soft_iface->name, bat_priv->bat_algo_ops->name);
986
987 bat_priv->bat_algo_ops->bat_orig_print(bat_priv, seq, hard_iface);
988
989out:
990 batadv_hardif_free_ref(hard_iface);
991 return 0;
992}
993
948int batadv_orig_hash_add_if(struct batadv_hard_iface *hard_iface, 994int batadv_orig_hash_add_if(struct batadv_hard_iface *hard_iface,
949 int max_if_num) 995 int max_if_num)
950{ 996{