X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=dummy%2Fnetifd-proto.sh;h=c27d56253ed1a955cbd2db704697b62ef3a29d27;hp=e10f6015f90d00e414e7f6eba7e54ada800a4676;hb=43c2934a4d3f9a3e9d7fc2a4e9a32a2bef7174ba;hpb=faa537e2f7bf53a087379adcd3527262491aa575 diff --git a/dummy/netifd-proto.sh b/dummy/netifd-proto.sh index e10f601..c27d562 100755 --- a/dummy/netifd-proto.sh +++ b/dummy/netifd-proto.sh @@ -108,11 +108,11 @@ _proto_push_route() { local mask="${str%%/*}" local gw="${str#*/}" - json_add_table "" + json_add_object "" json_add_string target "$target" - json_add_string mask "$mask" + json_add_string netmask "$mask" json_add_string gateway "$gw" - json_close_table + json_close_object } _proto_push_array() { @@ -138,8 +138,8 @@ proto_send_update() { _proto_push_array "ipaddr" "$PROTO_IPADDR" _proto_push_ip _proto_push_array "ip6addr" "$PROTO_IP6ADDR" _proto_push_ip - _proto_push_array "route" "$PROTO_ROUTE" _proto_push_route - _proto_push_array "route6" "$PROTO_ROUTE6" _proto_push_route + _proto_push_array "routes" "$PROTO_ROUTE" _proto_push_route + _proto_push_array "routes6" "$PROTO_ROUTE6" _proto_push_route _proto_push_array "dns" "$PROTO_DNS" _proto_push_ip _proto_push_array "dns_search" "$PROTO_DNS_SEARCH" _proto_push_ip _proto_notify "$interface" @@ -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