summaryrefslogtreecommitdiff
path: root/net/batman-adv/types.h
diff options
context:
space:
mode:
authorAntonio Quartulli <antonio@open-mesh.com>2013-09-03 11:10:23 +0200
committerAntonio Quartulli <antonio@meshcoding.com>2013-10-23 17:03:21 +0200
commitd0015fdd3d2c9cc5927637c74a66d85e8bcacf1c (patch)
tree541340ef841baf985b4f14268ebd9a7536df2a07 /net/batman-adv/types.h
parent81e26b1a1c0ad32a3c80e31024b5c4ff4842299a (diff)
batman-adv: provide orig_node routing API
Some operations executed on an orig_node depends on the current routing algorithm being used. To easily make this mechanism routing algorithm agnostic add a orig_node specific API that each algorithm can populate with its own routines. Such routines are then invoked by the code when needed, without knowing which routing algorithm is currently in use With this patch 3 API functions are added: - orig_free (to free routing depending internal structs) - orig_add_if (to change the inner state of an orig_node when a new hard interface is added) - orig_del_if (to change the inner state of an orig_node when an hard interface is removed) 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.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index d0e64d269da4..672a8134d3ba 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -996,6 +996,12 @@ struct batadv_forw_packet {
* @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)
+ * @bat_orig_free: free the resources allocated by the routing algorithm for an
+ * orig_node object
+ * @bat_orig_add_if: ask the routing algorithm to apply the needed changes to
+ * the orig_node due to a new hard-interface being added into the mesh
+ * @bat_orig_del_if: ask the routing algorithm to apply the needed changes to
+ * the orig_node due to an hard-interface being removed from the mesh
*/
struct batadv_algo_ops {
struct hlist_node list;
@@ -1012,6 +1018,11 @@ struct batadv_algo_ops {
struct batadv_neigh_node *neigh2);
/* orig_node handling API */
void (*bat_orig_print)(struct batadv_priv *priv, struct seq_file *seq);
+ void (*bat_orig_free)(struct batadv_orig_node *orig_node);
+ int (*bat_orig_add_if)(struct batadv_orig_node *orig_node,
+ int max_if_num);
+ int (*bat_orig_del_if)(struct batadv_orig_node *orig_node,
+ int max_if_num, int del_if_num);
};
/**