aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bat_iv_ogm.c
diff options
context:
space:
mode:
authorMartin Hundebøll <martin@hundeboll.net>2013-01-25 05:12:39 -0500
committerAntonio Quartulli <ordex@autistici.org>2013-03-13 17:53:49 -0400
commitd56b1705e28c196312607bc8bdde0e91879c20b6 (patch)
tree3f48f0c97be0db6927edc1dec0d414a28557e06b /net/batman-adv/bat_iv_ogm.c
parentd353d8d4d9f0184ac43a90c6e04b593c33bd28ea (diff)
batman-adv: network coding - detect coding nodes and remove these after timeout
To use network coding efficiently, a relay must know when neighbor nodes are likely to have enough information to be able to decode a network coded packet. This is detected by using OGMs from batman-adv to discover when one neighbor is in range of another neighbor. The relay check the TLL to detect when an OGM is forwarded from one neighbor by another neighbor, and thereby knows that the two neighbors are in range and thus overhear packets sent by each other. This information is saved in the orig_node struct to be used when searching for coding opportunities. Two lists are added to the orig_node struct: One for neighbors that can hear the orig_node (outgoing nc_nodes) and one for neighbors that the orig_node can hear (incoming nc_nodes). Information about nc_nodes is kept for 10 seconds and is available through debugfs in batman_adv/nc_nodes to use when debugging network coding. Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/bat_iv_ogm.c')
-rw-r--r--net/batman-adv/bat_iv_ogm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index a5bb0a769eb9..071f288b77a8 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -27,6 +27,7 @@
27#include "hard-interface.h" 27#include "hard-interface.h"
28#include "send.h" 28#include "send.h"
29#include "bat_algo.h" 29#include "bat_algo.h"
30#include "network-coding.h"
30 31
31static struct batadv_neigh_node * 32static struct batadv_neigh_node *
32batadv_iv_ogm_neigh_new(struct batadv_hard_iface *hard_iface, 33batadv_iv_ogm_neigh_new(struct batadv_hard_iface *hard_iface,
@@ -1185,6 +1186,10 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
1185 if (!orig_neigh_node) 1186 if (!orig_neigh_node)
1186 goto out; 1187 goto out;
1187 1188
1189 /* Update nc_nodes of the originator */
1190 batadv_nc_update_nc_node(bat_priv, orig_node, orig_neigh_node,
1191 batadv_ogm_packet, is_single_hop_neigh);
1192
1188 orig_neigh_router = batadv_orig_node_get_router(orig_neigh_node); 1193 orig_neigh_router = batadv_orig_node_get_router(orig_neigh_node);
1189 1194
1190 /* drop packet if sender is not a direct neighbor and if we 1195 /* drop packet if sender is not a direct neighbor and if we