summaryrefslogtreecommitdiff
path: root/net/batman-adv/types.h
diff options
context:
space:
mode:
authorAntonio Quartulli <antonio@open-mesh.com>2013-09-02 12:15:05 +0200
committerAntonio Quartulli <antonio@meshcoding.com>2013-10-23 15:33:11 +0200
commitc43c981e50f47bdd0f1eb400dc30ff13472c7be6 (patch)
treea824da57cc62888cff0d73203d4d321adf636e0a /net/batman-adv/types.h
parenta3285a8f20dace536ecc6a2f349150ea1d0bb391 (diff)
batman-adv: add bat_neigh_is_equiv_or_better API function
Each routing protocol has its own metric semantic and therefore is the protocol itself the only component able to compare two metrics to check their "similarity". This new API allows each routing protocol to implement its own logic and make the external code protocol agnostic. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/types.h')
-rw-r--r--net/batman-adv/types.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 7a00932a55bd..d0e64d269da4 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -993,6 +993,8 @@ struct batadv_forw_packet {
* @bat_ogm_schedule: prepare a new outgoing OGM for the send queue
* @bat_ogm_emit: send scheduled OGM
* @bat_neigh_cmp: compare the metrics of two neighbors
+ * @bat_neigh_is_equiv_or_better: check if neigh1 is equally good or
+ * better than neigh2 from the metric prospective
* @bat_orig_print: print the originator table (optional)
*/
struct batadv_algo_ops {
@@ -1006,6 +1008,8 @@ struct batadv_algo_ops {
void (*bat_ogm_emit)(struct batadv_forw_packet *forw_packet);
int (*bat_neigh_cmp)(struct batadv_neigh_node *neigh1,
struct batadv_neigh_node *neigh2);
+ bool (*bat_neigh_is_equiv_or_better)(struct batadv_neigh_node *neigh1,
+ struct batadv_neigh_node *neigh2);
/* orig_node handling API */
void (*bat_orig_print)(struct batadv_priv *priv, struct seq_file *seq);
};