2 NETIFD_MAIN_DIR
=..
/..
/scripts
3 .
$NETIFD_MAIN_DIR/netifd-proto.sh
7 ppp_generic_init_config
() {
8 proto_config_add_string
"username"
9 proto_config_add_string
"password"
10 proto_config_add_int
"keepalive"
13 proto_ppp_init_config
() {
16 ppp_generic_init_config
20 echo "ppp_setup($1): $2"
23 proto_ppp_teardown
() {
29 proto_pppoe_init_config
() {
30 ppp_generic_init_config
37 json_get_var username username
38 json_get_var password password
39 echo "pppoe_setup($interface, $device), username=$username, password=$password"
40 proto_init_update pppoe-
$interface 1
42 proto_add_ipv4_address
"192.168.2.1" 32
43 proto_add_dns_server
"192.168.2.2"
44 proto_add_ipv4_route
"0.0.0.0" 0 192.168.2.2
46 json_add_string
"ppp-type" "pppoe"
48 proto_send_update
"$interface"
50 proto_init_update pppoe-
$interface 1
52 proto_add_ipv6_address
"fe80::2" 64
53 proto_add_ipv6_route
"::0" 0 "fe80::1"
55 json_add_string
"ppp-type" "pppoe"
57 proto_send_update
"$interface"
59 proto_run_command
"$interface" sleep 30
62 proto_pppoe_teardown
() {
64 proto_notify_error
"$interface" PROCESS_KILLED
65 proto_block_restart
"$interface"
67 proto_kill_command
"$interface"