diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-15 05:40:08 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-15 05:40:08 +0000 |
commit | 873b895d50d69a45b52bef85a8a4fb190f9c89ce (patch) | |
tree | 267ed6e7d1c00e7eea291c00e0c7e5e91ae036e3 /networking/udhcp/dhcpc.c | |
parent | e235285c3a36c0e4efe21ec336e7015cd3cf3c62 (diff) | |
download | busybox-w32-873b895d50d69a45b52bef85a8a4fb190f9c89ce.tar.gz busybox-w32-873b895d50d69a45b52bef85a8a4fb190f9c89ce.tar.bz2 busybox-w32-873b895d50d69a45b52bef85a8a4fb190f9c89ce.zip |
udhcpc: reduce ifdef forest, no code changes
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r-- | networking/udhcp/dhcpc.c | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index d135ba74d..655d39fd2 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c | |||
@@ -169,12 +169,8 @@ int udhcpc_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
169 | "no-default-options\0" No_argument "o" | 169 | "no-default-options\0" No_argument "o" |
170 | "foreground\0" No_argument "f" | 170 | "foreground\0" No_argument "f" |
171 | "background\0" No_argument "b" | 171 | "background\0" No_argument "b" |
172 | #if ENABLE_FEATURE_UDHCPC_ARPING | 172 | USE_FEATURE_UDHCPC_ARPING("arping\0" No_argument "a") |
173 | "arping\0" No_argument "a" | 173 | USE_FEATURE_UDHCP_PORT("client-port\0" Required_argument "P") |
174 | #endif | ||
175 | #if ENABLE_FEATURE_UDHCP_PORT | ||
176 | "client-port\0" Required_argument "P" | ||
177 | #endif | ||
178 | ; | 174 | ; |
179 | #endif | 175 | #endif |
180 | enum { | 176 | enum { |
@@ -201,40 +197,24 @@ int udhcpc_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
201 | OPT_f = 1 << 20, | 197 | OPT_f = 1 << 20, |
202 | /* The rest has variable bit positions, need to be clever */ | 198 | /* The rest has variable bit positions, need to be clever */ |
203 | OPTBIT_f = 20, | 199 | OPTBIT_f = 20, |
204 | #if BB_MMU | 200 | USE_FOR_MMU( OPTBIT_b,) |
205 | OPTBIT_b, | 201 | USE_FEATURE_UDHCPC_ARPING(OPTBIT_a,) |
206 | #endif | 202 | USE_FEATURE_UDHCP_PORT( OPTBIT_P,) |
207 | #if ENABLE_FEATURE_UDHCPC_ARPING | 203 | USE_FOR_MMU( OPT_b = 1 << OPTBIT_b,) |
208 | OPTBIT_a, | 204 | USE_FEATURE_UDHCPC_ARPING(OPT_a = 1 << OPTBIT_a,) |
209 | #endif | 205 | USE_FEATURE_UDHCP_PORT( OPT_P = 1 << OPTBIT_P,) |
210 | #if ENABLE_FEATURE_UDHCP_PORT | ||
211 | OPTBIT_P, | ||
212 | #endif | ||
213 | #if BB_MMU | ||
214 | OPT_b = 1 << OPTBIT_b, | ||
215 | #endif | ||
216 | #if ENABLE_FEATURE_UDHCPC_ARPING | ||
217 | OPT_a = 1 << OPTBIT_a, | ||
218 | #endif | ||
219 | #if ENABLE_FEATURE_UDHCP_PORT | ||
220 | OPT_P = 1 << OPTBIT_P, | ||
221 | #endif | ||
222 | }; | 206 | }; |
223 | 207 | ||
224 | /* Default options. */ | 208 | /* Default options. */ |
225 | #if ENABLE_FEATURE_UDHCP_PORT | 209 | USE_FEATURE_UDHCP_PORT(SERVER_PORT = 67;) |
226 | SERVER_PORT = 67; | 210 | USE_FEATURE_UDHCP_PORT(CLIENT_PORT = 68;) |
227 | CLIENT_PORT = 68; | ||
228 | #endif | ||
229 | client_config.interface = "eth0"; | 211 | client_config.interface = "eth0"; |
230 | client_config.script = DEFAULT_SCRIPT; | 212 | client_config.script = DEFAULT_SCRIPT; |
231 | 213 | ||
232 | /* Parse command line */ | 214 | /* Parse command line */ |
233 | /* Cc: mutually exclusive; O: list; -T,-t,-A take numeric param */ | 215 | /* Cc: mutually exclusive; O: list; -T,-t,-A take numeric param */ |
234 | opt_complementary = "c--C:C--c:O::T+:t+:A+"; | 216 | opt_complementary = "c--C:C--c:O::T+:t+:A+"; |
235 | #if ENABLE_GETOPT_LONG | 217 | USE_GETOPT_LONG(applet_long_options = udhcpc_longopts;) |
236 | applet_long_options = udhcpc_longopts; | ||
237 | #endif | ||
238 | opt = getopt32(argv, "c:CV:H:h:F:i:np:qRr:s:T:t:vSA:O:of" | 218 | opt = getopt32(argv, "c:CV:H:h:F:i:np:qRr:s:T:t:vSA:O:of" |
239 | USE_FOR_MMU("b") | 219 | USE_FOR_MMU("b") |
240 | USE_FEATURE_UDHCPC_ARPING("a") | 220 | USE_FEATURE_UDHCPC_ARPING("a") |
@@ -257,7 +237,7 @@ int udhcpc_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
257 | /* Flags: 0000NEOS | 237 | /* Flags: 0000NEOS |
258 | S: 1 => Client requests Server to update A RR in DNS as well as PTR | 238 | S: 1 => Client requests Server to update A RR in DNS as well as PTR |
259 | O: 1 => Server indicates to client that DNS has been updated regardless | 239 | O: 1 => Server indicates to client that DNS has been updated regardless |
260 | E: 1 => Name data is DNS format, i.e. <4>host<6>domain<4>com<0> not "host.domain.com" | 240 | E: 1 => Name data is DNS format, i.e. <4>host<6>domain<3>com<0> not "host.domain.com" |
261 | N: 1 => Client requests Server to not update DNS | 241 | N: 1 => Client requests Server to not update DNS |
262 | */ | 242 | */ |
263 | client_config.fqdn[OPT_DATA + 0] = 0x1; | 243 | client_config.fqdn[OPT_DATA + 0] = 0x1; |