@ -14,6 +14,7 @@ proto_dhcp_init_config() {
proto_config_add_boolean 'broadcast:bool'
proto_config_add_boolean 'broadcast:bool'
proto_config_add_boolean 'release:bool'
proto_config_add_boolean 'release:bool'
proto_config_add_string 'reqopts:list(string)'
proto_config_add_string 'reqopts:list(string)'
proto_config_add_boolean 'defaultreqopts:bool'
proto_config_add_string iface6rd
proto_config_add_string iface6rd
proto_config_add_string sendopts
proto_config_add_string sendopts
proto_config_add_boolean delegate
proto_config_add_boolean delegate
@ -28,8 +29,8 @@ proto_dhcp_setup() {
local config = " $1 "
local config = " $1 "
local iface = " $2 "
local iface = " $2 "
local ipaddr hostname clientid vendorid broadcast release reqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute
local ipaddr hostname clientid vendorid broadcast release reqopts defaultreqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute
json_get_vars ipaddr hostname clientid vendorid broadcast release reqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute
json_get_vars ipaddr hostname clientid vendorid broadcast release reqopts defaultreqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute
local opt dhcpopts
local opt dhcpopts
for opt in $reqopts ; do
for opt in $reqopts ; do
@ -41,6 +42,7 @@ proto_dhcp_setup() {
done
done
[ -z " $hostname " ] && hostname = " $( cat /proc/sys/kernel/hostname) "
[ -z " $hostname " ] && hostname = " $( cat /proc/sys/kernel/hostname) "
[ " $defaultreqopts " = 0 ] && defaultreqopts = "-o" || defaultreqopts =
[ " $broadcast " = 1 ] && broadcast = "-B" || broadcast =
[ " $broadcast " = 1 ] && broadcast = "-B" || broadcast =
[ " $release " = 1 ] && release = "-R" || release =
[ " $release " = 1 ] && release = "-R" || release =
[ -n " $clientid " ] && clientid = " -x 0x3d: ${ clientid // : / } " || clientid = "-C"
[ -n " $clientid " ] && clientid = " -x 0x3d: ${ clientid // : / } " || clientid = "-C"
@ -62,7 +64,7 @@ proto_dhcp_setup() {
${ ipaddr : +-r $ipaddr } \
${ ipaddr : +-r $ipaddr } \
${ hostname : +-x " hostname: $hostname " } \
${ hostname : +-x " hostname: $hostname " } \
${ vendorid : +-V " $vendorid " } \
${ vendorid : +-V " $vendorid " } \
$clientid $broadcast $release $dhcpopts
$clientid $defaultreqopts $ broadcast $release $dhcpopts
}
}
proto_dhcp_renew( ) {
proto_dhcp_renew( ) {