public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Cc: Marek Lindner <lindner_marek@yahoo.de>
Subject: Re: [B.A.T.M.A.N.] [RFC 2/5] batman-adv: ELP - creating neighbor structures, updating LQs
Date: Sat, 24 Mar 2012 21:21:17 +0100	[thread overview]
Message-ID: <20120324202117.GH5662@lunn.ch> (raw)
In-Reply-To: <20120324081407.GA30000@ritirata.org>

On Sat, Mar 24, 2012 at 09:14:08AM +0100, Antonio Quartulli wrote:
> On Fri, Mar 23, 2012 at 10:22:33 +0100, Andrew Lunn wrote:
> > > +static int bat_v_elp_packet_recv(struct sk_buff *skb,
> > > +				 struct hard_iface *if_incoming)
> > > +{
> > > +	struct bat_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
> > > +	struct batman_elp_packet *elp_packet;
> > > +	struct hard_iface *primary_if;
> > > +	struct ethhdr *ethhdr;
> > > +	bool ret;
> > > +
> > > +	ret = check_management_packet(skb, if_incoming, BATMAN_ELP_HLEN);
> > > +	if (!ret)
> > > +		return NET_RX_DROP;
> > > +
> > > +	/* did we receive a B.A.T.M.A.N. V ELP packet on an interface
> > > +	 * that does not have B.A.T.M.A.N. V ELP enabled ? */
> > > +	if (bat_priv->bat_algo_ops->bat_ogm_emit != bat_v_ogm_emit)
> > > +		return NET_RX_DROP;
> > 
> > Hi Marek
> > 
> > I've not looked at the code, but i assume this can happen because
> > there is not a per algorithm receive handler? Maybe it makes sense to
> > have a receive handler in algo structure, which can handle per
> > algorithm receive functions? The common PDUs can be handled first and
> > then a call into the algo receive function made to dispatch algo
> > specific PDUs.
> 
> Does this mean that you want to support multiple algorithms at the
> same time?  I don't think it is a good idea..

I'm assuming the choice of algorithm is linked to the soft interface,
i.e, bat0 could be using a different algorithm to bat1. So i think
multiple algorithms are possible at the same time.

I have been thinking about this a bit more, and also about this bit of
code:

+       elp_packet = (struct batman_elp_packet *)skb_push(hard_iface->elp_skb,
+                                                         BATMAN_ELP_HLEN);
+       memset(elp_packet, 0, BATMAN_ELP_HLEN);
+
+       elp_packet->header.packet_type = BAT_V_ELP;
+       elp_packet->header.version = COMPAT_VERSION;
+       elp_packet->header.ttl = 0;

Marek, what are your plans for COMPAT_VERSION? Will there be a
COMPAT_VERSION_IV and COMPAT_VERSION_V sometime soon?

Maybe when registering a receive function, you can pass both the
packet_type and version. So a received ELP packet with
COMPAT_VERSION_IV would automatically get tossed away, and an ELP with
COMPAT_VERSION_V would get dispatched.

	 Andrew

  reply	other threads:[~2012-03-24 20:21 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 21:50 [B.A.T.M.A.N.] [RFC] ELP Marek Lindner
2012-03-22 21:51 ` [B.A.T.M.A.N.] [RFC 1/5] batman-adv: ELP - adding basic infrastructure Marek Lindner
2012-03-22 21:51   ` [B.A.T.M.A.N.] [RFC 2/5] batman-adv: ELP - creating neighbor structures, updating LQs Marek Lindner
2012-03-23 20:52     ` Andrew Lunn
2012-04-05 19:59       ` Marek Lindner
2012-03-23 21:22     ` Andrew Lunn
2012-03-24  8:14       ` Antonio Quartulli
2012-03-24 20:21         ` Andrew Lunn [this message]
2012-04-05 20:11           ` Marek Lindner
2012-04-06  7:17             ` Andrew Lunn
2012-04-06  8:18               ` Marek Lindner
2012-04-05 20:08       ` Marek Lindner
2012-03-22 21:51   ` [B.A.T.M.A.N.] [RFC 3/5] batman-adv: ELP - exporting neighbor list via debugfs Marek Lindner
2012-03-22 21:51   ` [B.A.T.M.A.N.] [RFC 4/5] batman-adv: ELP - adding sysfs parameter for elp interval Marek Lindner
2012-03-22 21:51   ` [B.A.T.M.A.N.] [RFC 5/5] batman-adv: ELP - add configurable minimum ELP packet length (def: 300B) Marek Lindner
2012-03-24 20:39     ` Andrew Lunn
2012-04-05 20:19       ` Marek Lindner
2012-03-23  6:41   ` [B.A.T.M.A.N.] [RFC 1/5] batman-adv: ELP - adding basic infrastructure Andrew Lunn
2012-03-23  6:50   ` Andrew Lunn
2012-04-05 20:21     ` Marek Lindner
2012-03-23  6:32 ` [B.A.T.M.A.N.] [RFC] ELP Andrew Lunn
2012-03-23  7:50   ` Antonio Quartulli
2012-04-05 20:30   ` Marek Lindner
2012-04-06  9:13     ` Andrew Lunn
2012-04-06 16:57       ` dan
2012-04-06 17:19         ` Andrew Lunn
2012-04-06 18:04           ` dan
2012-03-23  6:34 ` Andrew Lunn
2012-03-23  7:51   ` Antonio Quartulli
2012-04-05 20:30   ` 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=20120324202117.GH5662@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=lindner_marek@yahoo.de \
    /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