summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDan Fandrich2011-06-10 05:17:59 +0200
committerDenys Vlasenko2011-06-10 05:17:59 +0200
commitf533ec876716415ed0e6ba28d13dfb6263068e82 (patch)
tree30b5b8ddcad3d2673d76110b8a792a5cd1b3b067 /networking
parentd488f5e8dbdcd1f5f0ebb2ee9c1f2fb4a5374290 (diff)
downloadbusybox-f533ec876716415ed0e6ba28d13dfb6263068e82.zip
busybox-f533ec876716415ed0e6ba28d13dfb6263068e82.tar.gz
*: simplify Ethernet header includes
Signed-off-by: Dan Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-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
9 files changed, 20 insertions, 53 deletions
diff --git a/networking/ether-wake.c b/networking/ether-wake.c
index 260ba24..6a88279 100644
--- a/networking/ether-wake.c
+++ b/networking/ether-wake.c
@@ -74,13 +74,11 @@
//usage: "\n -i iface Interface to use (default eth0)"
//usage: "\n -p pass Append four or six byte password PW to the packet"
+#include "libbb.h"
#include <netpacket/packet.h>
-#include <net/ethernet.h>
#include <netinet/ether.h>
#include <linux/if.h>
-#include "libbb.h"
-
/* Note: PF_INET, SOCK_DGRAM, IPPROTO_UDP would allow SIOCGIFHWADDR to
* work as non-root, but we need SOCK_PACKET to specify the Ethernet
* destination address.
diff --git a/networking/ifconfig.c b/networking/ifconfig.c
index 2a56da5..b6604f5 100644
--- a/networking/ifconfig.c
+++ b/networking/ifconfig.c
@@ -46,18 +46,14 @@
//usage: " [mem_start NN] [io_addr NN] [irq NN]\n")
//usage: " [up|down] ..."
+#include "libbb.h"
+#include "inet_common.h"
#include <net/if.h>
#include <net/if_arp.h>
#include <netinet/in.h>
-#if defined(__GLIBC__) && __GLIBC__ >=2 && __GLIBC_MINOR__ >= 1
-#include <netpacket/packet.h>
-#include <net/ethernet.h>
-#else
-#include <sys/types.h>
-#include <netinet/if_ether.h>
+#ifdef HAVE_NET_ETHERNET_H
+# include <net/ethernet.h>
#endif
-#include "libbb.h"
-#include "inet_common.h"
#if ENABLE_FEATURE_IFCONFIG_SLIP
# include <net/if_slip.h>
diff --git a/networking/ifplugd.c b/networking/ifplugd.c
index 57d04e6..d8358cd 100644
--- a/networking/ifplugd.c
+++ b/networking/ifplugd.c
@@ -37,7 +37,9 @@
#include <linux/if.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
-#include <net/ethernet.h>
+#ifdef HAVE_NET_ETHERNET_H
+# include <net/ethernet.h>
+#endif
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/sockios.h>
diff --git a/networking/interface.c b/networking/interface.c
index bea54c1..79c322e 100644
--- a/networking/interface.c
+++ b/networking/interface.c
@@ -30,15 +30,14 @@
* 20001008 - Bernd Eckenfels, Patch from RH for setting mtu
* (default AF was wrong)
*/
+
+#include "libbb.h"
+#include "inet_common.h"
#include <net/if.h>
#include <net/if_arp.h>
-#ifndef __UCLIBC__
+#ifdef HAVE_NET_ETHERNET_H
# include <net/ethernet.h>
-#else
-# include <linux/if_ether.h>
#endif
-#include "libbb.h"
-#include "inet_common.h"
#if ENABLE_FEATURE_HWIB
/* #include <linux/if_infiniband.h> */
diff --git a/networking/libiproute/ll_proto.c b/networking/libiproute/ll_proto.c
index 04925ec..7aac836 100644
--- a/networking/libiproute/ll_proto.c
+++ b/networking/libiproute/ll_proto.c
@@ -12,11 +12,7 @@
#include "rt_names.h"
#include "utils.h"
-#if defined(__GLIBC__) && __GLIBC__ >=2 && __GLIBC_MINOR__ >= 1
-#include <net/ethernet.h>
-#else
-#include <linux/if_ether.h>
-#endif
+#include <netinet/if_ether.h>
#if !ENABLE_WERROR
#warning de-bloat
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 5d3291b..4d755e6 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -25,14 +25,8 @@
#include "dhcpd.h"
#include "dhcpc.h"
-#include <asm/types.h>
-#if (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined(_NEWLIB_VERSION)
-# include <netpacket/packet.h>
-# include <net/ethernet.h>
-#else
-# include <linux/if_packet.h>
-# include <linux/if_ether.h>
-#endif
+#include <netinet/if_ether.h>
+#include <netpacket/packet.h>
#include <linux/filter.h>
/* struct client_config_t client_config is in bb_common_bufsiz1 */
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c
index 2b7528c..66b42c5 100644
--- a/networking/udhcp/packet.c
+++ b/networking/udhcp/packet.c
@@ -6,18 +6,11 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
-#include <netinet/in.h>
-#if (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined _NEWLIB_VERSION
-# include <netpacket/packet.h>
-# include <net/ethernet.h>
-#else
-# include <asm/types.h>
-# include <linux/if_packet.h>
-# include <linux/if_ether.h>
-#endif
-
#include "common.h"
#include "dhcpd.h"
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#include <netpacket/packet.h>
void FAST_FUNC udhcp_init_header(struct dhcp_packet *packet, char type)
{
diff --git a/networking/udhcp/socket.c b/networking/udhcp/socket.c
index 39f1cec..a5220ba 100644
--- a/networking/udhcp/socket.c
+++ b/networking/udhcp/socket.c
@@ -22,17 +22,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <net/if.h>
-#if (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1) || defined _NEWLIB_VERSION
-# include <netpacket/packet.h>
-# include <net/ethernet.h>
-#else
-# include <asm/types.h>
-# include <linux/if_packet.h>
-# include <linux/if_ether.h>
-#endif
-
#include "common.h"
+#include <net/if.h>
int FAST_FUNC udhcp_read_interface(const char *interface, int *ifindex, uint32_t *nip, uint8_t *mac)
{
diff --git a/networking/zcip.c b/networking/zcip.c
index 6b7f214..8a35eca 100644
--- a/networking/zcip.c
+++ b/networking/zcip.c
@@ -35,14 +35,12 @@
//usage: "\nWith no -q, runs continuously monitoring for ARP conflicts,"
//usage: "\nexits only on I/O errors (link down etc)"
+#include "libbb.h"
#include <netinet/ether.h>
-#include <net/ethernet.h>
#include <net/if.h>
#include <net/if_arp.h>
-#include <linux/if_packet.h>
#include <linux/sockios.h>
-#include "libbb.h"
#include <syslog.h>
/* We don't need more than 32 bits of the counter */