summaryrefslogtreecommitdiffhomepage
path: root/dummy/netifd-proto.sh
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-10-21 01:44:26 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-10-21 01:44:26 +0200
commit14f7651a6e61ccd870be78dd6b303057ea982414 (patch)
tree1aae026f8806f4d89d4c0291e15fc7eea402a14d /dummy/netifd-proto.sh
parent31e8b6e9a4c0db86d27f6bdb21678bb48735a8a1 (diff)
proto-shell: allow protocol handlers to add interface error messages and block interface restart
Diffstat (limited to 'dummy/netifd-proto.sh')
-rwxr-xr-xdummy/netifd-proto.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/dummy/netifd-proto.sh b/dummy/netifd-proto.sh
index 3ab69d8..c27d562 100755
--- a/dummy/netifd-proto.sh
+++ b/dummy/netifd-proto.sh
@@ -182,6 +182,28 @@ proto_kill_command() {
_proto_notify "$interface"
}
+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"
+}
+
init_proto() {
proto="$1"; shift
cmd="$1"; shift