blob: 7098e827a4db294f4a106f2f990676271d9831f5 (
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
# This script runs last, after all network configuration
# has completed. It sets a property to let the framework
# know that setting up the interface is complete.
if [[ $interface == p2p* ]]
then
intf=p2p
else
intf=$interface
fi
# For debugging:
setprop dhcp.${intf}.reason "${reason}"
#HTC_WIFI_START
auto_ip()
{
case "${reason}" in
BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|IPV4LL)
setprop dhcp.${intf}.ipaddress "${new_ip_address}"
setprop dhcp.${intf}.gateway "${new_routers%% *}"
setprop dhcp.${intf}.mask "${new_subnet_mask}"
setprop dhcp.${intf}.leasetime "${new_dhcp_lease_time}"
setprop dhcp.${intf}.server "${new_dhcp_server_identifier}"
setprop dhcp.${intf}.vendorInfo "${new_vendor_encapsulated_options}"
setprop dhcp.${intf}.result "ok"
;;
EXPIRE|FAIL|STOP)
setprop dhcp.${intf}.result "failed"
;;
RELEASE)
setprop dhcp.${intf}.result "released"
;;
esac
}
no_auto_ip()
{
case "${reason}" in
BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT)
setprop dhcp.${intf}.ipaddress "${new_ip_address}"
setprop dhcp.${intf}.gateway "${new_routers%% *}"
setprop dhcp.${intf}.mask "${new_subnet_mask}"
setprop dhcp.${intf}.leasetime "${new_dhcp_lease_time}"
setprop dhcp.${intf}.server "${new_dhcp_server_identifier}"
setprop dhcp.${intf}.vendorInfo "${new_vendor_encapsulated_options}"
setprop dhcp.${intf}.result "ok"
;;
EXPIRE|FAIL|IPV4LL|STOP)
setprop dhcp.${intf}.result "failed"
;;
RELEASE)
setprop dhcp.${intf}.result "released"
;;
esac
}
default()
{
# For debugging:
# setprop dhcp.${intf}.reason "default_${reason}"
no_auto_ip
}
setprop dhcp.${intf}.ooxx "${autoip}"
case "${autoip}" in
ENABLE)
auto_ip;;
DISABLE)
no_auto_ip;;
*)
default;;
esac
#HTC_WIFI_END
|