lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] DNS Client in lwIP


From: Walter Saegesser
Subject: [lwip-users] DNS Client in lwIP
Date: Tue, 19 Apr 2011 15:58:09 +0200

I am implementing a very simple web server on a Stellaris Cortex-M3 controller and the first draft seems to works. The IP I get – at the moment – by DHCP and then in the browser I enter http://172.xxx.xxx.xxx.

 

Now if the user chooses to use DHCP he does not normally know the IP address (and there is no display to show it). Thus the user of the web server should be able to enter a name instead of the IP-address, e.g. http://MyDevice.

I have seen that during initialization I get a call to “dns_setservers” in dns.c and the correct IP (for the actual network) is passed.

In the lwIP WIKI if see that a function dns_ gethostbyname is available and an appropriate callback must be installed.

 

Generally I access the TCP stack by the netconn API. Unfortunately I am not able to figure out

-          when to call the dns_ gethostbyname function and in what context (from the viewpoint of the RTOS)

-          what the arguments should be (I reckon name=”MyDevice”, ip=172.xxx.xxx.xxx, found=CallBack, callback_arg=anything (NULL)).

-          what is to be expected as the result of the action. I fancy that the DNS server, the one provided by DHCP, should make an entry in its table with the name and ip given and that henceforth an URL of http://MyDevice in the browser should be redirected to 172.xxx.xxx.xxx.

-          what to do with the callback. The example given in the WIKI doesn’t give me an understanding

-          whether other DNS function must be called

 

Thanks for any help.

Walter

 

_______________________________________________
Walter Saegesser
Dip
l.-Ing. (FH)

R&D - Software
Business Unit IMS – Line of Business Solar Inverter
_______________________________________________
Delta Renewable Energy Systems (Switzerland) AG
Burgerfeldstrasse 19, CH-8730 Uznach SG, Switzerland
TEL:       +41 (0)55 246-4140
FAX:      +41 (0)55 246-4116
address@hidden
www.deltaenergysystems.com
_______________________________________________

 

********************************************************************************************************************************
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain
confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
[Delta Energy Systems]
********************************************************************************************************************************

reply via email to

[Prev in Thread] Current Thread [Next in Thread]