📄 dhcp-eval.5
字号:
considered. \fIOffset\fR and \fIlength\fR are applied to thecontents packet as in the \fBsubstring\fR operator..RE.PP.I string.PP.RS 0.25iA string, enclosed in quotes, may be specified as a data expression,and returns the text between the quotes, encoded in ASCII. Thebackslash ('\\') 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. Anyhexadecimal value can be specified with '\xnn', where nn is anypositive hexadecimal number less than 0xff..RE.PP.I colon-separated hexadecimal list.PP.RS 0.25iA list of hexadecimal octet values, separated by colons, may bespecified as a data expression..RE.PP.B concat (\fIdata-expr1\fB, ..., \fIdata-exprN\fB)\fR.RS 0.25iThe expressions are evaluated, and the results of each evaluation areconcatenated in the sequence that the subexpressions are listed. Ifany subexpression evaluates to null, the result of the concatenationis null..RE.PP.B reverse (\fInumeric-expr1\fB, \fIdata-expr2\fB)\fR.RS 0.25iThe two expressions are evaluated, and then the result of evaluatingthe data expression is reversed in place, using hunks of the sizespecified in the numeric expression. For example, if the numericexpression evaluates to four, and the data expression evaluates to twelve bytes of data, then the reverse expression will evaluate totwelve bytes of data, consisting of the last four bytes of the theinput data, followed by the middle four bytes, followed by the firstfour bytes..RE.PP.B leased-address.RS 0.25iIn any context where the client whose request is being processed hasbeen assigned an IP address, this data expression returns that IPaddress..RE.PP.B binary-to-ascii (\fInumeric-expr1\fB, \fInumeric-expr2\fB,.B \fIdata-expr1\fB,\fR \fIdata-expr2\fB)\fR.RS 0.25iConverts the result of evaluating data-expr2 into a text stringcontaining one number for each element of the result of evaluatingdata-expr2. Each number is separated from the other by the result ofevaluating data-expr1. The result of evaluating numeric-expr1specifies the base (2 through 16) into which the numbers should beconverted. The result of evaluating numeric-expr2 specifies thewidth in bits of each number, which may be either 8, 16 or 32..PPAs an example of the preceding three types of expressions, to producethe name of a PTR record for the IP address being assigned to aclient, one could write the following expression:.RE.PP.nf concat (binary-to-ascii (10, 8, ".", reverse (1, leased-address)), ".in-addr.arpa.");.fi.PP.B encode-int (\fInumeric-expr\fB, \fIwidth\fB)\fR.RS 0.25iNumeric-expr is evaluated and encoded as a data string of thespecified width, in network byte order (most significant byte first).If the numeric expression evaluates to the null value, the result isalso null..PP.B pick-first-value (\fIdata-expr1\fR [ ... \fIexpr\fRn ] \fB)\fR.RS 0.25iThe pick-first-value function takes any number of data expressions asits arguments. Each expression is evaluated, starting with the firstin the list, until an expression is found that does not evaluate to anull value. That expression is returned, and none of the subsequentexpressions are evaluated. If all expressions evaluate to a nullvalue, the null value is returned..RE.PP.B host-decl-name.RS 0.25iThe host-decl-name function returns the name of the host declarationthat matched the client whose request is currently being processed, ifany. If no host declaration matched, the result is the null value..RE.SH NUMERIC EXPRESSIONSNumeric expressions are expressions that evaluate to an integer. Ingeneral, the maximum size of such an integer should not be assumed tobe representable in fewer than 32 bits, but the precision of suchintegers may be more than 32 bits..PP.B extract-int (\fIdata-expr\fB, \fIwidth\fB)\fR.PP.RS 0.25iThe \fBextract-int\fR operator extracts an integer value in networkbyte order from the result of evaluating the specified dataexpression. Width is the width in bits of the integer to extract.Currently, the only supported widths are 8, 16 and 32. If theevaluation of the data expression doesn't provide sufficient bits toextract an integer of the specified size, the null value is returned..RE.PP.B lease-time.PP.RS 0.25iThe duration of the current lease - that is, the difference betweenthe current time and the time that the lease expires..RE.PP.I number.PP.RS 0.25iAny number between zero and the maximum representable size may bespecified as a numeric expression..RE.PP.B client-state.PP.RS 0.25iThe current state of the client instance being processed. This isonly useful in DHCP client configuration files. Possible values are:.TP 2.I \(buBooting - DHCP client is in the INIT state, and does not yet have anIP address. The next message transmitted will be a DHCPDISCOVER,which will be broadcast..TP.I \(buReboot - DHCP client is in the INIT-REBOOT state. It has an IPaddress, but is not yet using it. The next message to be transmittedwill be a DHCPREQUEST, which will be broadcast. If no response isheard, the client will bind to its address and move to the BOUND state..TP.I \(buSelect - DHCP client is in the SELECTING state - it has received atleast one DHCPOFFER message, but is waiting to see if it may receiveother DHCPOFFER messages from other servers. No messages are sent inthe SELECTING state..TP.I \(buRequest - DHCP client is in the REQUESTING state - it has received atleast one DHCPOFFER message, and has chosen which one it willrequest. The next message to be sent will be a DHCPREQUEST message,which will be broadcast..TP.I \(buBound - DHCP client is in the BOUND state - it has an IP address. Nomessages are transmitted in this state..TP.I \(buRenew - 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 tobe sent will be a DHCPREQUEST message, which will be unicast directlyto the server..TP.I \(buRebind - 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 tobe sent will be a DHCPREQUEST, which will be broadcast..RE.SH REFERENCE: LOGGINGLogging statements may be used to send information to the standard loggingchannels. A logging statement includes an optional priority (\fBfatal\fR,\fBerror\fR, \fBinfo\fR, or \fBdebug\fR), and a data expression..PP.B log (\fIpriority\fB, \fIdata-expr\fB)\fR.PPLogging statements take only a single data expression argument, so if youwant to output multiple data values, you will need to use the \fBconcat\fRoperator to concatenate them..RE.SH REFERENCE: DYNAMIC DNS UPDATES.PPThe DHCP client and server have the ability to dynamically update theDomain Name System. Within the configuration files, you can definehow you want the Domain Name System to be updated. These updates areRFC 2136 compliant so any DNS server supporting RFC 2136 should beable to accept updates from the DHCP server..SH SECURITYSupport for TSIG and DNSSEC is not yet available. When you set yourDNS server up to allow updates from the DHCP server or client, you maybe exposing it to unauthorized updates. To avoid this, the best youcan do right now is to use IP address-based packet filtering toprevent unauthorized hosts from submitting update requests.Obviously, there is currently no way to provide security for clientupdates - this will require TSIG or DNSSEC, neither of which is yetavailable in the DHCP distribution..PPDynamic DNS (DDNS) updates are performed by using the \fBdns-update\fRexpression. The \fBdns-update\fR expression is a boolean expressionthat takes four parameters. If the update succeeds, the result istrue. If it fails, the result is false. The four parameters that theare the resource record type (RR), the left hand side of the RR, theright hand side of the RR and the ttl that should be applied to therecord. The simplest example of the use of the function can be foundin the reference section of the dhcpd.conf file, where events aredescribed. In this example several statements are being used to makethe arguments to the \fBdns-update\f\R..PPIn the example, the first argument to the first \f\Bdns-update\fRexpression is a data expression that evaluates to the A RR type. Thesecond argument is constructed by concatenating the DHCP host-nameoption with a text string containing the local domain, in this case"ssd.example.net". The third argument is constructed by convertingthe address the client has been assigned from a 32-bit number into anascii string with each byte separated by a ".". The fourth argument,the TTL, specifies the amount of time remaining in the lease (notethat this isn't really correct, since the DNS server will pass thisTTL out whenever a request comes in, even if that is only a fewseconds before the lease expires)..PPIf the first \fBdns-update\fR statement succeeds, it is followed upwith a second update to install a PTR RR. The installation of a PTRrecord is similar to installing an A RR except that the left hand sideof the record is the leased address, reversed, with ".in-addr.arpa"concatenated. The right hand side is the fully qualified domain nameof the client to which the address is being leased..SH SEE ALSOdhcpd.conf(5), dhcpd.leases(5), dhclient.conf(5), dhcp-eval(5), dhcpd(8),dhclient(8), RFC2132, RFC2131..SH AUTHORThe Internet Systems Consortium DHCP Distribution was written by TedLemon under a contract with Vixie Labs. Funding forthis project was provided through Internet Systems Consortium.Information about Internet Systems Consortium can be found at.B http://www.isc.org.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -