Hello,  

playing with option-252 I found it already has a name. Found that as
well: http://marc.info/?l=openbsd-misc&m=126573542214773

Wrote a little script to find undocumented options, see end of message.

I moved some existing blocks when I found them to be in the wrong place.
Added a new section: "DHCP Extensions".
Kept ordering as used in the RFCs. 
BTW, format "X" is undocumented in src/usr.sbin/dhcpd/tables.c

took some time and research, please review:

Index: dhcp-options.5
===================================================================
RCS file: /cvs/src/usr.sbin/dhcpd/dhcp-options.5,v
retrieving revision 1.12
diff -u -r1.12 dhcp-options.5
--- dhcp-options.5      26 Sep 2012 16:19:45 -0000      1.12
+++ dhcp-options.5      16 Dec 2012 18:12:25 -0000
@@ -261,6 +261,12 @@
 the
 .Tn NVT ASCII
 character set.
+.It Ic option extensions-path Ar string ;
+A string to specify a file, retrievable via TFTP, which contains information
+which can be interpreted in the same way as the 64-octet vendor-extension 
+field within the BOOTP response, with exceptions; see RFC 2132, Section 3.20
+for details.
+
 .El
 .Ss IP Layer Parameters per Host
 .Bl -tag -width Ds
@@ -415,6 +421,12 @@
 This option specifies a list of IP addresses indicating NTP (RFC 5905)
 servers available to the client.
 Servers should be listed in order of preference.
+.It Ic option vendor-encapsulated-options Ar data-string ;
+This option is used by clients and servers to exchange vendor-specific 
+information. 
+The information is an opaque object of n octets, presumably interpreted by 
+vendor-specific code on the clients and servers. 
+See RFC 2132, Section 8.4 for details.
 .It Xo
 .Ic option netbios-name-servers Ar ip-address
 .Oo , Ar ip-address ... Oc ;
@@ -465,11 +477,6 @@
 This option specifies a list of systems that are running the X Window
 System Display Manager and are available to the client.
 Addresses should be listed in order of preference.
-.It Ic option dhcp-client-identifier Ar data-string ;
-This option can be used to specify a DHCP client identifier in a
-host declaration, so that
-.Xr dhcpd 8
-can find the host record by matching against the client identifier.
 .It Ic option nisplus-domain Ar string ;
 This option specifies the name of the client's NIS+ domain.
 The domain is formatted as a character string consisting of characters
@@ -483,20 +490,6 @@
 This option specifies a list of IP addresses indicating NIS+ servers
 available to the client.
 Servers should be listed in order of preference.
-.It Ic option tftp-server-name Ar string ;
-This option is used to identify a TFTP server and, if supported by the
-client, should have the same effect as the
-.Ic server-name
-declaration.
-BOOTP clients are unlikely to support this option.
-Some DHCP clients will support it, and others actually require it.
-.It Ic option bootfile-name Ar string ;
-This option is used to identify a bootstrap file.
-If supported by the client, it should have the same effect as the
-.Ic filename
-declaration.
-BOOTP clients are unlikely to support this option.
-Some DHCP clients will support it, and others actually require it.
 .It Xo
 .Ic option mobile-ip-home-agent Ar ip-address
 .Oo , Ar ip-address ... Oc ;
@@ -580,6 +573,155 @@
 may download their configuration information and software images
 from.
 Servers should be listed in order of preference.
+
+.It Xo
+.Ic option nds-servers Ar ip-address
+.Oo , Ar ip-address ... Oc ;
+.Xc
+This option specifies one or more NDS servers for the client to contact 
+for access to the NDS database. 
+Servers SHOULD be listed in order of preference.
+See RFC 2241 for details.
+.It Ic option nds-tree-name Ar string ;
+This option specifies the name of the NDS tree the client will be contacting. 
+NDS tree names are 16-bit Unicode strings. 
+For transmission in the NDS Tree Name Option, an NDS tree name is 
+transformed into octets using UTF-8. 
+The string should NOT be zero terminated.
+See RFC 2241 for details.
+.It Ic option nds-context Ar string ;
+This option specifies the initial NDS context the client should use.
+NDS contexts are 16-bit Unicode strings. 
+For transmission in the NDS Context Option, an NDS context is 
+transformed into octets using UTF-8.
+The string should NOT be zero terminated.
+A single DHCP option can only contain 255 octets. 
+Since an NDS context name can be longer than that, this option can 
+appear more than once in the DHCP packet. 
+The contents of all NDS Context options in the packet should be 
+concatenated as suggested in the DHCP specification to get the 
+complete NDS context. 
+A single encoded character could be split between two NDS Context Options.
+See RFC 2241 for details.
+.It Ic option autoproxy-script Ar string ;
+Option 144, site-specific as of RFC 3942. 
+Widely used for Web Proxy Autodiscovery Protocol (WPAD).
+.El
+.Ss DHCP Extensions (RFC 2132, Section 9)
+.Bl -tag -width Ds
+.It Ic option dhcp-requested-address Ar ip-address ;
+This option is used in a client request (DHCPDISCOVER) to allow the client 
+to request that a particular IP address be assigned.
+.It Ic option dhcp-lease-time Ar uint32 ;
+This option is used in a client request (DHCPDISCOVER or DHCPREQUEST) to 
+allow the client to request a lease time for the IP address. 
+In a server reply (DHCPOFFER), a DHCP server uses this option to specify the 
+lease time it is willing to offer.
+.It Xo
+.Ic option dhcp-option-overload Ar uint8 
+.Oo , Ar uint8 ... Oc ;
+.Xc
+This option is used to indicate that the DHCP 'sname' or 'file' fields are 
+being overloaded by using them to carry DHCP options. 
+A DHCP server inserts this option if the returned parameters will exceed 
+the usual space allotted for options.
+If this option is present, the client interprets the specified additional 
+fields after it concludes interpretation of the standard option fields.
+A value of 1 means the 'file' field is used to hold options.
+A value of 2 means the 'sname' field is used to hold options.
+A value of 3 means both fields are used to hold options.
+.It Ic option tftp-server-name Ar string ;
+This option is used to identify a TFTP server and, if supported by the
+client, should have the same effect as the
+.Ic server-name
+declaration.
+BOOTP clients are unlikely to support this option.
+Some DHCP clients will support it, and others actually require it.
+.It Ic option tftp-config-file Ar string ;
+Option 144. Per RFC 2132 options 128 - 254 are site-specific. 
+RFC 3942 reclassifies options 128 to 223 as publicly defined options and 
+puts them in "Unavailable" state by IANA. 
+See RFC 3679 for "Unused DHCP Option Codes to be Reassigned to Future 
+DHCP Options".
+See RFC 2939 for procedures for definitions of new DHCP options.
+.It Ic option bootfile-name Ar string ;
+This option is used to identify a bootstrap file.
+If supported by the client, it should have the same effect as the
+.Ic filename
+declaration.
+BOOTP clients are unlikely to support this option.
+Some DHCP clients will support it, and others actually require it.
+.It Ic option dhcp-message-type Ar uint8 ;
+This option is used to convey the type of the DHCP message.
+Values: 1=DHCPDISCOVER, 2=DHCPOFFER, 3=DHCPREQUEST, 4=DHCPDECLINE, 5=DHCPACK,
+6=DHCPNAK, 7=DHCPRELEASE, 8=DHCPINFORM.
+.It Ic option dhcp-server-identifier Ar ip-address ;
+This option is used in DHCPOFFER and DHCPREQUEST messages, and may 
+optionally be included in the DHCPACK and DHCPNAK messages. 
+DHCP servers include this option in the DHCPOFFER in order to allow the 
+client to distinguish between lease offers. 
+DHCP clients use the contents of the 'server identifier' field as the 
+destination address for any DHCP messages unicast to the DHCP server.
+DHCP clients also indicate which of several lease offers is being accepted 
+by including this option in a DHCPREQUEST message.
+The identifier is the IP address of the selected server.
+.It Xo
+.Ic option dhcp-parameter-request-list Ar uint8
+.Oo , Ar uint8 ... Oc ;
+.Xc
+This option is used by a DHCP client to request values for specified 
+configuration parameters. 
+The list of requested parameters is specified as n octets, where each 
+octet is a valid DHCP option code as defined in this document.
+The client MAY list the options in order of preference. 
+The DHCP server is not required to return the options in the requested 
+order, but MUST try to insert the requested options in the order requested 
+by the client.
+.It Ic option dhcp-max-message-size Ar uint16 ;
+This option specifies the maximum length DHCP message that it is willing 
+to accept.
+The length is specified as an unsigned 16-bit integer. 
+A client may use the maximum DHCP message size option in DHCPDISCOVER or 
+DHCPREQUEST messages, but should not use the option in DHCPDECLINE messages.
+.It Ic option dhcp-renewal-time Ar uint32 ;
+This option specifies the time interval from address assignment until the 
+client transitions to the RENEWING state.
+The value is in units of seconds.
+.It Ic option dhcp-rebinding-time Ar uint32 ;
+This option specifies the time interval from address assignment until the 
+client transitions to the REBINDING state.
+The value is in units of seconds.
+.It Ic option dhcp-class-identifier Ar string ;
+This option is used by DHCP clients to optionally identify the vendor type 
+and configuration of a DHCP client. 
+The information is a string of n octets, interpreted by servers. 
+Vendors may choose to define specific vendor class identifiers to convey 
+particular configuration or other identification information about a client.
+For example, the identifier may encode the client's hardware configuration. 
+Servers not equipped to interpret the class-specific information sent by a
+client MUST ignore it (although it may be reported). 
+Servers that respond SHOULD only use option 43 (
+.Ic vendor-encapsulated-options
+) to return the vendor-specific information to the client.
+.It Ic option user-class Ar string ;
+This option is used by a DHCP client to optionally identify the type or 
+category of user or applications it represents. 
+A DHCP server uses the User Class option to choose the address pool it 
+allocates an address from and/or to select any other configuration option.
+This option MAY carry multiple User Classes. 
+Servers may interpret the meanings of multiple class specifications in an 
+implementation dependent or configuration dependent manner, and so the use 
+of multiple classes by a DHCP client should be based on the specific server 
+implementation and configuration which will be used to process that User 
+class option. See RFC 3004 for details.
+.It Ic option relay-agent-information Ar string ;
+This is a "container" option for specific agent-supplied sub-options. 
+See RFC 3046 for details.
+.It Ic option dhcp-client-identifier Ar data-string ;
+This option can be used to specify a DHCP client identifier in a
+host declaration, so that
+.Xr dhcpd 8
+can find the host record by matching against the client identifier.
 .El
 .Sh SEE ALSO
 .Xr dhclient.conf 5 ,

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#!/bin/sh -e
# warning: exwrong does not handle complex formats
local _opts=$(grep "&dhcp_universe, " /usr/src/usr.sbin/dhcpd/tables.c | cut -d 
"\"" -f 2,4)
local _ifss="${IFS}"
local _opt=""
local _grepres=""
local _typ=""
local _typstr=""
local _typstrs=""
local _types="
e - end of data
I - IP address
l - 32-bit signed integer
L - 32-bit unsigned integer
s - 16-bit signed integer
S - 16-bit unsigned integer
b - 8-bit signed integer
B - 8-bit unsigned integer
t - ASCII text
f - flag (true or false)
A - array of whatever precedes (e.g., IA means array of IP addresses)"
_typstrs="
e end
I ip-address
l int32
L uint32
s int16
S uint16
b int8
B uint8
t string
f flag
A array
IA ip-addresses
IIA ip-addresses_twice
SA uint16s
BA uint8s
X string_"
IFS="
"
set -- $(print "${_opts}")
IFS="${ifss}"
while [ $# -ge 1 ] ; do
        _l="${1}"
        shift
        if [[ "X${_l}" == X"option-"* ]]; then 
                continue
        fi
        _opt=${_l%%\"*}
        _typ=${_l##*\"}
        if [[ "X${_typ}" == X"" ]]; then 
                continue
        fi
        _typstr=$(print "${_typstrs}" | grep "^${_typ} ")
        _typstr=${_typstr##* }
        if ! _grepres=$(grep "${_opt}" /usr/src/usr.sbin/dhcpd/dhcp-options.5); 
 then
                print "missing: ${_opt} -> ${_typstr}"
        else
                if ! $(print "${_grepres}" | grep "${_opt} .* ${_typstr}" > 
/dev/null);  then
                        print "exwrong: ${_opt} -> ${_typstr}"
                else
                        print "exright: ${_opt} -> ${_typstr}"
                fi
        fi
done

Reply via email to