README.udhcpd 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. udhcp server (udhcpd)
  2. --------------------
  3. The only command line argument to udhcpd is an optional specifed
  4. config file. If no config file is specified, udhcpd uses the default
  5. config file, /etc/udhcpd.conf. Ex:
  6. udhcpd /etc/udhcpd.eth1.conf
  7. The udhcp server employs a number of simple config files:
  8. udhcpd.leases
  9. ------------
  10. The udhcpd.leases behavior is designed for an embedded system. The
  11. file is written either every auto_time seconds, or when a SIGUSR1
  12. is received (the auto_time timer restarts if a SIGUSR1 is received).
  13. If you send a SIGTERM to udhcpd directly after a SIGUSR1, udhcpd will
  14. finish writing the leases file and wait for the aftermentioned script
  15. to be executed and finish before quiting, so you do not need to sleep
  16. between sending signals. When the file is written, a script can be
  17. optionally called to commit the file to flash. Lease times are stored
  18. in the file by time remaining in lease (for systems without clock
  19. that works when there is no power), or by the absolute time that it
  20. expires in seconds from epoch. In the remaining format, expired leases
  21. are stored as zero. The file is of the format:
  22. 16 byte MAC
  23. 4 byte ip address
  24. u32 expire time
  25. 16 byte MAC
  26. 4 byte ip address
  27. u32 expire time
  28. .
  29. etc.
  30. example: hexdump udhcpd.leases
  31. 0000000 1000 c95a 27d9 0000 0000 0000 0000 0000
  32. 0000010 a8c0 150a 0d00 2d29 5000 23fc 8566 0000
  33. 0000020 0000 0000 0000 0000 a8c0 140a 0d00 4e29
  34. 0000030
  35. udhcpd.conf
  36. ----------
  37. The format is fairly simple, there is a sample file with all the
  38. available options and comments describing them in samples/udhcpd.conf
  39. compile time options
  40. -------------------
  41. dhcpd.h contains the other two compile time options:
  42. LEASE_TIME: The default lease time if not specified in the config
  43. file.
  44. DHCPD_CONFIG_FILE: The defualt config file to use.