summaryrefslogtreecommitdiff
path: root/noncore/net
authormickeyl <mickeyl>2003-10-06 18:08:05 (UTC)
committer mickeyl <mickeyl>2003-10-06 18:08:05 (UTC)
commitb8ac6724a0aaed78a1df712d87110fe39b16955f (patch) (unidiff)
treef8607b34284882bd4ce99281d0377f83b6b2c086 /noncore/net
parent42aefe8bc6a8089b771d6f109fed22a770295cc8 (diff)
downloadopie-b8ac6724a0aaed78a1df712d87110fe39b16955f.zip
opie-b8ac6724a0aaed78a1df712d87110fe39b16955f.tar.gz
opie-b8ac6724a0aaed78a1df712d87110fe39b16955f.tar.bz2
fix ARP decoding for wired networks. Interestingly, 802.11 encapsulates
these in IP packets, while wired ethernet just tags the type_of_protocol.
Diffstat (limited to 'noncore/net') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp16
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.h2
2 files changed, 17 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 9460f56..60bf231 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -234,5 +234,5 @@ void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAd
234 234
235 235
236void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source, OMacAddress& dest ) 236void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, OMacAddress& dest )
237{ 237{
238 OARPPacket* arp = (OARPPacket*) p->child( "ARP" ); 238 OARPPacket* arp = (OARPPacket*) p->child( "ARP" );
@@ -250,4 +250,10 @@ void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source,
250 } 250 }
251 } 251 }
252}
253
254
255void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source, OMacAddress& dest )
256{
257 //TODO: Implement more IP based protocols
252 258
253 ODHCPPacket* dhcp = (ODHCPPacket*) p->child( "DHCP" ); 259 ODHCPPacket* dhcp = (ODHCPPacket*) p->child( "DHCP" );
@@ -350,4 +356,12 @@ void Wellenreiter::receivePacket( OPacket* p )
350 } 356 }
351 357
358 // check for an arp frame since arp frames come in two flavours:
359 // 802.11 encapsulates ARP data within IP packets while wired ethernet doesn't.
360 OARPPacket* arp = static_cast<OARPPacket*>( childIfToParse( p, "ARP" ) );
361 if ( arp )
362 {
363 handleARPData( p, arp, source, dest );
364 }
365
352 // check for a ip frame 366 // check for a ip frame
353 OIPPacket* ip = static_cast<OIPPacket*>( childIfToParse( p, "IP" ) ); 367 OIPPacket* ip = static_cast<OIPPacket*>( childIfToParse( p, "IP" ) );
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h
index ed96375..25a5e8d 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.h
+++ b/noncore/net/wellenreiter/gui/wellenreiter.h
@@ -30,4 +30,5 @@ class OWaveLanManagementPacket;
30class OWaveLanDataPacket; 30class OWaveLanDataPacket;
31class OEthernetPacket; 31class OEthernetPacket;
32class OARPPacket;
32class OMacAddress; 33class OMacAddress;
33class OIPPacket; 34class OIPPacket;
@@ -74,4 +75,5 @@ class Wellenreiter : public WellenreiterBase {
74 void handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ); 75 void handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to );
75 void handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAddress& from, OMacAddress& to ); 76 void handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAddress& from, OMacAddress& to );
77 void handleARPData( OPacket* p, OARPPacket* arp, OMacAddress& from, OMacAddress& to );
76 void handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& from, OMacAddress& to ); 78 void handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& from, OMacAddress& to );
77 void handleNotification( OPacket* p ); 79 void handleNotification( OPacket* p );