+proto_notify_error() {
+ local interface="$1"; shift
+
+ json_init
+ json_add_int action 3
+ json_add_array error
+ while [ $# -gt 0 ]; do
+ json_add_string "" "$1"
+ shift
+ done
+ json_close_array
+ _proto_notify "$interface"
+}
+
+proto_block_restart() {
+ local interface="$1"; shift
+
+ json_init
+ json_add_int action 4
+ _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"
+}
+
+proto_add_host_dependency() {
+ local interface="$1"
+ local host="$2"
+ local ifname="$3"
+
+ # execute in subshell to not taint callers env
+ # see tickets #11046, #11545, #11570
+ (
+ json_init
+ json_add_int action 6
+ json_add_string host "$host"
+ [ -n "$ifname" ] && json_add_string ifname "$ifname"
+ _proto_notify "$interface" -S
+ )
+}
+
+proto_setup_failed() {
+ local interface="$1"
+ json_init
+ json_add_int action 7
+ _proto_notify "$interface"
+}
+