gluon-mesh-batman-adv: announce MAC of mesh ifaces

This will make a node announce all MACs of its interfaces participating
in the batman-adv mesh. This enables other nodes to associate the
announced object with both the data reported by batadv-vis as well as a
simple list of neighbours as output by `iw dev $IFACE station dump`.
This commit is contained in:
Nils Schneider 2014-07-13 09:02:02 +02:00
parent c4ee0e650b
commit 3a34b7052f
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
require 'ubus'
local conn = ubus.connect()
local list = util.exec('batctl if')
local interfaces = {}
for _, line in ipairs(util.split(list)) do
local ifname = line:match('^(.-):')
if ifname ~= nil then
local status = conn:call("network.device", "status", { name = ifname })
table.insert(interfaces, status['macaddr'])
end
end
return interfaces