summaryrefslogtreecommitdiff
path: root/libopie2
authormickeyl <mickeyl>2003-10-21 13:23:37 (UTC)
committer mickeyl <mickeyl>2003-10-21 13:23:37 (UTC)
commit76ca3158518a851085b5a5ebe3724d0c0c3be857 (patch) (unidiff)
treec1e3cd417968e08a4f01497a431720f3088f0fa6 /libopie2
parentfccc5d110dea3bc32176694c8e5fc7f014706be6 (diff)
downloadopie-76ca3158518a851085b5a5ebe3724d0c0c3be857.zip
opie-76ca3158518a851085b5a5ebe3724d0c0c3be857.tar.gz
opie-76ca3158518a851085b5a5ebe3724d0c0c3be857.tar.bz2
add clear text debug output for ioctls
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/oioctlmap.cpp366
-rw-r--r--libopie2/opienet/oioctlmap.h17
-rw-r--r--libopie2/opienet/onetwork.cpp21
-rw-r--r--libopie2/opienet/opienet.pro11
-rwxr-xr-xlibopie2/tools/regen.py64
5 files changed, 470 insertions, 9 deletions
diff --git a/libopie2/opienet/oioctlmap.cpp b/libopie2/opienet/oioctlmap.cpp
new file mode 100644
index 0000000..4a67eb6
--- a/dev/null
+++ b/libopie2/opienet/oioctlmap.cpp
@@ -0,0 +1,366 @@
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
new file mode 100644
index 0000000..1cd89a3
--- a/dev/null
+++ b/libopie2/opienet/oioctlmap.h
@@ -0,0 +1,17 @@
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/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index be45924..918ba07 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -58,6 +58,11 @@
58 58
59using namespace std; 59using namespace std;
60 60
61#ifndef NODEBUG
62#include <opie2/oioctlmap.h>
63IntStringMap* _ioctlmap = constructIoctlMap();
64#endif
65
61/*====================================================================================== 66/*======================================================================================
62 * ONetwork 67 * ONetwork
63 *======================================================================================*/ 68 *======================================================================================*/
@@ -187,12 +192,16 @@ void ONetworkInterface::init()
187 192
188bool ONetworkInterface::ioctl( int call, struct ifreq& ifreq ) const 193bool ONetworkInterface::ioctl( int call, struct ifreq& ifreq ) const
189{ 194{
195 #ifndef NODEBUG
190 int result = ::ioctl( _sfd, call, &ifreq ); 196 int result = ::ioctl( _sfd, call, &ifreq );
191 if ( result == -1 ) 197 if ( result == -1 )
192 qDebug( "ONetworkInterface::ioctl (%s) call %d (0x%04X) - Status: Failed: %d (%s)", name(), call, call, result, strerror( errno ) ); 198 qDebug( "ONetworkInterface::ioctl (%s) call %s (0x%04X) - Status: Failed: %d (%s)", name(), (const char*) *(*_ioctlmap)[call], call, result, strerror( errno ) );
193 else 199 else
194 qDebug( "ONetworkInterface::ioctl (%s) call %d (0x%04X) - Status: Ok.", name(), call, call ); 200 qDebug( "ONetworkInterface::ioctl (%s) call %s (0x%04X) - Status: Ok.", name(), (const char*) *(*_ioctlmap)[call], call );
195 return ( result != -1 ); 201 return ( result != -1 );
202 #else
203 return ::ioctl( _sfd, call, &ifreq ) != -1;
204 #endif
196} 205}
197 206
198 207
@@ -883,12 +892,16 @@ int OWirelessNetworkInterface::scanNetwork()
883 892
884bool OWirelessNetworkInterface::wioctl( int call, struct iwreq& iwreq ) const 893bool OWirelessNetworkInterface::wioctl( int call, struct iwreq& iwreq ) const
885{ 894{
895 #ifndef NODEBUG
886 int result = ::ioctl( _sfd, call, &iwreq ); 896 int result = ::ioctl( _sfd, call, &iwreq );
887 if ( result == -1 ) 897 if ( result == -1 )
888 qDebug( "ONetworkInterface::wioctl (%s) call %d (0x%04X) - Status: Failed: %d (%s)", name(), call, call, result, strerror( errno ) ); 898 qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Failed: %d (%s)", name(), (const char*) *(*_ioctlmap)[call], call, result, strerror( errno ) );
889 else 899 else
890 qDebug( "ONetworkInterface::wioctl (%s) call %d (0x%04X) - Status: Ok.", name(), call, call ); 900 qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Ok.", name(), (const char*) *(*_ioctlmap)[call], call );
891 return ( result != -1 ); 901 return ( result != -1 );
902 #else
903 return ::ioctl( _sfd, call, &iwreq ) != -1;
904 #endif
892} 905}
893 906
894 907
diff --git a/libopie2/opienet/opienet.pro b/libopie2/opienet/opienet.pro
index 6fcc1ec..304d968 100644
--- a/libopie2/opienet/opienet.pro
+++ b/libopie2/opienet/opienet.pro
@@ -3,12 +3,15 @@ CONFIG += 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 wireless.h \ 7 wireless.h \
7 omanufacturerdb.cpp \ 8 oioctlmap.h \
8 onetutils.cpp \ 9 omanufacturerdb.h \
10 onetutils.h \
9 onetwork.h \ 11 onetwork.h \
10 opcap.h 12 opcap.h
11SOURCES = omanufacturerdb.cpp \ 13SOURCES = oioctlmap.cpp \
14 omanufacturerdb.cpp \
12 onetutils.cpp \ 15 onetutils.cpp \
13 onetwork.cpp \ 16 onetwork.cpp \
14 opcap.cpp 17 opcap.cpp
@@ -18,8 +21,6 @@ VERSION = 1.8.1
18INCLUDEPATH += $(OPIEDIR)/include 21INCLUDEPATH += $(OPIEDIR)/include
19DEPENDPATH += $(OPIEDIR)/include 22DEPENDPATH += $(OPIEDIR)/include
20LIBS += -lpcap 23LIBS += -lpcap
21MOC_DIR = moc
22OBJECTS_DIR = obj
23 24
24 25
25!contains( platform, x11 ) { 26!contains( platform, x11 ) {
diff --git a/libopie2/tools/regen.py b/libopie2/tools/regen.py
new file mode 100755
index 0000000..2f7f418
--- a/dev/null
+++ b/libopie2/tools/regen.py
@@ -0,0 +1,64 @@
1#!/usr/bin/env python
2
3#
4# regenerate ioctl_table.h
5#
6
7import sys
8import os
9result = os.popen( 'find /usr/include -name "*.h" |xargs grep -h SIOC|grep 0x' ).readlines()
10
11try:
12 tablehfile = file( sys.argv[1]+".h", "w" )
13except:
14 tablehfile = sys.stdout
15
16try:
17 tablecfile = file( sys.argv[1]+".cpp", "w" )
18except:
19 tablecfile = sys.stdout
20
21print >>tablehfile,"""
22/*
23 * ioctl table - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
24 */
25
26#ifndef IOCTLMAP_H
27#define IOCTLMAP_H
28
29#include <qstring.h>
30#include <qintdict.h>
31
32typedef QIntDict<QString> IntStringMap;
33
34IntStringMap* constructIoctlMap();
35
36#endif
37"""
38
39print >>tablecfile,"""
40/*
41 * ioctl table - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
42 */
43
44#include "%s"
45
46IntStringMap* constructIoctlMap()
47{
48\tIntStringMap* map = new IntStringMap();
49
50""" % (tablehfile.name)
51
52for line in result:
53 l = line.split()
54 if not l[0].startswith( "#define" ) or not l[2].startswith( "0x" ):
55 print >>sys.stderr, "can't parse line: %s" % l
56 continue
57 #print >>tablecfile, "\tqDebug( \"adding %s = %s\" );" % ( l[2], l[1] )
58 print >>tablecfile, "\tmap->insert( %s, new QString(\"%s\") );" % ( l[2], l[1] )
59
60
61print >>tablecfile,"""
62\treturn map;
63};
64""" \ No newline at end of file