diff options
author | Damien Neil <source@isc.org> | 2000-08-28 19:36:39 +0000 |
---|---|---|
committer | Damien Neil <source@isc.org> | 2000-08-28 19:36:39 +0000 |
commit | 1b234d446fbc53a26b589337d895c6023af74b09 (patch) | |
tree | db5836981a5a9d6bc935471ef2e1419a063d620e /common/dhcp-eval.5 | |
parent | 06f0ed0687487260d7e18601a8263f817cdec9b9 (diff) | |
download | isc-dhcp-1b234d446fbc53a26b589337d895c6023af74b09.tar.gz |
Finished up function call support.
Diffstat (limited to 'common/dhcp-eval.5')
-rw-r--r-- | common/dhcp-eval.5 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/common/dhcp-eval.5 b/common/dhcp-eval.5 index 7d33bd67..59cfc75b 100644 --- a/common/dhcp-eval.5 +++ b/common/dhcp-eval.5 @@ -350,6 +350,33 @@ the current time and the time that the lease expires. Any number between zero and the maximum representable size may be specified as a numeric expression. .RE +.SH +FUNCTIONS +Functions may be defined with the \fBdefine\fR statement. A function +definition may occur anywhere that regular statement may appear. +Functions occupy the same namespace as variables, and obey the same +scoping rules. +.PP +.nf +define set-hostname(prefix) { + option host-name + concat (prefix, binary-to-ascii (16, 32, "", leased-address)); +} +.fi +.PP +A function may return a value when used in an expression with the +\fBreturn\fR statement. A function with no return statement has a +value of null. +.PP +.nf +define make-hostname(prefix) { + return concat (prefix, binary-to-ascii (16, 32, "", leased-address)); +} + +option host-name make-hostname("dyn-"); +.fi +.PP +.RE .SH REFERENCE: LOGGING Logging statements may be used to send information to the standard logging channels. A logging statement includes an optional priority (\fBfatal\fR, |