From: Marek Lindner <lindner_marek@yahoo.de>
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] batman-adv: Add filtering of OGM messages
Date: Thu, 9 Feb 2012 15:59:06 +0800 [thread overview]
Message-ID: <201202091559.07197.lindner_marek@yahoo.de> (raw)
In-Reply-To: <1328727958-16119-1-git-send-email-martin@hundeboll.net>
On Thursday, February 09, 2012 03:05:58 Martin Hundebøll wrote:
> For testing purposes, forcing specific paths in a network where all
> nodes are within reach, can be useful. This patch allows the use to
> enter addresses from which direct OGMs should be ignored.
>
> An address is added by echoing it into
> /sys/class/net/bat0/filter_add_addr and removed again by echoing the
> same address into /sys/class/net/bat0/filter_del_addr. The list of
> currently blocked direct OGM sources is available in
> /sys/kernel/debug/batman-adv/bat0/filter_table.
In addition to what Antonio has already pointed out:
> diff --git a/bat_sysfs.c b/bat_sysfs.c
> index 3adb183..0fc5e3e 100644
> --- a/bat_sysfs.c
> +++ b/bat_sysfs.c
> @@ -27,6 +27,7 @@
> #include "gateway_common.h"
> #include "gateway_client.h"
> #include "vis.h"
> +#include "filter.h"
>
> static struct net_device *kobj_to_netdev(struct kobject *obj)
> {
> @@ -384,11 +385,49 @@ static ssize_t store_gw_bwidth(struct kobject *kobj,
> struct attribute *attr, return gw_bandwidth_set(net_dev, buff, count);
> }
It might be better to move filter_add/filter_del into debugfs. There we have
less "regulation rules" and more freedom when it comes to the syntax and what
we add. It is for debugging purposes anyways.
Do you plan to add more "filters" in the future ? Otherwise I'd rather call it
"block_orig/unblock_orig". Seems more obvious than the generic "filter".
> + if ((res = filter_parse_addr_str(buff, count, mac)) < 0) {
> + bat_info(net_dev, "Address has invalid format: %s\n", buff);
> + return res;
Is there no existing kernel function for the mac address parsing ?
> +void filter_addr_add(struct bat_priv *bat_priv, const uint8_t *addr)
> +{
> + struct orig_node *orig_node = orig_hash_find(bat_priv, addr);
> +
> + if (!orig_node)
> + return;
> +
> + atomic_set(&orig_node->filter, FILTER_TRUE);
> + orig_node_free_ref(orig_node);
> +}
This will only allow blocking an originator if it is already there. What if I
configure my node before the mesh is up ? For example via scripts ?
Cheers,
Marek
next prev parent reply other threads:[~2012-02-09 7:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-08 19:05 [B.A.T.M.A.N.] [RFC] batman-adv: Add filtering of OGM messages Martin Hundebøll
2012-02-08 19:53 ` Antonio Quartulli
2012-02-09 7:59 ` Marek Lindner [this message]
2012-02-10 14:53 ` [B.A.T.M.A.N.] [RFCv2] batman-adv: Add blocking of one hop " Martin Hundebøll
2012-02-10 14:56 ` Martin Hundebøll
2012-02-15 19:23 ` Simon Wunderlich
2012-02-16 10:54 ` Martin Hundebøll
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=201202091559.07197.lindner_marek@yahoo.de \
--to=lindner_marek@yahoo.de \
--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