1 . /usr/share/libubox/jshn.sh
3 proto_config_add_generic() {
5 json_add_string "" "$1"
10 proto_config_add_int() {
11 proto_config_add_generic "$1" 5
14 proto_config_add_string() {
15 proto_config_add_generic "$1" 3
18 proto_config_add_boolean() {
19 proto_config_add_generic "$1" 7
22 add_default_handler() {
23 case "$(type $1 2>/dev/null)" in
25 *) eval "$1() { return; }"
29 _proto_do_teardown() {
31 eval "$1_teardown \"$interface\" \"$ifname\""
36 eval "$1_setup \"$interface\" \"$ifname\""
51 add_default_handler "$1_init_config"
54 json_add_string "name" "$1"
56 json_add_boolean no-device "$no_device"
57 json_add_boolean available "$available"
58 json_add_array "config"
66 [[ "$proto" == "$1" ]] || return 0
69 setup) _proto_do_setup "$1";;
70 teardown) _proto_do_teardown "$1" ;;