X-Git-Url: http://git.tdb.fi/?p=netvis.git;a=blobdiff_plain;f=source%2Fnetvis.h;fp=source%2Fnetvis.h;h=68eed052f3649255d4d9ee74655e624a89327968;hp=46b96a58a85d3779d00e80c5010d7af5ff9e5733;hb=597a794cd648dd7b4c9d442fdc39f5961a38aba0;hpb=cb4b88367edde2829e40015f0bc02d653db2a6a8 diff --git a/source/netvis.h b/source/netvis.h index 46b96a5..68eed05 100644 --- a/source/netvis.h +++ b/source/netvis.h @@ -11,6 +11,10 @@ Distributed unter the GPL #include #include #include +#include +#include +#include +#include #include #include #include @@ -29,6 +33,18 @@ class Resolver; class NetVis: public Msp::RegisteredApplication { private: + struct CaptureContext + { + const pcap_pkthdr *cap_hdr; + Host *src_host; + Port *src_port; + Host *dst_host; + Port *dst_port; + unsigned size; + + CaptureContext(); + }; + std::string iface; pcap_t *pcap; Resolver *resolver; @@ -67,6 +83,11 @@ private: void create_history_texture(); static void capture_handler(unsigned char *, const pcap_pkthdr *, const unsigned char *); + void handle_ethernet(CaptureContext &, const ethhdr *, unsigned); + void handle_ipv4(CaptureContext &, const iphdr *, unsigned); + void handle_tcp(CaptureContext &, const tcphdr *, unsigned); + void handle_udp(CaptureContext &, const udphdr *, unsigned); + void handle_packet(CaptureContext &); void sighandler(int); };