b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] reorganized kernel interface patches (version 3)
@ 2010-03-24  4:52 Marek Lindner
  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
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Marek Lindner @ 2010-03-24  4:52 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking


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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-04-05 20:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-24  4:52 [B.A.T.M.A.N.] reorganized kernel interface patches (version 3) Marek Lindner
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).