summaryrefslogtreecommitdiff
path: root/libopie2/examples
authormickeyl <mickeyl>2003-04-07 18:07:38 (UTC)
committer mickeyl <mickeyl>2003-04-07 18:07:38 (UTC)
commitcac6a08e456a057a19cc1fc56824fc98ff4f0bc1 (patch) (unidiff)
treeb17fa559629bcb9f49d685d3ec8b8dddc6a20f46 /libopie2/examples
parent75f029f87d4c84b37ccfe1c81ef205a6cd5fca79 (diff)
downloadopie-cac6a08e456a057a19cc1fc56824fc98ff4f0bc1.zip
opie-cac6a08e456a057a19cc1fc56824fc98ff4f0bc1.tar.gz
opie-cac6a08e456a057a19cc1fc56824fc98ff4f0bc1.tar.bz2
- add OManufacturerDB
- API extensions for OMacAddress - add data packet recognition for miniwellenreiter
Diffstat (limited to 'libopie2/examples') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp63
-rw-r--r--libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp1
2 files changed, 40 insertions, 24 deletions
diff --git a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
index 7581888..f800336 100644
--- a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
+++ b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
@@ -83,29 +83,6 @@ public:
83 wiface = (OWirelessNetworkInterface*) iface; 83 wiface = (OWirelessNetworkInterface*) iface;
84 printf( "Using wireless interface '%s' for scanning (current SSID is '%s')...\n", (const char*) interface, (const char*) wiface->SSID() ); 84 printf( "Using wireless interface '%s' for scanning (current SSID is '%s')...\n", (const char*) interface, (const char*) wiface->SSID() );
85 85
86 /*
87
88 // ifconfig down the interface - this enable more crash-proof
89 // scanning with drivers like spectrum_cs...
90 if ( wiface->isUp() )
91 {
92 printf( "Interface status is up... switching to down... " );
93 wiface->setUp( false );
94 if ( wiface->isUp() )
95 {
96 printf( "failed (%s). Exiting.\n", strerror( errno ) );
97 exit( -1 );
98 }
99 else
100 {
101 printf( "ok.\n" );
102 }
103 }
104 else
105 printf( "Interface status is already down - good.\n" );
106
107 */
108
109 // ifconfig +promisc the interface to receive all packets 86 // ifconfig +promisc the interface to receive all packets
110 if ( !wiface->promiscuousMode() ) 87 if ( !wiface->promiscuousMode() )
111 { 88 {
@@ -169,7 +146,6 @@ public slots:
169 } 146 }
170 147
171 OWaveLanManagementPacket* beacon = (OWaveLanManagementPacket*) p->child( "802.11 Management" ); 148 OWaveLanManagementPacket* beacon = (OWaveLanManagementPacket*) p->child( "802.11 Management" );
172
173 if ( beacon ) 149 if ( beacon )
174 { 150 {
175 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); 151 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
@@ -183,6 +159,45 @@ public slots:
183 stations.insert( essid, new Station( "unknown", wiface->channel(), 159 stations.insert( essid, new Station( "unknown", wiface->channel(),
184 ((OWaveLanPacket*) beacon->parent())->usesWep() ) ); 160 ((OWaveLanPacket*) beacon->parent())->usesWep() ) );
185 } 161 }
162 return;
163 }
164
165 OWaveLanDataPacket* data = (OWaveLanDataPacket*) p->child( "802.11 Data" );
166 if ( data )
167 {
168 OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" );
169 if ( wlan->fromDS() && !wlan->toDS() )
170 {
171 printf( "FromDS: '%s' -> '%s' via '%s'\n",
172 (const char*) wlan->macAddress3().toString(true),
173 (const char*) wlan->macAddress1().toString(true),
174 (const char*) wlan->macAddress2().toString(true) );
175 }
176 else
177 if ( !wlan->fromDS() && wlan->toDS() )
178 {
179 printf( "ToDS: '%s' -> '%s' via '%s'\n",
180 (const char*) wlan->macAddress2().toString(true),
181 (const char*) wlan->macAddress3().toString(true),
182 (const char*) wlan->macAddress1().toString(true) );
183 }
184 else
185 if ( wlan->fromDS() && wlan->toDS() )
186 {
187 printf( "WSD(bridge): '%s' -> '%s' via '%s' and '%s'\n",
188 (const char*) wlan->macAddress4().toString(true),
189 (const char*) wlan->macAddress3().toString(true),
190 (const char*) wlan->macAddress1().toString(true),
191 (const char*) wlan->macAddress2().toString(true) );
192 }
193 else
194 {
195 printf( "IBSS(AdHoc): '%s' -> '%s' (Cell: '%s')'\n",
196 (const char*) wlan->macAddress2().toString(true),
197 (const char*) wlan->macAddress1().toString(true),
198 (const char*) wlan->macAddress3().toString(true) );
199 }
200 return;
186 } 201 }
187 } 202 }
188private: 203private:
diff --git a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp
index 020fc23..f801b15 100644
--- a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp
+++ b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp
@@ -12,6 +12,7 @@ int main( int argc, char** argv )
12 { 12 {
13 qDebug( "DEMO: ONetwork contains Interface '%s'", (const char*) it.current()->name() ); 13 qDebug( "DEMO: ONetwork contains Interface '%s'", (const char*) it.current()->name() );
14 qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString() ); 14 qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString() );
15 qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString(true) );
15 qDebug( "Demo: IPv4 Address is '%s'", (const char*) it.current()->ipV4Address() ); 16 qDebug( "Demo: IPv4 Address is '%s'", (const char*) it.current()->ipV4Address() );
16 if ( it.current()->isWireless() ) 17 if ( it.current()->isWireless() )
17 { 18 {