aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bat_v_elp.c
diff options
context:
space:
mode:
authorAntonio Quartulli <antonio@open-mesh.com>2016-01-16 16:40:13 +0800
committerAntonio Quartulli <a@unstable.cc>2016-02-29 16:05:31 +0800
commit9323158ef9f49935f0c61509919acd31dda8f11b (patch)
treeaac9dcf3817462f1f0f6b0071123643968ac5052 /net/batman-adv/bat_v_elp.c
parentbatman-adv: OGMv2 - add basic infrastructure (diff)
downloadlinux-dev-9323158ef9f49935f0c61509919acd31dda8f11b.tar.xz
linux-dev-9323158ef9f49935f0c61509919acd31dda8f11b.zip
batman-adv: OGMv2 - implement originators logic
Add the support for recognising new originators in the network and rebroadcast their OGMs. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Diffstat (limited to 'net/batman-adv/bat_v_elp.c')
-rw-r--r--net/batman-adv/bat_v_elp.c41
1 files changed, 1 insertions, 40 deletions
diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index dac88fad2697..fac5aee7ce05 100644
--- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c
@@ -37,8 +37,8 @@
#include <linux/workqueue.h>
#include "bat_algo.h"
+#include "bat_v_ogm.h"
#include "hard-interface.h"
-#include "hash.h"
#include "originator.h"
#include "packet.h"
#include "routing.h"
@@ -196,45 +196,6 @@ void batadv_v_elp_primary_iface_set(struct batadv_hard_iface *primary_iface)
}
/**
- * batadv_v_ogm_orig_get - retrieve and possibly create an originator node
- * @bat_priv: the bat priv with all the soft interface information
- * @addr: the address of the originator
- *
- * Return: the orig_node corresponding to the specified address. If such object
- * does not exist it is allocated here. In case of allocation failure returns
- * NULL.
- */
-static struct batadv_orig_node *
-batadv_v_ogm_orig_get(struct batadv_priv *bat_priv,
- const u8 *addr)
-{
- struct batadv_orig_node *orig_node;
- int hash_added;
-
- orig_node = batadv_orig_hash_find(bat_priv, addr);
- if (orig_node)
- return orig_node;
-
- orig_node = batadv_orig_node_new(bat_priv, addr);
- if (!orig_node)
- return NULL;
-
- hash_added = batadv_hash_add(bat_priv->orig_hash, batadv_compare_orig,
- batadv_choose_orig, orig_node,
- &orig_node->hash_entry);
- if (hash_added != 0) {
- /* orig_node->refcounter is initialised to 2 by
- * batadv_orig_node_new()
- */
- batadv_orig_node_put(orig_node);
- batadv_orig_node_put(orig_node);
- orig_node = NULL;
- }
-
- return orig_node;
-}
-
-/**
* batadv_v_elp_neigh_update - update an ELP neighbour node
* @bat_priv: the bat priv with all the soft interface information
* @neigh_addr: the neighbour interface address