-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 @@ -31,49 +31,48 @@ */ /* OPIE */ #include <opie2/onetwork.h> /* QT */ #include <qfile.h> #include <qtextstream.h> /* UNIX */ #include <arpa/inet.h> #include <cerrno> #include <cstring> #include <cstdlib> #include <math.h> #include <sys/ioctl.h> #include <sys/socket.h> #include <sys/types.h> #include <unistd.h> #include <linux/sockios.h> -#include <linux/wireless.h> using namespace std; /*====================================================================================== * ONetwork *======================================================================================*/ ONetwork* ONetwork::_instance = 0; ONetwork::ONetwork() { qDebug( "ONetwork::ONetwork()" ); synchronize(); } void ONetwork::synchronize() { // gather available interfaces by inspecting /proc/net/dev // we could use SIOCGIFCONF here, but we aren't interested in virtual (e.g. eth0:0) devices _interfaces.clear(); QString str; QFile f( "/proc/net/dev" ); bool hasFile = f.open( IO_ReadOnly ); 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 @@ -24,58 +24,61 @@ : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ONETWORK_H #define ONETWORK_H /* QT */ #include <qdict.h> #include <qmap.h> #include <qobject.h> #include <qhostaddress.h> /* OPIE */ #include <opie2/onetutils.h> -// ML: Yeah, I hate to include kernel headers, but it's necessary here -// ML: Recent RedHat and MandrakePatches to the Kernel and WE broke something -// ML: #include <net/if.h> e.g. conflicts with #include <linux/wireless.h> - #ifndef IFNAMSIZ #define IFNAMSIZ 16 #endif -#include <linux/wireless.h> +// ML: Yeah, I hate to include kernel headers, but it's necessary here +// ML: Here comes an ugly hack to prevent <linux/wireless.h> including <linux/if.h> +// ML: which conflicts with the user header <net/if.h> +// ML: We really a user header for the Wireless Extensions, something like <net/wireless.h> +// ML: I will drop Jean an mail on that subject + #include <net/if.h> +#define _LINUX_IF_H +#include <linux/wireless.h> #ifndef SIOCIWFIRSTPRIV #define SIOCIWFIRSTPRIV SIOCDEVPRIVATE #endif class ONetworkInterface; class OWirelessNetworkInterface; class OChannelHopper; class OMonitoringInterface; typedef struct ifreq ifreqstruct; typedef struct iwreq iwreqstruct; typedef struct iw_event iweventstruct; typedef struct iw_freq iwfreqstruct; typedef struct iw_priv_args iwprivargsstruct; typedef struct iw_range iwrangestruct; /*====================================================================================== * ONetwork *======================================================================================*/ class ONetwork : public QObject { Q_OBJECT |