2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2013 IPFire Network Development Team #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
22 function batman_adv_start
() {
23 # Load the batman kernel module.
24 module_load
"batman-adv"
27 function batman_adv_interface_add
() {
34 # Make sure, batman is running.
37 assert device_is_batman_adv_port
"${port}"
39 fwrite
"${SYS_CLASS_NET}/${port}/batman_adv/mesh_iface" "${device}"
42 function batman_adv_interface_del
() {
46 fwrite
"${SYS_CLASS_NET}/${port}/batman_adv/mesh_iface" "none"
49 function batman_adv_get_aggregated_ogms
() {
53 local value
="$(fread ${SYS_CLASS_NET}/${device}/mesh/aggregated_ogms)"
66 function batman_adv_get_ap_isolation
() {
70 local value
="$(fread ${SYS_CLASS_NET}/${device}/mesh/ap_isolation)"
83 function batman_adv_get_bonding_mode
() {
87 local value
="$(fread ${SYS_CLASS_NET}/${device}/mesh/bonding)"
100 function batman_adv_get_distributed_arp_table
() {
104 local value
="$(fread ${SYS_CLASS_NET}/${device}/mesh/distributed_arp_table)"
117 function batman_adv_get_bridge_loop_avoidance
() {
121 local value
="$(fread ${SYS_CLASS_NET}/${device}/mesh/bridge_loop_avoidance)"
134 function batman_adv_get_fragmentation
() {
138 local value
="$(fread ${SYS_CLASS_NET}/${device}/mesh/fragmentation)"
151 function batman_adv_get_gateway_mode
() {
155 local value
="$(fread ${SYS_CLASS_NET}/${device}/mesh/gw_mode)"
168 function batman_adv_get_gateway_bandwidth
() {
172 fread
"${SYS_CLASS_NET}/${device}/mesh/gw_bandwidth"
175 function batman_adv_get_gateway_selection_class
() {
179 fread
"${SYS_CLASS_NET}/${device}/mesh/gw_sel_class"
182 function batman_adv_get_hop_penalty
() {
186 fread
"${SYS_CLASS_NET}/${device}/mesh/hop_penalty"
189 function batman_adv_get_originator_interval
() {
193 fread
"${SYS_CLASS_NET}/${device}/mesh/orig_interval"
196 function batman_adv_get_routing_algorithm
() {
200 fread
"${SYS_CLASS_NET}/${device}/mesh/routing_algo"