add a default route in the dummy ppp.sh implementation to debug default route handlin...
[project/netifd.git] / dummy / proto / ppp.sh
index fc918a5..9f0c050 100755 (executable)
@@ -9,27 +9,27 @@ ppp_generic_init_config() {
        proto_config_add_int "keepalive"
 }
 
-ppp_init_config() {
+proto_ppp_init_config() {
        no_device=1
        available=1
        ppp_generic_init_config
 }
 
-ppp_setup() {
+proto_ppp_setup() {
        echo "ppp_setup($1): $2"
 }
 
-ppp_teardown() {
+proto_ppp_teardown() {
        return
 }
 
 add_protocol ppp
 
-pppoe_init_config() {
+proto_pppoe_init_config() {
        ppp_generic_init_config
 }
 
-pppoe_setup() {
+proto_pppoe_setup() {
        local interface="$1"
        local device="$2"
 
@@ -39,11 +39,15 @@ pppoe_setup() {
        proto_init_update ppp0 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
+       proto_add_data
+       json_add_string "ppp-type" "pppoe"
+       proto_close_data
        proto_send_update "$interface"
        proto_run_command "$interface" sleep 30
 }
 
-pppoe_teardown() {
+proto_pppoe_teardown() {
        [ "$ERROR" = 9 ] && {
                proto_notify_error "$interface" PROCESS_KILLED
                proto_block_restart "$interface"