use #ifdef CONFIG_* instead of #if CONFIG_*

This commit is contained in:
Glenn L McGrath 2002-11-26 09:02:06 +00:00
parent c5dced17c5
commit 8ae4cab4a8
5 changed files with 29 additions and 28 deletions

View File

@ -15,7 +15,7 @@
* that either displays or sets the characteristics of * that either displays or sets the characteristics of
* one or more of the system's networking interfaces. * one or more of the system's networking interfaces.
* *
* Version: $Id: interface.c,v 1.10 2002/09/17 06:36:02 andersen Exp $ * Version: $Id: interface.c,v 1.11 2002/11/26 09:02:04 bug1 Exp $
* *
* Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
* and others. Copyright 1993 MicroWalt Corporation * and others. Copyright 1993 MicroWalt Corporation
@ -44,7 +44,6 @@
* *
*/ */
#define HAVE_AFINET 1 #define HAVE_AFINET 1
#undef HAVE_AFINET6
#undef HAVE_AFIPX #undef HAVE_AFIPX
#undef HAVE_AFATALK #undef HAVE_AFATALK
#undef HAVE_AFNETROM #undef HAVE_AFNETROM
@ -52,8 +51,10 @@
#undef HAVE_AFECONET #undef HAVE_AFECONET
#undef HAVE_AFASH #undef HAVE_AFASH
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
#define HAVE_AFINET6 1 # define HAVE_AFINET6 1
#else
# undef HAVE_AFINET6
#endif #endif
/* /*

View File

@ -17,7 +17,7 @@
int xconnect(const char *host, const char *port) int xconnect(const char *host, const char *port)
{ {
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
struct addrinfo hints; struct addrinfo hints;
struct addrinfo *res; struct addrinfo *res;
struct addrinfo *addr_info; struct addrinfo *addr_info;

View File

@ -15,7 +15,7 @@
* Foundation; either version 2 of the License, or (at * Foundation; either version 2 of the License, or (at
* your option) any later version. * your option) any later version.
* *
* $Id: ifconfig.c,v 1.19 2002/08/22 18:22:10 bug1 Exp $ * $Id: ifconfig.c,v 1.20 2002/11/26 09:02:05 bug1 Exp $
* *
*/ */
@ -46,7 +46,7 @@
#include "busybox.h" #include "busybox.h"
#ifdef CONFIG_FEATURE_IFCONFIG_SLIP #ifdef CONFIG_FEATURE_IFCONFIG_SLIP
#include <linux/if_slip.h> # include <linux/if_slip.h>
#endif #endif
/* I don't know if this is needed for busybox or not. Anyone? */ /* I don't know if this is needed for busybox or not. Anyone? */
@ -55,20 +55,20 @@
/* Defines for glibc2.0 users. */ /* Defines for glibc2.0 users. */
#ifndef SIOCSIFTXQLEN #ifndef SIOCSIFTXQLEN
#define SIOCSIFTXQLEN 0x8943 # define SIOCSIFTXQLEN 0x8943
#define SIOCGIFTXQLEN 0x8942 # define SIOCGIFTXQLEN 0x8942
#endif #endif
/* ifr_qlen is ifru_ivalue, but it isn't present in 2.0 kernel headers */ /* ifr_qlen is ifru_ivalue, but it isn't present in 2.0 kernel headers */
#ifndef ifr_qlen #ifndef ifr_qlen
#define ifr_qlen ifr_ifru.ifru_mtu # define ifr_qlen ifr_ifru.ifru_mtu
#endif #endif
#ifndef IFF_DYNAMIC #ifndef IFF_DYNAMIC
#define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses */ # define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses */
#endif #endif
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
struct in6_ifreq { struct in6_ifreq {
struct in6_addr ifr6_addr; struct in6_addr ifr6_addr;
uint32_t ifr6_prefixlen; uint32_t ifr6_prefixlen;
@ -199,7 +199,7 @@ static const struct arg1opt Arg1Opt[] = {
{"SIOCSIFMAP", SIOCSIFMAP, ifreq_offsetof(ifr_map.irq)}, {"SIOCSIFMAP", SIOCSIFMAP, ifreq_offsetof(ifr_map.irq)},
#endif #endif
/* Last entry if for unmatched (possibly hostname) arg. */ /* Last entry if for unmatched (possibly hostname) arg. */
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
{"SIOCSIFADDR", SIOCSIFADDR, ifreq_offsetof(ifr_addr)}, /* IPv6 version ignores the offset */ {"SIOCSIFADDR", SIOCSIFADDR, ifreq_offsetof(ifr_addr)}, /* IPv6 version ignores the offset */
{"SIOCDIFADDR", SIOCDIFADDR, ifreq_offsetof(ifr_addr)}, /* IPv6 version ignores the offset */ {"SIOCDIFADDR", SIOCDIFADDR, ifreq_offsetof(ifr_addr)}, /* IPv6 version ignores the offset */
#endif #endif
@ -228,7 +228,7 @@ static const struct options OptArray[] = {
{"io_addr", N_ARG, ARG_IO_ADDR, 0}, {"io_addr", N_ARG, ARG_IO_ADDR, 0},
{"irq", N_ARG, ARG_IRQ, 0}, {"irq", N_ARG, ARG_IRQ, 0},
#endif #endif
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
{"add", N_ARG, ARG_ADD_DEL, 0}, {"add", N_ARG, ARG_ADD_DEL, 0},
{"del", N_ARG, ARG_ADD_DEL, 0}, {"del", N_ARG, ARG_ADD_DEL, 0},
#endif #endif
@ -265,7 +265,7 @@ int ifconfig_main(int argc, char **argv)
struct ifreq ifr; struct ifreq ifr;
struct sockaddr_in sai; struct sockaddr_in sai;
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
struct sockaddr_in6 sai6; struct sockaddr_in6 sai6;
#endif #endif
#ifdef CONFIG_FEATURE_IFCONFIG_HW #ifdef CONFIG_FEATURE_IFCONFIG_HW
@ -359,13 +359,13 @@ int ifconfig_main(int argc, char **argv)
#ifdef CONFIG_FEATURE_IFCONFIG_HW #ifdef CONFIG_FEATURE_IFCONFIG_HW
if (mask & A_CAST_RESOLVE) { if (mask & A_CAST_RESOLVE) {
#endif #endif
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
char *prefix; char *prefix;
int prefix_len = 0; int prefix_len = 0;
#endif #endif
safe_strncpy(host, *argv, (sizeof host)); safe_strncpy(host, *argv, (sizeof host));
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
if ((prefix = strchr(host, '/'))) { if ((prefix = strchr(host, '/'))) {
prefix_len = atol(prefix + 1); prefix_len = atol(prefix + 1);
if ((prefix_len < 0) || (prefix_len > 128)) { if ((prefix_len < 0) || (prefix_len > 128)) {
@ -381,7 +381,7 @@ int ifconfig_main(int argc, char **argv)
if (!strcmp(host, bb_INET_default)) { if (!strcmp(host, bb_INET_default)) {
/* Default is special, meaning 0.0.0.0. */ /* Default is special, meaning 0.0.0.0. */
sai.sin_addr.s_addr = INADDR_ANY; sai.sin_addr.s_addr = INADDR_ANY;
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
} else } else
if (inet_pton(AF_INET6, host, &sai6.sin6_addr) > if (inet_pton(AF_INET6, host, &sai6.sin6_addr) >
0) { 0) {

View File

@ -627,19 +627,19 @@ int netstat_main(int argc, char **argv)
} }
if (inet && flags&NETSTAT_TCP) if (inet && flags&NETSTAT_TCP)
do_info(_PATH_PROCNET_TCP,"AF INET (tcp)",tcp_do_one); do_info(_PATH_PROCNET_TCP,"AF INET (tcp)",tcp_do_one);
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
if (inet6 && flags&NETSTAT_TCP) if (inet6 && flags&NETSTAT_TCP)
do_info(_PATH_PROCNET_TCP6,"AF INET6 (tcp)",tcp_do_one); do_info(_PATH_PROCNET_TCP6,"AF INET6 (tcp)",tcp_do_one);
#endif #endif
if (inet && flags&NETSTAT_UDP) if (inet && flags&NETSTAT_UDP)
do_info(_PATH_PROCNET_UDP,"AF INET (udp)",udp_do_one); do_info(_PATH_PROCNET_UDP,"AF INET (udp)",udp_do_one);
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
if (inet6 && flags&NETSTAT_UDP) if (inet6 && flags&NETSTAT_UDP)
do_info(_PATH_PROCNET_UDP6,"AF INET6 (udp)",udp_do_one); do_info(_PATH_PROCNET_UDP6,"AF INET6 (udp)",udp_do_one);
#endif #endif
if (inet && flags&NETSTAT_RAW) if (inet && flags&NETSTAT_RAW)
do_info(_PATH_PROCNET_RAW,"AF INET (raw)",raw_do_one); do_info(_PATH_PROCNET_RAW,"AF INET (raw)",raw_do_one);
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
if (inet6 && flags&NETSTAT_RAW) if (inet6 && flags&NETSTAT_RAW)
do_info(_PATH_PROCNET_RAW6,"AF INET6 (raw)",raw_do_one); do_info(_PATH_PROCNET_RAW6,"AF INET6 (raw)",raw_do_one);
#endif #endif

View File

@ -15,7 +15,7 @@
* Foundation; either version 2 of the License, or (at * Foundation; either version 2 of the License, or (at
* your option) any later version. * your option) any later version.
* *
* $Id: route.c,v 1.18 2002/08/22 18:24:43 bug1 Exp $ * $Id: route.c,v 1.19 2002/11/26 09:02:06 bug1 Exp $
* *
* displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru> * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
* adjustments by Larry Doolittle <LRDoolittle@lbl.gov> * adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
@ -331,7 +331,7 @@ static int INET_setroute(int action, int options, char **args)
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
static int INET6_setroute(int action, int options, char **args) static int INET6_setroute(int action, int options, char **args)
{ {
struct in6_rtmsg rt; struct in6_rtmsg rt;
@ -560,7 +560,7 @@ void displayroutes(int noresolve, int netstatfmt)
} }
} }
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
static void INET6_displayroutes(int noresolve) static void INET6_displayroutes(int noresolve)
{ {
char buff[256]; char buff[256];
@ -651,7 +651,7 @@ int route_main(int argc, char **argv)
int opt; int opt;
int what = 0; int what = 0;
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
int af = AF_INET; int af = AF_INET;
#endif #endif
@ -669,7 +669,7 @@ int route_main(int argc, char **argv)
extended = 1; extended = 1;
break; break;
case 'A': case 'A':
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
if (strcmp(optarg, "inet6") == 0) if (strcmp(optarg, "inet6") == 0)
af = AF_INET6; af = AF_INET6;
break; break;
@ -679,7 +679,7 @@ int route_main(int argc, char **argv)
} }
} }
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
if (af == AF_INET6) if (af == AF_INET6)
INET6_displayroutes(*argv != NULL); INET6_displayroutes(*argv != NULL);
else else
@ -699,7 +699,7 @@ int route_main(int argc, char **argv)
show_usage(); show_usage();
} }
#if CONFIG_FEATURE_IPV6 #ifdef CONFIG_FEATURE_IPV6
if (af == AF_INET6) if (af == AF_INET6)
return INET6_setroute(what, 0, argv + 2); return INET6_setroute(what, 0, argv + 2);
#endif #endif