summaryrefslogtreecommitdiff
path: root/libopie2
Unidiff
Diffstat (limited to 'libopie2') (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
@@ -371,2 +371,16 @@ struct ieee_802_11_mgmt_body {
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
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
@@ -653,3 +653,4 @@ bool OWirelessNetworkInterface::monitorMode() const
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}
@@ -935,3 +936,3 @@ void OOrinocoMonitoringInterface::setChannel( int c )
935{ 936{
936 _if->setPrivate( "monitor", 2, 2, c ); 937 _if->setPrivate( "monitor", 2, 1, c );
937} 938}
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
@@ -67,2 +67,7 @@ OPacket::OPacket( int datalink, packetheaderstruct header, const unsigned char*
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:
@@ -318,2 +323,28 @@ OTCPPacket::~OTCPPacket()
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
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
@@ -157,2 +157,21 @@ class OEthernetPacket : public QObject
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