Hi.
I got a PLUS-license for KEIL uV5 and a KEIL MCBSTM32C evaluation board (for STM32F107).
I want to send my "DHCP Discover" message containing a (random/dummy) "BOOT File name" protocol element. But the information on www.keil.com/.../group__using__ethernet__interfaces__conf.html don't seems sufficient (my DHCP-client wont add this "BOOT File name" protocol element).
How can I add the "BOOT File name" protocol element to my "DHCP Discover" message?
best regards Terje Bøhler
Well you can't. It is possible to add a BOOTFILE option in DHCP option request list in a DHCP DISCOVER message. In order to request this, you need to enable Bootfile Name in Net_Config_ETH_0.h
#define ETH0_DHCP_BOOTFILE 1
Thanks Frank.
Acc. to p. 36 of rfc2131 (DHCP) it says for DHCPDISCOVER: www.ietf.org/.../rfc2131.txt "'file' options, if indicated in 'sname/file' option; otherwise unused". Q-1: Do you know why it is not possible to set/add this DHCP-field to KEILs DHCP-Client-implementation?
I already did include the "#define ETH0_DHCP_BOOTFILE 1" in my Net_Config_ETH_0.h. It says: "Bootfile Name enables or disables the DHCP option 67". But, no DHCP option 67 (Bootfile name) is included/seen in my "DHCP Discover" ... It seems like additional settings must be done (where do I enter the actual "Boot file name")? Q-2: Do you know which settings/procedures to be required/implemented?
Best regards Terje Bohler
DHCP server provides 'file', not DHCP client. That is why you can't.
Hi Franc.
The problem is that our DHCP Server requires 'something' (some dummy filename at least) in the 'Boot file name' field of the DHCP Discover message. And, according to the RFC2131, a DHCP Discover (from our DHCP Client) could contain this 'Boot file name'. Ref www.ietf.org/.../rfc2131.txt
p.8 DHCP Header
p.9 Table 1: Description of fields in a DHCP message 'file 128 Boot file name, null terminated string; 'generic' name or null in DHCPDISCOVER, fully qualified directory-path name in DHCPOFFER.'
p. 36 and 37 Table 5: Fields and options used by DHCP clients ''file' options, if indicated in 'sname/file' option, otherwise not used'
Table 5: Fields and options used by DHCP clients
(actually, when I 'hooked off' the 'Bootfile name' of the 'Dynamic Host Configuration' option in the Net_Config_ETH_0.h file, I could not see any change/additions in the DHCP Discover sent)
best regards Terje Bohler
In rfc2131 page 9, the 'file' field is defined as "Boot file name, null terminated string; "generic" name or null in DHCPDISCOVER, fully qualified directory-path name in DHCPOFFER." In other words, it is NOT mandatory to specify a "generic" name to this 'file' field. That means if your DHCP server really follows the rfc2131, it should accept 'NULL' for this 'file' field in DHCP DISCOVER. The more important thing is the option 67 'Bootfile name' in DHCPOFFER from your DHCP server back.
If you enable the option ETH0_DHCP_BOOTFILE in Net_Config_EHT_0.h, you can see the difference via e.g. Wireshark log, where in DHCPOFFER from DHCP server there will be an additional "Parameter Request List Item: (67) Bootfile name" comparing with the case of ETH0_DHCP_BOOTFILE disabled. That's why in Net_Config_EHT_0.h it is written "If enabled, the Bootfile Name (option 67) is also requested from DHCP server." for ETH0_DHCP_BOOTFILE.
Thus, the point is not whether or how to specify a boot file name in DHCP DISCOVER. The point is your DHCP server should accept the 'file' field with NULL in DHCPDISCOVER and encode its Bootfile name in DHCPOFFER back to the DHCP client.
sorry for the typo: "where in DHCPOFFER from DHCP server there will be an additional "Parameter Request List Item:"
should be:
"where in DHCPDiscover from DHCP client there will be an additional "Parameter Request List Item:…"