static_host_add() {
local cfg="$1"
local broadcast hostid macn macs mac name ip ips revip leasetime
+ local force_send extra_options option
config_get macs "$cfg" "mac"
[ -n "$macs" ] || return 0
hex_to_hostid hostid "$hostid" || return 1
fi
+ config_get force_send "$cfg" "force_send"
+ extra_options=
+ local _IFS="$IFS" IFS=','
+ for option in $force_send; do
+ case "$option" in
+ hostname)
+ extra_options="$extra_options${extra_options:+ }0c" ;;
+ domain-name)
+ extra_options="$extra_options${extra_options:+ }0f" ;;
+ fqdn)
+ extra_options="$extra_options${extra_options:+ }51" ;;
+ *)
+ echo "unknown option: $option" >&2 ;;
+ esac
+ done
+ IFS="$_IFS"
+
macn=0
for mac in $macs; do
macn=$(( macn + 1 ))
fi
config_list_foreach "$cfg" "routes" append_routes
config_list_foreach "$cfg" "dhcp_option" append_dhcp_options
+ if [ -n "$extra_options" ]; then
+ echo -e " if exists dhcp-parameter-request-list {\n option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list, $extra_options);\n }"
+ fi
echo "}"
done