diff options
| author | Michael Brown | 2016-07-04 16:07:05 +0200 |
|---|---|---|
| committer | Michael Brown | 2016-07-04 16:07:05 +0200 |
| commit | aeb62038119f1988b06fa6a55a74d3db65c64d79 (patch) | |
| tree | ebc9d4c6f06f6af2de4e22d437815fbfd0ebe6fc /src/include/ipxe | |
| parent | [dhcpv6] Include vendor class identifier option in DHCPv6 requests (diff) | |
| download | ipxe-aeb62038119f1988b06fa6a55a74d3db65c64d79.tar.gz ipxe-aeb62038119f1988b06fa6a55a74d3db65c64d79.tar.xz ipxe-aeb62038119f1988b06fa6a55a74d3db65c64d79.zip | |
[dhcp] Automatically generate vendor class identifier string
The vendor class identifier strings in DHCP_ARCH_VENDOR_CLASS_ID are
out of sync with the (correct) client architecture values in
DHCP_ARCH_CLIENT_ARCHITECTURE.
Fix by removing all definitions of DHCP_ARCH_VENDOR_CLASS_ID, and
instead generating the vendor class identifier string automatically
based on DHCP_ARCH_CLIENT_ARCHITECTURE and DHCP_ARCH_CLIENT_NDI.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe')
| -rw-r--r-- | src/include/ipxe/dhcp.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/include/ipxe/dhcp.h b/src/include/ipxe/dhcp.h index 693aa7e73..b699b31f0 100644 --- a/src/include/ipxe/dhcp.h +++ b/src/include/ipxe/dhcp.h @@ -210,6 +210,29 @@ struct dhcp_pxe_boot_menu_item { /** Vendor class identifier */ #define DHCP_VENDOR_CLASS_ID 60 +/** Vendor class identifier for PXE clients */ +#define DHCP_VENDOR_PXECLIENT( arch, ndi ) \ + 'P', 'X', 'E', 'C', 'l', 'i', 'e', 'n', 't', ':', \ + 'A', 'r', 'c', 'h', ':', DHCP_VENDOR_PXECLIENT_ARCH ( arch ), \ + ':', 'U', 'N', 'D', 'I', ':', DHCP_VENDOR_PXECLIENT_UNDI ( ndi ) + +/** Vendor class identifier architecture for PXE clients */ +#define DHCP_VENDOR_PXECLIENT_ARCH( arch ) \ + ( '0' + ( ( (arch) / 10000 ) % 10 ) ), \ + ( '0' + ( ( (arch) / 1000 ) % 10 ) ), \ + ( '0' + ( ( (arch) / 100 ) % 10 ) ), \ + ( '0' + ( ( (arch) / 10 ) % 10 ) ), \ + ( '0' + ( ( (arch) / 1 ) % 10 ) ) + +/** Vendor class identifier UNDI version for PXE clients */ +#define DHCP_VENDOR_PXECLIENT_UNDI( type, major, minor ) \ + DHCP_VENDOR_PXECLIENT_UNDI_VERSION ( major ), \ + DHCP_VENDOR_PXECLIENT_UNDI_VERSION ( minor ) +#define DHCP_VENDOR_PXECLIENT_UNDI_VERSION( version ) \ + ( '0' + ( ( (version) / 100 ) % 10 ) ), \ + ( '0' + ( ( (version) / 10 ) % 10 ) ), \ + ( '0' + ( ( (version) / 1 ) % 10 ) ) + /** Client identifier */ #define DHCP_CLIENT_ID 61 |
