diff options
Diffstat (limited to 'networking/ifconfig.c')
-rw-r--r-- | networking/ifconfig.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/networking/ifconfig.c b/networking/ifconfig.c index c77ea04b1..3beecaf3d 100644 --- a/networking/ifconfig.c +++ b/networking/ifconfig.c | |||
@@ -15,7 +15,7 @@ | |||
15 | * Foundation; either version 2 of the License, or (at | 15 | * Foundation; either version 2 of the License, or (at |
16 | * your option) any later version. | 16 | * your option) any later version. |
17 | * | 17 | * |
18 | * $Id: ifconfig.c,v 1.12 2001/08/10 06:02:23 mjn3 Exp $ | 18 | * $Id: ifconfig.c,v 1.13 2001/10/24 04:59:56 andersen Exp $ |
19 | * | 19 | * |
20 | */ | 20 | */ |
21 | 21 | ||
@@ -44,7 +44,7 @@ | |||
44 | #include <linux/if_ether.h> | 44 | #include <linux/if_ether.h> |
45 | #include "busybox.h" | 45 | #include "busybox.h" |
46 | 46 | ||
47 | #ifdef BB_FEATURE_IFCONFIG_SLIP | 47 | #ifdef CONFIG_FEATURE_IFCONFIG_SLIP |
48 | #include <linux/if_slip.h> | 48 | #include <linux/if_slip.h> |
49 | #endif | 49 | #endif |
50 | 50 | ||
@@ -173,7 +173,7 @@ static const struct arg1opt Arg1Opt[] = { | |||
173 | {"SIOCSIFDSTADDR", SIOCSIFDSTADDR, ifreq_offsetof(ifr_dstaddr)}, | 173 | {"SIOCSIFDSTADDR", SIOCSIFDSTADDR, ifreq_offsetof(ifr_dstaddr)}, |
174 | {"SIOCSIFNETMASK", SIOCSIFNETMASK, ifreq_offsetof(ifr_netmask)}, | 174 | {"SIOCSIFNETMASK", SIOCSIFNETMASK, ifreq_offsetof(ifr_netmask)}, |
175 | {"SIOCSIFBRDADDR", SIOCSIFBRDADDR, ifreq_offsetof(ifr_broadaddr)}, | 175 | {"SIOCSIFBRDADDR", SIOCSIFBRDADDR, ifreq_offsetof(ifr_broadaddr)}, |
176 | #ifdef BB_FEATURE_IFCONFIG_HW | 176 | #ifdef CONFIG_FEATURE_IFCONFIG_HW |
177 | {"SIOCSIFHWADDR", SIOCSIFHWADDR, ifreq_offsetof(ifr_hwaddr)}, | 177 | {"SIOCSIFHWADDR", SIOCSIFHWADDR, ifreq_offsetof(ifr_hwaddr)}, |
178 | #endif | 178 | #endif |
179 | {"SIOCSIFDSTADDR", SIOCSIFDSTADDR, ifreq_offsetof(ifr_dstaddr)}, | 179 | {"SIOCSIFDSTADDR", SIOCSIFDSTADDR, ifreq_offsetof(ifr_dstaddr)}, |
@@ -183,7 +183,7 @@ static const struct arg1opt Arg1Opt[] = { | |||
183 | #ifdef SIOCSOUTFILL | 183 | #ifdef SIOCSOUTFILL |
184 | {"SIOCSOUTFILL", SIOCSOUTFILL, ifreq_offsetof(ifr_data)}, | 184 | {"SIOCSOUTFILL", SIOCSOUTFILL, ifreq_offsetof(ifr_data)}, |
185 | #endif | 185 | #endif |
186 | #ifdef BB_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ | 186 | #ifdef CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ |
187 | {"SIOCSIFMAP", SIOCSIFMAP, ifreq_offsetof(ifr_map.mem_start)}, | 187 | {"SIOCSIFMAP", SIOCSIFMAP, ifreq_offsetof(ifr_map.mem_start)}, |
188 | {"SIOCSIFMAP", SIOCSIFMAP, ifreq_offsetof(ifr_map.base_addr)}, | 188 | {"SIOCSIFMAP", SIOCSIFMAP, ifreq_offsetof(ifr_map.base_addr)}, |
189 | {"SIOCSIFMAP", SIOCSIFMAP, ifreq_offsetof(ifr_map.irq)}, | 189 | {"SIOCSIFMAP", SIOCSIFMAP, ifreq_offsetof(ifr_map.irq)}, |
@@ -199,7 +199,7 @@ static const struct options OptArray[] = { | |||
199 | {"dstaddr", N_ARG, ARG_DSTADDR, 0}, | 199 | {"dstaddr", N_ARG, ARG_DSTADDR, 0}, |
200 | {"netmask", N_ARG, ARG_NETMASK, 0}, | 200 | {"netmask", N_ARG, ARG_NETMASK, 0}, |
201 | {"broadcast", N_ARG | M_CLR, ARG_BROADCAST, IFF_BROADCAST}, | 201 | {"broadcast", N_ARG | M_CLR, ARG_BROADCAST, IFF_BROADCAST}, |
202 | #ifdef BB_FEATURE_IFCONFIG_HW | 202 | #ifdef CONFIG_FEATURE_IFCONFIG_HW |
203 | {"hw", N_ARG, ARG_HW, 0}, | 203 | {"hw", N_ARG, ARG_HW, 0}, |
204 | #endif | 204 | #endif |
205 | {"pointopoint", N_ARG | M_CLR, ARG_POINTOPOINT, IFF_POINTOPOINT}, | 205 | {"pointopoint", N_ARG | M_CLR, ARG_POINTOPOINT, IFF_POINTOPOINT}, |
@@ -209,7 +209,7 @@ static const struct options OptArray[] = { | |||
209 | #ifdef SIOCSOUTFILL | 209 | #ifdef SIOCSOUTFILL |
210 | {"outfill", N_ARG, ARG_OUTFILL, 0}, | 210 | {"outfill", N_ARG, ARG_OUTFILL, 0}, |
211 | #endif | 211 | #endif |
212 | #ifdef BB_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ | 212 | #ifdef CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ |
213 | {"mem_start", N_ARG, ARG_MEM_START, 0}, | 213 | {"mem_start", N_ARG, ARG_MEM_START, 0}, |
214 | {"io_addr", N_ARG, ARG_IO_ADDR, 0}, | 214 | {"io_addr", N_ARG, ARG_IO_ADDR, 0}, |
215 | {"irq", N_ARG, ARG_IRQ, 0}, | 215 | {"irq", N_ARG, ARG_IRQ, 0}, |
@@ -229,11 +229,11 @@ static const struct options OptArray[] = { | |||
229 | * A couple of prototypes. | 229 | * A couple of prototypes. |
230 | */ | 230 | */ |
231 | 231 | ||
232 | #ifdef BB_FEATURE_IFCONFIG_HW | 232 | #ifdef CONFIG_FEATURE_IFCONFIG_HW |
233 | static int in_ether(char *bufp, struct sockaddr *sap); | 233 | static int in_ether(char *bufp, struct sockaddr *sap); |
234 | #endif | 234 | #endif |
235 | 235 | ||
236 | #ifdef BB_FEATURE_IFCONFIG_STATUS | 236 | #ifdef CONFIG_FEATURE_IFCONFIG_STATUS |
237 | extern int interface_opt_a; | 237 | extern int interface_opt_a; |
238 | extern int display_interfaces(char *ifname); | 238 | extern int display_interfaces(char *ifname); |
239 | #endif | 239 | #endif |
@@ -246,7 +246,7 @@ int ifconfig_main(int argc, char **argv) | |||
246 | { | 246 | { |
247 | struct ifreq ifr; | 247 | struct ifreq ifr; |
248 | struct sockaddr_in sai; | 248 | struct sockaddr_in sai; |
249 | #ifdef BB_FEATURE_IFCONFIG_HW | 249 | #ifdef CONFIG_FEATURE_IFCONFIG_HW |
250 | struct sockaddr sa; | 250 | struct sockaddr sa; |
251 | #endif | 251 | #endif |
252 | const struct arg1opt *a1op; | 252 | const struct arg1opt *a1op; |
@@ -266,7 +266,7 @@ int ifconfig_main(int argc, char **argv) | |||
266 | ++argv; | 266 | ++argv; |
267 | --argc; | 267 | --argc; |
268 | 268 | ||
269 | #ifdef BB_FEATURE_IFCONFIG_STATUS | 269 | #ifdef CONFIG_FEATURE_IFCONFIG_STATUS |
270 | if ((argc > 0) && (strcmp(*argv,"-a") == 0)) { | 270 | if ((argc > 0) && (strcmp(*argv,"-a") == 0)) { |
271 | interface_opt_a = 1; | 271 | interface_opt_a = 1; |
272 | --argc; | 272 | --argc; |
@@ -275,7 +275,7 @@ int ifconfig_main(int argc, char **argv) | |||
275 | #endif | 275 | #endif |
276 | 276 | ||
277 | if(argc <= 1) { | 277 | if(argc <= 1) { |
278 | #ifdef BB_FEATURE_IFCONFIG_STATUS | 278 | #ifdef CONFIG_FEATURE_IFCONFIG_STATUS |
279 | return display_interfaces(argc ? *argv : NULL); | 279 | return display_interfaces(argc ? *argv : NULL); |
280 | #else | 280 | #else |
281 | error_msg_and_die( "ifconfig was not compiled with interface status display support."); | 281 | error_msg_and_die( "ifconfig was not compiled with interface status display support."); |
@@ -333,7 +333,7 @@ int ifconfig_main(int argc, char **argv) | |||
333 | HOSTNAME: | 333 | HOSTNAME: |
334 | did_flags |= (mask & A_NETMASK); | 334 | did_flags |= (mask & A_NETMASK); |
335 | if (mask & A_CAST_HOST_COPY) { | 335 | if (mask & A_CAST_HOST_COPY) { |
336 | #ifdef BB_FEATURE_IFCONFIG_HW | 336 | #ifdef CONFIG_FEATURE_IFCONFIG_HW |
337 | if (mask & A_CAST_RESOLVE) { | 337 | if (mask & A_CAST_RESOLVE) { |
338 | #endif | 338 | #endif |
339 | safe_strncpy(host, *argv, (sizeof host)); | 339 | safe_strncpy(host, *argv, (sizeof host)); |
@@ -348,7 +348,7 @@ int ifconfig_main(int argc, char **argv) | |||
348 | continue; | 348 | continue; |
349 | } | 349 | } |
350 | p = (char *) &sai; | 350 | p = (char *) &sai; |
351 | #ifdef BB_FEATURE_IFCONFIG_HW | 351 | #ifdef CONFIG_FEATURE_IFCONFIG_HW |
352 | } else { /* A_CAST_HOST_COPY_IN_ETHER */ | 352 | } else { /* A_CAST_HOST_COPY_IN_ETHER */ |
353 | /* This is the "hw" arg case. */ | 353 | /* This is the "hw" arg case. */ |
354 | if (strcmp("ether", *argv) || (*++argv == NULL)) { | 354 | if (strcmp("ether", *argv) || (*++argv == NULL)) { |
@@ -368,7 +368,7 @@ int ifconfig_main(int argc, char **argv) | |||
368 | } else { | 368 | } else { |
369 | unsigned int i = strtoul(*argv,NULL,0); | 369 | unsigned int i = strtoul(*argv,NULL,0); |
370 | p = ((char *)(&ifr)) + a1op->ifr_offset; | 370 | p = ((char *)(&ifr)) + a1op->ifr_offset; |
371 | #ifdef BB_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ | 371 | #ifdef CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ |
372 | if (mask & A_MAP_TYPE) { | 372 | if (mask & A_MAP_TYPE) { |
373 | if (ioctl(sockfd, SIOCGIFMAP, &ifr) < 0) { | 373 | if (ioctl(sockfd, SIOCGIFMAP, &ifr) < 0) { |
374 | ++goterr; | 374 | ++goterr; |
@@ -446,7 +446,7 @@ int ifconfig_main(int argc, char **argv) | |||
446 | return goterr; | 446 | return goterr; |
447 | } | 447 | } |
448 | 448 | ||
449 | #ifdef BB_FEATURE_IFCONFIG_HW | 449 | #ifdef CONFIG_FEATURE_IFCONFIG_HW |
450 | /* Input an Ethernet address and convert to binary. */ | 450 | /* Input an Ethernet address and convert to binary. */ |
451 | static int | 451 | static int |
452 | in_ether(char *bufp, struct sockaddr *sap) | 452 | in_ether(char *bufp, struct sockaddr *sap) |