aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2002-11-26 09:02:06 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2002-11-26 09:02:06 +0000
commit8ae4cab4a85eea297a0b8ea9aa65c3c23b0a664b (patch)
tree8bdc5ce06345033fdb627a10abf4c3cd6b924e82
parentc5dced17c55134252928c728a1ae15f038211df5 (diff)
downloadbusybox-w32-8ae4cab4a85eea297a0b8ea9aa65c3c23b0a664b.tar.gz
busybox-w32-8ae4cab4a85eea297a0b8ea9aa65c3c23b0a664b.tar.bz2
busybox-w32-8ae4cab4a85eea297a0b8ea9aa65c3c23b0a664b.zip
use #ifdef CONFIG_* instead of #if CONFIG_*
-rw-r--r--libbb/interface.c9
-rw-r--r--libbb/xconnect.c2
-rw-r--r--networking/ifconfig.c26
-rw-r--r--networking/netstat.c6
-rw-r--r--networking/route.c14
5 files changed, 29 insertions, 28 deletions
diff --git a/libbb/interface.c b/libbb/interface.c
index b7353e5ad..2f4319265 100644
--- a/libbb/interface.c
+++ b/libbb/interface.c
@@ -15,7 +15,7 @@
15 * that either displays or sets the characteristics of 15 * that either displays or sets the characteristics of
16 * one or more of the system's networking interfaces. 16 * one or more of the system's networking interfaces.
17 * 17 *
18 * Version: $Id: interface.c,v 1.10 2002/09/17 06:36:02 andersen Exp $ 18 * Version: $Id: interface.c,v 1.11 2002/11/26 09:02:04 bug1 Exp $
19 * 19 *
20 * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> 20 * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
21 * and others. Copyright 1993 MicroWalt Corporation 21 * and others. Copyright 1993 MicroWalt Corporation
@@ -44,7 +44,6 @@
44 * 44 *
45 */ 45 */
46#define HAVE_AFINET 1 46#define HAVE_AFINET 1
47#undef HAVE_AFINET6
48#undef HAVE_AFIPX 47#undef HAVE_AFIPX
49#undef HAVE_AFATALK 48#undef HAVE_AFATALK
50#undef HAVE_AFNETROM 49#undef HAVE_AFNETROM
@@ -52,8 +51,10 @@
52#undef HAVE_AFECONET 51#undef HAVE_AFECONET
53#undef HAVE_AFASH 52#undef HAVE_AFASH
54 53
55#if CONFIG_FEATURE_IPV6 54#ifdef CONFIG_FEATURE_IPV6
56#define HAVE_AFINET6 1 55# define HAVE_AFINET6 1
56#else
57# undef HAVE_AFINET6
57#endif 58#endif
58 59
59/* 60/*
diff --git a/libbb/xconnect.c b/libbb/xconnect.c
index f3a1b4462..bc6505a40 100644
--- a/libbb/xconnect.c
+++ b/libbb/xconnect.c
@@ -17,7 +17,7 @@
17 17
18int xconnect(const char *host, const char *port) 18int xconnect(const char *host, const char *port)
19{ 19{
20#if CONFIG_FEATURE_IPV6 20#ifdef CONFIG_FEATURE_IPV6
21 struct addrinfo hints; 21 struct addrinfo hints;
22 struct addrinfo *res; 22 struct addrinfo *res;
23 struct addrinfo *addr_info; 23 struct addrinfo *addr_info;
diff --git a/networking/ifconfig.c b/networking/ifconfig.c
index 513f176d1..d0ee4c3a5 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.19 2002/08/22 18:22:10 bug1 Exp $ 18 * $Id: ifconfig.c,v 1.20 2002/11/26 09:02:05 bug1 Exp $
19 * 19 *
20 */ 20 */
21 21
@@ -46,7 +46,7 @@
46#include "busybox.h" 46#include "busybox.h"
47 47
48#ifdef CONFIG_FEATURE_IFCONFIG_SLIP 48#ifdef CONFIG_FEATURE_IFCONFIG_SLIP
49#include <linux/if_slip.h> 49# include <linux/if_slip.h>
50#endif 50#endif
51 51
52/* I don't know if this is needed for busybox or not. Anyone? */ 52/* I don't know if this is needed for busybox or not. Anyone? */
@@ -55,20 +55,20 @@
55 55
56/* Defines for glibc2.0 users. */ 56/* Defines for glibc2.0 users. */
57#ifndef SIOCSIFTXQLEN 57#ifndef SIOCSIFTXQLEN
58#define SIOCSIFTXQLEN 0x8943 58# define SIOCSIFTXQLEN 0x8943
59#define SIOCGIFTXQLEN 0x8942 59# define SIOCGIFTXQLEN 0x8942
60#endif 60#endif
61 61
62/* ifr_qlen is ifru_ivalue, but it isn't present in 2.0 kernel headers */ 62/* ifr_qlen is ifru_ivalue, but it isn't present in 2.0 kernel headers */
63#ifndef ifr_qlen 63#ifndef ifr_qlen
64#define ifr_qlen ifr_ifru.ifru_mtu 64# define ifr_qlen ifr_ifru.ifru_mtu
65#endif 65#endif
66 66
67#ifndef IFF_DYNAMIC 67#ifndef IFF_DYNAMIC
68#define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses */ 68# define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses */
69#endif 69#endif
70 70
71#if CONFIG_FEATURE_IPV6 71#ifdef CONFIG_FEATURE_IPV6
72struct in6_ifreq { 72struct in6_ifreq {
73 struct in6_addr ifr6_addr; 73 struct in6_addr ifr6_addr;
74 uint32_t ifr6_prefixlen; 74 uint32_t ifr6_prefixlen;
@@ -199,7 +199,7 @@ static const struct arg1opt Arg1Opt[] = {
199 {"SIOCSIFMAP", SIOCSIFMAP, ifreq_offsetof(ifr_map.irq)}, 199 {"SIOCSIFMAP", SIOCSIFMAP, ifreq_offsetof(ifr_map.irq)},
200#endif 200#endif
201 /* Last entry if for unmatched (possibly hostname) arg. */ 201 /* Last entry if for unmatched (possibly hostname) arg. */
202#if CONFIG_FEATURE_IPV6 202#ifdef CONFIG_FEATURE_IPV6
203 {"SIOCSIFADDR", SIOCSIFADDR, ifreq_offsetof(ifr_addr)}, /* IPv6 version ignores the offset */ 203 {"SIOCSIFADDR", SIOCSIFADDR, ifreq_offsetof(ifr_addr)}, /* IPv6 version ignores the offset */
204 {"SIOCDIFADDR", SIOCDIFADDR, ifreq_offsetof(ifr_addr)}, /* IPv6 version ignores the offset */ 204 {"SIOCDIFADDR", SIOCDIFADDR, ifreq_offsetof(ifr_addr)}, /* IPv6 version ignores the offset */
205#endif 205#endif
@@ -228,7 +228,7 @@ static const struct options OptArray[] = {
228 {"io_addr", N_ARG, ARG_IO_ADDR, 0}, 228 {"io_addr", N_ARG, ARG_IO_ADDR, 0},
229 {"irq", N_ARG, ARG_IRQ, 0}, 229 {"irq", N_ARG, ARG_IRQ, 0},
230#endif 230#endif
231#if CONFIG_FEATURE_IPV6 231#ifdef CONFIG_FEATURE_IPV6
232 {"add", N_ARG, ARG_ADD_DEL, 0}, 232 {"add", N_ARG, ARG_ADD_DEL, 0},
233 {"del", N_ARG, ARG_ADD_DEL, 0}, 233 {"del", N_ARG, ARG_ADD_DEL, 0},
234#endif 234#endif
@@ -265,7 +265,7 @@ int ifconfig_main(int argc, char **argv)
265 struct ifreq ifr; 265 struct ifreq ifr;
266 struct sockaddr_in sai; 266 struct sockaddr_in sai;
267 267
268#if CONFIG_FEATURE_IPV6 268#ifdef CONFIG_FEATURE_IPV6
269 struct sockaddr_in6 sai6; 269 struct sockaddr_in6 sai6;
270#endif 270#endif
271#ifdef CONFIG_FEATURE_IFCONFIG_HW 271#ifdef CONFIG_FEATURE_IFCONFIG_HW
@@ -359,13 +359,13 @@ int ifconfig_main(int argc, char **argv)
359#ifdef CONFIG_FEATURE_IFCONFIG_HW 359#ifdef CONFIG_FEATURE_IFCONFIG_HW
360 if (mask & A_CAST_RESOLVE) { 360 if (mask & A_CAST_RESOLVE) {
361#endif 361#endif
362#if CONFIG_FEATURE_IPV6 362#ifdef CONFIG_FEATURE_IPV6
363 char *prefix; 363 char *prefix;
364 int prefix_len = 0; 364 int prefix_len = 0;
365#endif 365#endif
366 366
367 safe_strncpy(host, *argv, (sizeof host)); 367 safe_strncpy(host, *argv, (sizeof host));
368#if CONFIG_FEATURE_IPV6 368#ifdef CONFIG_FEATURE_IPV6
369 if ((prefix = strchr(host, '/'))) { 369 if ((prefix = strchr(host, '/'))) {
370 prefix_len = atol(prefix + 1); 370 prefix_len = atol(prefix + 1);
371 if ((prefix_len < 0) || (prefix_len > 128)) { 371 if ((prefix_len < 0) || (prefix_len > 128)) {
@@ -381,7 +381,7 @@ int ifconfig_main(int argc, char **argv)
381 if (!strcmp(host, bb_INET_default)) { 381 if (!strcmp(host, bb_INET_default)) {
382 /* Default is special, meaning 0.0.0.0. */ 382 /* Default is special, meaning 0.0.0.0. */
383 sai.sin_addr.s_addr = INADDR_ANY; 383 sai.sin_addr.s_addr = INADDR_ANY;
384#if CONFIG_FEATURE_IPV6 384#ifdef CONFIG_FEATURE_IPV6
385 } else 385 } else
386 if (inet_pton(AF_INET6, host, &sai6.sin6_addr) > 386 if (inet_pton(AF_INET6, host, &sai6.sin6_addr) >
387 0) { 387 0) {
diff --git a/networking/netstat.c b/networking/netstat.c
index efca422ad..d2b2d5ede 100644
--- a/networking/netstat.c
+++ b/networking/netstat.c
@@ -627,19 +627,19 @@ int netstat_main(int argc, char **argv)
627 } 627 }
628 if (inet && flags&NETSTAT_TCP) 628 if (inet && flags&NETSTAT_TCP)
629 do_info(_PATH_PROCNET_TCP,"AF INET (tcp)",tcp_do_one); 629 do_info(_PATH_PROCNET_TCP,"AF INET (tcp)",tcp_do_one);
630#if CONFIG_FEATURE_IPV6 630#ifdef CONFIG_FEATURE_IPV6
631 if (inet6 && flags&NETSTAT_TCP) 631 if (inet6 && flags&NETSTAT_TCP)
632 do_info(_PATH_PROCNET_TCP6,"AF INET6 (tcp)",tcp_do_one); 632 do_info(_PATH_PROCNET_TCP6,"AF INET6 (tcp)",tcp_do_one);
633#endif 633#endif
634 if (inet && flags&NETSTAT_UDP) 634 if (inet && flags&NETSTAT_UDP)
635 do_info(_PATH_PROCNET_UDP,"AF INET (udp)",udp_do_one); 635 do_info(_PATH_PROCNET_UDP,"AF INET (udp)",udp_do_one);
636#if CONFIG_FEATURE_IPV6 636#ifdef CONFIG_FEATURE_IPV6
637 if (inet6 && flags&NETSTAT_UDP) 637 if (inet6 && flags&NETSTAT_UDP)
638 do_info(_PATH_PROCNET_UDP6,"AF INET6 (udp)",udp_do_one); 638 do_info(_PATH_PROCNET_UDP6,"AF INET6 (udp)",udp_do_one);
639#endif 639#endif
640 if (inet && flags&NETSTAT_RAW) 640 if (inet && flags&NETSTAT_RAW)
641 do_info(_PATH_PROCNET_RAW,"AF INET (raw)",raw_do_one); 641 do_info(_PATH_PROCNET_RAW,"AF INET (raw)",raw_do_one);
642#if CONFIG_FEATURE_IPV6 642#ifdef CONFIG_FEATURE_IPV6
643 if (inet6 && flags&NETSTAT_RAW) 643 if (inet6 && flags&NETSTAT_RAW)
644 do_info(_PATH_PROCNET_RAW6,"AF INET6 (raw)",raw_do_one); 644 do_info(_PATH_PROCNET_RAW6,"AF INET6 (raw)",raw_do_one);
645#endif 645#endif
diff --git a/networking/route.c b/networking/route.c
index 5c4ce8ca3..d4c65f8cd 100644
--- a/networking/route.c
+++ b/networking/route.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: route.c,v 1.18 2002/08/22 18:24:43 bug1 Exp $ 18 * $Id: route.c,v 1.19 2002/11/26 09:02:06 bug1 Exp $
19 * 19 *
20 * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru> 20 * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
21 * adjustments by Larry Doolittle <LRDoolittle@lbl.gov> 21 * adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
@@ -331,7 +331,7 @@ static int INET_setroute(int action, int options, char **args)
331 return EXIT_SUCCESS; 331 return EXIT_SUCCESS;
332} 332}
333 333
334#if CONFIG_FEATURE_IPV6 334#ifdef CONFIG_FEATURE_IPV6
335static int INET6_setroute(int action, int options, char **args) 335static int INET6_setroute(int action, int options, char **args)
336{ 336{
337 struct in6_rtmsg rt; 337 struct in6_rtmsg rt;
@@ -560,7 +560,7 @@ void displayroutes(int noresolve, int netstatfmt)
560 } 560 }
561} 561}
562 562
563#if CONFIG_FEATURE_IPV6 563#ifdef CONFIG_FEATURE_IPV6
564static void INET6_displayroutes(int noresolve) 564static void INET6_displayroutes(int noresolve)
565{ 565{
566 char buff[256]; 566 char buff[256];
@@ -651,7 +651,7 @@ int route_main(int argc, char **argv)
651 int opt; 651 int opt;
652 int what = 0; 652 int what = 0;
653 653
654#if CONFIG_FEATURE_IPV6 654#ifdef CONFIG_FEATURE_IPV6
655 int af = AF_INET; 655 int af = AF_INET;
656#endif 656#endif
657 657
@@ -669,7 +669,7 @@ int route_main(int argc, char **argv)
669 extended = 1; 669 extended = 1;
670 break; 670 break;
671 case 'A': 671 case 'A':
672#if CONFIG_FEATURE_IPV6 672#ifdef CONFIG_FEATURE_IPV6
673 if (strcmp(optarg, "inet6") == 0) 673 if (strcmp(optarg, "inet6") == 0)
674 af = AF_INET6; 674 af = AF_INET6;
675 break; 675 break;
@@ -679,7 +679,7 @@ int route_main(int argc, char **argv)
679 } 679 }
680 } 680 }
681 681
682#if CONFIG_FEATURE_IPV6 682#ifdef CONFIG_FEATURE_IPV6
683 if (af == AF_INET6) 683 if (af == AF_INET6)
684 INET6_displayroutes(*argv != NULL); 684 INET6_displayroutes(*argv != NULL);
685 else 685 else
@@ -699,7 +699,7 @@ int route_main(int argc, char **argv)
699 show_usage(); 699 show_usage();
700 } 700 }
701 701
702#if CONFIG_FEATURE_IPV6 702#ifdef CONFIG_FEATURE_IPV6
703 if (af == AF_INET6) 703 if (af == AF_INET6)
704 return INET6_setroute(what, 0, argv + 2); 704 return INET6_setroute(what, 0, argv + 2);
705#endif 705#endif