summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/802_11_user.h14
-rw-r--r--libopie2/opienet/onetwork.cpp5
-rw-r--r--libopie2/opienet/opcap.cpp31
-rw-r--r--libopie2/opienet/opcap.h19
4 files changed, 67 insertions, 2 deletions
diff --git a/libopie2/opienet/802_11_user.h b/libopie2/opienet/802_11_user.h
index f596bd8..cd98503 100644
--- a/libopie2/opienet/802_11_user.h
+++ b/libopie2/opienet/802_11_user.h
@@ -366,12 +366,26 @@ struct ieee_802_11_mgmt_body {
366 // struct ds_tds; 366 // struct ds_tds;
367 // struct cf_tcf; 367 // struct cf_tcf;
368 // struct fh_tfh; 368 // struct fh_tfh;
369 // struct tim_ttim; 369 // struct tim_ttim;
370}; 370};
371 371
372/* a 802.11 value */
373struct val_80211 {
374 unsigned int did;
375 unsigned short status, len;
376 unsigned int data;
377};
378
379/* header attached during prism monitor mode */
380struct prism_hdr {
381 unsigned int msgcode, msglen;
382 char devname[16];
383 struct val_80211 hosttime, mactime, channel, rssi, sq, signal,
384 noise, rate, istx, frmlen;
385};
372 386
373struct ieee_802_11_data_body { 387struct ieee_802_11_data_body {
374//FIXME 388//FIXME
375}; 389};
376 390
377struct ieee_802_11_control_body { 391struct ieee_802_11_control_body {
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index be2736a..95e7043 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -648,13 +648,14 @@ void OWirelessNetworkInterface::setMonitorMode( bool b )
648} 648}
649 649
650 650
651bool OWirelessNetworkInterface::monitorMode() const 651bool OWirelessNetworkInterface::monitorMode() const
652{ 652{
653 qDebug( "dataLinkType = %d", dataLinkType() ); 653 qDebug( "dataLinkType = %d", dataLinkType() );
654 return dataLinkType() == ARPHRD_IEEE80211; 654 return ( dataLinkType() == ARPHRD_IEEE80211 || dataLinkType() == 802 );
655 // 802 is the header type for PRISM - Linux support for this is pending...
655} 656}
656 657
657 658
658QString OWirelessNetworkInterface::nickName() const 659QString OWirelessNetworkInterface::nickName() const
659{ 660{
660 char str[IW_ESSID_MAX_SIZE]; 661 char str[IW_ESSID_MAX_SIZE];
@@ -930,13 +931,13 @@ OOrinocoMonitoringInterface::~OOrinocoMonitoringInterface()
930{ 931{
931} 932}
932 933
933 934
934void OOrinocoMonitoringInterface::setChannel( int c ) 935void OOrinocoMonitoringInterface::setChannel( int c )
935{ 936{
936 _if->setPrivate( "monitor", 2, 2, c ); 937 _if->setPrivate( "monitor", 2, 1, c );
937} 938}
938 939
939 940
940void OOrinocoMonitoringInterface::setEnabled( bool b ) 941void OOrinocoMonitoringInterface::setEnabled( bool b )
941{ 942{
942 if ( b ) 943 if ( b )
diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp
index e362883..675818e 100644
--- a/libopie2/opienet/opcap.cpp
+++ b/libopie2/opienet/opcap.cpp
@@ -62,12 +62,17 @@ OPacket::OPacket( int datalink, packetheaderstruct header, const unsigned char*
62 62
63 case DLT_IEEE802_11: 63 case DLT_IEEE802_11:
64 qDebug( "OPacket::OPacket(): Received Packet. Datalink = IEEE802.11" ); 64 qDebug( "OPacket::OPacket(): Received Packet. Datalink = IEEE802.11" );
65 new OWaveLanPacket( _end, (const struct ieee_802_11_header*) data, this ); 65 new OWaveLanPacket( _end, (const struct ieee_802_11_header*) data, this );
66 break; 66 break;
67 67
68 case DLT_PRISM_HEADER:
69 qDebug( "OPacket::OPacket(): Received Packet. Datalink = PRISM_HEADER" );
70 new OPrismHeaderPacket( _end, (const struct prism_hdr*) (unsigned char*) data, this );
71 break;
72
68 default: 73 default:
69 qWarning( "OPacket::OPacket(): Received Packet over unsupported datalink '%s'!", datalink ); 74 qWarning( "OPacket::OPacket(): Received Packet over unsupported datalink '%s'!", datalink );
70 } 75 }
71} 76}
72 77
73 78
@@ -313,12 +318,38 @@ OTCPPacket::OTCPPacket( const unsigned char* end, const struct tcphdr* data, QOb
313OTCPPacket::~OTCPPacket() 318OTCPPacket::~OTCPPacket()
314{ 319{
315} 320}
316 321
317 322
318/*====================================================================================== 323/*======================================================================================
324 * OPrismHeaderPacket
325 *======================================================================================*/
326
327
328OPrismHeaderPacket::OPrismHeaderPacket( const unsigned char* end, const struct prism_hdr* data, QObject* parent )
329 :QObject( parent, "Prism" ), _header( data )
330
331{
332 qDebug( "OPrismHeaderPacket::OPrismHeaderPacket(): decoding PRISM header..." );
333
334 qDebug( "Signal Strength = %d", data->signal.data );
335
336 new OWaveLanPacket( end, (const struct ieee_802_11_header*) (data+1), this );
337}
338
339OPrismHeaderPacket::~OPrismHeaderPacket()
340{
341}
342
343
344unsigned int OPrismHeaderPacket::signalStrength() const
345{
346 return _header->signal.data;
347}
348
349/*======================================================================================
319 * OWaveLanPacket 350 * OWaveLanPacket
320 *======================================================================================*/ 351 *======================================================================================*/
321 352
322 353
323OWaveLanPacket::OWaveLanPacket( const unsigned char* end, const struct ieee_802_11_header* data, QObject* parent ) 354OWaveLanPacket::OWaveLanPacket( const unsigned char* end, const struct ieee_802_11_header* data, QObject* parent )
324 :QObject( parent, "802.11" ), _wlanhdr( data ) 355 :QObject( parent, "802.11" ), _wlanhdr( data )
diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h
index fe88e68..83f7115 100644
--- a/libopie2/opienet/opcap.h
+++ b/libopie2/opienet/opcap.h
@@ -152,12 +152,31 @@ class OEthernetPacket : public QObject
152 private: 152 private:
153 const struct ether_header* _ether; 153 const struct ether_header* _ether;
154}; 154};
155 155
156 156
157/*====================================================================================== 157/*======================================================================================
158 * OPrismHeaderPacket - DLT_PRISM_HEADER frame
159 *======================================================================================*/
160
161class OPrismHeaderPacket : public QObject
162{
163 Q_OBJECT
164
165 public:
166 OPrismHeaderPacket( const unsigned char*, const struct prism_hdr*, QObject* parent = 0 );
167 virtual ~OPrismHeaderPacket();
168
169 unsigned int signalStrength() const;
170
171 private:
172 const struct prism_hdr* _header;
173};
174
175
176/*======================================================================================
158 * OWaveLanPacket - DLT_IEEE802_11 frame 177 * OWaveLanPacket - DLT_IEEE802_11 frame
159 *======================================================================================*/ 178 *======================================================================================*/
160 179
161class OWaveLanPacket : public QObject 180class OWaveLanPacket : public QObject
162{ 181{
163 Q_OBJECT 182 Q_OBJECT