diff options
Diffstat (limited to 'networking/udhcp/README.udhcpc')
-rw-r--r-- | networking/udhcp/README.udhcpc | 145 |
1 files changed, 0 insertions, 145 deletions
diff --git a/networking/udhcp/README.udhcpc b/networking/udhcp/README.udhcpc deleted file mode 100644 index 46970a566..000000000 --- a/networking/udhcp/README.udhcpc +++ /dev/null | |||
@@ -1,145 +0,0 @@ | |||
1 | udhcp client (udhcpc) | ||
2 | -------------------- | ||
3 | |||
4 | The udhcp client negotiates a lease with the DHCP server and notifies | ||
5 | a set of scripts when a leases is obtained or lost. | ||
6 | |||
7 | |||
8 | command line options | ||
9 | ------------------- | ||
10 | |||
11 | The command line options for the udhcp client are: | ||
12 | |||
13 | -c, --clientid=CLIENTID Set client identifier. Type is first char. | ||
14 | -C, --clientid-none Suppress default client identifier | ||
15 | -V, --vendorclass=CLASSID Set vendor class identifier | ||
16 | -H, --hostname=HOSTNAME Client hostname | ||
17 | -h, Alias for -H | ||
18 | -F, --fqdn=FQDN Client fully qualified domain name | ||
19 | -f, --foreground Do not fork after getting lease | ||
20 | -b, --background Fork to background if lease cannot be | ||
21 | immediately negotiated. | ||
22 | -i, --interface=INTERFACE Interface to use (default: eth0) | ||
23 | -n, --now Exit with failure if lease cannot be | ||
24 | immediately negotiated. | ||
25 | -p, --pidfile=file Store process ID of daemon in file | ||
26 | -q, --quit Quit after obtaining lease | ||
27 | -r, --request=IP IP address to request (default: none) | ||
28 | -s, --script=file Run file at dhcp events (default: | ||
29 | /usr/share/udhcpc/default.script) | ||
30 | -t, --retries=NUM Send up to NUM request packets | ||
31 | -v, --version Display version | ||
32 | |||
33 | |||
34 | If the requested IP address cannot be obtained, the client accepts the | ||
35 | address that the server offers. | ||
36 | |||
37 | |||
38 | udhcp client scripts | ||
39 | ------------------- | ||
40 | |||
41 | When an event occurs, udhcpc calls the action script. udhcpc never does | ||
42 | any configuration of the network interface itself, but instead relies on | ||
43 | a set of scripts. The script by default is | ||
44 | /usr/share/udhcpc/default.script but this can be changed via the command | ||
45 | line arguments. The three possible arguments to the script are: | ||
46 | |||
47 | deconfig: This argument is used when udhcpc starts, and | ||
48 | when a leases is lost. The script must put the interface in an | ||
49 | up, but deconfigured state, ie: ifconfig $interface 0.0.0.0. | ||
50 | |||
51 | bound: This argument is used when udhcpc moves from an | ||
52 | unbound, to a bound state. All of the paramaters are set in | ||
53 | enviromental variables, The script should configure the interface, | ||
54 | and set any other relavent parameters (default gateway, dns server, | ||
55 | etc). | ||
56 | |||
57 | renew: This argument is used when a DHCP lease is renewed. All of | ||
58 | the paramaters are set in enviromental variables. This argument is | ||
59 | used when the interface is already configured, so the IP address, | ||
60 | will not change, however, the other DHCP paramaters, such as the | ||
61 | default gateway, subnet mask, and dns server may change. | ||
62 | |||
63 | nak: This argument is used with udhcpc receives a NAK message. | ||
64 | The script with the deconfig argument will be called directly | ||
65 | afterwards, so no changes to the network interface are neccessary. | ||
66 | This hook is provided for purely informational purposes (the | ||
67 | message option may contain a reason for the NAK). | ||
68 | |||
69 | The paramaters for enviromental variables are as follows: | ||
70 | |||
71 | $HOME - The set $HOME env or "/" | ||
72 | $PATH - the set $PATH env or "/bin:/usr/bin:/sbin:/usr/sbin" | ||
73 | $1 - What action the script should perform | ||
74 | interface - The interface this was obtained on | ||
75 | ip - The obtained IP | ||
76 | mask - The number of bits in the netmask (ie: 24) | ||
77 | siaddr - The bootp next server option | ||
78 | sname - The bootp server name option | ||
79 | boot_file - The bootp boot file option | ||
80 | subnet - The assigend subnet mask | ||
81 | timezone - Offset in seconds from UTC | ||
82 | router - A list of routers | ||
83 | timesvr - A list of time servers | ||
84 | namesvr - A list of IEN 116 name servers | ||
85 | dns - A list of DNS server | ||
86 | logsvr - A list of MIT-LCS UDP log servers | ||
87 | cookiesvr - A list of RFC 865 cookie servers | ||
88 | lprsvr - A list of LPR servers | ||
89 | hostname - The assigned hostname | ||
90 | bootsize - The length in 512 octect blocks of the bootfile | ||
91 | domain - The domain name of the network | ||
92 | swapsvr - The IP address of the client's swap server | ||
93 | rootpath - The path name of the client's root disk | ||
94 | ipttl - The TTL to use for this network | ||
95 | mtu - The MTU to use for this network | ||
96 | broadcast - The broadcast address for this network | ||
97 | ntpsrv - A list of NTP servers | ||
98 | wins - A list of WINS servers | ||
99 | lease - The lease time, in seconds | ||
100 | dhcptype - DHCP message type (safely ignored) | ||
101 | serverid - The IP of the server | ||
102 | message - Reason for a DHCPNAK | ||
103 | tftp - The TFTP server name | ||
104 | bootfile - The bootfile name | ||
105 | |||
106 | additional options are easily added in options.c. | ||
107 | |||
108 | |||
109 | note on udhcpc's random seed | ||
110 | --------------------------- | ||
111 | |||
112 | udhcpc will seed its random number generator (used for generating xid's) | ||
113 | by reading /dev/urandom. If you have a lot of embedded systems on the same | ||
114 | network, with no entropy, you can either seed /dev/urandom by a method of | ||
115 | your own, or doing the following on startup: | ||
116 | |||
117 | ifconfig eth0 > /dev/urandom | ||
118 | |||
119 | in order to seed /dev/urandom with some data (mac address) unique to your | ||
120 | system. If reading /dev/urandom fails, udhcpc will fall back to its old | ||
121 | behavior of seeding with time(0). | ||
122 | |||
123 | |||
124 | signals accepted by udhcpc | ||
125 | ------------------------- | ||
126 | |||
127 | udhcpc also responds to SIGUSR1 and SIGUSR2. SIGUSR1 will force a renew state, | ||
128 | and SIGUSR2 will force a release of the current lease, and cause udhcpc to | ||
129 | go into an inactive state (until it is killed, or receives a SIGUSR1). You do | ||
130 | not need to sleep between sending signals, as signals received are processed | ||
131 | sequencially in the order they are received. | ||
132 | |||
133 | |||
134 | compile time options | ||
135 | ------------------- | ||
136 | |||
137 | options.c contains a set of dhcp options for the client: | ||
138 | |||
139 | name[10]: The name of the option as it will appear in scripts | ||
140 | |||
141 | flags: The type of option, as well as if it will be requested | ||
142 | by the client (OPTION_REQ) | ||
143 | |||
144 | code: The DHCP code for this option | ||
145 | |||