From 3a34b7052f6aeaf60d4cb50e0030f9a58b27c1c9 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sun, 13 Jul 2014 09:02:02 +0200 Subject: [PATCH] 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`. --- .../announce/announce.d/network/mesh_interfaces | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 gluon/gluon-mesh-batman-adv/files/lib/gluon/announce/announce.d/network/mesh_interfaces diff --git a/gluon/gluon-mesh-batman-adv/files/lib/gluon/announce/announce.d/network/mesh_interfaces b/gluon/gluon-mesh-batman-adv/files/lib/gluon/announce/announce.d/network/mesh_interfaces new file mode 100644 index 0000000..d078fcb --- /dev/null +++ b/gluon/gluon-mesh-batman-adv/files/lib/gluon/announce/announce.d/network/mesh_interfaces @@ -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