-rw-r--r-- | libopie2/opienet/opcap.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
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* | |||
60 | new OEthernetPacket( _end, (const struct ether_header*) data, this ); | 60 | new OEthernetPacket( _end, (const struct ether_header*) data, this ); |
61 | break; | 61 | break; |
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 | ||
74 | OPacket::~OPacket() | 79 | OPacket::~OPacket() |
75 | { | 80 | { |
@@ -311,16 +316,42 @@ OTCPPacket::OTCPPacket( const unsigned char* end, const struct tcphdr* data, QOb | |||
311 | } | 316 | } |
312 | 317 | ||
313 | OTCPPacket::~OTCPPacket() | 318 | OTCPPacket::~OTCPPacket() |
314 | { | 319 | { |
315 | } | 320 | } |
316 | 321 | ||
317 | 322 | ||
318 | /*====================================================================================== | 323 | /*====================================================================================== |
324 | * OPrismHeaderPacket | ||
325 | *======================================================================================*/ | ||
326 | |||
327 | |||
328 | OPrismHeaderPacket::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 | |||
339 | OPrismHeaderPacket::~OPrismHeaderPacket() | ||
340 | { | ||
341 | } | ||
342 | |||
343 | |||
344 | unsigned int OPrismHeaderPacket::signalStrength() const | ||
345 | { | ||
346 | return _header->signal.data; | ||
347 | } | ||
348 | |||
349 | /*====================================================================================== | ||
319 | * OWaveLanPacket | 350 | * OWaveLanPacket |
320 | *======================================================================================*/ | 351 | *======================================================================================*/ |
321 | 352 | ||
322 | 353 | ||
323 | OWaveLanPacket::OWaveLanPacket( const unsigned char* end, const struct ieee_802_11_header* data, QObject* parent ) | 354 | OWaveLanPacket::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 ) |
325 | 356 | ||
326 | { | 357 | { |