Open source code for DHCP and webserver for LPC2294 and CS8900

I know asking the earth. I have found webservers with fixed IP addresses but not with DHCP.

Are there any alternatives I can port easily given I'm a fairly newbie to C!

Many thanks in advance.

Reply to
Fred
Loading thread data ...

A web server itself has neither a fixed nor a dynamically assigned IP address.

Ignoring some custom/tiny servers for microcontrollers, a web server is an application running under a host operating system, (doesn't matter if the OS is a full blown system or a minimal kernel,) and it will use the IP address configured by the hosting environment.

Check the services provided by your host environment to see how to get an address via DHCP.

Roberto Waltman

[ Please reply to the group, ] [ return address is invalid. ]
Reply to
Roberto Waltman

Many thanks for your post.

I was looking for a dedicated microcontroller webserver for a local network with some a system where I could type in http://embedded_system_name/ and get a status page. I am aware that this is not just DHCP but somewhat more. I was wondering if there were any open source software which could do this or I could modify.

Reply to
Fred

DHCP supports something that is called DHCP hostname. The purpose of this is that a DHCP client can pass a hostname to the DHCP server which in turn can do two things.

a) it can assign an IP that is maybe influenced by the name you pass in.

b) it can comunicate the IP asigned and the name to the nameserver in use.

Both operations can be implemented differently if at all, but obviousely your DHCP client impelentation would have to support DHCP hostname.

As the other poster mentioned already, servers (no matter wether they are embedded or not) get fixed IPs assigned to keep things simpler. Thereafter it's the nameservers job to map a name to said IP. If the DHCP server comunicates the assigned IP to the nameserver it's not needed that the IP is always the same, but such configurations seem to be rare IMHO.

Implemeneting DHCP to one of the available freeware TCP stacks should not be rocket sience. Read the DHCP RFC's and study the stacks lower level IP networking code and you surely will get an idea on what to do.

HTH

Markus

Reply to
Markus Zingg

To some extent, it's quite self-contradictory to be using DHCP on one hand, i.e. dynamic IP and hostname assignment, but still require a static published DNS host name.

There are basically two solutions to this:

1) kill part of the dynamicity of DHCP (--> pre-assigned DHCP responses for known MAC addresses) 2) make the IP hostname mapping of your responsible DNS server dynamic, even though DNS is meant to be mostly static (--> update DNS tables by request from the embedded device, as part of its start-up procedure).

What both cases have in common is that the embedded system itself has little or nothing to do with them --- the bulk of the work has to be done on an organizational level, i.e. by your local network's adminstrator(s). They have to maintain the static DHCP tables, or make sure the local DNS server accepts such dangerous requests from otherwise completely unknown devices.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.