Merge pull request #396 from ecsv/batadv-2018.2
[feed/routing.git] / batman-adv / files / lib / netifd / proto / batadv_vlan.sh
1 #!/bin/sh
2
3 . /lib/functions.sh
4 . ../netifd-proto.sh
5 init_proto "$@"
6
7 proto_batadv_vlan_init_config() {
8 proto_config_add_string "ap_isolation"
9 }
10
11 proto_batadv_vlan_setup() {
12 local config="$1"
13 local iface="$2"
14
15 # VLAN specific variables
16 local device="${iface%.*}"
17 local vid="${iface#*.}"
18
19 # batadv_vlan options
20 local ap_isolation
21
22 json_get_vars ap_isolation
23
24 echo "$ap_isolation" > "/sys/class/net/${device}/mesh/vlan${vid}/ap_isolation"
25 proto_init_update "$iface" 1
26 proto_send_update "$config"
27 }
28
29 add_protocol batadv_vlan