ndhc/ndhc
2010-12-26 15:03:14 -05:00
..
arp.c Rename script.[ch] to ifchange.[ch]. 2010-12-24 10:12:41 -05:00
arp.h Rename arpping.[ch] to arp.[ch]. 2010-12-24 09:58:47 -05:00
CMakeLists.txt Rename script.[ch] to ifchange.[ch]. 2010-12-24 10:12:41 -05:00
config.h Fix --hostname option. 2010-12-24 10:44:06 -05:00
COPYING
dhcpd.h Update get_option() to use the function from busybox's udhcp variant; 2010-11-14 03:41:36 -05:00
dhcpmsg.c Allow receive of short dhcp packets over raw listen sockets. 2010-12-26 15:03:14 -05:00
dhcpmsg.h Rename clientpacket.c to dhcpmsg.c. 2010-12-24 10:01:12 -05:00
ifchange.c Rename script.[ch] to ifchange.[ch]. 2010-12-24 10:12:41 -05:00
ifchange.h Rename script.[ch] to ifchange.[ch]. 2010-12-24 10:12:41 -05:00
ndhc-defines.h Make write() and sendto() properly handle short writes and errors in ndhc. 2010-11-12 18:44:49 -05:00
ndhc.8
ndhc.c Fix --hostname option. 2010-12-24 10:44:06 -05:00
options.c Indentation fix. 2010-11-14 08:49:58 -05:00
options.h Clean up end_option(), and fix a possible off-by-one in the bound check. 2010-11-14 07:50:21 -05:00
packet.c Fix stale declaration of arp_check(). 2010-12-24 10:40:46 -05:00
packet.h Move change_listen_mode to packet.c. 2010-12-24 09:41:52 -05:00
README Fix typos in README. 2010-11-12 08:43:46 -05:00
socket.c Clean up and comment listen_socket(). 2010-11-14 00:46:02 -05:00
socket.h Clean up parameter names and comment read_interface(). 2010-11-14 00:41:32 -05:00
sys.c Move background() to sys.[ch]. 2010-12-24 09:47:09 -05:00
sys.h Move background() to sys.[ch]. 2010-12-24 09:47:09 -05:00
timeout.c Rename script.[ch] to ifchange.[ch]. 2010-12-24 10:12:41 -05:00
timeout.h Move timeout and arp handling code out to arpping.c and timeout.c. 2010-12-24 09:32:58 -05:00

ndhc client
--------------------

The ndhc client negotiates a lease with the DHCP server and notifies
ifchd when a leases is obtained or lost.


command line options
-------------------

The command line options for the ndhc client are:

-c, --clientid=CLIENTID         Client identifier
-H, --hostname=HOSTNAME         Client hostname
-h,				Alias for -H
-f, --foreground                Do not fork after getting lease
-b, --background                Fork to background if lease cannot be
                                immediately negotiated.
-i, --interface=INTERFACE       Interface to use (default: eth0)
-n, --now                       Exit with failure if lease cannot be
                                immediately negotiated.
-q, --quit                      Quit after obtaining lease
-r, --request=IP                IP address to request (default: none)
-v, --version                   Display version


If the requested IP address cannot be obtained, the client accepts the
address that the server offers.


note on ndhc's random seed
---------------------------

ndhc will seed its random number generator (used for generating xids)
by reading /dev/urandom. If you have a lot of embedded systems on the same
network, with no entropy, you can either seed /dev/urandom by a method of
your own, or doing the following on startup:

ifconfig eth0 > /dev/urandom

in order to seed /dev/urandom with some data (mac address) unique to your
system. If reading /dev/urandom fails, ndhc will fall back to its old
behavior of seeding with time(0).


signals accepted by ndhc
-------------------------

ndhc also responds to SIGUSR1 and SIGUSR2. SIGUSR1 will force a renew state,
and SIGUSR2 will force a release of the current lease, and cause ndhc to
go into an inactive state (until it is killed, or receives a SIGUSR1). You do
not need to sleep between sending signals, as signals received are processed
sequentially in the order they are received.