use #ifdef CONFIG_* instead of #if CONFIG_*
This commit is contained in:
parent
c5dced17c5
commit
8ae4cab4a8
@ -15,7 +15,7 @@
|
||||
* that either displays or sets the characteristics of
|
||||
* 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>
|
||||
* and others. Copyright 1993 MicroWalt Corporation
|
||||
@ -44,7 +44,6 @@
|
||||
*
|
||||
*/
|
||||
#define HAVE_AFINET 1
|
||||
#undef HAVE_AFINET6
|
||||
#undef HAVE_AFIPX
|
||||
#undef HAVE_AFATALK
|
||||
#undef HAVE_AFNETROM
|
||||
@ -52,8 +51,10 @@
|
||||
#undef HAVE_AFECONET
|
||||
#undef HAVE_AFASH
|
||||
|
||||
#if CONFIG_FEATURE_IPV6
|
||||
#define HAVE_AFINET6 1
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
# define HAVE_AFINET6 1
|
||||
#else
|
||||
# undef HAVE_AFINET6
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
int xconnect(const char *host, const char *port)
|
||||
{
|
||||
#if CONFIG_FEATURE_IPV6
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
struct addrinfo hints;
|
||||
struct addrinfo *res;
|
||||
struct addrinfo *addr_info;
|
||||
|
@ -15,7 +15,7 @@
|
||||
* Foundation; either version 2 of the License, or (at
|
||||
* 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"
|
||||
|
||||
#ifdef CONFIG_FEATURE_IFCONFIG_SLIP
|
||||
#include <linux/if_slip.h>
|
||||
# include <linux/if_slip.h>
|
||||
#endif
|
||||
|
||||
/* I don't know if this is needed for busybox or not. Anyone? */
|
||||
@ -55,20 +55,20 @@
|
||||
|
||||
/* Defines for glibc2.0 users. */
|
||||
#ifndef SIOCSIFTXQLEN
|
||||
#define SIOCSIFTXQLEN 0x8943
|
||||
#define SIOCGIFTXQLEN 0x8942
|
||||
# define SIOCSIFTXQLEN 0x8943
|
||||
# define SIOCGIFTXQLEN 0x8942
|
||||
#endif
|
||||
|
||||
/* ifr_qlen is ifru_ivalue, but it isn't present in 2.0 kernel headers */
|
||||
#ifndef ifr_qlen
|
||||
#define ifr_qlen ifr_ifru.ifru_mtu
|
||||
# define ifr_qlen ifr_ifru.ifru_mtu
|
||||
#endif
|
||||
|
||||
#ifndef IFF_DYNAMIC
|
||||
#define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses */
|
||||
# define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses */
|
||||
#endif
|
||||
|
||||
#if CONFIG_FEATURE_IPV6
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
struct in6_ifreq {
|
||||
struct in6_addr ifr6_addr;
|
||||
uint32_t ifr6_prefixlen;
|
||||
@ -199,7 +199,7 @@ static const struct arg1opt Arg1Opt[] = {
|
||||
{"SIOCSIFMAP", SIOCSIFMAP, ifreq_offsetof(ifr_map.irq)},
|
||||
#endif
|
||||
/* 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 */
|
||||
{"SIOCDIFADDR", SIOCDIFADDR, ifreq_offsetof(ifr_addr)}, /* IPv6 version ignores the offset */
|
||||
#endif
|
||||
@ -228,7 +228,7 @@ static const struct options OptArray[] = {
|
||||
{"io_addr", N_ARG, ARG_IO_ADDR, 0},
|
||||
{"irq", N_ARG, ARG_IRQ, 0},
|
||||
#endif
|
||||
#if CONFIG_FEATURE_IPV6
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
{"add", N_ARG, ARG_ADD_DEL, 0},
|
||||
{"del", N_ARG, ARG_ADD_DEL, 0},
|
||||
#endif
|
||||
@ -265,7 +265,7 @@ int ifconfig_main(int argc, char **argv)
|
||||
struct ifreq ifr;
|
||||
struct sockaddr_in sai;
|
||||
|
||||
#if CONFIG_FEATURE_IPV6
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
struct sockaddr_in6 sai6;
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_IFCONFIG_HW
|
||||
@ -359,13 +359,13 @@ int ifconfig_main(int argc, char **argv)
|
||||
#ifdef CONFIG_FEATURE_IFCONFIG_HW
|
||||
if (mask & A_CAST_RESOLVE) {
|
||||
#endif
|
||||
#if CONFIG_FEATURE_IPV6
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
char *prefix;
|
||||
int prefix_len = 0;
|
||||
#endif
|
||||
|
||||
safe_strncpy(host, *argv, (sizeof host));
|
||||
#if CONFIG_FEATURE_IPV6
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
if ((prefix = strchr(host, '/'))) {
|
||||
prefix_len = atol(prefix + 1);
|
||||
if ((prefix_len < 0) || (prefix_len > 128)) {
|
||||
@ -381,7 +381,7 @@ int ifconfig_main(int argc, char **argv)
|
||||
if (!strcmp(host, bb_INET_default)) {
|
||||
/* Default is special, meaning 0.0.0.0. */
|
||||
sai.sin_addr.s_addr = INADDR_ANY;
|
||||
#if CONFIG_FEATURE_IPV6
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
} else
|
||||
if (inet_pton(AF_INET6, host, &sai6.sin6_addr) >
|
||||
0) {
|
||||
|
@ -627,19 +627,19 @@ int netstat_main(int argc, char **argv)
|
||||
}
|
||||
if (inet && flags&NETSTAT_TCP)
|
||||
do_info(_PATH_PROCNET_TCP,"AF INET (tcp)",tcp_do_one);
|
||||
#if CONFIG_FEATURE_IPV6
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
if (inet6 && flags&NETSTAT_TCP)
|
||||
do_info(_PATH_PROCNET_TCP6,"AF INET6 (tcp)",tcp_do_one);
|
||||
#endif
|
||||
if (inet && flags&NETSTAT_UDP)
|
||||
do_info(_PATH_PROCNET_UDP,"AF INET (udp)",udp_do_one);
|
||||
#if CONFIG_FEATURE_IPV6
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
if (inet6 && flags&NETSTAT_UDP)
|
||||
do_info(_PATH_PROCNET_UDP6,"AF INET6 (udp)",udp_do_one);
|
||||
#endif
|
||||
if (inet && flags&NETSTAT_RAW)
|
||||
do_info(_PATH_PROCNET_RAW,"AF INET (raw)",raw_do_one);
|
||||
#if CONFIG_FEATURE_IPV6
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
if (inet6 && flags&NETSTAT_RAW)
|
||||
do_info(_PATH_PROCNET_RAW6,"AF INET6 (raw)",raw_do_one);
|
||||
#endif
|
||||
|
@ -15,7 +15,7 @@
|
||||
* Foundation; either version 2 of the License, or (at
|
||||
* 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>
|
||||
* adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
|
||||
@ -331,7 +331,7 @@ static int INET_setroute(int action, int options, char **args)
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
#if CONFIG_FEATURE_IPV6
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
static int INET6_setroute(int action, int options, char **args)
|
||||
{
|
||||
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)
|
||||
{
|
||||
char buff[256];
|
||||
@ -651,7 +651,7 @@ int route_main(int argc, char **argv)
|
||||
int opt;
|
||||
int what = 0;
|
||||
|
||||
#if CONFIG_FEATURE_IPV6
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
int af = AF_INET;
|
||||
#endif
|
||||
|
||||
@ -669,7 +669,7 @@ int route_main(int argc, char **argv)
|
||||
extended = 1;
|
||||
break;
|
||||
case 'A':
|
||||
#if CONFIG_FEATURE_IPV6
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
if (strcmp(optarg, "inet6") == 0)
|
||||
af = AF_INET6;
|
||||
break;
|
||||
@ -679,7 +679,7 @@ int route_main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_FEATURE_IPV6
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
if (af == AF_INET6)
|
||||
INET6_displayroutes(*argv != NULL);
|
||||
else
|
||||
@ -699,7 +699,7 @@ int route_main(int argc, char **argv)
|
||||
show_usage();
|
||||
}
|
||||
|
||||
#if CONFIG_FEATURE_IPV6
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
if (af == AF_INET6)
|
||||
return INET6_setroute(what, 0, argv + 2);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user