batman-adv: Split batadv proto in meshif and hardif part
[feed/routing.git] / batman-adv / files / lib / netifd / proto / batadv_hardif.sh
1 #!/bin/sh
2
3 [ -n "$INCLUDE_ONLY" ] || {
4 . /lib/functions.sh
5 . ../netifd-proto.sh
6 init_proto "$@"
7 }
8
9 proto_batadv_hardif_init_config() {
10 proto_config_add_string "master"
11 }
12
13 proto_batadv_hardif_setup() {
14 local config="$1"
15 local iface="$2"
16
17 local master
18
19 json_get_vars master
20
21 ( proto_add_host_dependency "$config" '' "$master" )
22
23 batctl -m "$master" interface -M add "$iface"
24
25 proto_init_update "$iface" 1
26 proto_send_update "$config"
27 }
28
29 proto_batadv_hardif_teardown() {
30 local config="$1"
31 local iface="$2"
32
33 local master
34
35 json_get_vars master
36
37 batctl -m "$master" interface -M del "$iface" || true
38 }
39
40 add_protocol batadv_hardif