public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Antonio Quartulli <ordex@autistici.org>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Cc: "Martin Hundebøll" <martin@hundeboll.net>
Subject: Re: [B.A.T.M.A.N.] [PATCHv2 3/7] batman-adv: Detect coding nodes and remove these after timeout
Date: Tue, 18 Dec 2012 23:54:55 +0100	[thread overview]
Message-ID: <20121218225455.GD23011@ritirata.org> (raw)
In-Reply-To: <67167faccab90f98beb606e16b5234c0e0b9ad21.1355466678.git.martin@hundeboll.net>

[-- Attachment #1: Type: text/plain, Size: 2190 bytes --]

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:
> + *  1) The OGM must have the most recent sequence number.
> + *  2) The TTL must be incremented by one and only one.

mh..should be decremented here? or maybe I misunderstood the condition.

> + *  3) The OGM must be received from the first hop from orig_node.
> + *  4) 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,

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-12-18 22:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-14  6:32 [B.A.T.M.A.N.] [PATCHv2 0/7] CATWOMAN: Network coding in batman-adv Martin Hundebøll
2012-12-14  6:32 ` [B.A.T.M.A.N.] [PATCHv2 1/7] batman-adv: Return reason for failure in batadv_check_unicast_packet() Martin Hundebøll
2012-12-15  8:10   ` Marek Lindner
2012-12-15 12:39     ` Antonio Quartulli
2012-12-14  6:32 ` [B.A.T.M.A.N.] [PATCHv2 2/7] batman-adv: Add the initial code for network coding Martin Hundebøll
2012-12-15 13:15   ` Antonio Quartulli
2012-12-14  6:32 ` [B.A.T.M.A.N.] [PATCHv2 3/7] batman-adv: Detect coding nodes and remove these after timeout Martin Hundebøll
2012-12-18 22:54   ` Antonio Quartulli [this message]
2012-12-14  6:32 ` [B.A.T.M.A.N.] [PATCHv2 4/7] batman-adv: Buffer unicast packets before forward Martin Hundebøll
2012-12-18 22:54   ` Antonio Quartulli
2012-12-14  6:32 ` [B.A.T.M.A.N.] [PATCHv2 5/7] batman-adv: Code and transmit packets if possible Martin Hundebøll
2012-12-14  6:32 ` [B.A.T.M.A.N.] [PATCHv2 6/7] batman-adv: Save overheard and tx packets for decoding Martin Hundebøll
2012-12-14  6:32 ` [B.A.T.M.A.N.] [PATCHv2 7/7] batman-adv: Receive coded packets and decode them Martin Hundebøll
2012-12-15  8:13 ` [B.A.T.M.A.N.] [PATCHv2 0/7] CATWOMAN: Network coding in batman-adv Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121218225455.GD23011@ritirata.org \
    --to=ordex@autistici.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=martin@hundeboll.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox