tags:

views:

147

answers:

3

I am coding a very simple DHCP client in C. I have trouble deciding whether it should use UDP or TCP, what basic commands should it support. I think it should be able to get at least DNS, SMTP, POP3 server information from server.

What else do I need to know? Is there a basic DHCP C implementation available which can help?

+1  A: 

What OS do you use?

The dhcpcd and dhclient are open source implementation of DHCP client.

May be it will help you.

demas
Linux I suppose.
AJ
+1  A: 

If you google dhcp client c, the first few results all seem to have source code and tips on implementing a c based dhcp client.

Sean
+4  A: 

You shouldn't have trouble "deciding" whether to use TCP or UDP, you should rely on the actual DHCP spec to determine what protocol is used. In fact, reliance on that spec will be more or less critical to implementing a DHCP client that does what it's supposed to do... since "what it's supposed to do" is defined in the spec.

delfuego
Verbatim from the RFC `DHCP uses UDP as its transport protocol`
ZJR