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_var ipaddr ipaddr
22 json_get_var hostname hostname
23 json_get_var clientid clientid
24 json_get_var vendorid vendorid
25 json_get_var broadcast broadcast
26 json_get_var reqopts reqopts
29 for opt in $reqopts; do
30 append dhcpopts "-O opt"
33 [ "$broadcast" = 1 ] && broadcast="-O broadcast" || broadcast=
35 proto_export "INTERFACE=$config"
36 proto_run_command "$config" udhcpc \
37 -p /var/run/udhcpc-$iface.pid \
38 -s /lib/netifd/dhcp.script \
40 ${ipaddr:+-r $ipaddr} \
41 ${hostname:+-H $hostname} \
42 ${clientid:+-c $clientid} \
43 ${vendorid:+-V $vendorid} \
47 proto_dhcp_teardown() {