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 ###############################################################################
23 # Load the batman kernel module.
24 module_load
"batman-adv"
31 local cmd
="ip link add name ${device} type batadv"
35 if [ ${ret} -eq ${EXIT_OK} ]; then
36 log DEBUG
"batman-adv device '${device}' has been created"
38 log ERROR
"batman-adv device '${device}' could not be created: ${ret}"
48 device_delete
"${device}"
58 # Make sure, batman is running.
61 __device_set_file
"${port}" "batman_adv/mesh_iface" "${device}"
68 __device_set_file
"${port}" "batman_adv/mesh_iface" "none"
71 batman_adv_get_aggregated_ogms
() {
75 local value
="$(__device_get_file "${device}" "mesh
/aggregated_ogms
")"
88 batman_adv_get_ap_isolation
() {
92 local value
="$(__device_get_file "${device}" "mesh
/ap_isolation
")"
105 batman_adv_get_bonding_mode
() {
109 local value
="$(__device_get_file "${device}" "mesh
/bonding
")"
122 batman_adv_get_distributed_arp_table
() {
126 local value
="$(__device_get_file "${device}" "mesh
/distributed_arp_table
")"
139 batman_adv_get_bridge_loop_avoidance
() {
143 local value
="$(__device_get_file "${device}" "mesh
/bridge_loop_avoidance
")"
156 batman_adv_get_fragmentation
() {
160 local value
="$(__device_get_file "${device}" "mesh
/fragmentation
")"
173 batman_adv_get_gateway_mode
() {
177 local value
="$(__device_get_file "${device}" "mesh
/gw_mode
")"
190 batman_adv_get_gateway_bandwidth
() {
194 __device_get_file
"${device}" "mesh/gw_bandwidth"
197 batman_adv_get_gateway_selection_class
() {
201 __device_get_file
"${device}" "mesh/gw_sel_class"
204 batman_adv_get_hop_penalty
() {
208 __device_get_file
"${device}" "mesh/hop_penalty"
211 batman_adv_get_originator_interval
() {
215 __device_get_file
"${device}" "mesh/orig_interval"
218 batman_adv_get_routing_algorithm
() {
222 __device_get_file
"${device}" "mesh/routing_algo"