*
* $Log: dhcpc.c,v $
* Revision 1.22 2006/08/01 07:38:41 haraldkipp
* DHCP client failed because of alignment errors. Removed the dispensable
* 'packed' attribute from the dyn_cfg structure.
*
* Revision 1.21 2006/01/23 19:52:10 haraldkipp
* Added required typecasts before left shift.
*
* Revision 1.20 2006/01/23 17:35:54 haraldkipp
* BOOTP and DYNCFG structures must be packed.
* Fixed memory alignment bug, which retrieved wrong values from DHCP options.
*
* Revision 1.19 2005/08/02 17:47:04 haraldkipp
* Major API documentation update.
*
* Revision 1.18 2005/04/05 17:44:57 haraldkipp
* Made stack space configurable.
*
* Revision 1.17 2005/03/28 18:26:59 mrjones4u
* Fixed non-release bug in DCHP client
*
* Revision 1.16 2005/02/03 14:33:56 haraldkipp
* Several bug fixes and enhancements. The most important fix will
* avoid hanging, when Ethernut is reset while ICMP pings are
* received. A large number of changes make the client to follow
* RFC 2131 more closely, like maintaining renewal and rebind time.
* Two new API calls, NutDhcpStatus() and NutDhcpError(), allow
* to query the current status of the DHCP client. The previously
* introduced API call NutDhcpIsConfigured() has been marked
* deprecated. Another problem was with timeout, because the client
* continued negotiation with the server after the timeout time
* given in the API called elapsed. Now all internal timeouts are
* adjusted to the API timeout. Furthermore the previous version
* let the client continue on fatal errors like UDP receive or UDP
* broadcast failures. Now the client stops on such errors and
* informs the caller. Finally the documentation has been enhanced.
*
* Revision 1.15 2004/12/31 10:51:40 drsung
* Bugfixes from Michel Hendriks applied:
* Allocate empty dyncfg's to prevent freeing twice of domain/hostname
* Clear pointer after ReleaseDynCfg to prevent freeing twice
* Make sure SelectOffer is never called with 0 offers
* When falling back from rebooting to selecting, clear
* the received ip address so NutDhcpIfConfig does not
* assume it has been configured properly
*
* Revision 1.14 2004/04/15 07:16:47 drsung
* Now it works... :-/
*
* Revision 1.13 2004/04/15 07:11:50 drsung
* Added hostname support to NutDHCPDiscover
*
* Revision 1.12 2004/03/18 11:24:01 haraldkipp
* Deprecated functions removed
*
* Revision 1.11 2004/03/03 17:53:28 drsung
* Support for new field 'hostname' in structure confos added.
*
* Revision 1.10 2004/02/25 16:34:32 haraldkipp
* New API added to relinguish the DHCP lease. Collecting more
* than one offer is now disabled, if the application sets timeout
* below three times of MAX_DHCP_WAIT (5 seconds). The lease renewal
* will now start when 3/4 has elapsed, opposed to 1/2 used previously.
* Finally the DHCP thread will sleep as long as possible, while the
* previous version woke up every ten seconds.
*
* Revision 1.9 2004/02/02 18:54:43 drsung
* gateway ip address was not set, if static network configuration from EEPROM is used.
*
* Revision 1.8 2004/01/14 17:50:41 drsung
* Fix for Win2k DHCP server applied. Thanks to Damian Slee
*
* Revision 1.7 2003/11/03 16:22:59 haraldkipp
* Renewal disabled if lease time is set to zero
*
* Revision 1.6 2003/10/13 10:18:08 haraldkipp
* Using new seconds counter
*
* Revision 1.5 2003/08/07 09:09:08 haraldkipp
* Redesign to follow RFC 2131 more closely.
*
* Revision 1.4 2003/07/20 18:25:40 haraldkipp
* Support secondary DNS.
*
* Revision 1.3 2003/07/17 09:44:14 haraldkipp
* Removed default MAC address and let the caller have a second chance.
*
* Revision 1.2 2003/05/15 14:25:38 haraldkipp
* Some DHCP servers discard discover telegrams.
* Thanks to Tomohiro Haraikawa.
*
* Revision 1.1.1.1 2003/05/09 14:41:57 haraldkipp
* Initial using 3.2.1
*
*