[PATCH] dhcp: add RFC5970 options to dhcp

Chuck Anderson cra at WPI.EDU
Wed Feb 29 17:45:55 UTC 2012


Thanks for doing this.

The comments refer to RFC5070 instead of 5970.

On Wed, Feb 29, 2012 at 12:13:05PM -0500, Neil Horman wrote:
> Hey there-
> 	I recently had a need to use dhcp6 options defined in RFC5970, but found
> they weren't yet implemented.  I wen't ahead and patched them in here.  I've
> tested them all (expect for botofile-params, since the StA format doesn't yet
> exist in dhcp), but the others work quite will.  This will allow dhcpd to pass
> bootfile urls back to ipv6 based netbooting clients (UEFI does this), based on
> the systems architecture.
> 
> Signed-off-by: Neil Horman <nhorman at tuxdriver.com>
> 
> ---
> 
> 
>  common/dhcp-options.5 |   41 +++++++++++++++++++++++++++++++++++++++++
>  common/tables.c       |   11 +++++++++++
>  includes/dhcp6.h      |    5 +++++
>  3 files changed, 57 insertions(+)
> 
> 
> diff -up ./common/dhcp-options.5.orig ./common/dhcp-options.5
> --- ./common/dhcp-options.5.orig	2011-05-20 10:33:26.000000000 -0400
> +++ ./common/dhcp-options.5	2012-02-29 12:04:11.074998816 -0500
> @@ -1712,7 +1712,48 @@ The \fBlq-relay-data\fR option is used i
>  The \fBlq-client-link\fR option is used internally by for lease query.
>  .RE
>  .PP
> +
> +.B option
> +.B dhcp6.bootfile-url
> +.I string 
> +.B ;
> +.RS 0.25i
> +.PP
> +The server sends this option to inform the client about a URL to a
> +boot file.  Used primarily for UEFI network booting, it contains an RFC3986
> +compliant URI which the client may use to boot an operating system.  This option
> +is defined in RFC5790
> +.RE
> +.PP
> +
> +.B option
> +.B dhcp6.arch-type
> +.I arch-id \fR[\fB,\fR arch-id\fR...] 
> +.B ;
> +.RS 0.25i
> +.PP
> +A client will send this option to a server so that the server may make decisions
> +on what options and addresses to offer the requesting client.  The option
> +consists of a list of 16 bit unsigned values that represent the architecure of
> +the requesting client.  These values corespond to the values available to the
> +dhcp4 option architecture-type, as defined in RFC4578, section 2.1.
> +This option is defined in RFC5790
>  .RE
> +.PP
> +
> +.B option
> +.B dhcp6.net-id
> +.I uint8, uint8, uint8 
> +.B ;
> +.RS 0.25i
> +.PP
> +A client will send this option to a server to inform it about the clients level
> +of UNDI support.  The option consists of 3 octets (a type, major and minor
> +value).  Specific meanings of these values are doumented in section 2.2 of
> +RFC4578.
> +This option is defined in RFC5790
> +.RE
> +.PP
>  .SH DEFINING NEW OPTIONS
>  The Internet Systems Consortium DHCP client and server provide the
>  capability to define new options.   Each DHCP option has a name, a
> diff -up ./common/tables.c.orig ./common/tables.c
> --- ./common/tables.c.orig	2011-05-20 10:33:27.000000000 -0400
> +++ ./common/tables.c	2012-02-29 12:03:22.610000294 -0500
> @@ -459,6 +459,17 @@ static struct option dhcpv6_options[] =
>  	{ "lq-relay-data", "6X",		&dhcpv6_universe, 47, 1 },
>  	{ "lq-client-link", "6A",		&dhcpv6_universe, 48, 1 },
>  
> +			/* RFC5970 OPTIONS */
> +	{ "bootfile-url", "t",			&dhcpv6_universe, 59, 1},
> +#if 0
> +	/* Can't implement this until arrays of strings with length "StA"
> +	 * are implemented
> +	 */
> +	{ "bootfile-param", "StA",		&dhcpv6_universe, 60, 1},
> +#endif
> +	{ "arch-type", "Sa",			&dhcpv6_universe, 61, 1},
> +	{ "net-id", "BA",			&dhcpv6_universe, 62, 1},
> +
>  	{ NULL, NULL, NULL, 0, 0 }
>  };
>  
> diff -up ./includes/dhcp6.h.orig ./includes/dhcp6.h
> --- ./includes/dhcp6.h.orig	2010-02-17 15:33:55.000000000 -0500
> +++ ./includes/dhcp6.h	2012-02-29 12:03:22.610000294 -0500
> @@ -75,6 +75,11 @@
>  #define D6O_CLT_TIME				46 /* RFC5007 */
>  #define D6O_LQ_RELAY_DATA			47 /* RFC5007 */
>  #define D6O_LQ_CLIENT_LINK			48 /* RFC5007 */
> +/* 49-58 Not yet assigned */
> +#define D60_BOOT_URL				59 /* RFC5070 */
> +#define D60_BOOT_PARAMS				60 /* RFC5070 */
> +#define D60_CLIENT_ARCH				61 /* RFC5070 */
> +#define D60_CLIENT_NII				62 /* RFC5070 */
>  
>  /* 
>   * Status Codes, from RFC 3315 section 24.4, and RFC 3633, 5007.


More information about the dhcp-hackers mailing list