gluon-core: add gluon_mesh netifd proto
This new protocol will allow configuring mesh interfaces independently of the used mesh protocol.
This commit is contained in:
parent
fb587e9b55
commit
5cd6295265
39
package/gluon-core/files/lib/netifd/proto/gluon_mesh.sh
Executable file
39
package/gluon-core/files/lib/netifd/proto/gluon_mesh.sh
Executable file
@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. ../netifd-proto.sh
|
||||
init_proto "$@"
|
||||
|
||||
proto_gluon_mesh_init_config() {
|
||||
proto_config_add_boolean fixed_mtu
|
||||
proto_config_add_boolean transitive
|
||||
}
|
||||
|
||||
proto_gluon_mesh_setup() {
|
||||
export CONFIG="$1"
|
||||
export IFNAME="$2"
|
||||
|
||||
local fixed_mtu transitive
|
||||
json_get_vars fixed_mtu transitive
|
||||
|
||||
export FIXED_MTU="$fixed_mtu"
|
||||
export TRANSITIVE="$transitive"
|
||||
|
||||
for script in /lib/gluon/core/mesh/setup.d/*; do
|
||||
[ ! -x "$script" ] || "$script"
|
||||
done
|
||||
|
||||
proto_init_update "$IFNAME" 1
|
||||
proto_send_update "$CONFIG"
|
||||
}
|
||||
|
||||
proto_gluon_mesh_teardown() {
|
||||
export CONFIG="$1"
|
||||
export IFNAME="$2"
|
||||
|
||||
for script in /lib/gluon/core/mesh/teardown.d/*; do
|
||||
[ ! -x "$script" ] || "$script"
|
||||
done
|
||||
}
|
||||
|
||||
add_protocol gluon_mesh
|
Loading…
Reference in New Issue
Block a user