summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-11-08 20:39:38 (UTC)
committer mickeyl <mickeyl>2003-11-08 20:39:38 (UTC)
commiteb26b0413c269b898a24deb30d5602ac0c142a56 (patch) (unidiff)
tree4e9b24ce6a9e8811eb9e62d8537b452921d4564d
parent33d86bb19d4e21b95504ba3b16789d08b4820313 (diff)
downloadopie-eb26b0413c269b898a24deb30d5602ac0c142a56.zip
opie-eb26b0413c269b898a24deb30d5602ac0c142a56.tar.gz
opie-eb26b0413c269b898a24deb30d5602ac0c142a56.tar.bz2
refactor the debug mapper and make it more secure
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/odebugmapper.cpp213
-rw-r--r--libopie2/opienet/odebugmapper.h26
-rw-r--r--libopie2/opienet/oioctlmap.cpp366
-rw-r--r--libopie2/opienet/oioctlmap.h17
-rw-r--r--libopie2/opienet/onetutils.cpp15
-rw-r--r--libopie2/opienet/onetutils.h18
-rw-r--r--libopie2/opienet/onetwork.cpp20
-rw-r--r--libopie2/opienet/opienet.pro4
-rwxr-xr-xlibopie2/tools/regen.py52
9 files changed, 311 insertions, 420 deletions
diff --git a/libopie2/opienet/odebugmapper.cpp b/libopie2/opienet/odebugmapper.cpp
new file mode 100644
index 0000000..d62b3ba
--- a/dev/null
+++ b/libopie2/opienet/odebugmapper.cpp
@@ -0,0 +1,213 @@
1
2/*
3 * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
4 */
5
6#include "odebugmapper.h"
7
8DebugMapper::DebugMapper()
9{
10 qDebug( "DebugMapper::DebugMapper()" );
11
12
13 _map.insert( 0x8902, new QString("SIOCSPGRP") );
14 _map.insert( 0x8904, new QString("SIOCGPGRP") );
15 _map.insert( 0x8905, new QString("SIOCATMARK") );
16 _map.insert( 0x8906, new QString("SIOCGSTAMP") );
17 _map.insert( 0x890B, new QString("SIOCADDRT") );
18 _map.insert( 0x890C, new QString("SIOCDELRT") );
19 _map.insert( 0x890D, new QString("SIOCRTMSG") );
20 _map.insert( 0x8910, new QString("SIOCGIFNAME") );
21 _map.insert( 0x8911, new QString("SIOCSIFLINK") );
22 _map.insert( 0x8912, new QString("SIOCGIFCONF") );
23 _map.insert( 0x8913, new QString("SIOCGIFFLAGS") );
24 _map.insert( 0x8914, new QString("SIOCSIFFLAGS") );
25 _map.insert( 0x8915, new QString("SIOCGIFADDR") );
26 _map.insert( 0x8916, new QString("SIOCSIFADDR") );
27 _map.insert( 0x8917, new QString("SIOCGIFDSTADDR") );
28 _map.insert( 0x8918, new QString("SIOCSIFDSTADDR") );
29 _map.insert( 0x8919, new QString("SIOCGIFBRDADDR") );
30 _map.insert( 0x891a, new QString("SIOCSIFBRDADDR") );
31 _map.insert( 0x891b, new QString("SIOCGIFNETMASK") );
32 _map.insert( 0x891c, new QString("SIOCSIFNETMASK") );
33 _map.insert( 0x891d, new QString("SIOCGIFMETRIC") );
34 _map.insert( 0x891e, new QString("SIOCSIFMETRIC") );
35 _map.insert( 0x891f, new QString("SIOCGIFMEM") );
36 _map.insert( 0x8920, new QString("SIOCSIFMEM") );
37 _map.insert( 0x8921, new QString("SIOCGIFMTU") );
38 _map.insert( 0x8922, new QString("SIOCSIFMTU") );
39 _map.insert( 0x8923, new QString("SIOCSIFNAME") );
40 _map.insert( 0x8924, new QString("SIOCSIFHWADDR") );
41 _map.insert( 0x8925, new QString("SIOCGIFENCAP") );
42 _map.insert( 0x8926, new QString("SIOCSIFENCAP") );
43 _map.insert( 0x8927, new QString("SIOCGIFHWADDR") );
44 _map.insert( 0x8929, new QString("SIOCGIFSLAVE") );
45 _map.insert( 0x8930, new QString("SIOCSIFSLAVE") );
46 _map.insert( 0x8931, new QString("SIOCADDMULTI") );
47 _map.insert( 0x8932, new QString("SIOCDELMULTI") );
48 _map.insert( 0x8933, new QString("SIOCGIFINDEX") );
49 _map.insert( 0x8934, new QString("SIOCSIFPFLAGS") );
50 _map.insert( 0x8935, new QString("SIOCGIFPFLAGS") );
51 _map.insert( 0x8936, new QString("SIOCDIFADDR") );
52 _map.insert( 0x8937, new QString("SIOCSIFHWBROADCAST") );
53 _map.insert( 0x8938, new QString("SIOCGIFCOUNT") );
54 _map.insert( 0x8940, new QString("SIOCGIFBR") );
55 _map.insert( 0x8941, new QString("SIOCSIFBR") );
56 _map.insert( 0x8942, new QString("SIOCGIFTXQLEN") );
57 _map.insert( 0x8943, new QString("SIOCSIFTXQLEN") );
58 _map.insert( 0x8953, new QString("SIOCDARP") );
59 _map.insert( 0x8954, new QString("SIOCGARP") );
60 _map.insert( 0x8955, new QString("SIOCSARP") );
61 _map.insert( 0x8960, new QString("SIOCDRARP") );
62 _map.insert( 0x8961, new QString("SIOCGRARP") );
63 _map.insert( 0x8962, new QString("SIOCSRARP") );
64 _map.insert( 0x8970, new QString("SIOCGIFMAP") );
65 _map.insert( 0x8971, new QString("SIOCSIFMAP") );
66 _map.insert( 0x8980, new QString("SIOCADDDLCI") );
67 _map.insert( 0x8981, new QString("SIOCDELDLCI") );
68 _map.insert( 0x89F0, new QString("SIOCDEVPRIVATE") );
69 _map.insert( 0x89E0, new QString("SIOCPROTOPRIVATE") );
70 _map.insert( 0x1fff, new QString("SIOCPARM_MASK") );
71 _map.insert( 0x00000000, new QString("SIOC_VOID") );
72 _map.insert( 0x20000000, new QString("SIOC_OUT") );
73 _map.insert( 0x40000000, new QString("SIOC_IN") );
74 _map.insert( 0x8B00, new QString("SIOCSIWCOMMIT") );
75 _map.insert( 0x8B01, new QString("SIOCGIWNAME") );
76 _map.insert( 0x8B02, new QString("SIOCSIWNWID") );
77 _map.insert( 0x8B03, new QString("SIOCGIWNWID") );
78 _map.insert( 0x8B04, new QString("SIOCSIWFREQ") );
79 _map.insert( 0x8B05, new QString("SIOCGIWFREQ") );
80 _map.insert( 0x8B06, new QString("SIOCSIWMODE") );
81 _map.insert( 0x8B07, new QString("SIOCGIWMODE") );
82 _map.insert( 0x8B08, new QString("SIOCSIWSENS") );
83 _map.insert( 0x8B09, new QString("SIOCGIWSENS") );
84 _map.insert( 0x8B0A, new QString("SIOCSIWRANGE") );
85 _map.insert( 0x8B0B, new QString("SIOCGIWRANGE") );
86 _map.insert( 0x8B0C, new QString("SIOCSIWPRIV") );
87 _map.insert( 0x8B0D, new QString("SIOCGIWPRIV") );
88 _map.insert( 0x8B0E, new QString("SIOCSIWSTATS") );
89 _map.insert( 0x8B0F, new QString("SIOCGIWSTATS") );
90 _map.insert( 0x8B10, new QString("SIOCSIWSPY") );
91 _map.insert( 0x8B11, new QString("SIOCGIWSPY") );
92 _map.insert( 0x8B14, new QString("SIOCSIWAP") );
93 _map.insert( 0x8B15, new QString("SIOCGIWAP") );
94 _map.insert( 0x8B17, new QString("SIOCGIWAPLIST") );
95 _map.insert( 0x8B18, new QString("SIOCSIWSCAN") );
96 _map.insert( 0x8B19, new QString("SIOCGIWSCAN") );
97 _map.insert( 0x8B1A, new QString("SIOCSIWESSID") );
98 _map.insert( 0x8B1B, new QString("SIOCGIWESSID") );
99 _map.insert( 0x8B1C, new QString("SIOCSIWNICKN") );
100 _map.insert( 0x8B1D, new QString("SIOCGIWNICKN") );
101 _map.insert( 0x8B20, new QString("SIOCSIWRATE") );
102 _map.insert( 0x8B21, new QString("SIOCGIWRATE") );
103 _map.insert( 0x8B22, new QString("SIOCSIWRTS") );
104 _map.insert( 0x8B23, new QString("SIOCGIWRTS") );
105 _map.insert( 0x8B24, new QString("SIOCSIWFRAG") );
106 _map.insert( 0x8B25, new QString("SIOCGIWFRAG") );
107 _map.insert( 0x8B26, new QString("SIOCSIWTXPOW") );
108 _map.insert( 0x8B27, new QString("SIOCGIWTXPOW") );
109 _map.insert( 0x8B28, new QString("SIOCSIWRETRY") );
110 _map.insert( 0x8B29, new QString("SIOCGIWRETRY") );
111 _map.insert( 0x8B2A, new QString("SIOCSIWENCODE") );
112 _map.insert( 0x8B2B, new QString("SIOCGIWENCODE") );
113 _map.insert( 0x8B2C, new QString("SIOCSIWPOWER") );
114 _map.insert( 0x8B2D, new QString("SIOCGIWPOWER") );
115 _map.insert( 0x8BE0, new QString("SIOCIWFIRSTPRIV") );
116 _map.insert( 0x8BFF, new QString("SIOCIWLASTPRIV") );
117 _map.insert( 0x8B00, new QString("SIOCIWFIRST") );
118 _map.insert( 0x5000, new QString("SIOCGBPQETHPARAM") );
119 _map.insert( 0x5001, new QString("SIOCSBPQETHPARAM") );
120 _map.insert( 0x890B, new QString("SIOCADDRT") );
121 _map.insert( 0x890C, new QString("SIOCDELRT") );
122 _map.insert( 0x890D, new QString("SIOCRTMSG") );
123 _map.insert( 0x8910, new QString("SIOCGIFNAME") );
124 _map.insert( 0x8911, new QString("SIOCSIFLINK") );
125 _map.insert( 0x8912, new QString("SIOCGIFCONF") );
126 _map.insert( 0x8913, new QString("SIOCGIFFLAGS") );
127 _map.insert( 0x8914, new QString("SIOCSIFFLAGS") );
128 _map.insert( 0x8915, new QString("SIOCGIFADDR") );
129 _map.insert( 0x8916, new QString("SIOCSIFADDR") );
130 _map.insert( 0x8917, new QString("SIOCGIFDSTADDR") );
131 _map.insert( 0x8918, new QString("SIOCSIFDSTADDR") );
132 _map.insert( 0x8919, new QString("SIOCGIFBRDADDR") );
133 _map.insert( 0x891a, new QString("SIOCSIFBRDADDR") );
134 _map.insert( 0x891b, new QString("SIOCGIFNETMASK") );
135 _map.insert( 0x891c, new QString("SIOCSIFNETMASK") );
136 _map.insert( 0x891d, new QString("SIOCGIFMETRIC") );
137 _map.insert( 0x891e, new QString("SIOCSIFMETRIC") );
138 _map.insert( 0x891f, new QString("SIOCGIFMEM") );
139 _map.insert( 0x8920, new QString("SIOCSIFMEM") );
140 _map.insert( 0x8921, new QString("SIOCGIFMTU") );
141 _map.insert( 0x8922, new QString("SIOCSIFMTU") );
142 _map.insert( 0x8923, new QString("SIOCSIFNAME") );
143 _map.insert( 0x8924, new QString("SIOCSIFHWADDR") );
144 _map.insert( 0x8925, new QString("SIOCGIFENCAP") );
145 _map.insert( 0x8926, new QString("SIOCSIFENCAP") );
146 _map.insert( 0x8927, new QString("SIOCGIFHWADDR") );
147 _map.insert( 0x8929, new QString("SIOCGIFSLAVE") );
148 _map.insert( 0x8930, new QString("SIOCSIFSLAVE") );
149 _map.insert( 0x8931, new QString("SIOCADDMULTI") );
150 _map.insert( 0x8932, new QString("SIOCDELMULTI") );
151 _map.insert( 0x8933, new QString("SIOCGIFINDEX") );
152 _map.insert( 0x8934, new QString("SIOCSIFPFLAGS") );
153 _map.insert( 0x8935, new QString("SIOCGIFPFLAGS") );
154 _map.insert( 0x8936, new QString("SIOCDIFADDR") );
155 _map.insert( 0x8937, new QString("SIOCSIFHWBROADCAST") );
156 _map.insert( 0x8938, new QString("SIOCGIFCOUNT") );
157 _map.insert( 0x8940, new QString("SIOCGIFBR") );
158 _map.insert( 0x8941, new QString("SIOCSIFBR") );
159 _map.insert( 0x8942, new QString("SIOCGIFTXQLEN") );
160 _map.insert( 0x8943, new QString("SIOCSIFTXQLEN") );
161 _map.insert( 0x8944, new QString("SIOCGIFDIVERT") );
162 _map.insert( 0x8945, new QString("SIOCSIFDIVERT") );
163 _map.insert( 0x8946, new QString("SIOCETHTOOL") );
164 _map.insert( 0x8947, new QString("SIOCGMIIPHY") );
165 _map.insert( 0x8948, new QString("SIOCGMIIREG") );
166 _map.insert( 0x8949, new QString("SIOCSMIIREG") );
167 _map.insert( 0x894A, new QString("SIOCWANDEV") );
168 _map.insert( 0x8953, new QString("SIOCDARP") );
169 _map.insert( 0x8954, new QString("SIOCGARP") );
170 _map.insert( 0x8955, new QString("SIOCSARP") );
171 _map.insert( 0x8960, new QString("SIOCDRARP") );
172 _map.insert( 0x8961, new QString("SIOCGRARP") );
173 _map.insert( 0x8962, new QString("SIOCSRARP") );
174 _map.insert( 0x8970, new QString("SIOCGIFMAP") );
175 _map.insert( 0x8971, new QString("SIOCSIFMAP") );
176 _map.insert( 0x8980, new QString("SIOCADDDLCI") );
177 _map.insert( 0x8981, new QString("SIOCDELDLCI") );
178 _map.insert( 0x8982, new QString("SIOCGIFVLAN") );
179 _map.insert( 0x8983, new QString("SIOCSIFVLAN") );
180 _map.insert( 0x8990, new QString("SIOCBONDENSLAVE") );
181 _map.insert( 0x8991, new QString("SIOCBONDRELEASE") );
182 _map.insert( 0x8992, new QString("SIOCBONDSETHWADDR") );
183 _map.insert( 0x8993, new QString("SIOCBONDSLAVEINFOQUERY") );
184 _map.insert( 0x8994, new QString("SIOCBONDINFOQUERY") );
185 _map.insert( 0x8995, new QString("SIOCBONDCHANGEACTIVE") );
186 _map.insert( 0x89F0, new QString("SIOCDEVPRIVATE") );
187 _map.insert( 0x89E0, new QString("SIOCPROTOPRIVATE") );
188
189};
190
191
192DebugMapper::~DebugMapper()
193{
194 qDebug( "DebugMapper::~DebugMapper()" );
195}
196
197
198const QString& DebugMapper::map( int value ) const
199{
200 QString* result = _map[ value ];
201
202 if ( !result )
203 {
204 qDebug( "DebugMapper::map() - value not found." );
205 return QString::null;
206 }
207 else
208 {
209 return *result;
210 }
211}
212
213
diff --git a/libopie2/opienet/odebugmapper.h b/libopie2/opienet/odebugmapper.h
new file mode 100644
index 0000000..66b331d
--- a/dev/null
+++ b/libopie2/opienet/odebugmapper.h
@@ -0,0 +1,26 @@
1
2/*
3 * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
4 */
5
6#ifndef DEBUGMAPPER_H
7#define DEBUGMAPPER_H
8
9#include <qstring.h>
10#include <qintdict.h>
11
12typedef QIntDict<QString> IntStringMap;
13
14class DebugMapper
15{
16 public:
17 DebugMapper();
18 ~DebugMapper();
19
20 const QString& map( int value ) const;
21 private:
22 IntStringMap _map;
23};
24
25#endif
26
diff --git a/libopie2/opienet/oioctlmap.cpp b/libopie2/opienet/oioctlmap.cpp
deleted file mode 100644
index 4a67eb6..0000000
--- a/libopie2/opienet/oioctlmap.cpp
+++ b/dev/null
@@ -1,366 +0,0 @@
1
2/*
3 * ioctl table - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
4 */
5
6#include "oioctlmap.h"
7
8IntStringMap* constructIoctlMap()
9{
10 IntStringMap* map = new IntStringMap();
11
12
13 qDebug( "adding 0x8902 = SIOCSPGRP" );
14 map->insert( 0x8902, new QString("SIOCSPGRP") );
15 qDebug( "adding 0x8904 = SIOCGPGRP" );
16 map->insert( 0x8904, new QString("SIOCGPGRP") );
17 qDebug( "adding 0x8905 = SIOCATMARK" );
18 map->insert( 0x8905, new QString("SIOCATMARK") );
19 qDebug( "adding 0x8906 = SIOCGSTAMP" );
20 map->insert( 0x8906, new QString("SIOCGSTAMP") );
21 qDebug( "adding 0x890B = SIOCADDRT" );
22 map->insert( 0x890B, new QString("SIOCADDRT") );
23 qDebug( "adding 0x890C = SIOCDELRT" );
24 map->insert( 0x890C, new QString("SIOCDELRT") );
25 qDebug( "adding 0x890D = SIOCRTMSG" );
26 map->insert( 0x890D, new QString("SIOCRTMSG") );
27 qDebug( "adding 0x8910 = SIOCGIFNAME" );
28 map->insert( 0x8910, new QString("SIOCGIFNAME") );
29 qDebug( "adding 0x8911 = SIOCSIFLINK" );
30 map->insert( 0x8911, new QString("SIOCSIFLINK") );
31 qDebug( "adding 0x8912 = SIOCGIFCONF" );
32 map->insert( 0x8912, new QString("SIOCGIFCONF") );
33 qDebug( "adding 0x8913 = SIOCGIFFLAGS" );
34 map->insert( 0x8913, new QString("SIOCGIFFLAGS") );
35 qDebug( "adding 0x8914 = SIOCSIFFLAGS" );
36 map->insert( 0x8914, new QString("SIOCSIFFLAGS") );
37 qDebug( "adding 0x8915 = SIOCGIFADDR" );
38 map->insert( 0x8915, new QString("SIOCGIFADDR") );
39 qDebug( "adding 0x8916 = SIOCSIFADDR" );
40 map->insert( 0x8916, new QString("SIOCSIFADDR") );
41 qDebug( "adding 0x8917 = SIOCGIFDSTADDR" );
42 map->insert( 0x8917, new QString("SIOCGIFDSTADDR") );
43 qDebug( "adding 0x8918 = SIOCSIFDSTADDR" );
44 map->insert( 0x8918, new QString("SIOCSIFDSTADDR") );
45 qDebug( "adding 0x8919 = SIOCGIFBRDADDR" );
46 map->insert( 0x8919, new QString("SIOCGIFBRDADDR") );
47 qDebug( "adding 0x891a = SIOCSIFBRDADDR" );
48 map->insert( 0x891a, new QString("SIOCSIFBRDADDR") );
49 qDebug( "adding 0x891b = SIOCGIFNETMASK" );
50 map->insert( 0x891b, new QString("SIOCGIFNETMASK") );
51 qDebug( "adding 0x891c = SIOCSIFNETMASK" );
52 map->insert( 0x891c, new QString("SIOCSIFNETMASK") );
53 qDebug( "adding 0x891d = SIOCGIFMETRIC" );
54 map->insert( 0x891d, new QString("SIOCGIFMETRIC") );
55 qDebug( "adding 0x891e = SIOCSIFMETRIC" );
56 map->insert( 0x891e, new QString("SIOCSIFMETRIC") );
57 qDebug( "adding 0x891f = SIOCGIFMEM" );
58 map->insert( 0x891f, new QString("SIOCGIFMEM") );
59 qDebug( "adding 0x8920 = SIOCSIFMEM" );
60 map->insert( 0x8920, new QString("SIOCSIFMEM") );
61 qDebug( "adding 0x8921 = SIOCGIFMTU" );
62 map->insert( 0x8921, new QString("SIOCGIFMTU") );
63 qDebug( "adding 0x8922 = SIOCSIFMTU" );
64 map->insert( 0x8922, new QString("SIOCSIFMTU") );
65 qDebug( "adding 0x8923 = SIOCSIFNAME" );
66 map->insert( 0x8923, new QString("SIOCSIFNAME") );
67 qDebug( "adding 0x8924 = SIOCSIFHWADDR" );
68 map->insert( 0x8924, new QString("SIOCSIFHWADDR") );
69 qDebug( "adding 0x8925 = SIOCGIFENCAP" );
70 map->insert( 0x8925, new QString("SIOCGIFENCAP") );
71 qDebug( "adding 0x8926 = SIOCSIFENCAP" );
72 map->insert( 0x8926, new QString("SIOCSIFENCAP") );
73 qDebug( "adding 0x8927 = SIOCGIFHWADDR" );
74 map->insert( 0x8927, new QString("SIOCGIFHWADDR") );
75 qDebug( "adding 0x8929 = SIOCGIFSLAVE" );
76 map->insert( 0x8929, new QString("SIOCGIFSLAVE") );
77 qDebug( "adding 0x8930 = SIOCSIFSLAVE" );
78 map->insert( 0x8930, new QString("SIOCSIFSLAVE") );
79 qDebug( "adding 0x8931 = SIOCADDMULTI" );
80 map->insert( 0x8931, new QString("SIOCADDMULTI") );
81 qDebug( "adding 0x8932 = SIOCDELMULTI" );
82 map->insert( 0x8932, new QString("SIOCDELMULTI") );
83 qDebug( "adding 0x8933 = SIOCGIFINDEX" );
84 map->insert( 0x8933, new QString("SIOCGIFINDEX") );
85 qDebug( "adding 0x8934 = SIOCSIFPFLAGS" );
86 map->insert( 0x8934, new QString("SIOCSIFPFLAGS") );
87 qDebug( "adding 0x8935 = SIOCGIFPFLAGS" );
88 map->insert( 0x8935, new QString("SIOCGIFPFLAGS") );
89 qDebug( "adding 0x8936 = SIOCDIFADDR" );
90 map->insert( 0x8936, new QString("SIOCDIFADDR") );
91 qDebug( "adding 0x8937 = SIOCSIFHWBROADCAST" );
92 map->insert( 0x8937, new QString("SIOCSIFHWBROADCAST") );
93 qDebug( "adding 0x8938 = SIOCGIFCOUNT" );
94 map->insert( 0x8938, new QString("SIOCGIFCOUNT") );
95 qDebug( "adding 0x8940 = SIOCGIFBR" );
96 map->insert( 0x8940, new QString("SIOCGIFBR") );
97 qDebug( "adding 0x8941 = SIOCSIFBR" );
98 map->insert( 0x8941, new QString("SIOCSIFBR") );
99 qDebug( "adding 0x8942 = SIOCGIFTXQLEN" );
100 map->insert( 0x8942, new QString("SIOCGIFTXQLEN") );
101 qDebug( "adding 0x8943 = SIOCSIFTXQLEN" );
102 map->insert( 0x8943, new QString("SIOCSIFTXQLEN") );
103 qDebug( "adding 0x8953 = SIOCDARP" );
104 map->insert( 0x8953, new QString("SIOCDARP") );
105 qDebug( "adding 0x8954 = SIOCGARP" );
106 map->insert( 0x8954, new QString("SIOCGARP") );
107 qDebug( "adding 0x8955 = SIOCSARP" );
108 map->insert( 0x8955, new QString("SIOCSARP") );
109 qDebug( "adding 0x8960 = SIOCDRARP" );
110 map->insert( 0x8960, new QString("SIOCDRARP") );
111 qDebug( "adding 0x8961 = SIOCGRARP" );
112 map->insert( 0x8961, new QString("SIOCGRARP") );
113 qDebug( "adding 0x8962 = SIOCSRARP" );
114 map->insert( 0x8962, new QString("SIOCSRARP") );
115 qDebug( "adding 0x8970 = SIOCGIFMAP" );
116 map->insert( 0x8970, new QString("SIOCGIFMAP") );
117 qDebug( "adding 0x8971 = SIOCSIFMAP" );
118 map->insert( 0x8971, new QString("SIOCSIFMAP") );
119 qDebug( "adding 0x8980 = SIOCADDDLCI" );
120 map->insert( 0x8980, new QString("SIOCADDDLCI") );
121 qDebug( "adding 0x8981 = SIOCDELDLCI" );
122 map->insert( 0x8981, new QString("SIOCDELDLCI") );
123 qDebug( "adding 0x89F0 = SIOCDEVPRIVATE" );
124 map->insert( 0x89F0, new QString("SIOCDEVPRIVATE") );
125 qDebug( "adding 0x89E0 = SIOCPROTOPRIVATE" );
126 map->insert( 0x89E0, new QString("SIOCPROTOPRIVATE") );
127 qDebug( "adding 0x1fff = SIOCPARM_MASK" );
128 map->insert( 0x1fff, new QString("SIOCPARM_MASK") );
129 qDebug( "adding 0x00000000 = SIOC_VOID" );
130 map->insert( 0x00000000, new QString("SIOC_VOID") );
131 qDebug( "adding 0x20000000 = SIOC_OUT" );
132 map->insert( 0x20000000, new QString("SIOC_OUT") );
133 qDebug( "adding 0x40000000 = SIOC_IN" );
134 map->insert( 0x40000000, new QString("SIOC_IN") );
135 qDebug( "adding 0x8B00 = SIOCSIWCOMMIT" );
136 map->insert( 0x8B00, new QString("SIOCSIWCOMMIT") );
137 qDebug( "adding 0x8B01 = SIOCGIWNAME" );
138 map->insert( 0x8B01, new QString("SIOCGIWNAME") );
139 qDebug( "adding 0x8B02 = SIOCSIWNWID" );
140 map->insert( 0x8B02, new QString("SIOCSIWNWID") );
141 qDebug( "adding 0x8B03 = SIOCGIWNWID" );
142 map->insert( 0x8B03, new QString("SIOCGIWNWID") );
143 qDebug( "adding 0x8B04 = SIOCSIWFREQ" );
144 map->insert( 0x8B04, new QString("SIOCSIWFREQ") );
145 qDebug( "adding 0x8B05 = SIOCGIWFREQ" );
146 map->insert( 0x8B05, new QString("SIOCGIWFREQ") );
147 qDebug( "adding 0x8B06 = SIOCSIWMODE" );
148 map->insert( 0x8B06, new QString("SIOCSIWMODE") );
149 qDebug( "adding 0x8B07 = SIOCGIWMODE" );
150 map->insert( 0x8B07, new QString("SIOCGIWMODE") );
151 qDebug( "adding 0x8B08 = SIOCSIWSENS" );
152 map->insert( 0x8B08, new QString("SIOCSIWSENS") );
153 qDebug( "adding 0x8B09 = SIOCGIWSENS" );
154 map->insert( 0x8B09, new QString("SIOCGIWSENS") );
155 qDebug( "adding 0x8B0A = SIOCSIWRANGE" );
156 map->insert( 0x8B0A, new QString("SIOCSIWRANGE") );
157 qDebug( "adding 0x8B0B = SIOCGIWRANGE" );
158 map->insert( 0x8B0B, new QString("SIOCGIWRANGE") );
159 qDebug( "adding 0x8B0C = SIOCSIWPRIV" );
160 map->insert( 0x8B0C, new QString("SIOCSIWPRIV") );
161 qDebug( "adding 0x8B0D = SIOCGIWPRIV" );
162 map->insert( 0x8B0D, new QString("SIOCGIWPRIV") );
163 qDebug( "adding 0x8B0E = SIOCSIWSTATS" );
164 map->insert( 0x8B0E, new QString("SIOCSIWSTATS") );
165 qDebug( "adding 0x8B0F = SIOCGIWSTATS" );
166 map->insert( 0x8B0F, new QString("SIOCGIWSTATS") );
167 qDebug( "adding 0x8B10 = SIOCSIWSPY" );
168 map->insert( 0x8B10, new QString("SIOCSIWSPY") );
169 qDebug( "adding 0x8B11 = SIOCGIWSPY" );
170 map->insert( 0x8B11, new QString("SIOCGIWSPY") );
171 qDebug( "adding 0x8B14 = SIOCSIWAP" );
172 map->insert( 0x8B14, new QString("SIOCSIWAP") );
173 qDebug( "adding 0x8B15 = SIOCGIWAP" );
174 map->insert( 0x8B15, new QString("SIOCGIWAP") );
175 qDebug( "adding 0x8B17 = SIOCGIWAPLIST" );
176 map->insert( 0x8B17, new QString("SIOCGIWAPLIST") );
177 qDebug( "adding 0x8B18 = SIOCSIWSCAN" );
178 map->insert( 0x8B18, new QString("SIOCSIWSCAN") );
179 qDebug( "adding 0x8B19 = SIOCGIWSCAN" );
180 map->insert( 0x8B19, new QString("SIOCGIWSCAN") );
181 qDebug( "adding 0x8B1A = SIOCSIWESSID" );
182 map->insert( 0x8B1A, new QString("SIOCSIWESSID") );
183 qDebug( "adding 0x8B1B = SIOCGIWESSID" );
184 map->insert( 0x8B1B, new QString("SIOCGIWESSID") );
185 qDebug( "adding 0x8B1C = SIOCSIWNICKN" );
186 map->insert( 0x8B1C, new QString("SIOCSIWNICKN") );
187 qDebug( "adding 0x8B1D = SIOCGIWNICKN" );
188 map->insert( 0x8B1D, new QString("SIOCGIWNICKN") );
189 qDebug( "adding 0x8B20 = SIOCSIWRATE" );
190 map->insert( 0x8B20, new QString("SIOCSIWRATE") );
191 qDebug( "adding 0x8B21 = SIOCGIWRATE" );
192 map->insert( 0x8B21, new QString("SIOCGIWRATE") );
193 qDebug( "adding 0x8B22 = SIOCSIWRTS" );
194 map->insert( 0x8B22, new QString("SIOCSIWRTS") );
195 qDebug( "adding 0x8B23 = SIOCGIWRTS" );
196 map->insert( 0x8B23, new QString("SIOCGIWRTS") );
197 qDebug( "adding 0x8B24 = SIOCSIWFRAG" );
198 map->insert( 0x8B24, new QString("SIOCSIWFRAG") );
199 qDebug( "adding 0x8B25 = SIOCGIWFRAG" );
200 map->insert( 0x8B25, new QString("SIOCGIWFRAG") );
201 qDebug( "adding 0x8B26 = SIOCSIWTXPOW" );
202 map->insert( 0x8B26, new QString("SIOCSIWTXPOW") );
203 qDebug( "adding 0x8B27 = SIOCGIWTXPOW" );
204 map->insert( 0x8B27, new QString("SIOCGIWTXPOW") );
205 qDebug( "adding 0x8B28 = SIOCSIWRETRY" );
206 map->insert( 0x8B28, new QString("SIOCSIWRETRY") );
207 qDebug( "adding 0x8B29 = SIOCGIWRETRY" );
208 map->insert( 0x8B29, new QString("SIOCGIWRETRY") );
209 qDebug( "adding 0x8B2A = SIOCSIWENCODE" );
210 map->insert( 0x8B2A, new QString("SIOCSIWENCODE") );
211 qDebug( "adding 0x8B2B = SIOCGIWENCODE" );
212 map->insert( 0x8B2B, new QString("SIOCGIWENCODE") );
213 qDebug( "adding 0x8B2C = SIOCSIWPOWER" );
214 map->insert( 0x8B2C, new QString("SIOCSIWPOWER") );
215 qDebug( "adding 0x8B2D = SIOCGIWPOWER" );
216 map->insert( 0x8B2D, new QString("SIOCGIWPOWER") );
217 qDebug( "adding 0x8BE0 = SIOCIWFIRSTPRIV" );
218 map->insert( 0x8BE0, new QString("SIOCIWFIRSTPRIV") );
219 qDebug( "adding 0x8BFF = SIOCIWLASTPRIV" );
220 map->insert( 0x8BFF, new QString("SIOCIWLASTPRIV") );
221 qDebug( "adding 0x8B00 = SIOCIWFIRST" );
222 map->insert( 0x8B00, new QString("SIOCIWFIRST") );
223 qDebug( "adding 0x5000 = SIOCGBPQETHPARAM" );
224 map->insert( 0x5000, new QString("SIOCGBPQETHPARAM") );
225 qDebug( "adding 0x5001 = SIOCSBPQETHPARAM" );
226 map->insert( 0x5001, new QString("SIOCSBPQETHPARAM") );
227 qDebug( "adding 0x890B = SIOCADDRT" );
228 map->insert( 0x890B, new QString("SIOCADDRT") );
229 qDebug( "adding 0x890C = SIOCDELRT" );
230 map->insert( 0x890C, new QString("SIOCDELRT") );
231 qDebug( "adding 0x890D = SIOCRTMSG" );
232 map->insert( 0x890D, new QString("SIOCRTMSG") );
233 qDebug( "adding 0x8910 = SIOCGIFNAME" );
234 map->insert( 0x8910, new QString("SIOCGIFNAME") );
235 qDebug( "adding 0x8911 = SIOCSIFLINK" );
236 map->insert( 0x8911, new QString("SIOCSIFLINK") );
237 qDebug( "adding 0x8912 = SIOCGIFCONF" );
238 map->insert( 0x8912, new QString("SIOCGIFCONF") );
239 qDebug( "adding 0x8913 = SIOCGIFFLAGS" );
240 map->insert( 0x8913, new QString("SIOCGIFFLAGS") );
241 qDebug( "adding 0x8914 = SIOCSIFFLAGS" );
242 map->insert( 0x8914, new QString("SIOCSIFFLAGS") );
243 qDebug( "adding 0x8915 = SIOCGIFADDR" );
244 map->insert( 0x8915, new QString("SIOCGIFADDR") );
245 qDebug( "adding 0x8916 = SIOCSIFADDR" );
246 map->insert( 0x8916, new QString("SIOCSIFADDR") );
247 qDebug( "adding 0x8917 = SIOCGIFDSTADDR" );
248 map->insert( 0x8917, new QString("SIOCGIFDSTADDR") );
249 qDebug( "adding 0x8918 = SIOCSIFDSTADDR" );
250 map->insert( 0x8918, new QString("SIOCSIFDSTADDR") );
251 qDebug( "adding 0x8919 = SIOCGIFBRDADDR" );
252 map->insert( 0x8919, new QString("SIOCGIFBRDADDR") );
253 qDebug( "adding 0x891a = SIOCSIFBRDADDR" );
254 map->insert( 0x891a, new QString("SIOCSIFBRDADDR") );
255 qDebug( "adding 0x891b = SIOCGIFNETMASK" );
256 map->insert( 0x891b, new QString("SIOCGIFNETMASK") );
257 qDebug( "adding 0x891c = SIOCSIFNETMASK" );
258 map->insert( 0x891c, new QString("SIOCSIFNETMASK") );
259 qDebug( "adding 0x891d = SIOCGIFMETRIC" );
260 map->insert( 0x891d, new QString("SIOCGIFMETRIC") );
261 qDebug( "adding 0x891e = SIOCSIFMETRIC" );
262 map->insert( 0x891e, new QString("SIOCSIFMETRIC") );
263 qDebug( "adding 0x891f = SIOCGIFMEM" );
264 map->insert( 0x891f, new QString("SIOCGIFMEM") );
265 qDebug( "adding 0x8920 = SIOCSIFMEM" );
266 map->insert( 0x8920, new QString("SIOCSIFMEM") );
267 qDebug( "adding 0x8921 = SIOCGIFMTU" );
268 map->insert( 0x8921, new QString("SIOCGIFMTU") );
269 qDebug( "adding 0x8922 = SIOCSIFMTU" );
270 map->insert( 0x8922, new QString("SIOCSIFMTU") );
271 qDebug( "adding 0x8923 = SIOCSIFNAME" );
272 map->insert( 0x8923, new QString("SIOCSIFNAME") );
273 qDebug( "adding 0x8924 = SIOCSIFHWADDR" );
274 map->insert( 0x8924, new QString("SIOCSIFHWADDR") );
275 qDebug( "adding 0x8925 = SIOCGIFENCAP" );
276 map->insert( 0x8925, new QString("SIOCGIFENCAP") );
277 qDebug( "adding 0x8926 = SIOCSIFENCAP" );
278 map->insert( 0x8926, new QString("SIOCSIFENCAP") );
279 qDebug( "adding 0x8927 = SIOCGIFHWADDR" );
280 map->insert( 0x8927, new QString("SIOCGIFHWADDR") );
281 qDebug( "adding 0x8929 = SIOCGIFSLAVE" );
282 map->insert( 0x8929, new QString("SIOCGIFSLAVE") );
283 qDebug( "adding 0x8930 = SIOCSIFSLAVE" );
284 map->insert( 0x8930, new QString("SIOCSIFSLAVE") );
285 qDebug( "adding 0x8931 = SIOCADDMULTI" );
286 map->insert( 0x8931, new QString("SIOCADDMULTI") );
287 qDebug( "adding 0x8932 = SIOCDELMULTI" );
288 map->insert( 0x8932, new QString("SIOCDELMULTI") );
289 qDebug( "adding 0x8933 = SIOCGIFINDEX" );
290 map->insert( 0x8933, new QString("SIOCGIFINDEX") );
291 qDebug( "adding 0x8934 = SIOCSIFPFLAGS" );
292 map->insert( 0x8934, new QString("SIOCSIFPFLAGS") );
293 qDebug( "adding 0x8935 = SIOCGIFPFLAGS" );
294 map->insert( 0x8935, new QString("SIOCGIFPFLAGS") );
295 qDebug( "adding 0x8936 = SIOCDIFADDR" );
296 map->insert( 0x8936, new QString("SIOCDIFADDR") );
297 qDebug( "adding 0x8937 = SIOCSIFHWBROADCAST" );
298 map->insert( 0x8937, new QString("SIOCSIFHWBROADCAST") );
299 qDebug( "adding 0x8938 = SIOCGIFCOUNT" );
300 map->insert( 0x8938, new QString("SIOCGIFCOUNT") );
301 qDebug( "adding 0x8940 = SIOCGIFBR" );
302 map->insert( 0x8940, new QString("SIOCGIFBR") );
303 qDebug( "adding 0x8941 = SIOCSIFBR" );
304 map->insert( 0x8941, new QString("SIOCSIFBR") );
305 qDebug( "adding 0x8942 = SIOCGIFTXQLEN" );
306 map->insert( 0x8942, new QString("SIOCGIFTXQLEN") );
307 qDebug( "adding 0x8943 = SIOCSIFTXQLEN" );
308 map->insert( 0x8943, new QString("SIOCSIFTXQLEN") );
309 qDebug( "adding 0x8944 = SIOCGIFDIVERT" );
310 map->insert( 0x8944, new QString("SIOCGIFDIVERT") );
311 qDebug( "adding 0x8945 = SIOCSIFDIVERT" );
312 map->insert( 0x8945, new QString("SIOCSIFDIVERT") );
313 qDebug( "adding 0x8946 = SIOCETHTOOL" );
314 map->insert( 0x8946, new QString("SIOCETHTOOL") );
315 qDebug( "adding 0x8947 = SIOCGMIIPHY" );
316 map->insert( 0x8947, new QString("SIOCGMIIPHY") );
317 qDebug( "adding 0x8948 = SIOCGMIIREG" );
318 map->insert( 0x8948, new QString("SIOCGMIIREG") );
319 qDebug( "adding 0x8949 = SIOCSMIIREG" );
320 map->insert( 0x8949, new QString("SIOCSMIIREG") );
321 qDebug( "adding 0x894A = SIOCWANDEV" );
322 map->insert( 0x894A, new QString("SIOCWANDEV") );
323 qDebug( "adding 0x8953 = SIOCDARP" );
324 map->insert( 0x8953, new QString("SIOCDARP") );
325 qDebug( "adding 0x8954 = SIOCGARP" );
326 map->insert( 0x8954, new QString("SIOCGARP") );
327 qDebug( "adding 0x8955 = SIOCSARP" );
328 map->insert( 0x8955, new QString("SIOCSARP") );
329 qDebug( "adding 0x8960 = SIOCDRARP" );
330 map->insert( 0x8960, new QString("SIOCDRARP") );
331 qDebug( "adding 0x8961 = SIOCGRARP" );
332 map->insert( 0x8961, new QString("SIOCGRARP") );
333 qDebug( "adding 0x8962 = SIOCSRARP" );
334 map->insert( 0x8962, new QString("SIOCSRARP") );
335 qDebug( "adding 0x8970 = SIOCGIFMAP" );
336 map->insert( 0x8970, new QString("SIOCGIFMAP") );
337 qDebug( "adding 0x8971 = SIOCSIFMAP" );
338 map->insert( 0x8971, new QString("SIOCSIFMAP") );
339 qDebug( "adding 0x8980 = SIOCADDDLCI" );
340 map->insert( 0x8980, new QString("SIOCADDDLCI") );
341 qDebug( "adding 0x8981 = SIOCDELDLCI" );
342 map->insert( 0x8981, new QString("SIOCDELDLCI") );
343 qDebug( "adding 0x8982 = SIOCGIFVLAN" );
344 map->insert( 0x8982, new QString("SIOCGIFVLAN") );
345 qDebug( "adding 0x8983 = SIOCSIFVLAN" );
346 map->insert( 0x8983, new QString("SIOCSIFVLAN") );
347 qDebug( "adding 0x8990 = SIOCBONDENSLAVE" );
348 map->insert( 0x8990, new QString("SIOCBONDENSLAVE") );
349 qDebug( "adding 0x8991 = SIOCBONDRELEASE" );
350 map->insert( 0x8991, new QString("SIOCBONDRELEASE") );
351 qDebug( "adding 0x8992 = SIOCBONDSETHWADDR" );
352 map->insert( 0x8992, new QString("SIOCBONDSETHWADDR") );
353 qDebug( "adding 0x8993 = SIOCBONDSLAVEINFOQUERY" );
354 map->insert( 0x8993, new QString("SIOCBONDSLAVEINFOQUERY") );
355 qDebug( "adding 0x8994 = SIOCBONDINFOQUERY" );
356 map->insert( 0x8994, new QString("SIOCBONDINFOQUERY") );
357 qDebug( "adding 0x8995 = SIOCBONDCHANGEACTIVE" );
358 map->insert( 0x8995, new QString("SIOCBONDCHANGEACTIVE") );
359 qDebug( "adding 0x89F0 = SIOCDEVPRIVATE" );
360 map->insert( 0x89F0, new QString("SIOCDEVPRIVATE") );
361 qDebug( "adding 0x89E0 = SIOCPROTOPRIVATE" );
362 map->insert( 0x89E0, new QString("SIOCPROTOPRIVATE") );
363
364 return map;
365};
366
diff --git a/libopie2/opienet/oioctlmap.h b/libopie2/opienet/oioctlmap.h
deleted file mode 100644
index 1cd89a3..0000000
--- a/libopie2/opienet/oioctlmap.h
+++ b/dev/null
@@ -1,17 +0,0 @@
1
2/*
3 * ioctl table - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
4 */
5
6#ifndef IOCTLMAP_H
7#define IOCTLMAP_H
8
9#include <qstring.h>
10#include <qintdict.h>
11
12typedef QIntDict<QString> IntStringMap;
13
14IntStringMap* constructIoctlMap();
15
16#endif
17
diff --git a/libopie2/opienet/onetutils.cpp b/libopie2/opienet/onetutils.cpp
index ce147c5..e3eb327 100644
--- a/libopie2/opienet/onetutils.cpp
+++ b/libopie2/opienet/onetutils.cpp
@@ -25,37 +25,26 @@
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#include <opie2/onetutils.h> 32#include <opie2/onetutils.h>
33#include <opie2/onetwork.h> 33#include <opie2/onetwork.h>
34#include <opie2/omanufacturerdb.h> 34#include <opie2/omanufacturerdb.h>
35 35
36#include <net/if.h> 36#include <net/if.h>
37#include <cassert> 37#include <assert.h>
38#include <cstdio> 38#include <stdio.h>
39using namespace std;
40
41#define IW_PRIV_TYPE_MASK 0x7000
42#define IW_PRIV_TYPE_NONE 0x0000
43#define IW_PRIV_TYPE_BYTE 0x1000
44#define IW_PRIV_TYPE_CHAR 0x2000
45#define IW_PRIV_TYPE_INT 0x4000
46#define IW_PRIV_TYPE_FLOAT 0x5000
47#define IW_PRIV_TYPE_ADDR 0x6000
48#define IW_PRIV_SIZE_FIXED 0x0800
49#define IW_PRIV_SIZE_MASK 0x07FF
50 39
51/*====================================================================================== 40/*======================================================================================
52 * OMacAddress 41 * OMacAddress
53 *======================================================================================*/ 42 *======================================================================================*/
54 43
55// static initializer for broadcast and unknown MAC Adresses 44// static initializer for broadcast and unknown MAC Adresses
56const unsigned char __broadcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; 45const unsigned char __broadcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
57const OMacAddress& OMacAddress::broadcast = OMacAddress( __broadcast ); 46const OMacAddress& OMacAddress::broadcast = OMacAddress( __broadcast );
58const unsigned char __unknown[6] = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 }; 47const unsigned char __unknown[6] = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 };
59const OMacAddress& OMacAddress::unknown = OMacAddress( __unknown ); 48const OMacAddress& OMacAddress::unknown = OMacAddress( __unknown );
60 49
61//TODO: Incorporate Ethernet Manufacturer database here! (inline or so) 50//TODO: Incorporate Ethernet Manufacturer database here! (inline or so)
diff --git a/libopie2/opienet/onetutils.h b/libopie2/opienet/onetutils.h
index 541c5ab..bddfab9 100644
--- a/libopie2/opienet/onetutils.h
+++ b/libopie2/opienet/onetutils.h
@@ -116,24 +116,42 @@ class OPrivateIOCTL : public QObject
116 u_int16_t _setargs; 116 u_int16_t _setargs;
117 117
118}; 118};
119 119
120 /*====================================================================================== 120 /*======================================================================================
121 * Miscellaneous 121 * Miscellaneous
122 *======================================================================================*/ 122 *======================================================================================*/
123 123
124void dumpBytes( const unsigned char* data, int num ); 124void dumpBytes( const unsigned char* data, int num );
125QString modeToString( int ); 125QString modeToString( int );
126int stringToMode( const QString& ); 126int stringToMode( const QString& );
127 127
128#define IW_PRIV_TYPE_MASK 0x7000
129#define IW_PRIV_TYPE_NONE 0x0000
130#define IW_PRIV_TYPE_BYTE 0x1000
131#define IW_PRIV_TYPE_CHAR 0x2000
132#define IW_PRIV_TYPE_INT 0x4000
133#define IW_PRIV_TYPE_FLOAT 0x5000
134#define IW_PRIV_TYPE_ADDR 0x6000
135#define IW_PRIV_SIZE_FIXED 0x0800
136#define IW_PRIV_SIZE_MASK 0x07FF
137
138#ifndef ARPHRD_IEEE80211
139#define ARPHRD_IEEE80211 801
140#endif
141#ifndef ARPHRD_IEEE80211_PRISM
142#define ARPHRD_IEEE80211_PRISM 802
143#endif
144
145
128/* Network to host order macros */ 146/* Network to host order macros */
129 147
130#ifdef LBL_ALIGN 148#ifdef LBL_ALIGN
131#define EXTRACT_16BITS(p) \ 149#define EXTRACT_16BITS(p) \
132 ((u_int16_t)((u_int16_t)*((const u_int8_t *)(p) + 0) << 8 | \ 150 ((u_int16_t)((u_int16_t)*((const u_int8_t *)(p) + 0) << 8 | \
133 (u_int16_t)*((const u_int8_t *)(p) + 1))) 151 (u_int16_t)*((const u_int8_t *)(p) + 1)))
134#define EXTRACT_32BITS(p) \ 152#define EXTRACT_32BITS(p) \
135 ((u_int32_t)((u_int32_t)*((const u_int8_t *)(p) + 0) << 24 | \ 153 ((u_int32_t)((u_int32_t)*((const u_int8_t *)(p) + 0) << 24 | \
136 (u_int32_t)*((const u_int8_t *)(p) + 1) << 16 | \ 154 (u_int32_t)*((const u_int8_t *)(p) + 1) << 16 | \
137 (u_int32_t)*((const u_int8_t *)(p) + 2) << 8 | \ 155 (u_int32_t)*((const u_int8_t *)(p) + 2) << 8 | \
138 (u_int32_t)*((const u_int8_t *)(p) + 3))) 156 (u_int32_t)*((const u_int8_t *)(p) + 3)))
139#else 157#else
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index c329e9a..95c813f 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -36,41 +36,39 @@
36#include <opie2/onetwork.h> 36#include <opie2/onetwork.h>
37#include <opie2/ostation.h> 37#include <opie2/ostation.h>
38 38
39/* QT */ 39/* QT */
40 40
41#include <qfile.h> 41#include <qfile.h>
42#include <qtextstream.h> 42#include <qtextstream.h>
43 43
44/* UNIX */ 44/* UNIX */
45 45
46#include <assert.h> 46#include <assert.h>
47#include <arpa/inet.h> 47#include <arpa/inet.h>
48#include <cerrno> 48#include <errno.h>
49#include <cstring> 49#include <string.h>
50#include <cstdlib> 50#include <stdlib.h>
51#include <math.h> 51#include <math.h>
52#include <sys/ioctl.h> 52#include <sys/ioctl.h>
53#include <sys/socket.h> 53#include <sys/socket.h>
54#include <sys/types.h> 54#include <sys/types.h>
55#include <unistd.h> 55#include <unistd.h>
56#include <linux/sockios.h> 56#include <linux/sockios.h>
57#include <net/if_arp.h> 57#include <net/if_arp.h>
58#include <stdarg.h> 58#include <stdarg.h>
59 59
60using namespace std;
61
62#ifndef NODEBUG 60#ifndef NODEBUG
63#include <opie2/oioctlmap.h> 61#include <opie2/odebugmapper.h>
64IntStringMap* _ioctlmap = constructIoctlMap(); 62DebugMapper* debugmapper = new DebugMapper();
65#endif 63#endif
66 64
67/*====================================================================================== 65/*======================================================================================
68 * ONetwork 66 * ONetwork
69 *======================================================================================*/ 67 *======================================================================================*/
70 68
71ONetwork* ONetwork::_instance = 0; 69ONetwork* ONetwork::_instance = 0;
72 70
73ONetwork::ONetwork() 71ONetwork::ONetwork()
74{ 72{
75 qDebug( "ONetwork::ONetwork()" ); 73 qDebug( "ONetwork::ONetwork()" );
76 qDebug( "ONetwork: This code has been compiled against Wireless Extensions V%d", WIRELESS_EXT ); 74 qDebug( "ONetwork: This code has been compiled against Wireless Extensions V%d", WIRELESS_EXT );
@@ -187,27 +185,27 @@ void ONetworkInterface::init()
187 { 185 {
188 qDebug( "ONetworkInterface::init(): Warning - can't get socket for device '%s'", name() ); 186 qDebug( "ONetworkInterface::init(): Warning - can't get socket for device '%s'", name() );
189 return; 187 return;
190 } 188 }
191} 189}
192 190
193 191
194bool ONetworkInterface::ioctl( int call, struct ifreq& ifreq ) const 192bool ONetworkInterface::ioctl( int call, struct ifreq& ifreq ) const
195{ 193{
196 #ifndef NODEBUG 194 #ifndef NODEBUG
197 int result = ::ioctl( _sfd, call, &ifreq ); 195 int result = ::ioctl( _sfd, call, &ifreq );
198 if ( result == -1 ) 196 if ( result == -1 )
199 qDebug( "ONetworkInterface::ioctl (%s) call %s (0x%04X) - Status: Failed: %d (%s)", name(), (const char*) *(*_ioctlmap)[call], call, result, strerror( errno ) ); 197 qDebug( "ONetworkInterface::ioctl (%s) call %s (0x%04X) - Status: Failed: %d (%s)", name(), (const char*) debugmapper->map( call ), call, result, strerror( errno ) );
200 else 198 else
201 qDebug( "ONetworkInterface::ioctl (%s) call %s (0x%04X) - Status: Ok.", name(), (const char*) *(*_ioctlmap)[call], call ); 199 qDebug( "ONetworkInterface::ioctl (%s) call %s (0x%04X) - Status: Ok.", name(), (const char*) debugmapper->map( call ), call );
202 return ( result != -1 ); 200 return ( result != -1 );
203 #else 201 #else
204 return ::ioctl( _sfd, call, &ifreq ) != -1; 202 return ::ioctl( _sfd, call, &ifreq ) != -1;
205 #endif 203 #endif
206} 204}
207 205
208 206
209bool ONetworkInterface::ioctl( int call ) const 207bool ONetworkInterface::ioctl( int call ) const
210{ 208{
211 strcpy( _ifr.ifr_name, name() ); 209 strcpy( _ifr.ifr_name, name() );
212 return ioctl( call, _ifr ); 210 return ioctl( call, _ifr );
213} 211}
@@ -960,27 +958,27 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
960 { 958 {
961 qDebug( " - no results (timeout) :(" ); 959 qDebug( " - no results (timeout) :(" );
962 return stations; 960 return stations;
963 } 961 }
964} 962}
965 963
966 964
967bool OWirelessNetworkInterface::wioctl( int call, struct iwreq& iwreq ) const 965bool OWirelessNetworkInterface::wioctl( int call, struct iwreq& iwreq ) const
968{ 966{
969 #ifndef NODEBUG 967 #ifndef NODEBUG
970 int result = ::ioctl( _sfd, call, &iwreq ); 968 int result = ::ioctl( _sfd, call, &iwreq );
971 if ( result == -1 ) 969 if ( result == -1 )
972 qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Failed: %d (%s)", name(), (const char*) *(*_ioctlmap)[call], call, result, strerror( errno ) ); 970 qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Failed: %d (%s)", name(), (const char*) debugmapper->map( call ), call, result, strerror( errno ) );
973 else 971 else
974 qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Ok.", name(), (const char*) *(*_ioctlmap)[call], call ); 972 qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Ok.", name(), (const char*) debugmapper->map( call ), call );
975 return ( result != -1 ); 973 return ( result != -1 );
976 #else 974 #else
977 return ::ioctl( _sfd, call, &iwreq ) != -1; 975 return ::ioctl( _sfd, call, &iwreq ) != -1;
978 #endif 976 #endif
979} 977}
980 978
981 979
982bool OWirelessNetworkInterface::wioctl( int call ) const 980bool OWirelessNetworkInterface::wioctl( int call ) const
983{ 981{
984 strcpy( _iwr.ifr_name, name() ); 982 strcpy( _iwr.ifr_name, name() );
985 return wioctl( call, _iwr ); 983 return wioctl( call, _iwr );
986} 984}
diff --git a/libopie2/opienet/opienet.pro b/libopie2/opienet/opienet.pro
index d966462..386c2db 100644
--- a/libopie2/opienet/opienet.pro
+++ b/libopie2/opienet/opienet.pro
@@ -1,26 +1,26 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on debug 2CONFIG += qt warn_on debug
3DESTDIR = $(OPIEDIR)/lib 3DESTDIR = $(OPIEDIR)/lib
4HEADERS = 802_11_user.h \ 4HEADERS = 802_11_user.h \
5 dhcp.h \ 5 dhcp.h \
6 udp_ports.h \ 6 udp_ports.h \
7 wireless.h \ 7 wireless.h \
8 oioctlmap.h \ 8 odebugmapper.h \
9 omanufacturerdb.h \ 9 omanufacturerdb.h \
10 onetutils.h \ 10 onetutils.h \
11 onetwork.h \ 11 onetwork.h \
12 opcap.h \ 12 opcap.h \
13 ostation.h 13 ostation.h
14SOURCES = oioctlmap.cpp \ 14SOURCES = odebugmapper.cpp \
15 omanufacturerdb.cpp \ 15 omanufacturerdb.cpp \
16 onetutils.cpp \ 16 onetutils.cpp \
17 onetwork.cpp \ 17 onetwork.cpp \
18 opcap.cpp \ 18 opcap.cpp \
19 ostation.cpp 19 ostation.cpp
20INTERFACES = 20INTERFACES =
21TARGET = opienet2 21TARGET = opienet2
22VERSION = 1.8.1 22VERSION = 1.8.1
23INCLUDEPATH += $(OPIEDIR)/include 23INCLUDEPATH += $(OPIEDIR)/include
24DEPENDPATH += $(OPIEDIR)/include 24DEPENDPATH += $(OPIEDIR)/include
25LIBS += -lpcap 25LIBS += -lpcap
26 26
diff --git a/libopie2/tools/regen.py b/libopie2/tools/regen.py
index 2f7f418..9ad5352 100755
--- a/libopie2/tools/regen.py
+++ b/libopie2/tools/regen.py
@@ -11,54 +11,84 @@ result = os.popen( 'find /usr/include -name "*.h" |xargs grep -h SIOC|grep 0x' )
11try: 11try:
12 tablehfile = file( sys.argv[1]+".h", "w" ) 12 tablehfile = file( sys.argv[1]+".h", "w" )
13except: 13except:
14 tablehfile = sys.stdout 14 tablehfile = sys.stdout
15 15
16try: 16try:
17 tablecfile = file( sys.argv[1]+".cpp", "w" ) 17 tablecfile = file( sys.argv[1]+".cpp", "w" )
18except: 18except:
19 tablecfile = sys.stdout 19 tablecfile = sys.stdout
20 20
21print >>tablehfile,""" 21print >>tablehfile,"""
22/* 22/*
23 * ioctl table - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de> 23 * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
24 */ 24 */
25 25
26#ifndef IOCTLMAP_H 26#ifndef DEBUGMAPPER_H
27#define IOCTLMAP_H 27#define DEBUGMAPPER_H
28 28
29#include <qstring.h> 29#include <qstring.h>
30#include <qintdict.h> 30#include <qintdict.h>
31 31
32typedef QIntDict<QString> IntStringMap; 32typedef QIntDict<QString> IntStringMap;
33 33
34IntStringMap* constructIoctlMap(); 34class DebugMapper
35{
36 public:
37 DebugMapper();
38 ~DebugMapper();
39
40 const QString& map( int value ) const;
41 private:
42 IntStringMap _map;
43};
35 44
36#endif 45#endif
37""" 46"""
38 47
39print >>tablecfile,""" 48print >>tablecfile,"""
40/* 49/*
41 * ioctl table - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de> 50 * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
42 */ 51 */
43 52
44#include "%s" 53#include "%s"
45 54
46IntStringMap* constructIoctlMap() 55DebugMapper::DebugMapper()
47{ 56{
48\tIntStringMap* map = new IntStringMap(); 57 qDebug( "DebugMapper::DebugMapper()" );
49 58
50""" % (tablehfile.name) 59""" % (tablehfile.name)
51 60
52for line in result: 61for line in result:
53 l = line.split() 62 l = line.split()
54 if not l[0].startswith( "#define" ) or not l[2].startswith( "0x" ): 63 if not l[0].startswith( "#define" ) or not l[2].startswith( "0x" ):
55 print >>sys.stderr, "can't parse line: %s" % l 64 print >>sys.stderr, "can't parse line: %s" % l
56 continue 65 continue
57 #print >>tablecfile, "\tqDebug( \"adding %s = %s\" );" % ( l[2], l[1] ) 66 print >>tablecfile, " _map.insert( %s, new QString(\"%s\") );" % ( l[2], l[1] )
58 print >>tablecfile, "\tmap->insert( %s, new QString(\"%s\") );" % ( l[2], l[1] )
59 67
60 68
61print >>tablecfile,""" 69print >>tablecfile,"""
62\treturn map;
63}; 70};
64""" \ No newline at end of file 71
72
73DebugMapper::~DebugMapper()
74{
75 qDebug( "DebugMapper::~DebugMapper()" );
76}
77
78
79const QString& DebugMapper::map( int value ) const
80{
81 QString* result = _map[ value ];
82
83 if ( !result )
84 {
85 qDebug( "DebugMapper::map() - value not found." );
86 return QString::null;
87 }
88 else
89 {
90 return *result;
91 }
92}
93
94"""