On Fri, Dec 14, 2012 at 07:32:48 +0100, Martin Hundebøll wrote: [...]
+/**
- batadv_nc_purge_orig_nc_nodes - go through list of nc nodes and purge stale
- entries
- @bat_priv: the bat priv with all the soft interface information
- @list: list of nc nodes
- @lock: nc node list lock
- @to_purge: function in charge to decide whether an entry has to be purged or
not. This function takes the nc node as argument and has to return
a boolean value: true is the entry has to be deleted, false
typo here? is -> if ?
otherwise
- */
+static void +batadv_nc_purge_orig_nc_nodes(struct batadv_priv *bat_priv,
struct list_head *list,
spinlock_t *lock,
bool (*to_purge)(struct batadv_priv *,
struct batadv_nc_node *))
[...]
/**
- batadv_can_nc_with_orig - checks whether the given orig node is suitable for
- coding or not
- @bat_priv: the bat priv with all the soft interface information
- @orig_node: neighboring orig node which may be used as nc candidate
- @ogm_packet: incoming ogm packet also used for the checks
- Returns true if:
- The OGM must have the most recent sequence number.
- The TTL must be incremented by one and only one.
mh..should be decremented here? or maybe I misunderstood the condition.
- The OGM must be received from the first hop from orig_node.
- The TQ value of the OGM must be above bat_priv->nc.min_tq.
- */
+static bool batadv_can_nc_with_orig(struct batadv_priv *bat_priv,
struct batadv_orig_node *orig_node,
struct batadv_ogm_packet *ogm_packet)
+{
- if (orig_node->last_real_seqno != ogm_packet->seqno)
return false;
- if (orig_node->last_ttl != ogm_packet->header.ttl + 1)
return false;
- if (!batadv_compare_eth(ogm_packet->orig, ogm_packet->prev_sender))
return false;
- if (ogm_packet->tq < bat_priv->nc.min_tq)
return false;
- return true;
+}
Cheers,