summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/types.h
diff options
context:
space:
mode:
authorAntonio Quartulli2016-07-03 12:46:32 +0200
committerSimon Wunderlich2016-08-09 07:54:29 +0200
commit086869438a73d8213a3f945da6679a548badbabc (patch)
tree3e22abd6c0b709c86edee8c4e356954ad0f292bf /net/batman-adv/types.h
parentbatman-adv: Remove unused primary_if and bat_priv variables (diff)
downloadkernel-qcow2-linux-086869438a73d8213a3f945da6679a548badbabc.tar.gz
kernel-qcow2-linux-086869438a73d8213a3f945da6679a548badbabc.tar.xz
kernel-qcow2-linux-086869438a73d8213a3f945da6679a548badbabc.zip
batman-adv: make the GW selection class algorithm specific
The B.A.T.M.A.N. V algorithm uses a different metric compared to its predecessor and for this reason the logic used to compute the best Gateway is also changed. This means that the GW selection class fed to this logic has a semantics that depends on the algorithm being used. Make the parsing and printing routine of the GW selection class routing algorithm specific. Each algorithm can now parse (and print) this value independently. If no API is provided by any algorithm, the default is to use the current mechanism of considering such value like an integer between 1 and 255. 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.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 96af6daa4fc9..deaadba61a2c 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -1450,12 +1450,24 @@ 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)
+ */
+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_algo_ops - mesh algorithm callbacks
* @list: list node for the batadv_algo_list
* @name: name of the algorithm
* @iface: callbacks related to interface handling
* @neigh: callbacks related to neighbors handling
* @orig: callbacks related to originators handling
+ * @gw: callbacks related to GW mode
*/
struct batadv_algo_ops {
struct hlist_node list;
@@ -1463,6 +1475,7 @@ struct batadv_algo_ops {
struct batadv_algo_iface_ops iface;
struct batadv_algo_neigh_ops neigh;
struct batadv_algo_orig_ops orig;
+ struct batadv_algo_gw_ops gw;
};
/**