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 ###############################################################################
26 # Make sure the kernel module is loaded
27 module_load
"batman-adv"
29 local cmd
="ip link add name ${device} type batadv"
33 if [ ${ret} -eq ${EXIT_OK} ]; then
34 log DEBUG
"batman-adv device '${device}' has been created"
36 log ERROR
"batman-adv device '${device}' could not be created: ${ret}"
46 device_delete
"${device}"
56 device_set_master
"${port}" "${device}"
63 __device_set_file
"${port}" "batman_adv/mesh_iface" "none"
66 batman_adv_get_aggregated_ogms
() {
70 local value
="$(__device_get_file "${device}" "mesh
/aggregated_ogms
")"
83 batman_adv_get_ap_isolation
() {
87 local value
="$(__device_get_file "${device}" "mesh
/ap_isolation
")"
100 batman_adv_get_bonding_mode
() {
104 local value
="$(__device_get_file "${device}" "mesh
/bonding
")"
117 batman_adv_get_distributed_arp_table
() {
121 local value
="$(__device_get_file "${device}" "mesh
/distributed_arp_table
")"
134 batman_adv_get_bridge_loop_avoidance
() {
138 local value
="$(__device_get_file "${device}" "mesh
/bridge_loop_avoidance
")"
151 batman_adv_get_fragmentation
() {
155 local value
="$(__device_get_file "${device}" "mesh
/fragmentation
")"
168 batman_adv_get_gateway_mode
() {
172 local value
="$(__device_get_file "${device}" "mesh
/gw_mode
")"
185 batman_adv_get_gateway_bandwidth
() {
189 __device_get_file
"${device}" "mesh/gw_bandwidth"
192 batman_adv_get_gateway_selection_class
() {
196 __device_get_file
"${device}" "mesh/gw_sel_class"
199 batman_adv_get_hop_penalty
() {
203 __device_get_file
"${device}" "mesh/hop_penalty"
206 batman_adv_get_originator_interval
() {
210 __device_get_file
"${device}" "mesh/orig_interval"
213 batman_adv_get_routing_algorithm
() {
217 __device_get_file
"${device}" "mesh/routing_algo"