author | mickeyl <mickeyl> | 2003-03-30 13:52:20 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-03-30 13:52:20 (UTC) |
commit | 9e3dc048e171af6d88f0cc3f16ad0c9fb6a15ce2 (patch) (unidiff) | |
tree | 2d3bd9b940729878f96d5dc2f2ef9fd22478f3f0 | |
parent | 3065a1c13bec5d0b101bec48ff666d45a02ce8a6 (diff) | |
download | opie-9e3dc048e171af6d88f0cc3f16ad0c9fb6a15ce2.zip opie-9e3dc048e171af6d88f0cc3f16ad0c9fb6a15ce2.tar.gz opie-9e3dc048e171af6d88f0cc3f16ad0c9fb6a15ce2.tar.bz2 |
introduce a workaround for conflicting user and kernel headers like
<linux/if.h> and <net/if.h>. I really don't like including kernel headers,
but in the case of <linux/wireless.h> there is no other option yet.
-rw-r--r-- | libopie2/opienet/onetwork.cpp | 1 | ||||
-rw-r--r-- | libopie2/opienet/onetwork.h | 13 |
2 files changed, 8 insertions, 6 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp index 998b50e..21fa390 100644 --- a/libopie2/opienet/onetwork.cpp +++ b/libopie2/opienet/onetwork.cpp | |||
@@ -43,25 +43,24 @@ | |||
43 | /* UNIX */ | 43 | /* UNIX */ |
44 | 44 | ||
45 | #include <arpa/inet.h> | 45 | #include <arpa/inet.h> |
46 | #include <cerrno> | 46 | #include <cerrno> |
47 | #include <cstring> | 47 | #include <cstring> |
48 | #include <cstdlib> | 48 | #include <cstdlib> |
49 | #include <math.h> | 49 | #include <math.h> |
50 | #include <sys/ioctl.h> | 50 | #include <sys/ioctl.h> |
51 | #include <sys/socket.h> | 51 | #include <sys/socket.h> |
52 | #include <sys/types.h> | 52 | #include <sys/types.h> |
53 | #include <unistd.h> | 53 | #include <unistd.h> |
54 | #include <linux/sockios.h> | 54 | #include <linux/sockios.h> |
55 | #include <linux/wireless.h> | ||
56 | 55 | ||
57 | using namespace std; | 56 | using namespace std; |
58 | 57 | ||
59 | /*====================================================================================== | 58 | /*====================================================================================== |
60 | * ONetwork | 59 | * ONetwork |
61 | *======================================================================================*/ | 60 | *======================================================================================*/ |
62 | 61 | ||
63 | ONetwork* ONetwork::_instance = 0; | 62 | ONetwork* ONetwork::_instance = 0; |
64 | 63 | ||
65 | ONetwork::ONetwork() | 64 | ONetwork::ONetwork() |
66 | { | 65 | { |
67 | qDebug( "ONetwork::ONetwork()" ); | 66 | qDebug( "ONetwork::ONetwork()" ); |
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h index 56da5f4..c544454 100644 --- a/libopie2/opienet/onetwork.h +++ b/libopie2/opienet/onetwork.h | |||
@@ -36,34 +36,37 @@ | |||
36 | 36 | ||
37 | /* QT */ | 37 | /* QT */ |
38 | 38 | ||
39 | #include <qdict.h> | 39 | #include <qdict.h> |
40 | #include <qmap.h> | 40 | #include <qmap.h> |
41 | #include <qobject.h> | 41 | #include <qobject.h> |
42 | #include <qhostaddress.h> | 42 | #include <qhostaddress.h> |
43 | 43 | ||
44 | /* OPIE */ | 44 | /* OPIE */ |
45 | 45 | ||
46 | #include <opie2/onetutils.h> | 46 | #include <opie2/onetutils.h> |
47 | 47 | ||
48 | // ML: Yeah, I hate to include kernel headers, but it's necessary here | ||
49 | // ML: Recent RedHat and MandrakePatches to the Kernel and WE broke something | ||
50 | // ML: #include <net/if.h> e.g. conflicts with #include <linux/wireless.h> | ||
51 | |||
52 | #ifndef IFNAMSIZ | 48 | #ifndef IFNAMSIZ |
53 | #define IFNAMSIZ 16 | 49 | #define IFNAMSIZ 16 |
54 | #endif | 50 | #endif |
55 | 51 | ||
56 | #include <linux/wireless.h> | 52 | // ML: Yeah, I hate to include kernel headers, but it's necessary here |
53 | // ML: Here comes an ugly hack to prevent <linux/wireless.h> including <linux/if.h> | ||
54 | // ML: which conflicts with the user header <net/if.h> | ||
55 | // ML: We really a user header for the Wireless Extensions, something like <net/wireless.h> | ||
56 | // ML: I will drop Jean an mail on that subject | ||
57 | |||
57 | #include <net/if.h> | 58 | #include <net/if.h> |
59 | #define _LINUX_IF_H | ||
60 | #include <linux/wireless.h> | ||
58 | 61 | ||
59 | #ifndef SIOCIWFIRSTPRIV | 62 | #ifndef SIOCIWFIRSTPRIV |
60 | #define SIOCIWFIRSTPRIV SIOCDEVPRIVATE | 63 | #define SIOCIWFIRSTPRIV SIOCDEVPRIVATE |
61 | #endif | 64 | #endif |
62 | 65 | ||
63 | class ONetworkInterface; | 66 | class ONetworkInterface; |
64 | class OWirelessNetworkInterface; | 67 | class OWirelessNetworkInterface; |
65 | class OChannelHopper; | 68 | class OChannelHopper; |
66 | class OMonitoringInterface; | 69 | class OMonitoringInterface; |
67 | 70 | ||
68 | typedef struct ifreq ifreqstruct; | 71 | typedef struct ifreq ifreqstruct; |
69 | typedef struct iwreq iwreqstruct; | 72 | typedef struct iwreq iwreqstruct; |