-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 @@ -356,11 +356,54 @@ OUDPPacket::OUDPPacket( const unsigned char* end, const struct udphdr* data, QOb 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 *======================================================================================*/ @@ -373,11 +416,47 @@ OTCPPacket::OTCPPacket( const unsigned char* end, const struct tcphdr* data, QOb 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 *======================================================================================*/ |