* 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 $
*
*/
#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? */
/* 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;
{"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
{"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
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
#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)) {
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) {
}
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
* 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>
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;
}
}
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
static void INET6_displayroutes(int noresolve)
{
char buff[256];
int opt;
int what = 0;
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
int af = AF_INET;
#endif
extended = 1;
break;
case 'A':
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
if (strcmp(optarg, "inet6") == 0)
af = AF_INET6;
break;
}
}
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
if (af == AF_INET6)
INET6_displayroutes(*argv != NULL);
else
show_usage();
}
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
if (af == AF_INET6)
return INET6_setroute(what, 0, argv + 2);
#endif