summaryrefslogtreecommitdiff
path: root/libopie2/opienet/onetutils.h
Unidiff
Diffstat (limited to 'libopie2/opienet/onetutils.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetutils.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/libopie2/opienet/onetutils.h b/libopie2/opienet/onetutils.h
index bddfab9..ca6815d 100644
--- a/libopie2/opienet/onetutils.h
+++ b/libopie2/opienet/onetutils.h
@@ -20,131 +20,146 @@
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32#ifndef ONETUTILS_H 32#ifndef ONETUTILS_H
33#define ONETUTILS_H 33#define ONETUTILS_H
34 34
35#include <qdict.h> 35#include <qdict.h>
36#include <qmap.h> 36#include <qmap.h>
37#include <qstring.h> 37#include <qstring.h>
38#include <qhostaddress.h> 38#include <qhostaddress.h>
39#include <qobject.h> 39#include <qobject.h>
40 40
41#include <sys/types.h> 41#include <sys/types.h>
42 42
43struct ifreq; 43struct ifreq;
44
45namespace Opie {
46namespace Net {
47
44class OWirelessNetworkInterface; 48class OWirelessNetworkInterface;
45 49
46/*====================================================================================== 50/*======================================================================================
47 * OMacAddress 51 * OMacAddress
48 *======================================================================================*/ 52 *======================================================================================*/
49 53
50class OMacAddress 54class OMacAddress
51{ 55{
52 public: 56 public:
53 // QString c'tor? -zecke 57 // QString c'tor? -zecke
54 OMacAddress(); 58 OMacAddress();
55 OMacAddress( unsigned char* ); 59 OMacAddress( unsigned char* );
56 OMacAddress( const unsigned char* ); 60 OMacAddress( const unsigned char* );
57 OMacAddress( struct ifreq& ); 61 OMacAddress( struct ifreq& );
58 ~OMacAddress(); 62 ~OMacAddress();
59 63
60 QString manufacturer() const; 64 QString manufacturer() const;
61 QString toString( bool substitute = false ) const; 65 QString toString( bool substitute = false ) const;
62 const unsigned char* native() const; 66 const unsigned char* native() const;
63 67
64 // no c'tor but this one why not make it a c'tor. it could also replace the others or is this the problem? 68 // no c'tor but this one why not make it a c'tor. it could also replace the others or is this the problem?
65 static OMacAddress fromString( const QString& ); 69 static OMacAddress fromString( const QString& );
66 70
67 public: 71 public:
68 static const OMacAddress& broadcast; // ff:ff:ff:ff:ff:ff 72 static const OMacAddress& broadcast; // ff:ff:ff:ff:ff:ff
69 static const OMacAddress& unknown; // 44:44:44:44:44:44 73 static const OMacAddress& unknown; // 44:44:44:44:44:44
70 74
71 private: 75 private:
72 unsigned char _bytes[6]; 76 unsigned char _bytes[6];
73 77
74 friend bool operator==( const OMacAddress &m1, const OMacAddress &m2 ); 78 friend bool operator==( const OMacAddress &m1, const OMacAddress &m2 );
79 class Private;
80 Private *d;
75 81
76}; 82};
77 83
78bool operator==( const OMacAddress &m1, const OMacAddress &m2 ); 84bool operator==( const OMacAddress &m1, const OMacAddress &m2 );
79 85
80 86
81/*====================================================================================== 87/*======================================================================================
82 * OHostAddress 88 * OHostAddress
83 *======================================================================================*/ 89 *======================================================================================*/
84 90
85class OHostAddress : public QHostAddress 91class OHostAddress : public QHostAddress
86{ 92{
87 /*public: 93 /*public:
88 OHostAddress(); 94 OHostAddress();
89 ~OHostAddress(); 95 ~OHostAddress();
90 */ 96 */
97 private:
98 class Private;
99 Private *d;
91}; 100};
92 101
93 102
94/*====================================================================================== 103/*======================================================================================
95 * OPrivateIOCTL 104 * OPrivateIOCTL
96 *======================================================================================*/ 105 *======================================================================================*/
97 106
98class OPrivateIOCTL : public QObject 107class OPrivateIOCTL : public QObject
99{ 108{
100 public: 109 public:
101 OPrivateIOCTL( QObject* parent, const char* name, int cmd, int getargs, int setargs ); 110 OPrivateIOCTL( QObject* parent, const char* name, int cmd, int getargs, int setargs );
102 ~OPrivateIOCTL(); 111 ~OPrivateIOCTL();
103 112
104 int numberGetArgs() const; 113 int numberGetArgs() const;
105 int typeGetArgs() const; 114 int typeGetArgs() const;
106 int numberSetArgs() const; 115 int numberSetArgs() const;
107 int typeSetArgs() const; 116 int typeSetArgs() const;
108 117
109 // FIXME return int? as ::ioctl does? -zecke 118 // FIXME return int? as ::ioctl does? -zecke
110 void invoke() const; 119 void invoke() const;
111 void setParameter( int, u_int32_t ); 120 void setParameter( int, u_int32_t );
112 121
113 private: 122 private:
114 u_int32_t _ioctl; 123 u_int32_t _ioctl;
115 u_int16_t _getargs; 124 u_int16_t _getargs;
116 u_int16_t _setargs; 125 u_int16_t _setargs;
117 126
127 class Private;
128 Private *d;
118}; 129};
119 130
120 /*====================================================================================== 131 /*======================================================================================
121 * Miscellaneous 132 * Miscellaneous
122 *======================================================================================*/ 133 *======================================================================================*/
123 134
135namespace Private {
124void dumpBytes( const unsigned char* data, int num ); 136void dumpBytes( const unsigned char* data, int num );
125QString modeToString( int ); 137QString modeToString( int );
126int stringToMode( const QString& ); 138int stringToMode( const QString& );
139}
140}
141}
127 142
128#define IW_PRIV_TYPE_MASK 0x7000 143#define IW_PRIV_TYPE_MASK 0x7000
129#define IW_PRIV_TYPE_NONE 0x0000 144#define IW_PRIV_TYPE_NONE 0x0000
130#define IW_PRIV_TYPE_BYTE 0x1000 145#define IW_PRIV_TYPE_BYTE 0x1000
131#define IW_PRIV_TYPE_CHAR 0x2000 146#define IW_PRIV_TYPE_CHAR 0x2000
132#define IW_PRIV_TYPE_INT 0x4000 147#define IW_PRIV_TYPE_INT 0x4000
133#define IW_PRIV_TYPE_FLOAT 0x5000 148#define IW_PRIV_TYPE_FLOAT 0x5000
134#define IW_PRIV_TYPE_ADDR 0x6000 149#define IW_PRIV_TYPE_ADDR 0x6000
135#define IW_PRIV_SIZE_FIXED 0x0800 150#define IW_PRIV_SIZE_FIXED 0x0800
136#define IW_PRIV_SIZE_MASK 0x07FF 151#define IW_PRIV_SIZE_MASK 0x07FF
137 152
138#ifndef ARPHRD_IEEE80211 153#ifndef ARPHRD_IEEE80211
139#define ARPHRD_IEEE80211 801 154#define ARPHRD_IEEE80211 801
140#endif 155#endif
141#ifndef ARPHRD_IEEE80211_PRISM 156#ifndef ARPHRD_IEEE80211_PRISM
142#define ARPHRD_IEEE80211_PRISM 802 157#define ARPHRD_IEEE80211_PRISM 802
143#endif 158#endif
144 159
145 160
146/* Network to host order macros */ 161/* Network to host order macros */
147 162
148#ifdef LBL_ALIGN 163#ifdef LBL_ALIGN
149#define EXTRACT_16BITS(p) \ 164#define EXTRACT_16BITS(p) \
150 ((u_int16_t)((u_int16_t)*((const u_int8_t *)(p) + 0) << 8 | \ 165 ((u_int16_t)((u_int16_t)*((const u_int8_t *)(p) + 0) << 8 | \