aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2011-06-10 05:17:59 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-06-10 05:17:59 +0200
commitf533ec876716415ed0e6ba28d13dfb6263068e82 (patch)
tree30b5b8ddcad3d2673d76110b8a792a5cd1b3b067
parentd488f5e8dbdcd1f5f0ebb2ee9c1f2fb4a5374290 (diff)
downloadbusybox-w32-f533ec876716415ed0e6ba28d13dfb6263068e82.tar.gz
busybox-w32-f533ec876716415ed0e6ba28d13dfb6263068e82.tar.bz2
busybox-w32-f533ec876716415ed0e6ba28d13dfb6263068e82.zip
*: simplify Ethernet header includes
Signed-off-by: Dan Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--include/platform.h13
-rw-r--r--networking/ether-wake.c4
-rw-r--r--networking/ifconfig.c12
-rw-r--r--networking/ifplugd.c4
-rw-r--r--networking/interface.c9
-rw-r--r--networking/libiproute/ll_proto.c6
-rw-r--r--networking/udhcp/dhcpc.c10
-rw-r--r--networking/udhcp/packet.c13
-rw-r--r--networking/udhcp/socket.c11
-rw-r--r--networking/zcip.c4
10 files changed, 30 insertions, 56 deletions
diff --git a/include/platform.h b/include/platform.h
index 780568c2b..429220b0d 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -332,8 +332,8 @@ typedef unsigned smalluint;
332 332
333/* ---- Who misses what? ------------------------------------ */ 333/* ---- Who misses what? ------------------------------------ */
334 334
335/* Assume all these functions exist by default. Platforms where it is not 335/* Assume all these functions and header files exist by default.
336 * true will #undef them below. 336 * Platforms where it is not true will #undef them below.
337 */ 337 */
338#define HAVE_CLEARENV 1 338#define HAVE_CLEARENV 1
339#define HAVE_FDATASYNC 1 339#define HAVE_FDATASYNC 1
@@ -349,9 +349,14 @@ typedef unsigned smalluint;
349#define HAVE_STRSEP 1 349#define HAVE_STRSEP 1
350#define HAVE_STRSIGNAL 1 350#define HAVE_STRSIGNAL 1
351#define HAVE_VASPRINTF 1 351#define HAVE_VASPRINTF 1
352#define HAVE_XTABS 1
352#define HAVE_MNTENT_H 1 353#define HAVE_MNTENT_H 1
354#define HAVE_NET_ETHERNET_H 1
353#define HAVE_SYS_STATFS_H 1 355#define HAVE_SYS_STATFS_H 1
354#define HAVE_XTABS 1 356
357#if defined(__GLIBC__) && (__GLIBC__ < 2 || __GLIBC_MINOR__ < 1)
358# undef HAVE_NET_ETHERNET_H
359#endif
355 360
356#if defined(__dietlibc__) 361#if defined(__dietlibc__)
357# undef HAVE_STRCHRNUL 362# undef HAVE_STRCHRNUL
@@ -368,6 +373,7 @@ typedef unsigned smalluint;
368# undef HAVE_STRSEP 373# undef HAVE_STRSEP
369# undef HAVE_STRSIGNAL 374# undef HAVE_STRSIGNAL
370# undef HAVE_VASPRINTF 375# undef HAVE_VASPRINTF
376# undef HAVE_NET_ETHERNET_H
371#endif 377#endif
372 378
373#if defined(__FreeBSD__) 379#if defined(__FreeBSD__)
@@ -395,6 +401,7 @@ typedef unsigned smalluint;
395# undef HAVE_DPRINTF 401# undef HAVE_DPRINTF
396# undef HAVE_STPCPY 402# undef HAVE_STPCPY
397# undef HAVE_STRCHRNUL 403# undef HAVE_STRCHRNUL
404# undef HAVE_NET_ETHERNET_H
398#endif 405#endif
399 406
400/* 407/*
diff --git a/networking/ether-wake.c b/networking/ether-wake.c
index 260ba2463..6a88279f4 100644
--- a/networking/ether-wake.c
+++ b/networking/ether-wake.c
@@ -74,13 +74,11 @@
74//usage: "\n -i iface Interface to use (default eth0)" 74//usage: "\n -i iface Interface to use (default eth0)"
75//usage: "\n -p pass Append four or six byte password PW to the packet" 75//usage: "\n -p pass Append four or six byte password PW to the packet"
76 76
77#include "libbb.h"
77#include <netpacket/packet.h> 78#include <netpacket/packet.h>
78#include <net/ethernet.h>
79#include <netinet/ether.h> 79#include <netinet/ether.h>
80#include <linux/if.h> 80#include <linux/if.h>
81 81
82#include "libbb.h"
83
84/* Note: PF_INET, SOCK_DGRAM, IPPROTO_UDP would allow SIOCGIFHWADDR to 82/* Note: PF_INET, SOCK_DGRAM, IPPROTO_UDP would allow SIOCGIFHWADDR to
85 * work as non-root, but we need SOCK_PACKET to specify the Ethernet 83 * work as non-root, but we need SOCK_PACKET to specify the Ethernet
86 * destination address. 84 * destination address.
diff --git a/networking/ifconfig.c b/networking/ifconfig.c
index 2a56da561..b6604f5d1 100644
--- a/networking/ifconfig.c
+++ b/networking/ifconfig.c
@@ -46,18 +46,14 @@
46//usage: " [mem_start NN] [io_addr NN] [irq NN]\n") 46//usage: " [mem_start NN] [io_addr NN] [irq NN]\n")
47//usage: " [up|down] ..." 47//usage: " [up|down] ..."
48 48
49#include "libbb.h"
50#include "inet_common.h"
49#include <net/if.h> 51#include <net/if.h>
50#include <net/if_arp.h> 52#include <net/if_arp.h>
51#include <netinet/in.h> 53#include <netinet/in.h>
52#if defined(__GLIBC__) && __GLIBC__ >=2 && __GLIBC_MINOR__ >= 1 54#ifdef HAVE_NET_ETHERNET_H
53#include <netpacket/packet.h> 55# include <net/ethernet.h>
54#include <net/ethernet.h>
55#else
56#include <sys/types.h>
57#include <netinet/if_ether.h>
58#endif 56#endif
59#include "libbb.h"
60#include "inet_common.h"
61 57
62#if ENABLE_FEATURE_IFCONFIG_SLIP 58#if ENABLE_FEATURE_IFCONFIG_SLIP
63# include <net/if_slip.h> 59# include <net/if_slip.h>
diff --git a/networking/ifplugd.c b/networking/ifplugd.c
index 57d04e67b..d8358cdfd 100644
--- a/networking/ifplugd.c
+++ b/networking/ifplugd.c
@@ -37,7 +37,9 @@
37#include <linux/if.h> 37#include <linux/if.h>
38#include <linux/mii.h> 38#include <linux/mii.h>
39#include <linux/ethtool.h> 39#include <linux/ethtool.h>
40#include <net/ethernet.h> 40#ifdef HAVE_NET_ETHERNET_H
41# include <net/ethernet.h>
42#endif
41#include <linux/netlink.h> 43#include <linux/netlink.h>
42#include <linux/rtnetlink.h> 44#include <linux/rtnetlink.h>
43#include <linux/sockios.h> 45#include <linux/sockios.h>
diff --git a/networking/interface.c b/networking/interface.c
index bea54c180..79c322ec0 100644
--- a/networking/interface.c
+++ b/networking/interface.c
@@ -30,15 +30,14 @@
30 * 20001008 - Bernd Eckenfels, Patch from RH for setting mtu 30 * 20001008 - Bernd Eckenfels, Patch from RH for setting mtu
31 * (default AF was wrong) 31 * (default AF was wrong)
32 */ 32 */
33
34#include "libbb.h"
35#include "inet_common.h"
33#include <net/if.h> 36#include <net/if.h>
34#include <net/if_arp.h> 37#include <net/if_arp.h>
35#ifndef __UCLIBC__ 38#ifdef HAVE_NET_ETHERNET_H
36# include <net/ethernet.h> 39# include <net/ethernet.h>
37#else
38# include <linux/if_ether.h>
39#endif 40#endif
40#include "libbb.h"
41#include "inet_common.h"
42 41
43#if ENABLE_FEATURE_HWIB 42#if ENABLE_FEATURE_HWIB
44/* #include <linux/if_infiniband.h> */ 43/* #include <linux/if_infiniband.h> */
diff --git a/networking/libiproute/ll_proto.c b/networking/libiproute/ll_proto.c
index 04925ecf6..7aac8364d 100644
--- a/networking/libiproute/ll_proto.c
+++ b/networking/libiproute/ll_proto.c
@@ -12,11 +12,7 @@
12#include "rt_names.h" 12#include "rt_names.h"
13#include "utils.h" 13#include "utils.h"
14 14
15#if defined(__GLIBC__) && __GLIBC__ >=2 && __GLIBC_MINOR__ >= 1 15#include <netinet/if_ether.h>
16#include <net/ethernet.h>
17#else
18#include <linux/if_ether.h>
19#endif
20 16
21#if !ENABLE_WERROR 17#if !ENABLE_WERROR
22#warning de-bloat 18#warning de-bloat
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 5d3291b8c..4d755e6b8 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -25,14 +25,8 @@
25#include "dhcpd.h" 25#include "dhcpd.h"
26#include "dhcpc.h" 26#include "dhcpc.h"
27 27
28#include <asm/types.h> 28#include <netinet/if_ether.h>
29#if (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined(_NEWLIB_VERSION) 29#include <netpacket/packet.h>
30# include <netpacket/packet.h>
31# include <net/ethernet.h>
32#else
33# include <linux/if_packet.h>
34# include <linux/if_ether.h>
35#endif
36#include <linux/filter.h> 30#include <linux/filter.h>
37 31
38/* struct client_config_t client_config is in bb_common_bufsiz1 */ 32/* struct client_config_t client_config is in bb_common_bufsiz1 */
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c
index 2b7528cc7..66b42c5e1 100644
--- a/networking/udhcp/packet.c
+++ b/networking/udhcp/packet.c
@@ -6,18 +6,11 @@
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9#include <netinet/in.h>
10#if (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined _NEWLIB_VERSION
11# include <netpacket/packet.h>
12# include <net/ethernet.h>
13#else
14# include <asm/types.h>
15# include <linux/if_packet.h>
16# include <linux/if_ether.h>
17#endif
18
19#include "common.h" 9#include "common.h"
20#include "dhcpd.h" 10#include "dhcpd.h"
11#include <netinet/in.h>
12#include <netinet/if_ether.h>
13#include <netpacket/packet.h>
21 14
22void FAST_FUNC udhcp_init_header(struct dhcp_packet *packet, char type) 15void FAST_FUNC udhcp_init_header(struct dhcp_packet *packet, char type)
23{ 16{
diff --git a/networking/udhcp/socket.c b/networking/udhcp/socket.c
index 39f1cec54..a5220ba74 100644
--- a/networking/udhcp/socket.c
+++ b/networking/udhcp/socket.c
@@ -22,17 +22,8 @@
22 * along with this program; if not, write to the Free Software 22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */ 24 */
25#include <net/if.h>
26#if (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined _NEWLIB_VERSION
27# include <netpacket/packet.h>
28# include <net/ethernet.h>
29#else
30# include <asm/types.h>
31# include <linux/if_packet.h>
32# include <linux/if_ether.h>
33#endif
34
35#include "common.h" 25#include "common.h"
26#include <net/if.h>
36 27
37int FAST_FUNC udhcp_read_interface(const char *interface, int *ifindex, uint32_t *nip, uint8_t *mac) 28int FAST_FUNC udhcp_read_interface(const char *interface, int *ifindex, uint32_t *nip, uint8_t *mac)
38{ 29{
diff --git a/networking/zcip.c b/networking/zcip.c
index 6b7f2144f..8a35eca5d 100644
--- a/networking/zcip.c
+++ b/networking/zcip.c
@@ -35,14 +35,12 @@
35//usage: "\nWith no -q, runs continuously monitoring for ARP conflicts," 35//usage: "\nWith no -q, runs continuously monitoring for ARP conflicts,"
36//usage: "\nexits only on I/O errors (link down etc)" 36//usage: "\nexits only on I/O errors (link down etc)"
37 37
38#include "libbb.h"
38#include <netinet/ether.h> 39#include <netinet/ether.h>
39#include <net/ethernet.h>
40#include <net/if.h> 40#include <net/if.h>
41#include <net/if_arp.h> 41#include <net/if_arp.h>
42#include <linux/if_packet.h>
43#include <linux/sockios.h> 42#include <linux/sockios.h>
44 43
45#include "libbb.h"
46#include <syslog.h> 44#include <syslog.h>
47 45
48/* We don't need more than 32 bits of the counter */ 46/* We don't need more than 32 bits of the counter */