From: Ted Lemon Date: Sun, 9 Jul 2000 06:49:39 +0000 (+0000) Subject: Document setting value of parameters through expressions. X-Git-Tag: V3-BETA-2-PATCH-1~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e501cb0799e4e4e757ac12b70ad1355590c2a3ab;p=thirdparty%2Fdhcp.git Document setting value of parameters through expressions. --- diff --git a/common/dhcp-options.5 b/common/dhcp-options.5 index d1776fb1e..e15620594 100644 --- a/common/dhcp-options.5 +++ b/common/dhcp-options.5 @@ -87,7 +87,25 @@ hexadecimal, seperated by colons. For example: or option dhcp-client-identifier 43:4c:49:45:54:2d:46:4f:4f; .fi +.SH SETTING OPTION VALUES USING EXPRESSIONS +Sometimes it's helpful to be able to set the value of a DHCP option +based on some value that the client has sent. To do this, you can +use expression evaluation. The +.B dhcp-eval(5) +manual page describes how to write expressions. To assign the result +of an evaluation to an option, define the option as follows: +.nf +.sp 1 + \fBoption \fImy-option \fB= \fIexpression \fB;\fR +.fi .PP +For example: +.nf +.sp 1 + option hostname = binary-to-ascii (16, 8, "-", + substring (hardware, 1, 6)); +.fi +.SH STANDARD DHCP OPTIONS The documentation for the various options mentioned below is taken from the latest IETF draft document on DHCP options. Options which are not listed by name may be defined by the name option-\fInnn\fR, diff --git a/server/dhcpd.conf.5 b/server/dhcpd.conf.5 index e4e5be811..bb4a44199 100644 --- a/server/dhcpd.conf.5 +++ b/server/dhcpd.conf.5 @@ -1404,6 +1404,24 @@ The \fIddns-updates\fR parameter controls whether or not the server will attempt to do a ddns update when a lease is confirmed. Set this to \fIoff\fR if the server should not attempt to do updates within a certain scope. The \fIddns-updates\fR parameter is on by default. +.SH SETTING PARAMETER VALUES USING EXPRESSIONS +Sometimes it's helpful to be able to set the value of a DHCP server +parameter based on some value that the client has sent. To do this, +you can use expression evaluation. The +.B dhcp-eval(5) +manual page describes how to write expressions. To assign the result +of an evaluation to an option, define the option as follows: +.nf +.sp 1 + \fImy-parameter \fB= \fIexpression \fB;\fR +.fi +.PP +For example: +.nf +.sp 1 + ddns-hostname = binary-to-ascii (16, 8, "-", + substring (hardware, 1, 6)); +.fi .SH REFERENCE: OPTION STATEMENTS .PP DHCP option statements are documented in the