-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 @@ -358,2 +358,3 @@ OUDPPacket::OUDPPacket( const unsigned char* end, const struct udphdr* data, QOb + OUDPPacket::~OUDPPacket() @@ -363,2 +364,44 @@ 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() +{ +} + + /*====================================================================================== @@ -375,2 +418,3 @@ OTCPPacket::OTCPPacket( const unsigned char* end, const struct tcphdr* data, QOb + OTCPPacket::~OTCPPacket() @@ -380,2 +424,37 @@ 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; +} + /*====================================================================================== |