Merge pull request #519 from freifunk-gluon/gw_sel_class
gluon-mesh-batman-adv-core: make gateway selection class configurable
This commit is contained in:
commit
e01e99c5f4
@ -82,6 +82,18 @@
|
|||||||
mac = 'xe:xx:xx:xx:xx:xx',
|
mac = 'xe:xx:xx:xx:xx:xx',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Options specific to routing protocols (optional)
|
||||||
|
-- mesh = {
|
||||||
|
-- Options specific to the batman-adv routing protocol (optional)
|
||||||
|
-- batman_adv = {
|
||||||
|
-- Gateway selection class (optional)
|
||||||
|
-- The default class 20 is based on the link quality (TQ) only,
|
||||||
|
-- class 1 is calculated from both the TQ and the announced bandwidth
|
||||||
|
-- gw_sel_class = 1,
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
|
||||||
|
next_node = {
|
||||||
-- Refer to http://fastd.readthedocs.org/en/latest/ to better understand
|
-- Refer to http://fastd.readthedocs.org/en/latest/ to better understand
|
||||||
-- what these options do.
|
-- what these options do.
|
||||||
fastd_mesh_vpn = {
|
fastd_mesh_vpn = {
|
||||||
|
@ -117,6 +117,22 @@ next_node : package
|
|||||||
mac = 'ca:ff:ee:ba:be:00'
|
mac = 'ca:ff:ee:ba:be:00'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mesh : optional
|
||||||
|
Options specific to routing protocols.
|
||||||
|
|
||||||
|
At the moment, only the ``batman_adv`` routing protocol has such options:
|
||||||
|
|
||||||
|
The optional value ``gw_sel_class`` sets the gateway selection class. The default
|
||||||
|
class 20 is based on the link quality (TQ) only, class 1 is calculated from
|
||||||
|
both the TQ and the announced bandwidth.
|
||||||
|
::
|
||||||
|
|
||||||
|
mesh = {
|
||||||
|
batman_adv = {
|
||||||
|
gw_sel_class = 1,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fastd_mesh_vpn
|
fastd_mesh_vpn
|
||||||
Remote server setup for the fastd-based mesh VPN.
|
Remote server setup for the fastd-based mesh VPN.
|
||||||
|
@ -21,3 +21,7 @@ end
|
|||||||
|
|
||||||
need_boolean('mesh_on_wan', false)
|
need_boolean('mesh_on_wan', false)
|
||||||
need_boolean('mesh_on_lan', false)
|
need_boolean('mesh_on_lan', false)
|
||||||
|
|
||||||
|
if need_table('mesh', nil, false) and need_table('mesh.batman_adv', nil, false) then
|
||||||
|
need_number('mesh.batman_adv.gw_sel_class', false)
|
||||||
|
end
|
||||||
|
@ -6,11 +6,17 @@ local site = require 'gluon.site_config'
|
|||||||
local uci = require('luci.model.uci').cursor()
|
local uci = require('luci.model.uci').cursor()
|
||||||
|
|
||||||
|
|
||||||
|
local gw_sel_class
|
||||||
|
if site.mesh and site.mesh.batman_adv then
|
||||||
|
gw_sel_class = site.mesh.batman_adv.gw_sel_class
|
||||||
|
end
|
||||||
|
|
||||||
uci:delete('batman-adv', 'bat0')
|
uci:delete('batman-adv', 'bat0')
|
||||||
uci:section('batman-adv', 'mesh', 'bat0',
|
uci:section('batman-adv', 'mesh', 'bat0',
|
||||||
{
|
{
|
||||||
orig_interval = 5000,
|
orig_interval = 5000,
|
||||||
gw_mode = 'client',
|
gw_mode = 'client',
|
||||||
|
gw_sel_class = gw_sel_class,
|
||||||
hop_penalty = 15,
|
hop_penalty = 15,
|
||||||
multicast_mode = 0,
|
multicast_mode = 0,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user