Does RTEMS really support client DHCP? [YES!]

Gene Smith gds at chartertn.net
Wed Oct 29 18:01:29 UTC 2008


Yes, pretty simple (but undocumented AFAICT).

Just define RTEMS_USE_BOOTP in application file networkconfig.h and 
change rtems_bsd_do_bootp to rtems_bsd_do_dhcp in the 
rtems_bsdnet_config definition. You also have to declare "void 
rtems_bsdnet_do_dhcp (void);" in networkconfig.h and it works.

You can also specify a hostname in rtems_bsdnet_config and move it 
outside of #if (!defined (RTEMS_USE_BOOTP)) and the hostname works like 
the Macraigor device described below, e.g., you can ping using your 
hostname or the hostname plus domain name (domain name current set in 
DNS/DHCP server, e.g., dnsmasq.conf).

I need to go back and make sure bootp also works, but I mainly wanted 
DHCP. (Not sure about the possibly bootp issue with dnsmasq.)

Gene Smith wrote:
> How do you enable DHCP client support in RTEMS? In networkconfig.h you 
> define RTEMS_USE_BOOTP to enable BOOTP/DHCP. But when this happens I 
> only see BOOTP request broadcasts sent from the RTEMS unit, but get no 
> answer. When I plug in my other device, Macraigor JTAG described below, 
> I see packets DHCP Discover and DHCP Request and the address (and 
> hostname) are obtained. (This is looking with Wireshark.)
> 
> I see a large file, *dhcp.c, in RTEMS libnetworking but it is not 
> included in my code for some reason. Also, see references on the list to 
> BOOTP not working with Linksys routers and/or dnsmasq. So probably need 
> DHCP to work if possible. My wireless router is Linksys and it contains 
> dnsmasq.
> 
> My previous post on this subject is included below since it was a reply 
> to a very old post which may not be visible in threaded view mode. 
> Should have made a new post.
> 
> -gene
> 
> gene wrote 10/28/2008:
>> The question below was asked on the list some time ago but never got a 
>> reply. I have also been trying to figure out the same question.
>>
>> Right now I have a non-RTEMS Macraigor jtag debugger box on my local 
>> network. I have given it a hostname "mpdemon" since that is what the 
>> product is. The host name is originally entered through the serial 
>> console on the jtag box. I have also configured the jtag box to obtain 
>> its IP address with DHCP (static is the other option). When the box 
>> powers up it obtains its address from my server (as I would expect) and 
>> it is ping-able and it webpage is accessible using the name mpdemon (or 
>> the longer name mpdemon.mylocaldomain). My DNS server (dnsmasq) was 
>> never told about the name "mpdemon" but now understands it when used by 
>> any host.
>>
>> As the question below points out, in RTEMS networkconfig.h you can't 
>> seem to specify the hostname when BOOTP (really DHCP?) is enabled. So is 
>> it possible to do in RTEMS what the Macraigor jtag box can do using DHCP 
>> (automatically make its hostname known in DNS)?
>>
>> -gene
>>
>> Alex Holeczy wrote, On 06/03/2005 09:42 AM:
>>>> I am working on an RTEMS application where I am configuring the network 
>>>> interface to use BOOTP/DHCP to get the IP address for the system.
>>>>
>>>> In order for a user application to connect to the system, I would like 
>>>> to specify the network hostname of the system and I would prefer not 
>>>> having to configure the DHCP daemon with this information.  This would 
>>>> allow the user application to connect to the system without knowing the 
>>>> IP or mac address.
>>>>
>>>> In the network configuration structure, there is an entry for the RTEMS 
>>>> application to provide a hostname.  It seems that this hostname is only 
>>>> used locally and does not get included in the bootp request packet.
>>>>
>>>> Is there currently a way for an RTEMS application to provide the DNS 
>>>> server with its local hostname?
>>>>
>>>> What would be the downsize of modifying the bootp request packet to 
>>>> include the host name option?
>>>>
>>>>
>>>> Regards,
>>>> Alex




More information about the users mailing list