785 lines
23 KiB
HTML
785 lines
23 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of dhcp-eval</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>dhcp-eval</H1>
|
|
Section: File Formats (5)<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
dhcp-eval - ISC DHCP conditional evaluation
|
|
<A NAME="lbAC"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The Internet Systems Consortium DHCP client and server both provide
|
|
the ability to perform conditional behavior depending on the contents
|
|
of packets they receive. The syntax for specifying this conditional
|
|
behaviour is documented here.
|
|
<A NAME="lbAD"> </A>
|
|
<H2>REFERENCE: CONDITIONAL BEHAVIOUR</H2>
|
|
|
|
Conditional behaviour may be specified using the if statement and the else
|
|
or elsif statements or the switch and case statements.
|
|
A conditional statement can appear anywhere
|
|
that a regular statement (e.g., an option statement) can appear, and
|
|
can enclose one or more such statements.
|
|
<P>
|
|
|
|
<B>CONDITIONAL BEHAVIOUR: IF</B>
|
|
|
|
<P>
|
|
|
|
A typical conditional if statement in a server might be:
|
|
<P>
|
|
|
|
<PRE>
|
|
if option dhcp-user-class = "accounting" {
|
|
max-lease-time 17600;
|
|
option domain-name "accounting.example.org";
|
|
option domain-name-servers ns1.accounting.example.org,
|
|
ns2.accounting.example.org;
|
|
} elsif option dhcp-user-class = "sales" {
|
|
max-lease-time 17600;
|
|
option domain-name "sales.example.org";
|
|
option domain-name-servers ns1.sales.example.org,
|
|
ns2.sales.example.org;
|
|
} elsif option dhcp-user-class = "engineering" {
|
|
max-lease-time 17600;
|
|
option domain-name "engineering.example.org";
|
|
option domain-name-servers ns1.engineering.example.org,
|
|
ns2.engineering.example.org;
|
|
} else {
|
|
max-lease-time 600;
|
|
option domain-name "misc.example.org";
|
|
option domain-name-servers ns1.misc.example.org,
|
|
ns2.misc.example.org;
|
|
}
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
On the client side, an example of conditional evaluation might be:
|
|
<P>
|
|
|
|
<PRE>
|
|
# example.org filters DNS at its firewall, so we have to use their DNS
|
|
# servers when we connect to their network. If we are not at
|
|
# example.org, prefer our own DNS server.
|
|
if not option domain-name = "example.org" {
|
|
prepend domain-name-servers 127.0.0.1;
|
|
}
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
The
|
|
<B>if</B>
|
|
|
|
statement and the
|
|
<B>elsif</B>
|
|
|
|
continuation statement both take boolean expressions as their
|
|
arguments. That is, they take expressions that, when evaluated,
|
|
produce a boolean result. If the expression evaluates to true, then
|
|
the statements enclosed in braces following the
|
|
<B>if</B>
|
|
|
|
statement are executed, and all subsequent
|
|
<B>elsif</B>
|
|
|
|
and
|
|
<B>else</B>
|
|
|
|
clauses are skipped. Otherwise, each subsequent
|
|
<B>elsif</B>
|
|
|
|
clause's expression is checked, until an elsif clause is encountered
|
|
whose test evaluates to true. If such a clause is found, the
|
|
statements in braces following it are executed, and then any
|
|
subsequent
|
|
<B>elsif</B>
|
|
|
|
and
|
|
<B>else</B>
|
|
|
|
clauses are skipped. If all the
|
|
<B>if</B>
|
|
|
|
and
|
|
<B>elsif</B>
|
|
|
|
clauses are checked but none
|
|
of their expressions evaluate true, then if there is an
|
|
<B>else</B>
|
|
|
|
clause, the statements enclosed in braces following the
|
|
<B>else</B>
|
|
|
|
are evaluated. Boolean expressions that evaluate to null are
|
|
treated as false in conditionals.
|
|
<P>
|
|
|
|
<B>CONDITIONAL BEHAVIOUR: SWITCH</B>
|
|
|
|
<P>
|
|
|
|
The above example can be rewritten using a switch construct as well.
|
|
<P>
|
|
|
|
<PRE>
|
|
switch (option dhcp-user-class) {
|
|
case "accounting":
|
|
max-lease-time 17600;
|
|
option domain-name "accounting.example.org";
|
|
option domain-name-servers ns1.accounting.example.org,
|
|
ns2.accounting.example.org;
|
|
case "sales":
|
|
max-lease-time 17600;
|
|
option domain-name "sales.example.org";
|
|
option domain-name-servers ns1.sales.example.org,
|
|
ns2.sales.example.org;
|
|
break;
|
|
case "engineering":
|
|
max-lease-time 17600;
|
|
option domain-name "engineering.example.org";
|
|
option domain-name-servers ns1.engineering.example.org,
|
|
ns2.engineering.example.org;
|
|
break;
|
|
default:
|
|
max-lease-time 600;
|
|
option domain-name "misc.example.org";
|
|
option domain-name-servers ns1.misc.example.org,
|
|
ns2.misc.example.org;
|
|
break;
|
|
}
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
The
|
|
<B>switch</B>
|
|
|
|
statement and the
|
|
<B>case</B>
|
|
|
|
statements can both be data expressions or numeric expressions. Within
|
|
a switch statement they all must be the same type. The server
|
|
evaluates the expression from the switch statement and then it evaluates
|
|
the expressions from the case statements until it finds a match.
|
|
<P>
|
|
|
|
If it finds a match it starts executing statements from that case
|
|
until the next break statement. If it doesn't find a match it
|
|
starts from the default statement and again proceeds to the next
|
|
break statement. If there is no match and no default it does nothing.
|
|
<P>
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>BOOLEAN EXPRESSIONS</H2>
|
|
|
|
The following is the current list of boolean expressions that are
|
|
supported by the DHCP distribution.
|
|
<P>
|
|
|
|
<I>data-expression-1 </I><B>=</B> <I>data-expression-2</I>
|
|
|
|
<DL COMPACT><DT id="1"><DD>
|
|
<P>
|
|
|
|
The <B>=</B> operator compares the values of two data expressions,
|
|
returning true if they are the same, false if they are not. If
|
|
either the left-hand side or the right-hand side are null, the
|
|
result is also null.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<I>data-expression-1 </I><B>~=</B> <I>data-expression-2</I>
|
|
|
|
<I>data-expression-1 </I><B>~~</B> <I>data-expression-2</I>
|
|
|
|
<DL COMPACT><DT id="2"><DD>
|
|
<P>
|
|
|
|
The <B>~=</B> and <B>~~</B> operators (not available on all systems) perform
|
|
extended <A HREF="/cgi-bin/man/man2html?7+regex">regex</A>(7) matching of the values of two data expressions, returning
|
|
true if <I>data-expression-1</I> matches against the regular expression
|
|
evaluated by <I>data-expression-2</I>, or false if it does not match or
|
|
encounters some error. If either the left-hand side or the right-hand side
|
|
are null or empty strings, the result is also false. The <B>~~</B> operator
|
|
differs from the <B>~=</B> operator in that it is case-insensitive.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<I>boolean-expression-1 </I><B>and</B> <I>boolean-expression-2</I>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="3"><DD>
|
|
The <B>and</B> operator evaluates to true if the boolean expression on
|
|
the left-hand side and the boolean expression on the right-hand side
|
|
both evaluate to true. Otherwise, it evaluates to false. If either
|
|
the expression on the left-hand side or the expression on the
|
|
right-hand side are null, the result is null.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<I>boolean-expression-1 </I><B>or</B> <I>boolean-expression-2</I>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="4"><DD>
|
|
The <B>or</B> operator evaluates to true if either the boolean
|
|
expression on the left-hand side or the boolean expression on the
|
|
right-hand side evaluate to true. Otherwise, it evaluates to false.
|
|
If either the expression on the left-hand side or the expression on
|
|
the right-hand side are null, the result is null.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>not </B><I>boolean-expression</I>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="5"><DD>
|
|
The <B>not</B> operator evaluates to true if <I>boolean-expression</I>
|
|
evaluates to false, and returns false if <I>boolean-expression</I> evaluates
|
|
to true. If <I>boolean-expression</I> evaluates to null, the result
|
|
is also null.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>exists </B><I>option-name</I>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="6"><DD>
|
|
The <B>exists</B> expression returns true if the specified option
|
|
exists in the incoming DHCP packet being processed.
|
|
</DL>
|
|
|
|
<B>known</B>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="7"><DD>
|
|
The <B>known</B> expression returns true if the client whose request is
|
|
currently being processed is known - that is, if there's a host
|
|
declaration for it.
|
|
</DL>
|
|
|
|
<B>static</B>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="8"><DD>
|
|
The <B>static</B> expression returns true if the lease assigned to the
|
|
client whose request is currently being processed is derived from a static
|
|
address assignment.
|
|
</DL>
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H2>DATA EXPRESSIONS</H2>
|
|
|
|
Several of the boolean expressions above depend on the results of
|
|
evaluating data expressions. A list of these expressions is provided
|
|
here.
|
|
<P>
|
|
|
|
<B>substring (</B><I>data-expr</I><B>, </B><I>offset</I><B>, </B><I>length</I><B>)</B>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="9"><DD>
|
|
The <B>substring</B> operator evaluates the data expression and returns
|
|
the substring of the result of that evaluation that starts
|
|
<I>offset</I> bytes from the beginning, continuing for <I>length</I>
|
|
bytes. <I>Offset</I> and <I>length</I> are both numeric expressions.
|
|
If <I>data-expr</I>, <I>offset</I> or <I>length</I> evaluate to null,
|
|
then the result is also null. If <I>offset</I> is greater than or
|
|
equal to the length of the evaluated data, then a zero-length data
|
|
string is returned. If <I>length is greater then the remaining
|
|
length of the evaluated data after offset</I>, then a data string
|
|
containing all data from <I>offset</I> to the end of the evaluated data
|
|
is returned.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>suffix (</B><I>data-expr</I><B>, </B><I>length</I><B>)</B>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="10"><DD>
|
|
The <B>suffix</B> operator evaluates <I>data-expr</I> and returns the
|
|
last <I>length</I> bytes of the result of that evaluation. <I>Length</I>
|
|
is a numeric expression. If <I>data-expr</I> or <I>length</I> evaluate
|
|
to null, then the result is also null. If <I>suffix</I> evaluates to a
|
|
number greater than the length of the evaluated data, then the
|
|
evaluated data is returned.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>lcase (</B><I>data-expr</I><B>)</B>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="11"><DD>
|
|
The <B>lcase</B> function returns the result of evaluating
|
|
<I>data-expr</I> converted to lower case. If <I>data-expr</I> evaluates
|
|
to null, then the result is also null.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>ucase (</B><I>data-expr</I><B>)</B>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="12"><DD>
|
|
The <B>ucase</B> function returns the result of evaluating
|
|
<I>data-expr</I> converted to upper case. If <I>data-expr</I> evaluates
|
|
to null, then the result is also null.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>option </B><I>option-name</I>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="13"><DD>
|
|
The <B>option</B> operator returns the contents of the specified option in
|
|
the packet to which the server is responding.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>config-option </B><I>option-name</I>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="14"><DD>
|
|
The <B>config-option</B> operator returns the value for the specified option
|
|
that the DHCP client or server has been configured to send.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>gethostname()</B>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="15"><DD>
|
|
The <B>gethostname()</B> function returns a data string whose contents are a
|
|
character string, the results of calling gethostname() on the local
|
|
system with a size limit of 255 bytes (not including NULL terminator). This
|
|
can be used for example to configure dhclient to send the local hostname
|
|
without knowing the local hostname at the time dhclient.conf is written.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>hardware</B>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="16"><DD>
|
|
The <B>hardware</B> operator returns a data string whose first element
|
|
is the type of network interface indicated in packet being considered,
|
|
and whose subsequent elements are client's link-layer address. If
|
|
there is no packet, or if the RFC2131 <I>hlen</I> field is invalid,
|
|
then the result is null. Hardware types include ethernet (1),
|
|
token-ring (6), and fddi (8). Hardware types are specified by the
|
|
IETF, and details on how the type numbers are defined can be found in
|
|
RFC2131 (in the ISC DHCP distribution, this is included in the doc/
|
|
subdirectory).
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>packet (</B><I>offset</I><B>, </B><I>length</I><B>)</B>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="17"><DD>
|
|
The <B>packet</B> operator returns the specified portion of the packet
|
|
being considered, or null in contexts where no packet is being
|
|
considered. <I>Offset</I> and <I>length</I> are applied to the
|
|
contents packet as in the <B>substring</B> operator.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<I>string</I>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="18"><DD>
|
|
A string, enclosed in quotes, may be specified as a data expression,
|
|
and returns the text between the quotes, encoded in ASCII. The
|
|
backslash ('\') character is treated specially, as in C programming: '\t'
|
|
means TAB, '\r' means carriage return, '\n' means newline, and '\b' means
|
|
bell. Any octal value can be specified with '\nnn', where nnn is any
|
|
positive octal number less than 0400. Any hexadecimal value can be
|
|
specified with '\xnn', where nn is any positive hexadecimal number less
|
|
than or equal to 0xff.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<I>colon-separated hexadecimal list</I>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="19"><DD>
|
|
A list of hexadecimal octet values, separated by colons, may be
|
|
specified as a data expression.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>concat (</B><I>data-expr1</I><B>, ..., </B><I>data-exprN</I><B>)</B>
|
|
|
|
<DL COMPACT><DT id="20"><DD>
|
|
The expressions are evaluated, and the results of each evaluation are
|
|
concatenated in the sequence that the subexpressions are listed. If
|
|
any subexpression evaluates to null, the result of the concatenation
|
|
is null.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>reverse (</B><I>numeric-expr1</I><B>, </B><I>data-expr2</I><B>)</B>
|
|
|
|
<DL COMPACT><DT id="21"><DD>
|
|
The two expressions are evaluated, and then the result of evaluating
|
|
the data expression is reversed in place, using hunks of the size
|
|
specified in the numeric expression. For example, if the numeric
|
|
expression evaluates to four, and the data expression evaluates to
|
|
twelve bytes of data, then the reverse expression will evaluate to
|
|
twelve bytes of data, consisting of the last four bytes of the
|
|
input data, followed by the middle four bytes, followed by the first
|
|
four bytes.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>leased-address</B>
|
|
|
|
<DL COMPACT><DT id="22"><DD>
|
|
In any context where the client whose request is being processed has
|
|
been assigned an IP address, this data expression returns that IP
|
|
address. In any context where the client whose request is being
|
|
processed has not been assigned an ip address, if this data expression
|
|
is found in executable statements executed on that client's behalf,
|
|
a log message indicating "there is no lease associated with this client"
|
|
is syslogged to the debug level (this is considered dhcpd.conf debugging
|
|
information).
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>binary-to-ascii (</B><I>numeric-expr1</I><B>, </B><I>numeric-expr2</I><B>,</B>
|
|
|
|
<B></B><I>data-expr1</I><B>,</B> <I>data-expr2</I><B>)</B>
|
|
|
|
<DL COMPACT><DT id="23"><DD>
|
|
Converts the result of evaluating data-expr2 into a text string
|
|
containing one number for each element of the result of evaluating
|
|
data-expr2. Each number is separated from the other by the result of
|
|
evaluating data-expr1. The result of evaluating numeric-expr1
|
|
specifies the base (2 through 16) into which the numbers should be
|
|
converted. The result of evaluating numeric-expr2 specifies the
|
|
width in bits of each number, which may be either 8, 16 or 32.
|
|
<P>
|
|
|
|
As an example of the preceding three types of expressions, to produce
|
|
the name of a PTR record for the IP address being assigned to a
|
|
client, one could write the following expression:
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<PRE>
|
|
concat (binary-to-ascii (10, 8, ".",
|
|
reverse (1, leased-address)),
|
|
".in-addr.arpa.");
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
<B>encode-int (</B><I>numeric-expr</I><B>, </B><I>width</I><B>)</B>
|
|
|
|
<DL COMPACT><DT id="24"><DD>
|
|
Numeric-expr is evaluated and encoded as a data string of the
|
|
specified width, in network byte order (most significant byte first).
|
|
If the numeric expression evaluates to the null value, the result is
|
|
also null.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>pick-first-value (</B><I>data-expr1</I> [ ... <I>expr</I>n ] <B>)</B>
|
|
|
|
<DL COMPACT><DT id="25"><DD>
|
|
The pick-first-value function takes any number of data expressions as
|
|
its arguments. Each expression is evaluated, starting with the first
|
|
in the list, until an expression is found that does not evaluate to a
|
|
null value. That expression is returned, and none of the subsequent
|
|
expressions are evaluated. If all expressions evaluate to a null
|
|
value, the null value is returned.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>host-decl-name</B>
|
|
|
|
<DL COMPACT><DT id="26"><DD>
|
|
The host-decl-name function returns the name of the host declaration
|
|
that matched the client whose request is currently being processed, if
|
|
any. If no host declaration matched, the result is the null value.
|
|
</DL>
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>NUMERIC EXPRESSIONS</H2>
|
|
|
|
Numeric expressions are expressions that evaluate to an integer. In
|
|
general, the maximum size of such an integer should not be assumed to
|
|
be representable in fewer than 32 bits, but the precision of such
|
|
integers may be more than 32 bits.
|
|
<P>
|
|
|
|
In addition to the following operators several standard math functions
|
|
are available. They are:
|
|
<PRE>
|
|
operation symbol
|
|
add <B>+</B>
|
|
subtract <B>-</B>
|
|
divide <B>/</B>
|
|
multiply <B>*</B>
|
|
modulus <B>%</B>
|
|
bitwise and <B>&</B>
|
|
bitwise or <B>|</B>
|
|
bitwise xor <B>^</B>
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
<B>extract-int (</B><I>data-expr</I><B>, </B><I>width</I><B>)</B>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="27"><DD>
|
|
The <B>extract-int</B> operator extracts an integer value in network
|
|
byte order from the result of evaluating the specified data
|
|
expression. Width is the width in bits of the integer to extract.
|
|
Currently, the only supported widths are 8, 16 and 32. If the
|
|
evaluation of the data expression doesn't provide sufficient bits to
|
|
extract an integer of the specified size, the null value is returned.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>lease-time</B>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="28"><DD>
|
|
The duration of the current lease - that is, the difference between
|
|
the current time and the time that the lease expires.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<I>number</I>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="29"><DD>
|
|
Any number between zero and the maximum representable size may be
|
|
specified as a numeric expression.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>client-state</B>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="30"><DD>
|
|
The current state of the client instance being processed. This is
|
|
only useful in DHCP client configuration files. Possible values are:
|
|
<DL COMPACT>
|
|
<DT id="31"><I>•</I>
|
|
|
|
<DD>
|
|
Booting - DHCP client is in the INIT state, and does not yet have an
|
|
IP address. The next message transmitted will be a DHCPDISCOVER,
|
|
which will be broadcast.
|
|
<DT id="32"><I>•</I>
|
|
|
|
<DD>
|
|
Reboot - DHCP client is in the INIT-REBOOT state. It has an IP
|
|
address, but is not yet using it. The next message to be transmitted
|
|
will be a DHCPREQUEST, which will be broadcast. If no response is
|
|
heard, the client will bind to its address and move to the BOUND state.
|
|
<DT id="33"><I>•</I>
|
|
|
|
<DD>
|
|
Select - DHCP client is in the SELECTING state - it has received at
|
|
least one DHCPOFFER message, but is waiting to see if it may receive
|
|
other DHCPOFFER messages from other servers. No messages are sent in
|
|
the SELECTING state.
|
|
<DT id="34"><I>•</I>
|
|
|
|
<DD>
|
|
Request - DHCP client is in the REQUESTING state - it has received at
|
|
least one DHCPOFFER message, and has chosen which one it will
|
|
request. The next message to be sent will be a DHCPREQUEST message,
|
|
which will be broadcast.
|
|
<DT id="35"><I>•</I>
|
|
|
|
<DD>
|
|
Bound - DHCP client is in the BOUND state - it has an IP address. No
|
|
messages are transmitted in this state.
|
|
<DT id="36"><I>•</I>
|
|
|
|
<DD>
|
|
Renew - DHCP client is in the RENEWING state - it has an IP address,
|
|
and is trying to contact the server to renew it. The next message to
|
|
be sent will be a DHCPREQUEST message, which will be unicast directly
|
|
to the server.
|
|
<DT id="37"><I>•</I>
|
|
|
|
<DD>
|
|
Rebind - DHCP client is in the REBINDING state - it has an IP address,
|
|
and is trying to contact any server to renew it. The next message to
|
|
be sent will be a DHCPREQUEST, which will be broadcast.
|
|
</DL>
|
|
</DL>
|
|
|
|
<A NAME="lbAH"> </A>
|
|
<H2>REFERENCE: ACTION EXPRESSIONS</H2>
|
|
|
|
<P>
|
|
|
|
<B>log (</B><I>priority</I><B>, </B><I>data-expr</I><B>)</B>
|
|
|
|
<DL COMPACT><DT id="38"><DD>
|
|
<P>
|
|
|
|
Logging statements may be used to send information to the standard logging
|
|
channels. A logging statement includes an optional priority (<B>fatal</B>,
|
|
<B>error</B>, <B>info</B>, or <B>debug</B>), and a data expression.
|
|
<P>
|
|
|
|
Logging statements take only a single data expression argument, so if you
|
|
want to output multiple data values, you will need to use the <B>concat</B>
|
|
operator to concatenate them.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>execute (</B><I>command-path</I><B> [, </B><I>data-expr1</I><B>, ... </B><I>data-exprN</I><B>]);</B>
|
|
|
|
<DL COMPACT><DT id="39"><DD>
|
|
<P>
|
|
|
|
The <B>execute</B> statement runs an external command. The first argument
|
|
is a string literal containing the name or path of the command to run.
|
|
The other arguments, if present, are either string literals or data-
|
|
expressions which evaluate to text strings, to be passed as command-line
|
|
arguments to the command.
|
|
<P>
|
|
|
|
<B>execute</B> is synchronous; the program will block until the external
|
|
command being run has finished. Please note that lengthy program
|
|
execution (for example, in an "on commit" in dhcpd.conf) may result in
|
|
bad performance and timeouts. Only external applications with very short
|
|
execution times are suitable for use.
|
|
<P>
|
|
|
|
Passing user-supplied data to an external application might be dangerous.
|
|
Make sure the external application checks input buffers for validity.
|
|
Non-printable ASCII characters will be converted into dhcpd.conf language
|
|
octal escapes ("\nnn"), make sure your external command handles them as
|
|
such.
|
|
<P>
|
|
|
|
It is possible to use the execute statement in any context, not only
|
|
on events. If you put it in a regular scope in the configuration file
|
|
you will execute that command every time a scope is evaluated.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>parse-vendor-option;</B>
|
|
|
|
<DL COMPACT><DT id="40"><DD>
|
|
<P>
|
|
|
|
The <B>parse-vendor-option</B> statement attempts to parse a vendor
|
|
option (code 43). It is only useful while processing a packet on the server
|
|
and requires that the administrator has already used the
|
|
<B>vendor-option-space</B> statement to select a valid vendor space.
|
|
<P>
|
|
|
|
This functionality may be used if the server needs to take different
|
|
actions depending on the values the client placed in the vendor option
|
|
and the sub-options are not at fixed locations. It is handled as an
|
|
action to allow an administrator to examine the incoming options and
|
|
choose the correct vendor space.
|
|
</DL>
|
|
|
|
<A NAME="lbAI"> </A>
|
|
<H2>REFERENCE: DYNAMIC DNS UPDATES</H2>
|
|
|
|
<P>
|
|
|
|
See the dhcpd.conf and dhclient.conf man pages for more information
|
|
about DDNS.
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<A HREF="/cgi-bin/man/man2html?5+dhcpd.conf">dhcpd.conf</A>(5), <A HREF="/cgi-bin/man/man2html?5+dhcpd.leases">dhcpd.leases</A>(5), <A HREF="/cgi-bin/man/man2html?5+dhclient.conf">dhclient.conf</A>(5), <A HREF="/cgi-bin/man/man2html?5+dhcp-options">dhcp-options</A>(5), <A HREF="/cgi-bin/man/man2html?8+dhcpd">dhcpd</A>(8),
|
|
<A HREF="/cgi-bin/man/man2html?8+dhclient">dhclient</A>(8), RFC2132, RFC2131.
|
|
<A NAME="lbAK"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
Information about Internet Systems Consortium can be found at
|
|
<B><A HREF="https://www.isc.org.">https://www.isc.org.</A></B>
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="41"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="42"><A HREF="#lbAC">DESCRIPTION</A><DD>
|
|
<DT id="43"><A HREF="#lbAD">REFERENCE: CONDITIONAL BEHAVIOUR</A><DD>
|
|
<DT id="44"><A HREF="#lbAE">BOOLEAN EXPRESSIONS</A><DD>
|
|
<DT id="45"><A HREF="#lbAF">DATA EXPRESSIONS</A><DD>
|
|
<DT id="46"><A HREF="#lbAG">NUMERIC EXPRESSIONS</A><DD>
|
|
<DT id="47"><A HREF="#lbAH">REFERENCE: ACTION EXPRESSIONS</A><DD>
|
|
<DT id="48"><A HREF="#lbAI">REFERENCE: DYNAMIC DNS UPDATES</A><DD>
|
|
<DT id="49"><A HREF="#lbAJ">SEE ALSO</A><DD>
|
|
<DT id="50"><A HREF="#lbAK">AUTHOR</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:03 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|