summaryrefslogtreecommitdiff
path: root/ethtool.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2011-05-04 11:41:40 -0700
committerBen Hutchings <bhutchings@solarflare.com>2011-05-13 01:04:58 +0100
commit8a7c0708b6fb7be245c21e9f6aabb0d8fd968a03 (patch)
tree688afc9d16112e07040948e5834d59fa9f933042 /ethtool.c
parent00b20bcd0d2ec976941783a160d9f3cb3ddfa361 (diff)
downloadethtool-8a7c0708b6fb7be245c21e9f6aabb0d8fd968a03.tar.gz
Cleanup defines and header includes to address several issues
This change is meant to address several issues. First it moves the check for ethtool-config.h into ethtool-util.h the reason for this change is so that any references to ethtool-util.h outside of ethtool.c will use the correct defines for the endian types. In addition I have pulled several headers that will be common to both ethtool.c and rxclass.c into the ethtool-util.h header file. I am also centralizing several macros that will be needed across multiple files when I implement the network flow classifier rules. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'ethtool.c')
-rw-r--r--ethtool.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/ethtool.c b/ethtool.c
index 9ad7000..24d4e4f 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -21,19 +21,12 @@
* * show settings for all devices
*/
-#ifdef HAVE_CONFIG_H
-# include "ethtool-config.h"
-#endif
-
-#include <sys/types.h>
+#include "ethtool-util.h"
#include <string.h>
#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
-#include <net/if.h>
#include <sys/utsname.h>
#include <limits.h>
#include <ctype.h>
@@ -43,18 +36,10 @@
#include <arpa/inet.h>
#include <linux/sockios.h>
-#include "ethtool-util.h"
-
-#ifndef SIOCETHTOOL
-#define SIOCETHTOOL 0x8946
-#endif
#ifndef MAX_ADDR_LEN
#define MAX_ADDR_LEN 32
#endif
-#ifndef ARRAY_SIZE
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-#endif
#ifndef HAVE_NETIF_MSG
enum {