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.] [RFC 2/4] batman-adv: added IPv6 to DAT and generic functions in distributed-arp-table.c
Date: Wed, 29 May 2013 17:32:02 +0200	[thread overview]
Message-ID: <20130529153202.GU3333@ritirata.org> (raw)
In-Reply-To: <CAP5XTDOfQeQ_13wUebA2e68kBCty=NV7mLG4x2nqZ6aVzL6xig@mail.gmail.com>

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

On Wed, May 29, 2013 at 08:16:25AM -0700, Mihail Costea wrote:
> >>  /**
> >>   * batadv_dat_entry_hash_find - look for a given dat_entry in the local hash
> >> @@ -393,6 +403,11 @@ static void batadv_dat_entry_add(struct batadv_priv *bat_priv, void *data,
> >>       case BATADV_DAT_IPV4:
> >>               choose = batadv_hash_dat_ipv4;
> >>               break;
> >> +#if IS_ENABLED(CONFIG_IPV6)
> >> +     case BATADV_DAT_IPV6:
> >> +             choose = batadv_hash_dat_ipv6;
> >> +             break;
> >> +#endif
> >
> > mh...I was just wondering: for the hash functions it would be nice to re-use the
> > same "array approach" that you used for the printing format.
> >
> > So we would have an array of function pointers to reference rather than having
> > this switch block...What do you think?
> >
> > I think it would be possible to do this for many other "variable" parameters if
> > required.
> >
> 
> Should there be a struct that contains all of them, like:
> 
> struct batadv_dat_data  {
> 

I was thinking of having many array, but I have to say that the "struct idea" is
much cleaner and it can be seen like an API.
Then we would only have one array of objects of this type.

Cheers,

-- 
Antonio Quartulli

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

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

  reply	other threads:[~2013-05-29 15:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-17 12:27 [B.A.T.M.A.N.] [RFC 1/4] batman-adv: renamed batadv_dat_snoop_*_arp_* functions to batadv_dat_snoop_*_msg_* Mihail
2013-05-17 12:27 ` [B.A.T.M.A.N.] [RFC 2/4] batman-adv: added IPv6 to DAT and generic functions in distributed-arp-table.c Mihail
2013-05-26 13:57   ` Antonio Quartulli
2013-05-29 15:16     ` Mihail Costea
2013-05-29 15:32       ` Antonio Quartulli [this message]
2013-05-29 15:21     ` Mihail Costea
2013-05-29 15:33       ` Antonio Quartulli
2013-05-29 16:12         ` Mihail Costea
2013-05-29 16:13           ` Antonio Quartulli
2013-05-17 12:27 ` [B.A.T.M.A.N.] [RFC 3/4] batman-adv: added necessary functions for NDP, like checking if a packet is valid or creating a Neighbor Advertisement Mihail
2013-05-26 14:02   ` Antonio Quartulli
2013-05-29 15:36     ` Mihail Costea
2013-05-29 15:43       ` Antonio Quartulli
2013-05-30  2:19         ` Mihail Costea
2013-05-17 12:27 ` [B.A.T.M.A.N.] [RFC 4/4] batman-adv: generalize snooping mechanism in order to suport NDP too Mihail
2013-05-17 12:33 ` [B.A.T.M.A.N.] [RFC 1/4] batman-adv: renamed batadv_dat_snoop_*_arp_* functions to batadv_dat_snoop_*_msg_* Mihail Costea
2013-05-26 13:59 ` Antonio Quartulli
2013-05-29 14:54   ` Mihail Costea
2013-06-24  7:57     ` Antonio Quartulli
2013-06-25  3:42       ` Mihail Costea

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=20130529153202.GU3333@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