[ipxe-devel] DHCPDISCOVER announcement of capabilities?

Michael Brown mbrown at fensystems.co.uk
Mon Nov 15 17:11:08 UTC 2010

On Monday 15 Nov 2010 12:54:05 Jarrod Johnson wrote:
> One problem I have as many iPXE implementations start appearing in vendor
> firmware is that I can't tell at DHCP transaction time whether the
>  requester has CONFIG_*BLAH* set.  For example, I usually have a
>  conditional to say something like 'if not iPXE, chainload iPXE, else http
>  boot', and then a vendor nic has iPXE, but not HTTP enabled.  My
>  workaround is basically to have my own build and burn it on adapters as
>  needed with a different vendor id to match on.  Any ideas on how iPXE
>  might be able to announce what features it has (kinda like how the banner
>  advertises on-screen, but in DISCOVER in a way that can be examined by
>  dhcpd).  I'm thinking a bitfield with each CONFIG option mapped to a bit
>  position.

Happily, this is already possible.  iPXE uses feature-specific DHCP options to 
indicate to the DHCP server the exact same list that appears on-screen in the 
"Features:" portion of the start-up banner.

For example, to test for HTTP support:

  option space ipxe;
  option ipxe-encap-opts code 175 = encapsulate ipxe;
  option ipxe.http code 19 = unsigned integer 8;

  if exists ipxe.http {

I've updated http://ipxe.org/howto/dhcpd to document this.

In more detail: each feature number in include/ipxe/features.h represents a 
DHCP option encapsulated within option 175.  For example,


means that option 175.19 will indicate the presence of HTTP support.  The 
option value is intended to be a feature-specific version number, which is 
controlled by the FEATURE() macro.  For example, in net/tcp/http.c:


means that the banner will include "HTTP" as a displayed feature, and 
DHCPDISCOVER/DHCPOFFER will include option 175.19 with a value of 1.


More information about the ipxe-devel mailing list