summaryrefslogtreecommitdiff
Side-by-side diff
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
@@ -364,16 +364,30 @@ struct ieee_802_11_mgmt_body {
// struct ssid_t ssid;
// struct rates_t rates;
// struct ds_t ds;
// struct cf_t cf;
// struct fh_t fh;
// struct tim_t tim;
};
+/* a 802.11 value */
+struct val_80211 {
+ unsigned int did;
+ unsigned short status, len;
+ unsigned int data;
+};
+
+/* header attached during prism monitor mode */
+struct prism_hdr {
+ unsigned int msgcode, msglen;
+ char devname[16];
+ struct val_80211 hosttime, mactime, channel, rssi, sq, signal,
+ noise, rate, istx, frmlen;
+};
struct ieee_802_11_data_body {
//FIXME
};
struct ieee_802_11_control_body {
//FIXME
};
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
@@ -646,17 +646,18 @@ void OWirelessNetworkInterface::setMonitorMode( bool b )
else
qDebug( "ONetwork(): can't switch monitor mode without installed monitoring interface" );
}
bool OWirelessNetworkInterface::monitorMode() const
{
qDebug( "dataLinkType = %d", dataLinkType() );
- return dataLinkType() == ARPHRD_IEEE80211;
+ return ( dataLinkType() == ARPHRD_IEEE80211 || dataLinkType() == 802 );
+ // 802 is the header type for PRISM - Linux support for this is pending...
}
QString OWirelessNetworkInterface::nickName() const
{
char str[IW_ESSID_MAX_SIZE];
_iwr.u.data.pointer = &str[0];
_iwr.u.data.length = IW_ESSID_MAX_SIZE;
@@ -928,17 +929,17 @@ OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* ifa
OOrinocoMonitoringInterface::~OOrinocoMonitoringInterface()
{
}
void OOrinocoMonitoringInterface::setChannel( int c )
{
- _if->setPrivate( "monitor", 2, 2, c );
+ _if->setPrivate( "monitor", 2, 1, c );
}
void OOrinocoMonitoringInterface::setEnabled( bool b )
{
if ( b )
{
setChannel( 1 );
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
@@ -60,16 +60,21 @@ OPacket::OPacket( int datalink, packetheaderstruct header, const unsigned char*
new OEthernetPacket( _end, (const struct ether_header*) data, this );
break;
case DLT_IEEE802_11:
qDebug( "OPacket::OPacket(): Received Packet. Datalink = IEEE802.11" );
new OWaveLanPacket( _end, (const struct ieee_802_11_header*) data, this );
break;
+ case DLT_PRISM_HEADER:
+ qDebug( "OPacket::OPacket(): Received Packet. Datalink = PRISM_HEADER" );
+ new OPrismHeaderPacket( _end, (const struct prism_hdr*) (unsigned char*) data, this );
+ break;
+
default:
qWarning( "OPacket::OPacket(): Received Packet over unsupported datalink '%s'!", datalink );
}
}
OPacket::~OPacket()
{
@@ -311,16 +316,42 @@ OTCPPacket::OTCPPacket( const unsigned char* end, const struct tcphdr* data, QOb
}
OTCPPacket::~OTCPPacket()
{
}
/*======================================================================================
+ * OPrismHeaderPacket
+ *======================================================================================*/
+
+
+OPrismHeaderPacket::OPrismHeaderPacket( const unsigned char* end, const struct prism_hdr* data, QObject* parent )
+ :QObject( parent, "Prism" ), _header( data )
+
+{
+ qDebug( "OPrismHeaderPacket::OPrismHeaderPacket(): decoding PRISM header..." );
+
+ qDebug( "Signal Strength = %d", data->signal.data );
+
+ new OWaveLanPacket( end, (const struct ieee_802_11_header*) (data+1), this );
+}
+
+OPrismHeaderPacket::~OPrismHeaderPacket()
+{
+}
+
+
+unsigned int OPrismHeaderPacket::signalStrength() const
+{
+ return _header->signal.data;
+}
+
+/*======================================================================================
* OWaveLanPacket
*======================================================================================*/
OWaveLanPacket::OWaveLanPacket( const unsigned char* end, const struct ieee_802_11_header* data, QObject* parent )
: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
@@ -150,16 +150,35 @@ class OEthernetPacket : public QObject
int type() const;
private:
const struct ether_header* _ether;
};
/*======================================================================================
+ * OPrismHeaderPacket - DLT_PRISM_HEADER frame
+ *======================================================================================*/
+
+class OPrismHeaderPacket : public QObject
+{
+ Q_OBJECT
+
+ public:
+ OPrismHeaderPacket( const unsigned char*, const struct prism_hdr*, QObject* parent = 0 );
+ virtual ~OPrismHeaderPacket();
+
+ unsigned int signalStrength() const;
+
+ private:
+ const struct prism_hdr* _header;
+};
+
+
+/*======================================================================================
* OWaveLanPacket - DLT_IEEE802_11 frame
*======================================================================================*/
class OWaveLanPacket : public QObject
{
Q_OBJECT
public: