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