author | mickeyl <mickeyl> | 2003-10-06 18:08:05 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-10-06 18:08:05 (UTC) |
commit | b8ac6724a0aaed78a1df712d87110fe39b16955f (patch) (side-by-side diff) | |
tree | f8607b34284882bd4ce99281d0377f83b6b2c086 /noncore/net/wellenreiter/gui/wellenreiter.cpp | |
parent | 42aefe8bc6a8089b771d6f109fed22a770295cc8 (diff) | |
download | opie-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/wellenreiter/gui/wellenreiter.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 16 |
1 files changed, 15 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 -void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source, OMacAddress& dest ) +void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, OMacAddress& dest ) { OARPPacket* arp = (OARPPacket*) p->child( "ARP" ); @@ -250,4 +250,10 @@ void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source, } } +} + + +void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source, OMacAddress& dest ) +{ + //TODO: Implement more IP based protocols ODHCPPacket* dhcp = (ODHCPPacket*) p->child( "DHCP" ); @@ -350,4 +356,12 @@ void Wellenreiter::receivePacket( OPacket* p ) } + // check for an arp frame since arp frames come in two flavours: + // 802.11 encapsulates ARP data within IP packets while wired ethernet doesn't. + OARPPacket* arp = static_cast<OARPPacket*>( childIfToParse( p, "ARP" ) ); + if ( arp ) + { + handleARPData( p, arp, source, dest ); + } + // check for a ip frame OIPPacket* ip = static_cast<OIPPacket*>( childIfToParse( p, "IP" ) ); |