-rw-r--r-- | libopie2/opienet/opcap.cpp | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp index 1de7124..cc8ce7f 100644 --- a/libopie2/opienet/opcap.cpp +++ b/libopie2/opienet/opcap.cpp @@ -343,54 +343,133 @@ OMacAddress OARPPacket::targetMacAddress() const return OMacAddress( _arphdr->ar_tha ); } /*====================================================================================== * OUDPPacket *======================================================================================*/ OUDPPacket::OUDPPacket( const unsigned char* end, const struct udphdr* data, QObject* parent ) :QObject( parent, "UDP" ), _udphdr( data ) { qDebug( "OUDPPacket::OUDPPacket(): decoding UDP header..." ); } + OUDPPacket::~OUDPPacket() { } +int OUDPPacket::fromPort() const +{ + return _udphdr->source; +} + + +int OUDPPacket::toPort() const +{ + return _udphdr->dest; +} + + +int OUDPPacket::length() const +{ + return _udphdr->len; +} + + +int OUDPPacket::checksum() const +{ + return _udphdr->check; +} + + +/*====================================================================================== + * ODHCPPacket + *======================================================================================*/ + + +ODHCPPacket::ODHCPPacket( const unsigned char* end, const struct dhcp_packet* data, QObject* parent ) + :QObject( parent, "DHCP" ), _dhcphdr( data ) + +{ + qDebug( "ODHCPPacket::ODHCPPacket(): decoding DHCP information..." ); +} + + +ODHCPPacket::~ODHCPPacket() +{ +} + + /*====================================================================================== * OTCPPacket *======================================================================================*/ OTCPPacket::OTCPPacket( const unsigned char* end, const struct tcphdr* data, QObject* parent ) :QObject( parent, "TCP" ), _tcphdr( data ) { qDebug( "OTCPPacket::OTCPPacket(): decoding TCP header..." ); } + OTCPPacket::~OTCPPacket() { } +int OTCPPacket::fromPort() const +{ + return _tcphdr->source; +} + + +int OTCPPacket::toPort() const +{ + return _tcphdr->dest; +} + + +int OTCPPacket::seq() const +{ + return _tcphdr->seq; +} + + +int OTCPPacket::ack() const +{ + return _tcphdr->ack_seq; +} + + +int OTCPPacket::window() const +{ + return _tcphdr->window; +} + + +int OTCPPacket::checksum() const +{ + return _tcphdr->check; +} + /*====================================================================================== * 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 ); } |