3 # This UCI-Defaults script will split the batadv proto network interfaces
4 # in batadv_hardif and batadv proto. The configuration options from
5 # /etc/config/batman-adv will be moved to the latter.
9 proto_batadv_to_batadv_hardif
() {
15 config_get proto
"${section}" proto
16 config_get mesh
"${section}" mesh
17 config_get routing_algo
"${section}" routing_algo
19 if [ -z "$mesh" -o "${proto}" != "batadv" ]; then
23 uci
set network.
"${section}".proto
="batadv_hardif"
24 uci rename network.
"${section}".mesh
="master"
25 uci delete network.
"${section}".routing_algo
27 # create new section or adjust existing one
28 uci
set network.
"${mesh}"=interface
29 uci
set network.
"${mesh}".proto
=batadv
30 [ -n "${routing_algo}" ] && uci set network."${mesh}".routing_algo="${routing_algo}"
33 mv_batadv_config_section
() {
38 local bridge_loop_avoidance
39 local distributed_arp_table
51 config_get aggregated_ogms
"${section}" aggregated_ogms
52 config_get ap_isolation
"${section}" ap_isolation
53 config_get bonding
"${section}" bonding
54 config_get bridge_loop_avoidance
"${section}" bridge_loop_avoidance
55 config_get distributed_arp_table
"${section}" distributed_arp_table
56 config_get fragmentation
"${section}" fragmentation
57 config_get gw_bandwidth
"${section}" gw_bandwidth
58 config_get gw_mode
"${section}" gw_mode
59 config_get gw_sel_class
"${section}" gw_sel_class
60 config_get hop_penalty
"${section}" hop_penalty
61 config_get isolation_mark
"${section}" isolation_mark
62 config_get log_level
"${section}" log_level
63 config_get multicast_mode
"${section}" multicast_mode
64 config_get network_coding
"${section}" network_coding
65 config_get orig_interval
"${section}" orig_interval
67 # update section in case it exists
68 [ -n "${aggregated_ogms}" ] && uci set network."${section}".aggregated_ogms="${aggregated_ogms}"
69 [ -n "${ap_isolation}" ] && uci set network."${section}".ap_isolation="${ap_isolation}"
70 [ -n "${bonding}" ] && uci set network."${section}".bonding="${bonding}"
71 [ -n "${bridge_loop_avoidance}" ] && uci set network."${section}".bridge_loop_avoidance="${bridge_loop_avoidance}"
72 [ -n "${distributed_arp_table}" ] && uci set network."${section}".distributed_arp_table="${distributed_arp_table}"
73 [ -n "${fragmentation}" ] && uci set network."${section}".fragmentation="${fragmentation}"
74 [ -n "${gw_bandwidth}" ] && uci set network."${section}".gw_bandwidth="${gw_bandwidth}"
75 [ -n "${gw_mode}" ] && uci set network."${section}".gw_mode="${gw_mode}"
76 [ -n "${gw_sel_class}" ] && uci set network."${section}".gw_sel_class="${gw_sel_class}"
77 [ -n "${hop_penalty}" ] && uci set network."${section}".hop_penalty="${hop_penalty}"
78 [ -n "${isolation_mark}" ] && uci set network."${section}".isolation_mark="${isolation_mark}"
79 [ -n "${log_level}" ] && uci set network."${section}".log_level="${log_level}"
80 [ -n "${multicast_mode}" ] && uci set network."${section}".multicast_mode="${multicast_mode}"
81 [ -n "${network_coding}" ] && uci set network."${section}".network_coding="${network_coding}"
82 [ -n "${orig_interval}" ] && uci set network."${section}".orig_interval="${orig_interval}"
85 if [ -f /etc
/config
/batman-adv
]; then
87 config_foreach proto_batadv_to_batadv_hardif
'interface'
90 config_load batman-adv
91 config_foreach mv_batadv_config_section
'mesh'
94 rm -f /etc
/config
/batman-adv