aboutsummaryrefslogtreecommitdiff
path: root/networking/interface.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-04-01 15:09:44 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-04-01 15:09:44 +0200
commit5342c3f3106b4afa2a76d3173f4827c4b8236da8 (patch)
treedacc6d57ae73220cf5d6db48f77911e8fb314c7c /networking/interface.c
parent345e093c2910e9e837de5b7cc5fb46752351f84d (diff)
downloadbusybox-w32-5342c3f3106b4afa2a76d3173f4827c4b8236da8.tar.gz
busybox-w32-5342c3f3106b4afa2a76d3173f4827c4b8236da8.tar.bz2
busybox-w32-5342c3f3106b4afa2a76d3173f4827c4b8236da8.zip
clean up redundant, commented-out and misplaced includes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/interface.c')
-rw-r--r--networking/interface.c42
1 files changed, 15 insertions, 27 deletions
diff --git a/networking/interface.c b/networking/interface.c
index 0d5a0f97d..b59a61de4 100644
--- a/networking/interface.c
+++ b/networking/interface.c
@@ -33,14 +33,18 @@
33 33
34#include <net/if.h> 34#include <net/if.h>
35#include <net/if_arp.h> 35#include <net/if_arp.h>
36#if (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined(_NEWLIB_VERSION)
37# include <net/ethernet.h>
38#else
39# include <linux/if_ether.h>
40#endif
36#include "libbb.h" 41#include "libbb.h"
37#include "inet_common.h" 42#include "inet_common.h"
38 43
39
40#if ENABLE_FEATURE_HWIB 44#if ENABLE_FEATURE_HWIB
41/* #include <linux/if_infiniband.h> */ 45/* #include <linux/if_infiniband.h> */
42#undef INFINIBAND_ALEN 46# undef INFINIBAND_ALEN
43#define INFINIBAND_ALEN 20 47# define INFINIBAND_ALEN 20
44#endif 48#endif
45 49
46#if ENABLE_FEATURE_IPV6 50#if ENABLE_FEATURE_IPV6
@@ -53,39 +57,35 @@
53#define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6" 57#define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6"
54 58
55#ifdef HAVE_AFINET6 59#ifdef HAVE_AFINET6
56 60# ifndef _LINUX_IN6_H
57#ifndef _LINUX_IN6_H
58/* 61/*
59 * This is in linux/include/net/ipv6.h. 62 * This is from linux/include/net/ipv6.h
60 */ 63 */
61
62struct in6_ifreq { 64struct in6_ifreq {
63 struct in6_addr ifr6_addr; 65 struct in6_addr ifr6_addr;
64 uint32_t ifr6_prefixlen; 66 uint32_t ifr6_prefixlen;
65 unsigned int ifr6_ifindex; 67 unsigned int ifr6_ifindex;
66}; 68};
67 69# endif
68#endif
69
70#endif /* HAVE_AFINET6 */ 70#endif /* HAVE_AFINET6 */
71 71
72/* Defines for glibc2.0 users. */ 72/* Defines for glibc2.0 users. */
73#ifndef SIOCSIFTXQLEN 73#ifndef SIOCSIFTXQLEN
74#define SIOCSIFTXQLEN 0x8943 74# define SIOCSIFTXQLEN 0x8943
75#define SIOCGIFTXQLEN 0x8942 75# define SIOCGIFTXQLEN 0x8942
76#endif 76#endif
77 77
78/* ifr_qlen is ifru_ivalue, but it isn't present in 2.0 kernel headers */ 78/* ifr_qlen is ifru_ivalue, but it isn't present in 2.0 kernel headers */
79#ifndef ifr_qlen 79#ifndef ifr_qlen
80#define ifr_qlen ifr_ifru.ifru_mtu 80# define ifr_qlen ifr_ifru.ifru_mtu
81#endif 81#endif
82 82
83#ifndef HAVE_TXQUEUELEN 83#ifndef HAVE_TXQUEUELEN
84#define HAVE_TXQUEUELEN 1 84# define HAVE_TXQUEUELEN 1
85#endif 85#endif
86 86
87#ifndef IFF_DYNAMIC 87#ifndef IFF_DYNAMIC
88#define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses */ 88# define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses */
89#endif 89#endif
90 90
91/* Display an Internet socket address. */ 91/* Display an Internet socket address. */
@@ -711,14 +711,6 @@ static const struct hwtype loop_hwtype = {
711 .type = ARPHRD_LOOPBACK 711 .type = ARPHRD_LOOPBACK
712}; 712};
713 713
714#include <net/if_arp.h>
715
716#if (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined(_NEWLIB_VERSION)
717#include <net/ethernet.h>
718#else
719#include <linux/if_ether.h>
720#endif
721
722/* Display an Ethernet address in readable format. */ 714/* Display an Ethernet address in readable format. */
723static char* FAST_FUNC ether_print(unsigned char *ptr) 715static char* FAST_FUNC ether_print(unsigned char *ptr)
724{ 716{
@@ -794,8 +786,6 @@ static int FAST_FUNC ether_input(const char *bufp, struct sockaddr *sap)
794 return 0; 786 return 0;
795} 787}
796 788
797#include <net/if_arp.h>
798
799static const struct hwtype ppp_hwtype = { 789static const struct hwtype ppp_hwtype = {
800 .name = "ppp", 790 .name = "ppp",
801 .title = "Point-to-Point Protocol", 791 .title = "Point-to-Point Protocol",
@@ -993,7 +983,6 @@ static void ife_print6(struct interface *ptr)
993#define ife_print6(a) ((void)0) 983#define ife_print6(a) ((void)0)
994#endif 984#endif
995 985
996
997static void ife_print(struct interface *ptr) 986static void ife_print(struct interface *ptr)
998{ 987{
999 const struct aftype *ap; 988 const struct aftype *ap;
@@ -1277,7 +1266,6 @@ int FAST_FUNC in_ib(const char *bufp, struct sockaddr *sap)
1277} 1266}
1278#endif 1267#endif
1279 1268
1280
1281int FAST_FUNC display_interfaces(char *ifname) 1269int FAST_FUNC display_interfaces(char *ifname)
1282{ 1270{
1283 int status; 1271 int status;