X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fnetvis.h;h=1c8c2874f29d3236f85d073c74f8934e94d7e86b;hb=e7ccd0d35487219da5d1e447e5fd435ad763ba4c;hp=68eed052f3649255d4d9ee74655e624a89327968;hpb=597a794cd648dd7b4c9d442fdc39f5961a38aba0;p=netvis.git diff --git a/source/netvis.h b/source/netvis.h index 68eed05..1c8c287 100644 --- a/source/netvis.h +++ b/source/netvis.h @@ -12,7 +12,10 @@ Distributed unter the GPL #include #include #include +#include #include +#include +#include #include #include #include @@ -23,6 +26,7 @@ Distributed unter the GPL #include #include #include +#include "address.h" class History; class Host; @@ -48,16 +52,15 @@ private: std::string iface; pcap_t *pcap; Resolver *resolver; - unsigned localnet; - unsigned localnet_mask; + std::list
localnets; Msp::Graphics::SimpleGLWindow *wnd; Msp::GL::Font *font; unsigned max_hosts; unsigned max_visible_hosts; - std::map hosts; - std::map disabled_hosts; + std::map hosts; + std::map disabled_hosts; std::list packets; std::map ports; History *history; @@ -72,12 +75,12 @@ public: ~NetVis(); const Msp::GL::Font &get_font() const { return *font; } - const std::map &get_hosts() const { return hosts; } + const std::map &get_hosts() const { return hosts; } const std::map &get_ports() const { return ports; } private: virtual void tick(); void render(); - Host &get_host(unsigned); + Host &get_host(const Address &); Msp::GL::Color generate_color(bool) const; Port &get_port(unsigned); void create_history_texture(); @@ -85,8 +88,11 @@ private: 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_ipv6(CaptureContext &, const ip6_hdr *, unsigned); void handle_tcp(CaptureContext &, const tcphdr *, unsigned); void handle_udp(CaptureContext &, const udphdr *, unsigned); + void handle_icmp(CaptureContext &, const icmphdr *, unsigned); + void handle_icmp6(CaptureContext &, const icmp6_hdr *, unsigned); void handle_packet(CaptureContext &); void sighandler(int);