-rw-r--r-- | libopie2/opienet/opcap.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h index 9119972..0c9e7da 100644 --- a/libopie2/opienet/opcap.h +++ b/libopie2/opienet/opcap.h | |||
@@ -46,25 +46,28 @@ extern "C" // work around a bpf/pcap conflict in recent headers | |||
46 | #include <time.h> | 46 | #include <time.h> |
47 | 47 | ||
48 | /* QT */ | 48 | /* QT */ |
49 | #include <qevent.h> | 49 | #include <qevent.h> |
50 | #include <qfile.h> | 50 | #include <qfile.h> |
51 | #include <qhostaddress.h> | 51 | #include <qhostaddress.h> |
52 | #include <qobject.h> | 52 | #include <qobject.h> |
53 | #include <qstring.h> | 53 | #include <qstring.h> |
54 | #include <qmap.h> | 54 | #include <qmap.h> |
55 | 55 | ||
56 | /* OPIE */ | 56 | /* OPIE */ |
57 | #include <opie2/onetutils.h> | 57 | #include <opie2/onetutils.h> |
58 | |||
59 | /* Custom Network Includes */ | ||
58 | #include "802_11_user.h" | 60 | #include "802_11_user.h" |
61 | #include "dhcp.h" | ||
59 | 62 | ||
60 | /* TYPEDEFS */ | 63 | /* TYPEDEFS */ |
61 | typedef struct timeval timevalstruct; | 64 | typedef struct timeval timevalstruct; |
62 | typedef struct pcap_pkthdr packetheaderstruct; | 65 | typedef struct pcap_pkthdr packetheaderstruct; |
63 | 66 | ||
64 | /* FORWARDS */ | 67 | /* FORWARDS */ |
65 | class OPacketCapturer; | 68 | class OPacketCapturer; |
66 | class QSocketNotifier; | 69 | class QSocketNotifier; |
67 | 70 | ||
68 | /*====================================================================================== | 71 | /*====================================================================================== |
69 | * OPacket - A frame on the wire | 72 | * OPacket - A frame on the wire |
70 | *======================================================================================*/ | 73 | *======================================================================================*/ |
@@ -468,58 +471,81 @@ class OARPPacket : public QObject | |||
468 | *======================================================================================*/ | 471 | *======================================================================================*/ |
469 | 472 | ||
470 | class OUDPPacket : public QObject | 473 | class OUDPPacket : public QObject |
471 | { | 474 | { |
472 | Q_OBJECT | 475 | Q_OBJECT |
473 | 476 | ||
474 | public: | 477 | public: |
475 | OUDPPacket( const unsigned char*, const struct udphdr*, QObject* parent = 0 ); | 478 | OUDPPacket( const unsigned char*, const struct udphdr*, QObject* parent = 0 ); |
476 | virtual ~OUDPPacket(); | 479 | virtual ~OUDPPacket(); |
477 | 480 | ||
478 | int fromPort() const; | 481 | int fromPort() const; |
479 | int toPort() const; | 482 | int toPort() const; |
483 | int length() const; | ||
484 | int checksum() const; | ||
480 | 485 | ||
481 | private: | 486 | private: |
482 | const struct udphdr* _udphdr; | 487 | const struct udphdr* _udphdr; |
483 | }; | 488 | }; |
484 | 489 | ||
485 | /*====================================================================================== | 490 | /*====================================================================================== |
491 | * ODHCPPacket | ||
492 | *======================================================================================*/ | ||
493 | |||
494 | class ODHCPPacket : public QObject | ||
495 | { | ||
496 | Q_OBJECT | ||
497 | |||
498 | public: | ||
499 | ODHCPPacket( const unsigned char*, const struct dhcp_packet*, QObject* parent = 0 ); | ||
500 | virtual ~ODHCPPacket(); | ||
501 | |||
502 | private: | ||
503 | const struct dhcp_packet* _dhcphdr; | ||
504 | }; | ||
505 | |||
506 | /*====================================================================================== | ||
486 | * OTCPPacket | 507 | * OTCPPacket |
487 | *======================================================================================*/ | 508 | *======================================================================================*/ |
488 | 509 | ||
489 | class OTCPPacket : public QObject | 510 | class OTCPPacket : public QObject |
490 | { | 511 | { |
491 | Q_OBJECT | 512 | Q_OBJECT |
492 | 513 | ||
493 | public: | 514 | public: |
494 | OTCPPacket( const unsigned char*, const struct tcphdr*, QObject* parent = 0 ); | 515 | OTCPPacket( const unsigned char*, const struct tcphdr*, QObject* parent = 0 ); |
495 | virtual ~OTCPPacket(); | 516 | virtual ~OTCPPacket(); |
496 | 517 | ||
497 | int fromPort() const; | 518 | int fromPort() const; |
498 | int toPort() const; | 519 | int toPort() const; |
520 | int seq() const; | ||
521 | int ack() const; | ||
522 | int window() const; | ||
523 | int checksum() const; | ||
499 | 524 | ||
500 | private: | 525 | private: |
501 | const struct tcphdr* _tcphdr; | 526 | const struct tcphdr* _tcphdr; |
502 | }; | 527 | }; |
503 | 528 | ||
504 | 529 | ||
505 | /*====================================================================================== | 530 | /*====================================================================================== |
506 | * OPacketCapturer | 531 | * OPacketCapturer |
507 | *======================================================================================*/ | 532 | *======================================================================================*/ |
508 | 533 | ||
509 | /** | 534 | /** |
510 | * @brief A class based wrapper for network packet capturing. | 535 | * @brief A class based wrapper for network packet capturing. |
511 | * | 536 | * |
512 | * This class is the base of a high-level interface to the well known packet capturing | 537 | * This class is the base of a high-level interface to the well known packet capturing |
513 | * library libpcap. ... | 538 | * library libpcap. |
539 | * @see http://tcpdump.org | ||
514 | */ | 540 | */ |
515 | class OPacketCapturer : public QObject | 541 | class OPacketCapturer : public QObject |
516 | { | 542 | { |
517 | Q_OBJECT | 543 | Q_OBJECT |
518 | 544 | ||
519 | public: | 545 | public: |
520 | /** | 546 | /** |
521 | * Constructor. | 547 | * Constructor. |
522 | */ | 548 | */ |
523 | OPacketCapturer( QObject* parent = 0, const char* name = 0 ); | 549 | OPacketCapturer( QObject* parent = 0, const char* name = 0 ); |
524 | /** | 550 | /** |
525 | * Destructor. | 551 | * Destructor. |