X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnetvis.h;h=46b96a58a85d3779d00e80c5010d7af5ff9e5733;hb=d21b97e4f7f62ccdaf347012d6355a76f974f87e;hp=47f5de5bd31e7b05ea80248fe1ae32f32ffa5669;hpb=dca5eb6c41ea4315203fdf8edaa81e7f6575cca5;p=netvis.git diff --git a/source/netvis.h b/source/netvis.h index 47f5de5..46b96a5 100644 --- a/source/netvis.h +++ b/source/netvis.h @@ -13,18 +13,20 @@ Distributed unter the GPL #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include +class History; class Host; class Packet; +class Port; class Resolver; -class NetVis: public Msp::Application +class NetVis: public Msp::RegisteredApplication { private: std::string iface; @@ -41,34 +43,32 @@ private: std::map hosts; std::map disabled_hosts; std::list packets; - std::map port_colors; - bool draw_labels; - bool blend; + std::map ports; + History *history; Msp::Time::TimeStamp tick_t; Msp::Time::TimeStamp fps_t; unsigned frames; float fps; - Msp::Debug::Profiler profiler; - public: NetVis(int, char **); ~NetVis(); const Msp::GL::Font &get_font() const { return *font; } 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); - Msp::GL::Color &get_port_color(unsigned); - void key_press(unsigned, unsigned, wchar_t); + Msp::GL::Color generate_color(bool) const; + Port &get_port(unsigned); + void create_history_texture(); static void capture_handler(unsigned char *, const pcap_pkthdr *, const unsigned char *); void sighandler(int); - - static Application::RegApp reg; }; #endif