-rw-r--r-- | libopie2/opienet/onetwork.h | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h index a49c8fb..057b1a0 100644 --- a/libopie2/opienet/onetwork.h +++ b/libopie2/opienet/onetwork.h | |||
@@ -10,83 +10,70 @@ | |||
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | 28 | ||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #ifndef ONETWORK_H | 31 | #ifndef ONETWORK_H |
32 | #define ONETWORK_H | 32 | #define ONETWORK_H |
33 | 33 | ||
34 | #if !defined( OPIE_WE_VERSION ) | ||
35 | #warning No wireless extension specified; autodetecting... | ||
36 | #include <linux/version.h> | ||
37 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23) | ||
38 | #define OPIE_WE_VERSION 15 | ||
39 | #else | ||
40 | #define OPIE_WE_VERSION 16 | ||
41 | #endif // LINUX_VERSION_CODE < KERNEL_VERSION(2.4.23) | ||
42 | #endif // !defined( OPIE_WE_VERSION ) | ||
43 | |||
44 | #if OPIE_WE_VERSION == 15 | ||
45 | #include "wireless.15.h" | ||
46 | #warning Using WE V15 | ||
47 | #endif | ||
48 | #if OPIE_WE_VERSION == 16 | ||
49 | #include "wireless.16.h" | ||
50 | #warning Using WE V16 | ||
51 | #endif | ||
52 | |||
53 | /* OPIE */ | 34 | /* OPIE */ |
54 | |||
55 | #include <opie2/onetutils.h> | 35 | #include <opie2/onetutils.h> |
56 | #include <opie2/ostation.h> | 36 | #include <opie2/ostation.h> |
57 | 37 | ||
58 | /* QT */ | 38 | /* QT */ |
59 | |||
60 | #include <qvaluelist.h> | 39 | #include <qvaluelist.h> |
61 | #include <qdict.h> | 40 | #include <qdict.h> |
62 | #include <qmap.h> | 41 | #include <qmap.h> |
63 | #include <qobject.h> | 42 | #include <qobject.h> |
64 | #include <qhostaddress.h> | 43 | #include <qhostaddress.h> |
65 | 44 | ||
45 | /* STD */ | ||
46 | // hacky workaround until we have a user space wireless.h | ||
47 | #include <net/if.h> | ||
48 | #define _LINUX_IF_H | ||
49 | #include <linux/wireless.h> | ||
50 | #ifndef IW_MAX_PRIV_DEF | ||
51 | #define IW_MAX_PRIV_DEF 128 | ||
52 | #endif | ||
53 | |||
66 | namespace Opie { | 54 | namespace Opie { |
67 | namespace Net { | 55 | namespace Net { |
68 | |||
69 | class ONetworkInterface; | 56 | class ONetworkInterface; |
70 | class OWirelessNetworkInterface; | 57 | class OWirelessNetworkInterface; |
71 | class OChannelHopper; | 58 | class OChannelHopper; |
72 | class OMonitoringInterface; | 59 | class OMonitoringInterface; |
73 | 60 | ||
74 | /*====================================================================================== | 61 | /*====================================================================================== |
75 | * ONetwork | 62 | * ONetwork |
76 | *======================================================================================*/ | 63 | *======================================================================================*/ |
77 | 64 | ||
78 | /** | 65 | /** |
79 | * @brief A container class for all network interfaces | 66 | * @brief A container class for all network interfaces |
80 | * | 67 | * |
81 | * This class provides access to all available network interfaces of your computer. | 68 | * This class provides access to all available network interfaces of your computer. |
82 | * | 69 | * |
83 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> | 70 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> |
84 | */ | 71 | */ |
85 | class ONetwork : public QObject | 72 | class ONetwork : public QObject |
86 | { | 73 | { |
87 | Q_OBJECT | 74 | Q_OBJECT |
88 | 75 | ||
89 | public: | 76 | public: |
90 | typedef QDict<ONetworkInterface> InterfaceMap; | 77 | typedef QDict<ONetworkInterface> InterfaceMap; |
91 | typedef QDictIterator<ONetworkInterface> InterfaceIterator; | 78 | typedef QDictIterator<ONetworkInterface> InterfaceIterator; |
92 | 79 | ||