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>
Subject: Re: [B.A.T.M.A.N.] Implement DAT for IPv6
Date: Fri, 1 Mar 2013 12:08:09 +0100	[thread overview]
Message-ID: <20130301110809.GC20607@ritirata.org> (raw)
In-Reply-To: <CAP5XTDP_8pCJA8uXpQoMNExiVaCvmBCmkKT_aDErk0qYk7-pmw@mail.gmail.com>

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

On Fri, Mar 01, 2013 at 12:59:18PM +0200, Mihail Costea wrote:
> Hi,
> 
> I've started implementing DAT for IPv6 and I have a few questions
> regarding the design.
> I've already implemented a snooping mechanism for Network Solicitation
> package, but now I have to add it to the ipv6 distributed table.
> I'm also a beginner in kernel programming so any help would be useful.
> 
> From what I've seen there is a lot of code in distributed-arp-table.c
> that could be used for ipv6 distributed table.

yeah, I think that the table handling and DHT primitives can be reused for IPv6
(they were designed on purpose).

> A problem in using that code, from what I've seen, is the fact that
> <struct batadv_dat_entry > has a field for ip with only 32 bits
> (__be32).

Yes, here a way to generalise the structure is needed.

> 
> So I was thinking to make it more general by:
> 1. transforming that into a pointer (unsigned char *ip) and add a
> field size which will represent the total size of the ip.
> The ip itself would be allocated dynamically.
> 2. use a union with both _be32 / struct in6_addr. In this case the
> problem is that if we use ipv4 then all the other space for struct
> in6_addr would be wasted.

correct. and for point 2) I think we waste a not negligible amount of memory..

> 
> The second problem from what I've seen in the code is that the
> batadv_priv->dat field is hardcoded.
> For ipv6 we would need a new field to memorize the table, but I don't
> think it's a really hard problem to solve in order to make it general.
> 

I did not get the problem with the dat field?
Can't you use the same table to store both IPv4 and IPv6? The DHT is made to
store general data, so I think (with the suggestions you wrote above) that you
should be able to use one table only.

> This solution would be to avoid code duplicate. Off course, I could
> still write all the code in parallel just for IPv6, but I think that a
> common base would be useful.
> 

Re-use code is definitely the way to go :) easy maintenance later, one single
point for bug-fixing and code has been tested already (so it should work[tm] as
expected :-))

> Thanks,

no worries :)

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:[~2013-03-01 11:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-01 10:59 [B.A.T.M.A.N.] Implement DAT for IPv6 Mihail Costea
2013-03-01 11:08 ` Antonio Quartulli [this message]
2013-03-01 11:38   ` Mihail Costea
2013-03-01 11:43     ` Antonio Quartulli
2013-03-01 11:56       ` Mihail Costea
2013-03-08  9:22         ` Mihail Costea
2013-03-08  9:33           ` Antonio Quartulli
2013-03-08 10:11             ` Mihail Costea
2013-03-08 10:14               ` Antonio Quartulli
2013-03-01 11:11 ` Antonio Quartulli
2013-03-01 11:41   ` Mihail Costea
2013-03-01 11:48     ` Antonio Quartulli

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=20130301110809.GC20607@ritirata.org \
    --to=ordex@autistici.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /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