summaryrefslogtreecommitdiffhomepage
path: root/dummy/proto/ppp.sh
blob: f78933cc42dd33f74d5e2d3c0374ef00cb7f8dfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh

. ../netifd-proto.sh
init_proto "$@"

ppp_init_config() {
	proto_config_add_string "username"
	proto_config_add_string "password"
	proto_config_add_int "keepalive"
}

ppp_setup() {
	echo "ppp_setup($1): $2"
}

ppp_teardown() {
	return
}

ppp_init() {
	no_device=1
	available=1
}

add_protocol ppp

pppoe_init_config() {
	ppp_init_config
}

pppoe_init() {
	return
}

pppoe_setup() {
	local interface="$1"
	local device="$2"

	json_get_var username username
	json_get_var password password
	echo "pppoe_setup($interface, $device), username=$username, password=$password"
	proto_init_update ppp0 1
	proto_add_ipv4_address "192.168.2.1" 32
	proto_add_dns_server "192.168.2.2"
	proto_send_update "$interface"
	proto_run_command "$interface" sleep 30
}

pppoe_teardown() {
	proto_kill_command "$interface"
	return
}

add_protocol pppoe