7 proto_dhcp_init_config
() {
8 proto_config_add_string
"ipaddr"
9 proto_config_add_string
"netmask"
10 proto_config_add_string
"hostname"
11 proto_config_add_string
"clientid"
12 proto_config_add_string
"vendorid"
13 proto_config_add_boolean
"broadcast"
14 proto_config_add_string
"reqopts"
21 json_get_vars ipaddr hostname clientid vendorid broadcast reqopts
24 for opt
in $reqopts; do
25 append dhcpopts
"-O opt"
28 [ "$broadcast" = 1 ] && broadcast
="-O broadcast" || broadcast
=
30 proto_export
"INTERFACE=$config"
31 proto_run_command
"$config" udhcpc \
32 -p /var
/run
/udhcpc-
$iface.pid \
33 -s /lib
/netifd
/dhcp.
script \
35 ${ipaddr:+-r $ipaddr} \
36 ${hostname:+-H $hostname} \
37 ${clientid:+-c $clientid} \
38 ${vendorid:+-V $vendorid} \
42 proto_dhcp_teardown
() {
44 proto_kill_command
"$interface"