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: [B.A.T.M.A.N.] reorganized kernel interface patches (version 3)
Date: Wed, 24 Mar 2010 12:52:18 +0800 [thread overview]
Message-ID: <201003241252.18954.lindner_marek@yahoo.de> (raw)
Hi,
since my last patches did not trigger too many complaints I went ahead and
submitted them. This opens the way for the last series of patches which
conclude the matter. All remaining /proc files have been eliminated and moved
over to /sys. While doing so, I reworked the interface handling to satisfy an
old feature request: interfaces can be added & removed on the fly.
On startup batman-adv will scan the system for available interfaces to create
a "batman_adv" subfolder in their respective /sys/class/net folder, e.g.
eth0: /sys/class/net/eth0/batman_adv
This subfolder will contain the settings which are relevant for this
interface. You can tell batman-adv to use an interface by writing "bat0" into
the mesh_iface file:
echo bat0 > /sys/class/net/eth0/batman_adv/mesh_iface
or write "none" to deactivate it:
echo none > /sys/class/net/eth0/batman_adv/mesh_iface
Although only "bat0" is accepted at this point, the syntax already gears
towards multiple virtual mesh support. Later you will be able to create/name
your virtual meshes by writing into this file. Retrieve the interface status by
simply reading its status file:
cat /sys/class/net/eth0/batman_adv/iface_status
Note: batman-adv will continuously observe the system's interfaces. Whenever
new interfaces appear or disappear batman will update the /sys/class/net
folders automatically. Also, batman-adv will make sure that incompatible
interfaces (e.g. loopback, non-ethernet, etc) won't have the subfolder, hence
can't be activated.
The batctl interface syntax had to be modified in order to cope with these
changes. You can run:
batctl interface
to get the list of active interfaces and their status. To add or delete
interfaces you can run:
batctl interface add|del eth0 eth1 ..
Since removing an active interface is a tricky thing where many operations can
go wrong I expect some crashes/race conditions in the code. I tested it a
while on multiple machines with multiple interfaces and it works for me but
I'm sure there are more bugs to find.
Regards,
Marek
next reply other threads:[~2010-03-24 4:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-24 4:52 Marek Lindner [this message]
2010-03-24 4:52 ` [B.A.T.M.A.N.] [PATCH 1/5] batman-adv: move originator interval setting from /proc to /sys Marek Lindner
2010-03-24 4:52 ` [B.A.T.M.A.N.] [PATCH 2/5] batctl: follow the orig_interval move " Marek Lindner
2010-03-24 4:52 ` [B.A.T.M.A.N.] [PATCH 3/5] batman-adv: remove redundant pointer to originator interface Marek Lindner
2010-03-24 4:52 ` [B.A.T.M.A.N.] [PATCH 4/5] batman-adv: move /proc interface handling to /sys Marek Lindner
2010-03-24 4:52 ` [B.A.T.M.A.N.] [PATCH 5/5] batctl: adapt batctl to new sysfs interface handling Marek Lindner
2010-04-01 17:28 ` [B.A.T.M.A.N.] reorganized kernel interface patches (version 3) Linus Lüssing
2010-04-03 9:44 ` Marek Lindner
2010-04-05 20:47 ` 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=201003241252.18954.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.