diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-04-29 14:03:11 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-04-29 14:03:11 +0200 |
commit | cd4b616312da6714fcd7768c4271a1b69261180f (patch) | |
tree | f5bc5a48bce9344f33498e5b265b75efcb4bfe10 /dummy | |
parent | 0f738b8f6c5d89ad5130c74a8dcb9a1df9a190bc (diff) |
proto-shell: add support for appending configuration data over multiple update_link notifications
Diffstat (limited to 'dummy')
-rwxr-xr-x | dummy/netifd-proto.sh | 6 | ||||
-rwxr-xr-x | dummy/proto/ppp.sh | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/dummy/netifd-proto.sh b/dummy/netifd-proto.sh index f1ddd1a..31af697 100755 --- a/dummy/netifd-proto.sh +++ b/dummy/netifd-proto.sh @@ -43,6 +43,7 @@ proto_init_update() { local up="$2" local external="$3" + PROTO_KEEP=0 PROTO_INIT=1 PROTO_TUNNEL_OPEN= PROTO_IPADDR= @@ -58,6 +59,10 @@ proto_init_update() { [ -n "$3" ] && json_add_boolean "address-external" "$external" } +proto_set_keep() { + PROTO_KEEP="$1" +} + proto_close_nested() { [ -n "$PROTO_NESTED_OPEN" ] && json_close_object PROTO_NESTED_OPEN= @@ -166,6 +171,7 @@ proto_send_update() { local interface="$1" proto_close_nested + json_add_boolean keep "$PROTO_KEEP" _proto_push_array "ipaddr" "$PROTO_IPADDR" _proto_push_ip _proto_push_array "ip6addr" "$PROTO_IP6ADDR" _proto_push_ip _proto_push_array "routes" "$PROTO_ROUTE" _proto_push_route diff --git a/dummy/proto/ppp.sh b/dummy/proto/ppp.sh index 9f0c050..5bc3ea6 100755 --- a/dummy/proto/ppp.sh +++ b/dummy/proto/ppp.sh @@ -37,6 +37,7 @@ proto_pppoe_setup() { json_get_var password password echo "pppoe_setup($interface, $device), username=$username, password=$password" proto_init_update ppp0 1 + proto_set_keep 1 proto_add_ipv4_address "192.168.2.1" 32 proto_add_dns_server "192.168.2.2" proto_add_ipv4_route "0.0.0.0" 0 192.168.2.2 @@ -44,6 +45,16 @@ proto_pppoe_setup() { json_add_string "ppp-type" "pppoe" proto_close_data proto_send_update "$interface" + + proto_init_update ppp0 1 + proto_set_keep 1 + proto_add_ipv6_address "fe80::2" 64 + proto_add_ipv6_route "::0" 0 "fe80::1" + proto_add_data + json_add_string "ppp-type" "pppoe" + proto_close_data + proto_send_update "$interface" + proto_run_command "$interface" sleep 30 } |