aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/types.h
diff options
context:
space:
mode:
authorAntonio Quartulli <a@unstable.cc>2016-07-03 12:46:33 +0200
committerSimon Wunderlich <sw@simonwunderlich.de>2016-08-09 07:54:29 +0200
commit34d99cfefaac596adfe9b69f5e7c2cd291af2334 (patch)
tree3499da74782f91678e0601f61512e3fbfa05a6f5 /net/batman-adv/types.h
parentbatman-adv: make the GW selection class algorithm specific (diff)
downloadlinux-dev-34d99cfefaac596adfe9b69f5e7c2cd291af2334.tar.xz
linux-dev-34d99cfefaac596adfe9b69f5e7c2cd291af2334.zip
batman-adv: make GW election code protocol specific
Each routing protocol may have its own specific logic about gateway election which is potentially based on the metric being used. Create two GW specific API functions and move the current election logic in the B.A.T.M.A.N. IV specific code. Signed-off-by: Antonio Quartulli <a@unstable.cc> Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/types.h')
-rw-r--r--net/batman-adv/types.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index deaadba61a2c..54710c781ca7 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -1453,11 +1453,22 @@ struct batadv_algo_orig_ops {
* struct batadv_algo_gw_ops - mesh algorithm callbacks (GW specific)
* @store_sel_class: parse and stores a new GW selection class (optional)
* @show_sel_class: prints the current GW selection class (optional)
+ * @get_best_gw_node: select the best GW from the list of available nodes
+ * (optional)
+ * @is_eligible: check if a newly discovered GW is a potential candidate for
+ * the election as best GW (optional)
+ * @print: print the gateway table (optional)
*/
struct batadv_algo_gw_ops {
ssize_t (*store_sel_class)(struct batadv_priv *bat_priv, char *buff,
size_t count);
ssize_t (*show_sel_class)(struct batadv_priv *bat_priv, char *buff);
+ struct batadv_gw_node *(*get_best_gw_node)
+ (struct batadv_priv *bat_priv);
+ bool (*is_eligible)(struct batadv_priv *bat_priv,
+ struct batadv_orig_node *curr_gw_orig,
+ struct batadv_orig_node *orig_node);
+ void (*print)(struct batadv_priv *bat_priv, struct seq_file *seq);
};
/**