[commits] [openwrt-feed-devel] master: batman-adv-devel: Add support for hardif settings (5d7f3ca)

postmaster at open-mesh.org postmaster at open-mesh.org
Thu Aug 1 16:55:20 CEST 2019


Repository : ssh://git@open-mesh.org/openwrt-feed-devel

On branch  : master

>---------------------------------------------------------------

commit 5d7f3ca0fe11089326e57bd6099c71cbaace9877
Author: Sven Eckelmann <sven at narfation.org>
Date:   Sat Jun 15 09:25:05 2019 +0200

    batman-adv-devel: Add support for hardif settings
    
    B.A.T.M.A.N. V support additional settings which are hardif specific. The
    batadv_hardif proto has to expose them to allow automatic configuration.
    The default configuration would be:
    
      config interface 'bat0_hardif_eth0'
            option proto 'batadv_hardif'
            option master 'bat0'
            option ifname 'eth0'
            option mtu '1536'
            option 'elp_interval' 500
            # string like '1mbit' is accepted instead of kbit for override
            option 'throughput_override' '0'
    
    Signed-off-by: Sven Eckelmann <sven at narfation.org>


>---------------------------------------------------------------

5d7f3ca0fe11089326e57bd6099c71cbaace9877
 batman-adv-devel/files/lib/netifd/proto/batadv_hardif.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/batman-adv-devel/files/lib/netifd/proto/batadv_hardif.sh b/batman-adv-devel/files/lib/netifd/proto/batadv_hardif.sh
index 9283d2b..76ccd81 100755
--- a/batman-adv-devel/files/lib/netifd/proto/batadv_hardif.sh
+++ b/batman-adv-devel/files/lib/netifd/proto/batadv_hardif.sh
@@ -7,21 +7,30 @@
 }
 
 proto_batadv_hardif_init_config() {
+	proto_config_add_int 'elp_interval'
 	proto_config_add_string "master"
+	proto_config_add_string 'throughput_override'
 }
 
 proto_batadv_hardif_setup() {
 	local config="$1"
 	local iface="$2"
 
+	local elp_interval
 	local master
+	local throughput_override
 
+	json_get_vars elp_interval
 	json_get_vars master
+	json_get_vars throughput_override
 
 	( proto_add_host_dependency "$config" '' "$master" )
 
 	batctl -m "$master" interface -M add "$iface"
 
+	[ -n "$elp_interval" ] && batctl -m "$master" hardif "$iface" elp_interval "$elp_interval"
+	[ -n "$throughput_override" ] && batctl -m "$master" hardif "$iface" throughput_override "$throughput_override"
+
 	proto_init_update "$iface" 1
 	proto_send_update "$config"
 }



More information about the commits mailing list