proto-shell: add a notify command for setting interface availability
[project/netifd.git] / dummy / netifd-proto.sh
index c27d562..11337c2 100755 (executable)
@@ -48,6 +48,8 @@ proto_init_update() {
        PROTO_IP6ADDR=
        PROTO_ROUTE=
        PROTO_ROUTE6=
+       PROTO_DNS=
+       PROTO_DNS_SEARCH=
        json_init
        json_add_int action 0
        [ -n "$ifname" -a "*" != "$ifname" ] && json_add_string "ifname" "$ifname"
@@ -204,6 +206,15 @@ proto_block_restart() {
        _proto_notify "$interface"
 }
 
+proto_set_available() {
+       local interface="$1"
+       local state="$2"
+       json_init
+       json_add_int action 5
+       json_add_boolean available "$state"
+       _proto_notify "$interface"
+}
+
 init_proto() {
        proto="$1"; shift
        cmd="$1"; shift