-rw-r--r-- | libopie2/opienet/onetwork.cpp | 3 | ||||
-rw-r--r-- | libopie2/opienet/onetwork.h | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp index 25c70e0..998b50e 100644 --- a/libopie2/opienet/onetwork.cpp +++ b/libopie2/opienet/onetwork.cpp | |||
@@ -42,24 +42,25 @@ | |||
42 | 42 | ||
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/wireless.h> | 55 | #include <linux/wireless.h> |
55 | 56 | ||
56 | using namespace std; | 57 | using namespace std; |
57 | 58 | ||
58 | /*====================================================================================== | 59 | /*====================================================================================== |
59 | * ONetwork | 60 | * ONetwork |
60 | *======================================================================================*/ | 61 | *======================================================================================*/ |
61 | 62 | ||
62 | ONetwork* ONetwork::_instance = 0; | 63 | ONetwork* ONetwork::_instance = 0; |
63 | 64 | ||
64 | ONetwork::ONetwork() | 65 | ONetwork::ONetwork() |
65 | { | 66 | { |
@@ -716,25 +717,25 @@ OHostAPMonitoringInterface::~OHostAPMonitoringInterface() | |||
716 | { | 717 | { |
717 | } | 718 | } |
718 | 719 | ||
719 | void OHostAPMonitoringInterface::setEnabled( bool b ) | 720 | void OHostAPMonitoringInterface::setEnabled( bool b ) |
720 | { | 721 | { |
721 | // IW_MODE_MONITOR was introduced in Wireless Extensions Version 15 | 722 | // IW_MODE_MONITOR was introduced in Wireless Extensions Version 15 |
722 | // Wireless Extensions < Version 15 need iwpriv commandos for monitoring | 723 | // Wireless Extensions < Version 15 need iwpriv commandos for monitoring |
723 | 724 | ||
724 | #if WIRELESS_EXT > 14 | 725 | #if WIRELESS_EXT > 14 |
725 | _if->_iwr.u.mode = IW_MODE_MONITOR; | 726 | _if->_iwr.u.mode = IW_MODE_MONITOR; |
726 | _if->wioctl( SIOCSIWMODE ); | 727 | _if->wioctl( SIOCSIWMODE ); |
727 | #else | 728 | #else |
728 | int* args = (int*) &_if._iwr.u.name; | 729 | int* args = (int*) &_if->_iwr.u.name; |
729 | args[0] = 2; | 730 | args[0] = 2; |
730 | args[1] = 0; | 731 | args[1] = 0; |
731 | _if->wioctl( SIOCDEVPRIVATE ); | 732 | _if->wioctl( SIOCDEVPRIVATE ); |
732 | #endif | 733 | #endif |
733 | 734 | ||
734 | OMonitoringInterface::setEnabled( b ); | 735 | OMonitoringInterface::setEnabled( b ); |
735 | } | 736 | } |
736 | 737 | ||
737 | 738 | ||
738 | QString OHostAPMonitoringInterface::name() const | 739 | QString OHostAPMonitoringInterface::name() const |
739 | { | 740 | { |
740 | return "hostap"; | 741 | return "hostap"; |
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h index 936ac85..56da5f4 100644 --- a/libopie2/opienet/onetwork.h +++ b/libopie2/opienet/onetwork.h | |||
@@ -39,28 +39,36 @@ | |||
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 | 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 | 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> | 50 | // ML: #include <net/if.h> e.g. conflicts with #include <linux/wireless.h> |
51 | |||
52 | #ifndef IFNAMSIZ | ||
51 | #define IFNAMSIZ 16 | 53 | #define IFNAMSIZ 16 |
54 | #endif | ||
55 | |||
52 | #include <linux/wireless.h> | 56 | #include <linux/wireless.h> |
53 | #include <net/if.h> | 57 | #include <net/if.h> |
54 | 58 | ||
59 | #ifndef SIOCIWFIRSTPRIV | ||
60 | #define SIOCIWFIRSTPRIV SIOCDEVPRIVATE | ||
61 | #endif | ||
62 | |||
55 | class ONetworkInterface; | 63 | class ONetworkInterface; |
56 | class OWirelessNetworkInterface; | 64 | class OWirelessNetworkInterface; |
57 | class OChannelHopper; | 65 | class OChannelHopper; |
58 | class OMonitoringInterface; | 66 | class OMonitoringInterface; |
59 | 67 | ||
60 | typedef struct ifreq ifreqstruct; | 68 | typedef struct ifreq ifreqstruct; |
61 | typedef struct iwreq iwreqstruct; | 69 | typedef struct iwreq iwreqstruct; |
62 | typedef struct iw_event iweventstruct; | 70 | typedef struct iw_event iweventstruct; |
63 | typedef struct iw_freq iwfreqstruct; | 71 | typedef struct iw_freq iwfreqstruct; |
64 | typedef struct iw_priv_args iwprivargsstruct; | 72 | typedef struct iw_priv_args iwprivargsstruct; |
65 | typedef struct iw_range iwrangestruct; | 73 | typedef struct iw_range iwrangestruct; |
66 | 74 | ||