NETIFD_MAIN_DIR="${NETIFD_MAIN_DIR:-/lib/netifd}"
+PROTO_DEFAULT_OPTIONS="defaultroute peerdns metric"
. /usr/share/libubox/jshn.sh
. $NETIFD_MAIN_DIR/utils.sh
config_add_boolean "$@"
}
+proto_config_add_defaults() {
+ proto_config_add_boolean "defaultroute"
+ proto_config_add_boolean "peerdns"
+ proto_config_add_int "metric"
+}
+
+proto_add_dynamic_defaults() {
+ [ -n "$defaultroute" ] && json_add_boolean defaultroute "$defaultroute"
+ [ -n "$peerdns" ] && json_add_boolean peerdns "$peerdns"
+ [ -n "$metric" ] && json_add_int metric "$metric"
+}
+
_proto_do_teardown() {
json_load "$data"
eval "proto_$1_teardown \"$interface\" \"$ifname\""