Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
firmware
FFS Gluon
Commits
d97586dd
Commit
d97586dd
authored
9 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Plain Diff
Merge branch 'announce-separate-frequencies' of
https://github.com/FreifunkBremen/gluon
parents
58306fd1
89a9d813
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/statistics.d/clients
+43
-8
43 additions, 8 deletions
...an-adv-core/files/lib/gluon/announce/statistics.d/clients
with
43 additions
and
8 deletions
package/gluon-mesh-batman-adv-core/files/lib/gluon/announce/statistics.d/clients
+
43
−
8
View file @
d97586dd
local list = io.lines("/sys/kernel/debug/batman_adv/bat0/transtable_local")
local iwinfo = require 'iwinfo'
local counts = { total = 0
, wifi = 0
, wifi24 = 0
, wifi5 = 0
}
local
count = 0
local
list = io.lines("/sys/kernel/debug/batman_adv/bat0/transtable_local")
local
wifi
=
0
local
clients
=
{}
for line in list do
for line in list do
local mac, _, flags, lastseen = line:match("^ %* ([0-9a-f:]+) *(.- )%[(.-)%] +(%d+%.%d+)")
local mac, _, flags, lastseen = line:match("^ %* ([0-9a-f:]+) *(.- )%[(.-)%] +(%d+%.%d+)")
if mac then
if mac then
if not flags:match('P') then
if not flags:match('P') then
count = count + 1
counts.total = counts.total + 1
clients[mac:lower()] = true
if flags:match('W') then
if flags:match('W') then
wifi =
wifi +1
counts.wifi = counts.
wifi +1
end
end
end
end
end
end
end
end
return { total = count
function count_iface_stations(iface)
, wifi = wifi
local wifitype = iwinfo.type(iface)
}
if wifitype == nil then
return
end
local freq = iwinfo[wifitype].frequency(iface)
local key
if freq >= 2400 and freq < 2500 then
key = "wifi24"
elseif freq >= 5000 and freq < 6000 then
key = "wifi5"
else
return
end
for k, v in pairs(iwinfo[wifitype].assoclist(iface)) do
if clients[k:lower()] then
counts[key] = counts[key] + 1
end
end
end
local ifaces = {}
uci:foreach("wireless", "wifi-iface", function(s)
if s.network == "client" and s.mode == "ap" then
count_iface_stations(s.ifname)
end
end)
return counts
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment