summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
index f1966c1..ebd3b5f 100644
--- a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
+++ b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
@@ -120,97 +120,97 @@ public:
120 120
121 // enable monitoring mode 121 // enable monitoring mode
122 printf( "Enabling monitor mode...\n" ); 122 printf( "Enabling monitor mode...\n" );
123 wiface->setMode( "monitor" ); 123 wiface->setMode( "monitor" );
124 124
125 // open a packet capturer 125 // open a packet capturer
126 cap = new OPacketCapturer(); 126 cap = new OPacketCapturer();
127 cap->open( interface ); 127 cap->open( interface );
128 if ( !cap->isOpen() ) 128 if ( !cap->isOpen() )
129 { 129 {
130 printf( "Unable to open libpcap (%s). Exiting.\n", strerror( errno ) ); 130 printf( "Unable to open libpcap (%s). Exiting.\n", strerror( errno ) );
131 exit( -1 ); 131 exit( -1 );
132 } 132 }
133 133
134 // set capturer to non-blocking mode 134 // set capturer to non-blocking mode
135 cap->setBlocking( false ); 135 cap->setBlocking( false );
136 136
137 // start channel hopper 137 // start channel hopper
138 //wiface->setChannelHopping( 1000 ); 138 //wiface->setChannelHopping( 1000 );
139 139
140 // connect 140 // connect
141 connect( cap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); 141 connect( cap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) );
142 // timer 142 // timer
143 startTimer( 1000 ); 143 startTimer( 1000 );
144 144
145 } 145 }
146 146
147 ~Wellenreiter() {}; 147 ~Wellenreiter() {};
148 148
149public slots: 149public slots:
150 virtual void timerEvent(QTimerEvent* e) 150 virtual void timerEvent(QTimerEvent* e)
151 { 151 {
152 wiface->setChannel( channel++ ); 152 wiface->setChannel( channel++ );
153 if ( channel == 14 ) channel = 1; 153 if ( channel == 14 ) channel = 1;
154 } 154 }
155 155
156 void receivePacket(OPacket* p) 156 void receivePacket(OPacket* p)
157 { 157 {
158 if (!p) 158 if (!p)
159 { 159 {
160 printf( "(empty packet received)\n" ); 160 printf( "(empty packet received)\n" );
161 return; 161 return;
162 } 162 }
163 163
164 OWaveLanManagementPacket* beacon = (OWaveLanManagementPacket*) p->child( "802.11 Management" ); 164 OWaveLanManagementPacket* beacon = (OWaveLanManagementPacket*) p->child( "802.11 Management" );
165 if ( beacon ) 165 if ( beacon )
166 { 166 {
167 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); 167 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
168 QString essid = ssid ? ssid->ID() : "<unknown>"; 168 QString essid = ssid ? ssid->ID() : QString::fromLatin1( "<unknown>" );
169 169
170 if ( stations.find( essid ) ) 170 if ( stations.find( essid ) )
171 stations[essid]->beacons++; 171 stations[essid]->beacons++;
172 else 172 else
173 { 173 {
174 printf( "found new network @ channel %d, SSID = '%s'\n", wiface->channel(), (const char*) essid ); 174 printf( "found new network @ channel %d, SSID = '%s'\n", wiface->channel(), (const char*) essid );
175 stations.insert( essid, new Station( "unknown", wiface->channel(), 175 stations.insert( essid, new Station( "unknown", wiface->channel(),
176 ((OWaveLanPacket*) beacon->parent())->usesWep() ) ); 176 ((OWaveLanPacket*) beacon->parent())->usesWep() ) );
177 } 177 }
178 return; 178 return;
179 } 179 }
180 180
181 OWaveLanDataPacket* data = (OWaveLanDataPacket*) p->child( "802.11 Data" ); 181 OWaveLanDataPacket* data = (OWaveLanDataPacket*) p->child( "802.11 Data" );
182 if ( data ) 182 if ( data )
183 { 183 {
184 OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); 184 OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" );
185 if ( wlan->fromDS() && !wlan->toDS() ) 185 if ( wlan->fromDS() && !wlan->toDS() )
186 { 186 {
187 printf( "FromDS: '%s' -> '%s' via '%s'\n", 187 printf( "FromDS: '%s' -> '%s' via '%s'\n",
188 (const char*) wlan->macAddress3().toString(true), 188 (const char*) wlan->macAddress3().toString(true),
189 (const char*) wlan->macAddress1().toString(true), 189 (const char*) wlan->macAddress1().toString(true),
190 (const char*) wlan->macAddress2().toString(true) ); 190 (const char*) wlan->macAddress2().toString(true) );
191 } 191 }
192 else 192 else
193 if ( !wlan->fromDS() && wlan->toDS() ) 193 if ( !wlan->fromDS() && wlan->toDS() )
194 { 194 {
195 printf( "ToDS: '%s' -> '%s' via '%s'\n", 195 printf( "ToDS: '%s' -> '%s' via '%s'\n",
196 (const char*) wlan->macAddress2().toString(true), 196 (const char*) wlan->macAddress2().toString(true),
197 (const char*) wlan->macAddress3().toString(true), 197 (const char*) wlan->macAddress3().toString(true),
198 (const char*) wlan->macAddress1().toString(true) ); 198 (const char*) wlan->macAddress1().toString(true) );
199 } 199 }
200 else 200 else
201 if ( wlan->fromDS() && wlan->toDS() ) 201 if ( wlan->fromDS() && wlan->toDS() )
202 { 202 {
203 printf( "WSD(bridge): '%s' -> '%s' via '%s' and '%s'\n", 203 printf( "WSD(bridge): '%s' -> '%s' via '%s' and '%s'\n",
204 (const char*) wlan->macAddress4().toString(true), 204 (const char*) wlan->macAddress4().toString(true),
205 (const char*) wlan->macAddress3().toString(true), 205 (const char*) wlan->macAddress3().toString(true),
206 (const char*) wlan->macAddress1().toString(true), 206 (const char*) wlan->macAddress1().toString(true),
207 (const char*) wlan->macAddress2().toString(true) ); 207 (const char*) wlan->macAddress2().toString(true) );
208 } 208 }
209 else 209 else
210 { 210 {
211 printf( "IBSS(AdHoc): '%s' -> '%s' (Cell: '%s')'\n", 211 printf( "IBSS(AdHoc): '%s' -> '%s' (Cell: '%s')'\n",
212 (const char*) wlan->macAddress2().toString(true), 212 (const char*) wlan->macAddress2().toString(true),
213 (const char*) wlan->macAddress1().toString(true), 213 (const char*) wlan->macAddress1().toString(true),
214 (const char*) wlan->macAddress3().toString(true) ); 214 (const char*) wlan->macAddress3().toString(true) );
215 } 215 }
216 return; 216 return;